From 86bc29e4a898ce5a73c2cfd59ebf3b7460204ddb Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 3 Oct 2020 00:36:16 +0800 Subject: [PATCH] kernel: bump 5.4 to 5.4.68 (#5555) [mac80211] ca5ee6e mac80211: Fix potential endless loop 2c14710 mac80211: add more AQL fixes/improvements 91fb3ce mac80211: remove an obsolete patch that is no longer doing anything useful acf1733 mac80211: add preliminary support for enabling 802.11ax in config d717343 mac80211: update encap offload patches to the latest version 673062f mac80211: allow bigger A-MSDU sizes in VHT, even if HT is limited caf7277 mac80211: do not allow bigger VHT MPDUs than the hardware supports cd36c0d mac80211: select the first available channel for 5GHz interfaces 1c6d456 mac80211: fix regression in station connection monitor optimization 4bd7689 mac80211: update sta connection monitor regression fix [target] Sync: at91, ath25, ath79, lantiq, mediatek, mvebu. --- include/image-commands.mk | 17 +- include/image.mk | 5 + include/kernel-version.mk | 4 +- .../boot/arm-trusted-firmware-mvebu/Makefile | 195 ++- .../patches/200-hostssl.patch | 20 + package/boot/at91bootstrap/Makefile | 68 +- package/boot/at91bootstrap/at91bootstrap.mk | 36 +- package/boot/mt7623n-preloader/Makefile | 22 + package/boot/uboot-at91/Makefile | 52 +- .../patches/001-fix-Wformat-security.patch | 34 +- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ath79 | 2 + package/boot/uboot-envtools/files/lantiq | 2 +- package/boot/uboot-envtools/files/mvebu | 6 +- package/boot/uboot-envtools/files/ramips | 7 + package/boot/uboot-mediatek/Makefile | 5 +- .../001-eth-mtk-add-mt7531-switch.patch | 1074 ------------ .../patches/005-update-bpir2-defconfig.patch | 1 - .../patches/007-env-fat-use-bootdevice.patch | 8 +- package/boot/uboot-mvebu/Makefile | 21 +- ...add_support_for_macronix_mx25u12835f.patch | 4 +- ...mada-37xx.h_increase_max_gunzip_size.patch | 2 +- ...Add-missing-common-host-capabilities.patch | 43 + ...-3720-espressobin-use-Linux-model-co.patch | 45 + ...-3720-espressobin-split-common-parts.patch | 369 ++++ ...add-support-for-boards-with-populate.patch | 89 + ...sobin-Set-environment-variable-fdtfi.patch | 100 ++ .../patches/210-link-libcrypto-static.patch | 8 +- ...witch-default-PHY-speed-to-3.125Gbit.patch | 43 - package/kernel/linux/modules/fs.mk | 2 +- package/kernel/linux/modules/hwmon.mk | 4 +- package/kernel/linux/modules/leds.mk | 30 + package/kernel/mac80211/ath.mk | 8 + .../files/lib/netifd/wireless/mac80211.sh | 49 +- .../mac80211/files/lib/wifi/mac80211.sh | 4 +- .../subsys/140-tweak-TSQ-setting.patch | 15 - ...ce-packet-loss-event-false-positives.patch | 10 +- ...ing-queue-hash-initialization-to-80.patch} | 6 +- ...d-refresh-aggregation-session-in-en.patch} | 8 +- ...ap-offload-for-tx-multicast-control.patch} | 30 +- ...-control.hw_key-for-encap-offload-p.patch} | 6 +- ...rework-tx-encapsulation-offload-API.patch} | 182 +- ...-duplication-in-tx-status-functions.patch} | 0 ...x-status-call-to-ieee80211_sta_regi.patch} | 0 ...optimize-station-connection-monitor.patch} | 0 ...D_TXPROCESSING-and-HW_80211_ENCAP-t.patch} | 8 +- ...2.3-offload-and-802.11-tx-status-co.patch} | 0 ...using-ieee80211_tx_status_ext-to-fr.patch} | 0 ...eee80211_tx_status_ext-to-support-b.patch} | 4 +- ...he-driver-when-a-sta-uses-4-address.patch} | 2 +- ...ize-code-to-remove-a-forward-declara.patch | 1110 ++++++++++++ ...AQL-aggregation-estimation-to-HE-and.patch | 49 + ...-add-AQL-support-for-VHT160-tx-rates.patch | 23 + ...igger-A-MSDU-sizes-in-VHT-even-if-HT.patch | 26 + ...allow-bigger-VHT-MPDUs-than-the-hard.patch | 34 + ...regression-in-sta-connection-monitor.patch | 38 + ...11-fix-misplaced-while-instead-of-if.patch | 31 + .../500-mac80211_configure_antenna_gain.patch | 8 +- .../files/zzz-default-settings | 3 +- package/network/services/hostapd/Makefile | 24 +- .../hostapd/files/hostapd-full.config | 2 +- .../network/services/hostapd/files/hostapd.sh | 118 +- .../patches/110-wolfssl-compile-fix.patch | 10 + .../services/hostapd/src/src/ap/ubus.c | 99 +- .../hostapd/src/src/utils/build_features.h | 4 + .../apm821xx/base-files/etc/board.d/01_leds | 5 - .../etc/hotplug.d/firmware/10-ath9k-eeprom | 42 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 2 - .../base-files/lib/preinit/79_move_config | 2 - .../base-files/lib/upgrade/platform.sh | 3 - target/linux/apm821xx/dts/apm82181.dtsi | 33 +- target/linux/apm821xx/dts/meraki-mr24.dts | 58 +- target/linux/apm821xx/dts/meraki-mx60.dts | 25 +- .../linux/apm821xx/dts/netgear-wndap620.dts | 30 +- .../linux/apm821xx/dts/netgear-wndap660.dts | 64 +- .../linux/apm821xx/dts/netgear-wndap6x0.dtsi | 5 +- .../linux/apm821xx/dts/netgear-wndr4700.dts | 104 +- target/linux/apm821xx/dts/wd-mybooklive.dts | 5 +- .../arch/powerpc/platforms/44x/wndr4700.c | 99 -- target/linux/apm821xx/nand/config-default | 1 - .../202-add-netgear-wndr4700-support.patch | 32 - target/linux/arc770/config-4.14 | 200 --- ...c-Disable-frame-filtering-completely.patch | 31 - target/linux/at91/Makefile | 2 +- .../at91/base-files/etc/board.d/02_network | 2 +- target/linux/at91/base-files/lib/at91.sh | 92 - .../lib/preinit/01_preinit_do_at91.sh | 7 - target/linux/at91/config-4.14 | 562 ------ target/linux/at91/image/Makefile | 16 +- target/linux/at91/image/sam9x.mk | 123 +- target/linux/at91/image/sama5.mk | 66 +- target/linux/at91/image/uboot-env.txt | 8 +- .../100-ARM-at91-build-dtb-for-LMU5000.patch | 10 - ...RM-at91-build-dtb-for-sama5d2-ptc-Ek.patch | 434 ----- .../101-ARM-at91-build-dtb-for-q5xr5.patch | 4 +- .../102-ARM-at91-build-dtb-for-wb45n.patch | 4 +- ...2-ARM-at91-wb45n-fix-duplicate-label.patch | 20 + .../103-ARM-at91-build-dtb-for-wb50n.patch | 2 +- ...3-ARM-at91-wb50n-fix-duplicate-label.patch | 39 + target/linux/at91/sam9x/config-default | 196 ++- target/linux/at91/sama5/config-default | 561 ++++++ target/linux/ath25/Makefile | 2 +- .../lib/preinit/15_preinit_iface_atheros | 9 +- .../linux/ath25/{config-4.14 => config-5.4} | 74 +- target/linux/ath25/image/Makefile | 28 +- .../107-ar5312_gpio.patch | 20 +- .../108-ar2315_gpio.patch | 18 +- .../110-ar2313_ethernet.patch | 40 +- .../120-spiflash.patch | 9 +- .../130-watchdog.patch | 4 +- .../140-redboot_boardconfig.patch | 14 +- .../141-redboot_partition_scan.patch | 14 +- .../142-redboot_various_erase_size_fix.patch | 16 +- .../210-reset_button.patch | 0 .../220-enet_micrel_workaround.patch | 10 +- .../330-board_leds.patch | 0 target/linux/ath79/Makefile | 2 +- .../ath79/dts/ar1022_iodata_wn-ag300dgr.dts | 5 +- .../ath79/dts/ar1022_sitecom_wlr-7100.dts | 5 +- target/linux/ath79/dts/ar7100.dtsi | 2 +- .../dts/ar7100_mikrotik_routerboard-4xx.dtsi | 4 +- .../ath79/dts/ar7161_adtran_bsap1800-v2.dts | 1 - .../ath79/dts/ar7161_adtran_bsap1840.dts | 1 - .../ath79/dts/ar7161_adtran_bsap1880.dtsi | 4 +- .../linux/ath79/dts/ar7161_aruba_ap-105.dts | 5 +- .../ath79/dts/ar7161_buffalo_wzr-600dhp.dts | 8 + .../dts/ar7161_buffalo_wzr-hp-ag300h.dts | 268 +-- .../dts/ar7161_buffalo_wzr-hp-ag300h.dtsi | 271 +++ .../ath79/dts/ar7161_dlink_dir-825-b1.dts | 5 +- .../linux/ath79/dts/ar7161_jjplus_ja76pf2.dts | 5 +- target/linux/ath79/dts/ar7161_meraki_mr16.dts | 174 ++ .../dts/ar7161_mikrotik_routerboard-493g.dts | 1 - .../linux/ath79/dts/ar7161_netgear_wndr.dtsi | 4 +- .../ath79/dts/ar7161_netgear_wndr3700-v2.dts | 1 - .../ath79/dts/ar7161_netgear_wndr3700.dts | 1 - .../ath79/dts/ar7161_netgear_wndr3800.dts | 1 - .../ath79/dts/ar7161_netgear_wndr3800ch.dts | 1 - .../ath79/dts/ar7161_netgear_wndrmac-v1.dts | 1 - .../ath79/dts/ar7161_netgear_wndrmac-v2.dts | 1 - .../ath79/dts/ar7161_siemens_ws-ap3610.dts | 5 +- .../dts/ar7161_ubnt_routerstation-pro.dts | 1 - .../ath79/dts/ar7161_ubnt_routerstation.dts | 1 - .../ath79/dts/ar7161_ubnt_routerstation.dtsi | 4 +- .../ath79/dts/ar7240_buffalo_whr-g301n.dts | 5 +- .../ath79/dts/ar7240_dlink_dir-615-e4.dts | 5 +- .../ath79/dts/ar7240_engenius_enh202-v1.dts | 183 ++ .../ath79/dts/ar7240_netgear_wnr1000-v2.dts | 5 +- .../ath79/dts/ar7240_netgear_wnr612-v2.dts | 1 - .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 4 +- target/linux/ath79/dts/ar7240_on_n150r.dts | 1 - target/linux/ath79/dts/ar7240_tplink.dtsi | 4 +- .../ath79/dts/ar7240_tplink_tl-wa701nd-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wa730re-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wa801nd-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wa830re-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wa901nd-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wr740n-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wr740n-v3.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wr741-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wr743nd-v1.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wr841-v5.dts | 1 - .../ath79/dts/ar7240_tplink_tl-wr941-v4.dts | 1 - .../ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts | 1 - .../ath79/dts/ar7241_netgear_wnr2000-v3.dts | 5 +- .../ath79/dts/ar7241_netgear_wnr2200-16m.dts | 1 - .../ath79/dts/ar7241_netgear_wnr2200-8m.dts | 1 - .../ath79/dts/ar7241_netgear_wnr2200.dtsi | 4 +- target/linux/ath79/dts/ar7241_tplink.dtsi | 4 +- .../ath79/dts/ar7241_tplink_tl-mr3220-v1.dts | 1 - .../ath79/dts/ar7241_tplink_tl-mr3420-v1.dts | 1 - .../ath79/dts/ar7241_tplink_tl-wr841-v7.dts | 1 - .../ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 5 +- .../linux/ath79/dts/ar7241_ubnt_airrouter.dts | 1 - .../ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts | 1 - .../ath79/dts/ar7241_ubnt_nanobridge-m.dts | 1 - .../dts/ar7241_ubnt_nanostation-loco-m.dts | 1 - .../ath79/dts/ar7241_ubnt_nanostation-m.dts | 1 - .../ath79/dts/ar7241_ubnt_picostation-m.dts | 1 - .../ath79/dts/ar7241_ubnt_powerbridge-m.dts | 1 - .../linux/ath79/dts/ar7241_ubnt_rocket-m.dts | 1 - target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 5 +- .../linux/ath79/dts/ar7242_avm_fritz300e.dts | 5 +- .../ath79/dts/ar7242_buffalo_bhr-4grv.dts | 1 - .../ath79/dts/ar7242_buffalo_wzr-bhr.dtsi | 4 +- .../dts/ar7242_buffalo_wzr-hp-g302h-a1a0.dts | 5 +- .../ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts | 1 - .../ath79/dts/ar7242_tplink_tl-wr2543-v1.dts | 5 +- .../ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts | 1 - .../ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts | 1 - target/linux/ath79/dts/ar7242_ubnt_sw.dtsi | 5 +- target/linux/ath79/dts/ar724x.dtsi | 2 +- target/linux/ath79/dts/ar9132.dtsi | 4 +- .../ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts | 7 +- .../dts/ar9132_tplink_tl-wr1043nd-v1.dts | 7 +- .../ath79/dts/ar9132_tplink_tl-wr941-v2.dts | 7 +- target/linux/ath79/dts/ar9330.dtsi | 2 +- .../linux/ath79/dts/ar9330_dlink_dir-505.dts | 5 +- .../ath79/dts/ar9330_glinet_gl-ar150.dts | 5 +- target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 5 +- target/linux/ath79/dts/ar9331.dtsi | 1 + .../ath79/dts/ar9331_8dev_carambola2.dts | 5 +- .../ath79/dts/ar9331_alfa-network_ap121f.dts | 5 +- target/linux/ath79/dts/ar9331_arduino_yun.dts | 5 +- .../dts/ar9331_embeddedwireless_dorin.dts | 5 +- .../linux/ath79/dts/ar9331_etactica_eg200.dts | 5 +- target/linux/ath79/dts/ar9331_glinet_6408.dts | 1 - target/linux/ath79/dts/ar9331_glinet_6416.dts | 1 - .../linux/ath79/dts/ar9331_glinet_64xx.dtsi | 4 +- .../linux/ath79/dts/ar9331_glinet_gl-mifi.dts | 5 +- .../linux/ath79/dts/ar9331_pisen_ts-d084.dts | 5 +- .../linux/ath79/dts/ar9331_pisen_wmm003n.dts | 5 +- .../ath79/dts/ar9331_tplink_tl-mr10u.dts | 1 - .../ath79/dts/ar9331_tplink_tl-mr3020-v1.dts | 7 +- .../ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 7 +- .../ath79/dts/ar9331_tplink_tl-wr703n.dts | 1 - .../dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 4 +- .../ath79/dts/ar9331_tplink_tl-wr710n-v1.dts | 1 - .../dts/ar9331_tplink_tl-wr710n-v2.1.dts | 1 - .../ath79/dts/ar9331_tplink_tl-wr710n.dtsi | 4 +- .../ath79/dts/ar9331_tplink_tl-wr740n-v4.dts | 1 - .../ath79/dts/ar9331_tplink_tl-wr740n-v5.dts | 1 - .../ath79/dts/ar9331_tplink_tl-wr741nd-v4.dts | 1 - .../dts/ar9331_tplink_tl-wr741nd-v4.dtsi | 4 +- .../dts/ar9341_engenius_ens202ext-v1.dts | 180 ++ target/linux/ath79/dts/ar9341_pcs_cr3000.dts | 5 +- .../linux/ath79/dts/ar9341_pisen_wmb001n.dts | 5 +- target/linux/ath79/dts/ar9341_tplink.dtsi | 4 +- .../ath79/dts/ar9341_tplink_tl-mr3420-v2.dts | 1 - .../linux/ath79/dts/ar9341_tplink_tl-wa.dtsi | 4 +- .../ath79/dts/ar9341_tplink_tl-wa850re-v1.dts | 1 - .../ath79/dts/ar9341_tplink_tl-wa860re-v1.dts | 1 - .../ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts | 1 - .../ath79/dts/ar9341_tplink_tl-wr841-v8.dts | 1 - .../ath79/dts/ar9341_tplink_tl-wr842n-v2.dts | 1 - .../linux/ath79/dts/ar9342_iodata_etg3-r.dts | 5 +- .../ath79/dts/ar9342_ubnt_bullet-m-xw.dts | 1 - .../linux/ath79/dts/ar9342_ubnt_lap-120.dts | 3 +- .../dts/ar9342_ubnt_litebeam-ac-gen2.dts | 3 +- .../ath79/dts/ar9342_ubnt_nanobeam-ac.dts | 3 +- .../dts/ar9342_ubnt_nanostation-ac-loco.dts | 3 +- .../ath79/dts/ar9342_ubnt_nanostation-ac.dts | 3 +- .../dts/ar9342_ubnt_nanostation-loco-m-xw.dts | 1 - .../dts/ar9342_ubnt_nanostation-m-xw.dts | 1 - .../dts/ar9342_ubnt_powerbeam-5ac-gen2.dts | 3 +- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 6 +- target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 4 +- .../ath79/dts/ar9344_aerohive_hiveap-121.dts | 7 +- .../ath79/dts/ar9344_comfast_cf-e120a-v3.dts | 5 +- .../ath79/dts/ar9344_compex_wpj344-16m.dts | 5 +- .../ath79/dts/ar9344_devolo_magic-2-wifi.dts | 5 +- .../ath79/dts/ar9344_dlink_dir-825-c1.dts | 1 - .../ath79/dts/ar9344_dlink_dir-835-a1.dts | 1 - .../linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi | 4 +- .../ath79/dts/ar9344_enterasys_ws-ap3705i.dts | 5 +- .../ath79/dts/ar9344_mercury_mw4530r-v1.dts | 8 + .../ar9344_mikrotik_routerboard-sxt-5n.dtsi | 14 +- ...ar9344_mikrotik_routerboard-sxt-5nd-r2.dts | 1 - .../linux/ath79/dts/ar9344_netgear_wndr.dtsi | 4 +- .../ath79/dts/ar9344_netgear_wndr3700-v4.dts | 1 - .../ath79/dts/ar9344_netgear_wndr4300.dts | 1 - .../ath79/dts/ar9344_netgear_wndr4300sw.dts | 1 - .../ath79/dts/ar9344_netgear_wndr4300tn.dts | 1 - .../linux/ath79/dts/ar9344_ocedo_raccoon.dts | 5 +- target/linux/ath79/dts/ar9344_pcs_cap324.dts | 9 +- target/linux/ath79/dts/ar9344_pcs_cr5000.dts | 5 +- target/linux/ath79/dts/ar9344_qihoo_c301.dts | 5 +- .../dts/ar9344_teltonika_rut955-h7v3c0.dts | 1 - .../ath79/dts/ar9344_teltonika_rut955.dts | 1 - .../ath79/dts/ar9344_teltonika_rut9xx.dtsi | 5 +- target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 12 +- .../ath79/dts/ar9344_tplink_cpe210-v1.dts | 1 - .../ath79/dts/ar9344_tplink_cpe220-v2.dts | 1 - .../ath79/dts/ar9344_tplink_cpe510-v1.dts | 1 - .../ath79/dts/ar9344_tplink_cpe510-v2.dts | 1 - .../ath79/dts/ar9344_tplink_cpe510-v3.dts | 1 - .../ath79/dts/ar9344_tplink_cpe610-v1.dts | 1 - .../ath79/dts/ar9344_tplink_cpe610-v2.dts | 1 - .../ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts | 1 - .../ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts | 1 - .../dts/ar9344_tplink_tl-wdr4300-v1-il.dts | 1 - .../ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts | 1 - .../ath79/dts/ar9344_tplink_tl-wdr4310-v1.dts | 1 - .../ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi | 4 +- .../ath79/dts/ar9344_tplink_wbs210-v1.dts | 1 - .../ath79/dts/ar9344_tplink_wbs210-v2.dts | 1 - .../ath79/dts/ar9344_tplink_wbs510-v1.dts | 1 - .../ath79/dts/ar9344_tplink_wbs510-v2.dts | 1 - .../ath79/dts/ar9344_ubnt_unifi-ap-pro.dts | 157 ++ .../linux/ath79/dts/ar9344_wd_mynet-n750.dts | 5 +- .../ar9344_wd_mynet-wifi-rangeextender.dts | 5 +- .../ath79/dts/ar9344_winchannel_wb2000.dts | 5 +- .../ath79/dts/ar9344_zbtlink_zbt-wd323.dts | 5 +- target/linux/ath79/dts/ar934x.dtsi | 2 - target/linux/ath79/dts/ath79.dtsi | 4 + target/linux/ath79/dts/qca9531_8dev_lima.dts | 5 +- .../ath79/dts/qca9531_comfast_cf-e130n-v2.dts | 14 +- .../ath79/dts/qca9531_comfast_cf-e313ac.dts | 5 +- .../ath79/dts/qca9531_comfast_cf-e314n-v2.dts | 5 +- .../linux/ath79/dts/qca9531_comfast_cf-e5.dts | 5 +- .../ath79/dts/qca9531_comfast_cf-e560ac.dts | 5 +- .../ath79/dts/qca9531_comfast_cf-ew72.dts | 5 +- .../dts/qca9531_comfast_cf-wr752ac-v1.dts | 5 +- .../ath79/dts/qca9531_compex_wpj531-16m.dts | 5 +- .../ath79/dts/qca9531_dlink_dch-g020-a1.dts | 5 +- .../ath79/dts/qca9531_engenius_ews511ap.dts | 5 +- .../dts/qca9531_glinet_gl-ar300m-lite.dts | 2 - .../dts/qca9531_glinet_gl-ar300m-nand.dts | 2 - .../dts/qca9531_glinet_gl-ar300m-nor.dts | 2 - .../ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 3 +- .../ath79/dts/qca9531_glinet_gl-ar300m16.dts | 2 - .../ath79/dts/qca9531_glinet_gl-ar750.dts | 5 +- .../ath79/dts/qca9531_glinet_gl-e750.dts | 5 +- .../ath79/dts/qca9531_glinet_gl-x750.dts | 5 +- target/linux/ath79/dts/qca9531_telco_t1.dts | 5 +- .../dts/qca9531_tplink_archer-d50-v1.dts | 5 +- .../ath79/dts/qca9531_tplink_tl-mr3420-v3.dts | 5 +- .../ath79/dts/qca9531_tplink_tl-mr6400-v1.dts | 5 +- .../ath79/dts/qca9531_tplink_tl-wr810n-v1.dts | 1 - .../dts/qca9531_tplink_tl-wr902ac-v1.dts | 19 +- .../linux/ath79/dts/qca9531_yuncore_a770.dts | 5 +- .../ath79/dts/qca9533_comfast_cf-e110n-v2.dts | 5 +- .../ath79/dts/qca9533_dlink_dap-1330-a1.dts | 1 - .../ath79/dts/qca9533_dlink_dap-1365-a1.dts | 1 - .../ath79/dts/qca9533_dlink_dap-13xx.dtsi | 4 +- .../dts/qca9533_mikrotik_routerboard-16m.dtsi | 4 +- .../qca9533_mikrotik_routerboard-lhg-2nd.dts | 1 - .../qca9533_mikrotik_routerboard-lhg-hb.dtsi | 9 +- .../ath79/dts/qca9533_tplink_cpe210-v2.dts | 1 - .../ath79/dts/qca9533_tplink_cpe210-v3.dts | 1 - .../ath79/dts/qca9533_tplink_cpe220-v3.dts | 1 - .../ath79/dts/qca9533_tplink_cpexxx.dtsi | 4 +- .../dts/qca9533_tplink_tl-wa801nd-v3.dts | 1 - .../dts/qca9533_tplink_tl-wa801nd-v4.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wa801nd.dtsi | 4 +- .../dts/qca9533_tplink_tl-wa850re-v2.dts | 25 +- .../ath79/dts/qca9533_tplink_tl-wr802n-v1.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr802n-v2.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr802n.dtsi | 4 +- .../ath79/dts/qca9533_tplink_tl-wr810n-v2.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr841-v10.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr841-v11.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr841-v12.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr841-v9.dts | 1 - .../ath79/dts/qca9533_tplink_tl-wr841.dtsi | 4 +- .../ath79/dts/qca9533_tplink_tl-wr842n-v3.dts | 5 +- .../linux/ath79/dts/qca9533_ubnt_acb-isp.dts | 5 +- target/linux/ath79/dts/qca953x.dtsi | 2 +- .../ath79/dts/qca953x_tplink_tl-wr810n.dtsi | 4 +- .../ath79/dts/qca9556_avm_fritz-repeater.dtsi | 5 +- .../ath79/dts/qca9556_avm_fritz1750e.dts | 4 +- .../linux/ath79/dts/qca9556_avm_fritz450e.dts | 4 +- ...6_mikrotik_routerboard-wap-g-5hact2hnd.dts | 5 +- .../linux/ath79/dts/qca9557_8dev_rambutan.dts | 5 +- .../ath79/dts/qca9557_buffalo_bhr-4grv2.dts | 5 +- .../ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi | 4 +- .../ath79/dts/qca9557_iodata_wn-ac1167dgr.dts | 1 - .../ath79/dts/qca9557_iodata_wn-ac1600dgr.dts | 1 - .../dts/qca9557_iodata_wn-ac1600dgr2.dts | 1 - .../linux/ath79/dts/qca9557_zyxel_nbg6616.dts | 1 - .../dts/qca9558_allnet_all-wap02860ac.dts | 5 +- .../dts/qca9558_comfast_cf-wr650ac-v1.dts | 1 - .../dts/qca9558_comfast_cf-wr650ac-v2.dts | 1 - .../ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 4 +- .../ath79/dts/qca9558_devolo_dvl1200e.dts | 1 - .../ath79/dts/qca9558_devolo_dvl1200i.dts | 1 - .../ath79/dts/qca9558_devolo_dvl1750c.dts | 1 - .../ath79/dts/qca9558_devolo_dvl1750e.dts | 1 - .../ath79/dts/qca9558_devolo_dvl1750i.dts | 1 - .../ath79/dts/qca9558_devolo_dvl1750x.dts | 1 - .../ath79/dts/qca9558_devolo_dvl1xxx.dtsi | 4 +- .../ath79/dts/qca9558_dlink_dap-2695-a1.dts | 5 +- .../ath79/dts/qca9558_domywifi_dw33d.dts | 5 +- .../ath79/dts/qca9558_engenius_ecb1750.dts | 5 +- .../ath79/dts/qca9558_engenius_epg5000.dts | 5 +- .../qca9558_librerouter_librerouter-v1.dts | 5 +- ..._mikrotik_routerboard-921gs-5hpacd-15s.dts | 1 - ...58_mikrotik_routerboard-922uags-5hpacd.dts | 1 - .../dts/qca9558_mikrotik_routerboard-92x.dtsi | 4 +- .../ath79/dts/qca9558_netgear_ex6400.dts | 1 - .../ath79/dts/qca9558_netgear_ex7300.dts | 1 - .../ath79/dts/qca9558_netgear_ex7300.dtsi | 4 +- .../linux/ath79/dts/qca9558_ocedo_koala.dts | 5 +- .../linux/ath79/dts/qca9558_ocedo_ursus.dts | 5 +- .../ath79/dts/qca9558_openmesh_om5p-ac-v2.dts | 5 +- .../ath79/dts/qca9558_sitecom_wlr-8100.dts | 5 +- .../ath79/dts/qca9558_tplink_archer-c.dtsi | 4 +- .../ath79/dts/qca9558_tplink_archer-c5-v1.dts | 1 - .../ath79/dts/qca9558_tplink_archer-c7-v1.dts | 1 - .../ath79/dts/qca9558_tplink_archer-c7-v2.dts | 1 - .../ath79/dts/qca9558_tplink_archer-d7-v1.dts | 1 - .../ath79/dts/qca9558_tplink_archer-d7.dtsi | 4 +- .../dts/qca9558_tplink_archer-d7b-v1.dts | 1 - .../ath79/dts/qca9558_tplink_re350k-v1.dts | 25 +- .../ath79/dts/qca9558_tplink_re355-v1.dts | 1 - .../ath79/dts/qca9558_tplink_re450-v1.dts | 1 - .../linux/ath79/dts/qca9558_tplink_rex5x.dtsi | 4 +- .../dts/qca9558_tplink_tl-wdr4900-v2.dts | 5 +- .../dts/qca9558_tplink_tl-wr1043nd-v2.dts | 1 - .../dts/qca9558_tplink_tl-wr1043nd-v3.dts | 1 - .../ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi | 4 +- .../dts/qca9558_tplink_tl-wr1045nd-v2.dts | 1 - .../dts/qca9558_tplink_tl-wr941n-v7-cn.dts | 5 +- .../ath79/dts/qca9558_trendnet_tew-823dru.dts | 5 +- .../dts/qca9558_ubnt_powerbeam-5ac-500.dts | 3 +- .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 1 - target/linux/ath79/dts/qca955x.dtsi | 2 +- target/linux/ath79/dts/qca955x_ubnt_xc.dtsi | 6 +- .../ath79/dts/qca955x_zyxel_nbg6x16.dtsi | 4 +- .../linux/ath79/dts/qca9561_avm_fritz4020.dts | 5 +- .../dts/qca9561_tplink_archer-c25-v1.dts | 5 +- .../dts/qca9561_tplink_archer-c58-v1.dts | 5 +- .../dts/qca9561_tplink_archer-c59-v1.dts | 5 +- .../dts/qca9561_tplink_archer-c59-v2.dts | 5 +- .../ath79/dts/qca9561_tplink_archer-c5x.dtsi | 10 +- .../dts/qca9561_tplink_archer-c60-v1.dts | 5 +- .../dts/qca9561_tplink_archer-c60-v2.dts | 5 +- .../dts/qca9561_tplink_archer-c60-v3.dts | 5 +- .../ath79/dts/qca9561_tplink_archer-c6x.dtsi | 10 +- .../dts/qca9561_tplink_eap225-wall-v2.dts | 145 ++ .../ath79/dts/qca9561_xiaomi_mi-router-4q.dts | 7 +- .../linux/ath79/dts/qca9563_compex_wpj563.dts | 5 +- .../ath79/dts/qca9563_dlink_dir-842-c.dtsi | 4 +- .../ath79/dts/qca9563_dlink_dir-842-c1.dts | 1 - .../ath79/dts/qca9563_dlink_dir-842-c2.dts | 1 - .../ath79/dts/qca9563_dlink_dir-842-c3.dts | 1 - .../ath79/dts/qca9563_dlink_dir-859-a1.dts | 5 +- .../dts/qca9563_elecom_wrc-1750ghbk2-i.dts | 1 - .../dts/qca9563_elecom_wrc-300ghbk2-i.dts | 1 - .../ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi | 4 +- .../dts/qca9563_glinet_gl-ar750s-nor-nand.dts | 2 - .../dts/qca9563_glinet_gl-ar750s-nor.dts | 2 - .../ath79/dts/qca9563_glinet_gl-ar750s.dtsi | 4 +- .../linux/ath79/dts/qca9563_nec_wg1200cr.dts | 5 +- .../linux/ath79/dts/qca9563_nec_wg800hp.dts | 5 +- .../linux/ath79/dts/qca9563_netgear_wndr.dtsi | 4 +- .../ath79/dts/qca9563_netgear_wndr4300-v2.dts | 2 - .../ath79/dts/qca9563_netgear_wndr4500-v3.dts | 2 - .../linux/ath79/dts/qca9563_phicomm_k2t.dts | 5 +- .../ath79/dts/qca9563_rosinson_wr818.dts | 5 +- .../ath79/dts/qca9563_tplink_archer-a7-v5.dts | 1 - .../ath79/dts/qca9563_tplink_archer-c2-v3.dts | 5 +- .../dts/qca9563_tplink_archer-c6-v2-us.dts | 5 +- .../ath79/dts/qca9563_tplink_archer-c6-v2.dts | 5 +- .../ath79/dts/qca9563_tplink_archer-c7-v4.dts | 5 +- .../ath79/dts/qca9563_tplink_archer-c7-v5.dts | 1 - .../dts/qca9563_tplink_archer-x6-v2.dtsi | 8 +- .../dts/qca9563_tplink_archer-x7-v5.dtsi | 4 +- .../ath79/dts/qca9563_tplink_eap245-v3.dts | 162 ++ .../ath79/dts/qca9563_tplink_re450-v2.dts | 1 - .../ath79/dts/qca9563_tplink_re450-v3.dts | 1 - .../linux/ath79/dts/qca9563_tplink_re450.dtsi | 4 +- .../dts/qca9563_tplink_tl-wpa8630-v1.dts | 1 - .../ath79/dts/qca9563_tplink_tl-wpa8630.dtsi | 4 +- .../dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts | 5 +- .../dts/qca9563_tplink_tl-wpa8630p-v2-int.dts | 5 +- .../dts/qca9563_tplink_tl-wpa8630p-v2.dtsi | 4 +- .../dts/qca9563_tplink_tl-wr1043n-v5.dts | 1 - .../ath79/dts/qca9563_tplink_tl-wr1043n.dtsi | 4 +- .../dts/qca9563_tplink_tl-wr1043nd-v4.dts | 1 - .../ath79/dts/qca9563_ubnt_unifiac-lite.dts | 1 - .../ath79/dts/qca9563_ubnt_unifiac-lr.dts | 1 - .../dts/qca9563_ubnt_unifiac-mesh-pro.dts | 1 - .../ath79/dts/qca9563_ubnt_unifiac-mesh.dts | 1 - .../ath79/dts/qca9563_ubnt_unifiac-pro.dts | 1 - .../linux/ath79/dts/qca9563_ubnt_unifiac.dtsi | 4 +- .../linux/ath79/dts/qca9563_yuncore_a782.dts | 1 - .../ath79/dts/qca9563_yuncore_xd4200.dts | 1 - .../ath79/dts/qca9563_yuncore_xd4200.dtsi | 4 +- target/linux/ath79/dts/qca956x.dtsi | 2 +- .../ath79/dts/tp9343_tplink_tl-wa901nd-v4.dts | 1 - .../ath79/dts/tp9343_tplink_tl-wa901nd-v5.dts | 1 - .../ath79/dts/tp9343_tplink_tl-wr940n-v3.dts | 1 - .../ath79/dts/tp9343_tplink_tl-wr940n-v4.dts | 1 - .../ath79/dts/tp9343_tplink_tl-wr940n-v6.dts | 1 - .../ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts | 1 - .../linux/ath79/dts/tp9343_tplink_tl-wx.dtsi | 4 +- .../generic/base-files/etc/board.d/01_leds | 21 +- .../generic/base-files/etc/board.d/02_network | 90 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 13 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 23 +- .../etc/uci-defaults/04_led_migration | 18 +- .../etc/uci-defaults/05_fix-compat-version | 10 + target/linux/ath79/image/Makefile | 5 - target/linux/ath79/image/common-buffalo.mk | 15 + target/linux/ath79/image/generic-tp-link.mk | 31 + target/linux/ath79/image/generic-ubnt.mk | 25 + target/linux/ath79/image/generic.mk | 139 +- target/linux/ath79/image/tiny.mk | 9 +- .../nand/base-files/etc/init.d/bootcount | 2 +- .../nand/base-files/lib/upgrade/glinet.sh | 2 +- ...1-Don-t-use-DT-aliases-for-numbering.patch | 2 +- ...0032-amba_pl011-Round-input-clock-up.patch | 6 +- ...Add-cts-event-workaround-DT-property.patch | 2 +- .../950-0037-Add-dwc_otg-driver.patch | 2 +- ...50-0040-fbdev-add-FBIOCOPYAREA-ioctl.patch | 8 +- ...hci_fixup_endpoint-for-interval-adju.patch | 2 +- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 6 +- ....dtbo-overlays-to-be-built-piecemeal.patch | 2 +- ...ow-.dtbo-overlays-to-be-built-adjust.patch | 2 +- ...CS_HIGH-if-GPIO-descriptors-are-used.patch | 4 +- ..._descriptor-fixup-moved-to-spi_setup.patch | 2 +- ...te-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch | 2 +- .../bcm47xx/patches-5.4/159-cpu_fixes.patch | 6 +- .../dts/bcm63167-sercomm-h500-s-lowi.dts | 2 +- .../dts/bcm63167-sercomm-h500-s-vfes.dts | 2 +- .../bcm63xx/dts/bcm63167-sercomm-h500-s.dtsi | 2 +- ...low-limiting-ports-for-ehci-platform.patch | 2 +- .../gemini/base-files/etc/board.d/02_network | 27 + .../011-kbuild-export-SUBARCH.patch | 4 +- ...Implement-optimised-checksum-routine.patch | 176 ++ ...m-Fix-pathological-zero-length-calls.patch | 28 + ...ast-GRO-for-skbs-with-Ethernet-heade.patch | 78 + ...e-fwnode-parsing-into-sfp-bus-layer.patch} | 0 ...-net-phy-add-core-phylib-sfp-support.patch | 2 +- ...pport-for-clause-37-auto-negotiation.patch | 6 +- ...dsa-rtl8366-Pass-GENMASK-signed-bits.patch | 27 + ...tl4_a-Implement-Realtek-4-byte-A-tag.patch | 232 +++ ...sa-rtl8366rb-Support-the-CPU-DSA-tag.patch | 100 ++ ...atek-Integrate-GDM-PSE-setup-operat.patch} | 44 +- ...iatek-Refine-the-timing-of-GDM-PSE-s.patch | 45 + ...diatek-Enable-GDM-GDMA_DROP_ALL-mode.patch | 33 + target/linux/generic/config-5.4 | 6 + .../hack-5.4/230-openwrt_lzma_options.patch | 6 +- .../301-mips_image_cmdline_hack.patch | 2 +- .../550-loop-Report-EOPNOTSUPP-properly.patch | 2 +- .../hack-5.4/647-netfilter-flow-acct.patch | 2 +- .../650-netfilter-add-xt_OFFLOAD-target.patch | 2 +- .../702-phy_add_aneg_done_function.patch | 2 +- .../generic/hack-5.4/902-debloat_proc.patch | 6 +- .../hack-5.4/904-debloat_dma_buf.patch | 2 +- .../pending-5.4/110-ehci_hcd_ignore_oc.patch | 6 +- .../pending-5.4/201-extra_optimization.patch | 2 +- .../300-mips_expose_boot_raw.patch | 4 +- .../411-mtd-partial_eraseblock_write.patch | 13 +- .../412-mtd-partial_eraseblock_unlock.patch | 2 +- .../pending-5.4/630-packet_socket_type.patch | 8 +- ...w_table-add-hardware-offload-support.patch | 6 +- ...-support-hardware-flow-table-offload.patch | 78 + ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 24 +- ...ng-with-source-address-failed-policy.patch | 2 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +- ...dd-support-for-threaded-NAPI-polling.patch | 12 +- ...et-mtk_eth_soc-use-napi_consume_skb.patch} | 2 +- ...eth_soc-significantly-reduce-mdio-b.patch} | 2 +- ...net-mtk_eth_soc-fix-rx-vlan-offload.patch} | 14 +- ...eth_soc-fix-unnecessary-tx-queue-st.patch} | 18 +- ..._eth_soc-use-larger-burst-size-for-q.patch | 32 + ...-mtk_eth_soc-increase-DMA-ring-sizes.patch | 21 + ..._eth_soc-implement-dynamic-interrupt.patch | 281 +++ ..._eth_soc-cache-hardware-pointer-of-l.patch | 67 + ..._eth_soc-only-read-the-full-rx-descr.patch | 44 + ..._eth_soc-unmap-rx-data-before-callin.patch | 44 + ..._eth_soc-avoid-rearming-interrupt-if.patch | 35 + ...k_eth_soc-fix-parsing-packets-in-GDM.patch | 75 + ..._eth_soc-set-PPE-flow-hash-as-skb-ha.patch | 23 + ...ta-Assign-OF-node-to-the-SCSI-device.patch | 4 +- .../pending-5.4/834-ledtrig-libata.patch | 10 +- .../imx6/base-files/etc/board.d/02_network | 36 +- target/linux/imx6/base-files/lib/imx6.sh | 103 -- .../imx6/base-files/lib/preinit/01_sysinfo | 7 - .../base-files/lib/preinit/79_move_config | 4 +- .../imx6/base-files/lib/upgrade/platform.sh | 80 +- ...msm-use-sdhci_set_clock-instead-of-s.patch | 2 +- .../705-net-add-qualcomm-ar40xx-phy.patch | 35 +- target/linux/ipq806x/config-5.4 | 1 + ...issing-ipq806x-clocks-in-PCIe-driver.patch | 103 -- ...nge-duplicate-PCI-reset-to-phy-reset.patch | 72 - ...I-qcom-Add-missing-reset-for-ipq806x.patch | 62 - .../patches-5.4/851-add-gsbi1-dts.patch | 44 + .../patches-5.4/997-device_tree_cmdline.patch | 12 + .../etc/uci-defaults/05_fix-compat-version | 16 - .../arch/arm/boot/dts/kirkwood-ea3500.dts | 2 +- .../arch/arm/boot/dts/kirkwood-nsa310s.dts | 2 +- target/linux/kirkwood/image/Makefile | 3 +- .../ase/base-files/etc/board.d/02_network | 2 +- target/linux/lantiq/ase/config-5.4 | 2 - target/linux/lantiq/config-5.4 | 3 - .../dts/lantiq/amazonse_allnet_all0333cj.dts | 2 +- .../boot/dts/lantiq/ar9_bt_homehub-v3a.dts | 2 +- .../dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts | 2 +- .../boot/dts/lantiq/ar9_netgear_dgn3500.dtsi | 2 +- .../mips/boot/dts/lantiq/ar9_zte_h201l.dts | 2 +- .../boot/dts/lantiq/ar9_zyxel_p-2601hn.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv4510pw.dts | 2 +- .../lantiq/danube_arcadyan_arv4518pwr01.dtsi | 2 +- .../dts/lantiq/danube_arcadyan_arv4519pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv4520pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv4525pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv452cqw.dts | 2 +- .../lantiq/danube_arcadyan_arv7506pw11.dts | 2 +- .../lantiq/danube_arcadyan_arv7510pw22.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv7518pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv7519pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv7525pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv752dpw.dts | 2 +- .../lantiq/danube_arcadyan_arv752dpw22.dts | 2 +- .../dts/lantiq/danube_audiocodes_mp-252.dts | 2 +- .../boot/dts/lantiq/danube_bt_homehub-v2b.dts | 2 +- .../dts/lantiq/danube_lantiq_easy50712.dts | 2 +- .../lantiq/danube_siemens_gigaset-sx76x.dts | 2 +- .../lantiq/falcon_lantiq_easy98000-nand.dts | 2 +- .../lantiq/falcon_lantiq_easy98000-nor.dts | 2 +- .../boot/dts/lantiq/falcon_sflash-16m.dtsi | 2 +- .../dts/lantiq/vr9_alphanetworks_asl56026.dts | 2 +- .../dts/lantiq/vr9_arcadyan_arv7519rw22.dts | 2 +- .../boot/dts/lantiq/vr9_arcadyan_vg3503j.dts | 2 +- .../lantiq/vr9_arcadyan_vgv7510kw22-nor.dts | 2 +- .../dts/lantiq/vr9_arcadyan_vgv7519-nor.dts | 2 +- .../boot/dts/lantiq/vr9_bt_homehub-v5a.dts | 2 +- .../dts/lantiq/vr9_buffalo_wbmr-300hpd.dts | 2 +- .../dts/lantiq/vr9_lantiq_easy80920-nand.dts | 2 +- .../dts/lantiq/vr9_lantiq_easy80920-nor.dts | 2 +- .../boot/dts/lantiq/vr9_netgear_dm200.dts | 2 +- .../dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts | 2 +- .../dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts | 2 +- .../dts/lantiq/amazonse_allnet_all0333cj.dts | 2 +- .../boot/dts/lantiq/ar9_bt_homehub-v3a.dts | 2 +- .../dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts | 2 +- .../boot/dts/lantiq/ar9_netgear_dgn3500.dtsi | 2 +- .../mips/boot/dts/lantiq/ar9_zte_h201l.dts | 2 +- .../boot/dts/lantiq/ar9_zyxel_p-2601hn.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv4510pw.dts | 2 +- .../lantiq/danube_arcadyan_arv4518pwr01.dtsi | 2 +- .../dts/lantiq/danube_arcadyan_arv4519pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv4520pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv4525pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv452cqw.dts | 2 +- .../lantiq/danube_arcadyan_arv7506pw11.dts | 2 +- .../lantiq/danube_arcadyan_arv7510pw22.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv7518pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv7519pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv7525pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv752dpw.dts | 2 +- .../lantiq/danube_arcadyan_arv752dpw22.dts | 2 +- .../dts/lantiq/danube_audiocodes_mp-252.dts | 2 +- .../boot/dts/lantiq/danube_bt_homehub-v2b.dts | 2 +- .../dts/lantiq/danube_lantiq_easy50712.dts | 2 +- .../lantiq/danube_siemens_gigaset-sx76x.dts | 2 +- .../lantiq/falcon_lantiq_easy98000-nand.dts | 2 +- .../lantiq/falcon_lantiq_easy98000-nor.dts | 2 +- .../boot/dts/lantiq/falcon_sflash-16m.dtsi | 2 +- .../dts/lantiq/vr9_alphanetworks_asl56026.dts | 2 +- .../dts/lantiq/vr9_arcadyan_arv7519rw22.dts | 2 +- .../boot/dts/lantiq/vr9_arcadyan_vg3503j.dts | 2 +- .../lantiq/vr9_arcadyan_vgv7510kw22-nor.dts | 2 +- .../dts/lantiq/vr9_arcadyan_vgv7519-nor.dts | 2 +- .../boot/dts/lantiq/vr9_avm_fritz7412.dts | 16 +- .../boot/dts/lantiq/vr9_bt_homehub-v5a.dts | 2 +- .../dts/lantiq/vr9_buffalo_wbmr-300hpd.dts | 2 +- .../dts/lantiq/vr9_lantiq_easy80920-nand.dts | 2 +- .../dts/lantiq/vr9_lantiq_easy80920-nor.dts | 2 +- .../boot/dts/lantiq/vr9_netgear_dm200.dts | 2 +- .../mips/boot/dts/lantiq/vr9_tplink_vr200.dts | 2 +- .../boot/dts/lantiq/vr9_tplink_vr200v.dts | 2 +- .../dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts | 2 +- .../dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts | 2 +- .../lantiq/patches-5.4/0152-lantiq-VPE.patch | 2 +- .../xrx200/base-files/etc/board.d/02_network | 8 +- .../xway/base-files/etc/board.d/02_network | 2 +- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 4 +- ...FIG_COMPAT-leak-during-headers-insta.patch | 516 ++++++ ...low-specifying-s2-prot-bits-when-map.patch | 2 +- ...rop-qman-mmio-cacheable-mapping-hack.patch | 4 +- ...hc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch | 6 +- ...-of-esdhc-convert-to-use-esdhc_tunin.patch | 6 +- ...-of-esdhc-update-tuning-erratum-A-00.patch | 6 +- ...5-usb-dwc3-add-otg-properties-update.patch | 2 +- ...1-usb-host-ehci-hcd-enable-park-mode.patch | 2 +- ...move-EH-SINGLE_STEP_SET_FEATURE-impl.patch | 4 +- ...host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch | 4 +- ...-host-xhci-add-.bus_suspend-override.patch | 2 +- ...st-xhci-do-warm-reset-for-link-state.patch | 2 +- .../base-files/etc/uci-defaults/99-net-ps | 5 - .../arch/arm/boot/dts/mt7629-lynx-rfb.dts | 2 +- .../arch/arm/boot/dts/mt7629-rfb.dts | 2 +- .../files-4.19/arch/arm/boot/dts/mt7629.dtsi | 2 +- .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 2 +- .../mediatek/mt7622-elecom-wrc-2533gent.dts | 2 +- .../boot/dts/mediatek/mt7622-lynx-rfb1.dts | 2 +- .../arm64/boot/dts/mediatek/mt7622-rfb1.dts | 2 +- .../arch/arm64/boot/dts/mediatek/mt7622.dtsi | 2 +- .../drivers/net/phy/mtk/mt753x/mt7530.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt7530.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt7531.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt7531.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x.h | 2 +- .../net/phy/mtk/mt753x/mt753x_common.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_mdio.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_nl.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_nl.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_regs.h | 2 +- .../net/phy/mtk/mt753x/mt753x_swconfig.c | 2 +- .../net/phy/mtk/mt753x/mt753x_swconfig.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_vlan.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_vlan.h | 2 +- .../mt7622-bananapi-bpi-r64-rootdisk.dts | 2 +- .../mediatek/mt7622-elecom-wrc-2533gent.dts | 2 +- .../boot/dts/mediatek/mt7622-rfb1-ubi.dts | 2 +- .../drivers/net/phy/mtk/mt753x/mt7530.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt7530.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt7531.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt7531.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x.h | 2 +- .../net/phy/mtk/mt753x/mt753x_common.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_mdio.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_nl.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_nl.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_regs.h | 2 +- .../net/phy/mtk/mt753x/mt753x_swconfig.c | 2 +- .../net/phy/mtk/mt753x/mt753x_swconfig.h | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_vlan.c | 2 +- .../drivers/net/phy/mtk/mt753x/mt753x_vlan.h | 2 +- .../linux/mediatek/image/gen_mtk_mmc_img.sh | 2 +- target/linux/mediatek/image/mt7622.mk | 2 +- target/linux/mediatek/modules.mk | 12 + target/linux/mediatek/mt7622/config-5.4 | 58 +- ...-spi-make-spi-max-frequency-optional.patch | 2 +- ...dts-add-wmac-support-for-mt7622-rfb1.patch | 2 +- ...03-crypto-fix-eip97-cache-incoherent.patch | 26 + ...dsa-mt7530-Refine-message-in-Kconfig.patch | 98 -- ...data-ready-for-adding-a-new-hardware.patch | 441 ----- ...new-MT7531-binding-to-support-MT7531.patch | 179 -- ...530-Add-the-support-of-MT7531-switch.patch | 1096 ------------ ...mt7531-dsa-to-bananapi-bpi-r64-board.patch | 138 -- ...agate-resolved-link-config-via-mac_l.patch | 246 +++ ...e-resolved-link-config-via-mac_link_.patch | 143 ++ ...se-resolved-link-config-in-mac_link_.patch | 145 ++ ...xtend-device-data-ready-for-adding-a.patch | 458 +++++ ...530-Add-the-support-of-MT7531-switch.patch | 1510 +++++++++++++++++ ...mt7531-dsa-to-bananapi-bpi-r64-board.patch | 71 + ...623-add-missing-pause-for-switchport.patch | 23 + .../patches-5.4/0900-bt-mtk-serial-fix.patch | 2 +- ...ek-Split-PCIe-node-for-MT2712-MT7622.patch | 4 +- .../mediatek/patches-5.4/0999-hnat.patch | 48 +- ...1001-eth-mtk-disable-TBDDONE-support.patch | 24 - ...s-mt7622-rfb-change-to-ax-mtd-layout.patch | 23 + ...diatek-fix-clearing-interrupt-status.patch | 24 + ..._eth_soc-add-support-for-coherent-DM.patch | 83 + ...ediatek-add-support-for-coherent-DMA.patch | 108 ++ .../files/arch/powerpc/platforms/85xx/panda.c | 2 +- .../arch/powerpc/platforms/85xx/red15w_rev1.c | 2 +- .../arch/powerpc/platforms/85xx/ws-ap3710i.c | 2 +- .../etc/uci-defaults/05_fix-compat-version | 21 - .../boot/dts/marvell/armada-3720-uDPU.dts | 2 +- .../boot/dts/armada-370-buffalo-ls421de.dts | 15 +- .../marvell/armada-3720-espressobin-emmc.dts | 2 +- .../armada-3720-espressobin-v7-emmc.dts | 2 +- .../marvell/armada-3720-espressobin-v7.dts | 2 +- .../dts/marvell/armada-3720-gl-mv1000.dts | 2 +- target/linux/mvebu/image/cortexa9.mk | 7 +- .../mvebu/image/generic-arm64.bootscript | 8 + target/linux/mvebu/modules.mk | 21 + .../030-linkstation-poweroff.patch | 177 ++ .../oxnas/files/drivers/phy/phy-oxnas-pcie.c | 2 +- target/linux/oxnas/image/ox820.mk | 4 + .../oxnas/patches-5.4/999-libata-hacks.patch | 8 +- target/linux/pistachio/Makefile | 3 +- target/linux/pistachio/config-4.14 | 355 ---- ...ine-img-mdc-Handle-early-status-read.patch | 68 - ...mg-spfi-Implement-dual-and-quad-mode.patch | 198 --- ...-device-select-bits-for-SPFI-port-st.patch | 27 - ...-device-0-configuration-for-all-devi.patch | 64 - ...i-RX-maximum-burst-size-for-DMA-is-8.patch | 59 - ...g-spfi-finish-every-transfer-cleanly.patch | 120 -- ...y-programming-min-delta-up-to-10-tim.patch | 66 - ...istachio-Fix-wrong-SDHost-card-speed.patch | 49 - ...-img-marduk-switch-mmc-to-1-bit-mode.patch | 47 - ...or-support-mtd-name-from-device-tree.patch | 34 - ...ength-of-ID-before-reading-bits-per-.patch | 33 - ...JEDEC-manufacturer-ID-for-Gigadevice.patch | 35 - ...413-mtd-Introduce-SPI-NAND-framework.patch | 707 -------- ...mtd-spi-nand-Support-Gigadevice-GD5F.patch | 524 ------ ...TS-img-marduk-add-nor-partition-name.patch | 20 - ...S-img-marduk-add-nand-device-support.patch | 30 - ...ethernet-mediatek-support-net-labels.patch | 4 +- .../patches-5.4/011-tune_lzma_options.patch | 6 +- 776 files changed, 11738 insertions(+), 9572 deletions(-) create mode 100644 package/boot/arm-trusted-firmware-mvebu/patches/200-hostssl.patch delete mode 100644 package/boot/uboot-mediatek/patches/001-eth-mtk-add-mt7531-switch.patch create mode 100644 package/boot/uboot-mvebu/patches/130-mmc-xenon_sdhci-Add-missing-common-host-capabilities.patch create mode 100644 package/boot/uboot-mvebu/patches/131-arm64-dts-armada-3720-espressobin-use-Linux-model-co.patch create mode 100644 package/boot/uboot-mvebu/patches/132-arm64-dts-armada-3720-espressobin-split-common-parts.patch create mode 100644 package/boot/uboot-mvebu/patches/133-arm64-dts-a3720-add-support-for-boards-with-populate.patch create mode 100644 package/boot/uboot-mvebu/patches/134-arm-mvebu-Espressobin-Set-environment-variable-fdtfi.patch delete mode 100644 package/boot/uboot-mvebu/patches/220-arm-dts-uDPU-switch-default-PHY-speed-to-3.125Gbit.patch delete mode 100644 package/kernel/mac80211/patches/subsys/140-tweak-TSQ-setting.patch rename package/kernel/mac80211/patches/subsys/{320-mac80211-add-missing-queue-hash-initialization-to-80.patch => 314-mac80211-add-missing-queue-hash-initialization-to-80.patch} (86%) rename package/kernel/mac80211/patches/subsys/{321-mac80211-check-and-refresh-aggregation-session-in-en.patch => 315-mac80211-check-and-refresh-aggregation-session-in-en.patch} (88%) rename package/kernel/mac80211/patches/subsys/{325-mac80211-skip-encap-offload-for-tx-multicast-control.patch => 316-mac80211-skip-encap-offload-for-tx-multicast-control.patch} (74%) rename package/kernel/mac80211/patches/subsys/{326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch => 317-mac80211-set-info-control.hw_key-for-encap-offload-p.patch} (79%) rename package/kernel/mac80211/patches/subsys/{314-mac80211-rework-tx-encapsulation-offload-API.patch => 318-mac80211-rework-tx-encapsulation-offload-API.patch} (82%) rename package/kernel/mac80211/patches/subsys/{315-mac80211-reduce-duplication-in-tx-status-functions.patch => 319-mac80211-reduce-duplication-in-tx-status-functions.patch} (100%) rename package/kernel/mac80211/patches/subsys/{316-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch => 320-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch} (100%) rename package/kernel/mac80211/patches/subsys/{317-mac80211-optimize-station-connection-monitor.patch => 321-mac80211-optimize-station-connection-monitor.patch} (100%) rename package/kernel/mac80211/patches/subsys/{318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch => 322-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch} (97%) rename package/kernel/mac80211/patches/subsys/{319-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch => 323-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch} (100%) rename package/kernel/mac80211/patches/subsys/{322-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch => 324-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch} (100%) rename package/kernel/mac80211/patches/subsys/{323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch => 325-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch} (98%) rename package/kernel/mac80211/patches/subsys/{324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch => 326-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch} (97%) create mode 100644 package/kernel/mac80211/patches/subsys/327-mac80211-reorganize-code-to-remove-a-forward-declara.patch create mode 100644 package/kernel/mac80211/patches/subsys/328-mac80211-extend-AQL-aggregation-estimation-to-HE-and.patch create mode 100644 package/kernel/mac80211/patches/subsys/329-mac80211-add-AQL-support-for-VHT160-tx-rates.patch create mode 100644 package/kernel/mac80211/patches/subsys/330-mac80211-allow-bigger-A-MSDU-sizes-in-VHT-even-if-HT.patch create mode 100644 package/kernel/mac80211/patches/subsys/331-mac80211-do-not-allow-bigger-VHT-MPDUs-than-the-hard.patch create mode 100644 package/kernel/mac80211/patches/subsys/332-mac80211-fix-regression-in-sta-connection-monitor.patch create mode 100644 package/kernel/mac80211/patches/subsys/370-mac80211-fix-misplaced-while-instead-of-if.patch create mode 100644 package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch delete mode 100644 target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c delete mode 100644 target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch delete mode 100644 target/linux/arc770/config-4.14 delete mode 100644 target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch delete mode 100644 target/linux/at91/base-files/lib/at91.sh delete mode 100644 target/linux/at91/base-files/lib/preinit/01_preinit_do_at91.sh delete mode 100644 target/linux/at91/config-4.14 delete mode 100644 target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch delete mode 100644 target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch rename target/linux/at91/{patches-4.14 => patches-5.4}/101-ARM-at91-build-dtb-for-q5xr5.patch (74%) rename target/linux/at91/{patches-4.14 => patches-5.4}/102-ARM-at91-build-dtb-for-wb45n.patch (74%) create mode 100644 target/linux/at91/patches-5.4/102-ARM-at91-wb45n-fix-duplicate-label.patch rename target/linux/at91/{patches-4.14 => patches-5.4}/103-ARM-at91-build-dtb-for-wb50n.patch (85%) create mode 100644 target/linux/at91/patches-5.4/103-ARM-at91-wb50n-fix-duplicate-label.patch rename target/linux/ath25/{config-4.14 => config-5.4} (76%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/107-ar5312_gpio.patch (92%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/108-ar2315_gpio.patch (95%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/110-ar2313_ethernet.patch (98%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/120-spiflash.patch (98%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/130-watchdog.patch (98%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/140-redboot_boardconfig.patch (81%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/141-redboot_partition_scan.patch (76%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/142-redboot_various_erase_size_fix.patch (81%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/210-reset_button.patch (100%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/220-enet_micrel_workaround.patch (88%) rename target/linux/ath25/{patches-4.14 => patches-5.4}/330-board_leds.patch (100%) create mode 100644 target/linux/ath79/dts/ar7161_buffalo_wzr-600dhp.dts create mode 100644 target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi create mode 100644 target/linux/ath79/dts/ar7161_meraki_mr16.dts create mode 100644 target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts create mode 100644 target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts create mode 100644 target/linux/ath79/dts/ar9344_mercury_mw4530r-v1.dts create mode 100644 target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts create mode 100644 target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts create mode 100644 target/linux/ath79/generic/base-files/etc/uci-defaults/05_fix-compat-version create mode 100755 target/linux/gemini/base-files/etc/board.d/02_network create mode 100644 target/linux/generic/backport-5.4/041-v5.5-arm64-Implement-optimised-checksum-routine.patch create mode 100644 target/linux/generic/backport-5.4/042-v5.5-arm64-csum-Fix-pathological-zero-length-calls.patch create mode 100644 target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch rename target/linux/generic/backport-5.4/{716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch => 716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch} (100%) create mode 100644 target/linux/generic/backport-5.4/756-v5.8-net-dsa-rtl8366-Pass-GENMASK-signed-bits.patch create mode 100644 target/linux/generic/backport-5.4/757-v5.8-net-dsa-tag_rtl4_a-Implement-Realtek-4-byte-A-tag.patch create mode 100644 target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch rename target/linux/{mediatek/patches-5.4/1000-eth-gdm-config-backport.patch => generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch} (67%) create mode 100644 target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch create mode 100644 target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch create mode 100644 target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch rename target/linux/{ramips/patches-5.4/0400-net-ethernet-mediatek-use-napi_consume_skb.patch => generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch} (96%) rename target/linux/{ramips/patches-5.4/0401-net-ethernet-mediatek-significantly-reduce-mdio-bus-.patch => generic/pending-5.4/770-01-net-ethernet-mtk_eth_soc-significantly-reduce-mdio-b.patch} (91%) rename target/linux/{mediatek/patches-5.4/0400-eth-fix-rx-vlan-hw-offload.patch => generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch} (64%) rename target/linux/{mediatek/patches-5.4/0401-eth-fix-eth1-tx-timeout.patch => generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch} (58%) create mode 100644 target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch create mode 100644 target/linux/generic/pending-5.4/770-05-net-ethernet-mtk_eth_soc-increase-DMA-ring-sizes.patch create mode 100644 target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch create mode 100644 target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch create mode 100644 target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch create mode 100644 target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch create mode 100644 target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch create mode 100644 target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch create mode 100644 target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch delete mode 100644 target/linux/imx6/base-files/lib/preinit/01_sysinfo delete mode 100644 target/linux/ipq806x/patches-5.4/093-1-v5.8-ipq806x-PCI-qcom-Add-missing-ipq806x-clocks-in-PCIe-driver.patch delete mode 100644 target/linux/ipq806x/patches-5.4/093-2-v5.8-ipq806x-PCI-qcom-Change-duplicate-PCI-reset-to-phy-reset.patch delete mode 100644 target/linux/ipq806x/patches-5.4/093-3-v5.8-ipq806x-PCI-qcom-Add-missing-reset-for-ipq806x.patch create mode 100644 target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch create mode 100644 target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch delete mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version create mode 100644 target/linux/layerscape/patches-5.4/701-net-0408-sdk_fman-fix-CONFIG_COMPAT-leak-during-headers-insta.patch delete mode 100755 target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps create mode 100644 target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch delete mode 100644 target/linux/mediatek/patches-5.4/0600-1-6-net-dsa-mt7530-Refine-message-in-Kconfig.patch delete mode 100644 target/linux/mediatek/patches-5.4/0600-2-6-net-dsa-mt7530-Extend-device-data-ready-for-adding-a-new-hardware.patch delete mode 100644 target/linux/mediatek/patches-5.4/0600-3-6-dt-bindings-net-dsa-add-new-MT7531-binding-to-support-MT7531.patch delete mode 100644 target/linux/mediatek/patches-5.4/0600-4-6-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch delete mode 100644 target/linux/mediatek/patches-5.4/0600-6-6-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch create mode 100644 target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch create mode 100644 target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch create mode 100644 target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch create mode 100644 target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch create mode 100644 target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch create mode 100644 target/linux/mediatek/patches-5.4/0605-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch create mode 100644 target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch delete mode 100644 target/linux/mediatek/patches-5.4/1001-eth-mtk-disable-TBDDONE-support.patch create mode 100644 target/linux/mediatek/patches-5.4/1003-dts-mt7622-rfb-change-to-ax-mtd-layout.patch create mode 100644 target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch create mode 100644 target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch create mode 100644 target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch delete mode 100644 target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version create mode 100644 target/linux/mvebu/modules.mk create mode 100644 target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch delete mode 100644 target/linux/pistachio/config-4.14 delete mode 100644 target/linux/pistachio/patches-4.14/101-dmaengine-img-mdc-Handle-early-status-read.patch delete mode 100644 target/linux/pistachio/patches-4.14/102-spi-img-spfi-Implement-dual-and-quad-mode.patch delete mode 100644 target/linux/pistachio/patches-4.14/103-spi-img-spfi-set-device-select-bits-for-SPFI-port-st.patch delete mode 100644 target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch delete mode 100644 target/linux/pistachio/patches-4.14/105-spi-img-spfi-RX-maximum-burst-size-for-DMA-is-8.patch delete mode 100644 target/linux/pistachio/patches-4.14/106-spi-img-spfi-finish-every-transfer-cleanly.patch delete mode 100644 target/linux/pistachio/patches-4.14/107-clockevents-Retry-programming-min-delta-up-to-10-tim.patch delete mode 100644 target/linux/pistachio/patches-4.14/108-clk-pistachio-Fix-wrong-SDHost-card-speed.patch delete mode 100644 target/linux/pistachio/patches-4.14/109-MIPS-DTS-img-marduk-switch-mmc-to-1-bit-mode.patch delete mode 100644 target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch delete mode 100644 target/linux/pistachio/patches-4.14/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch delete mode 100644 target/linux/pistachio/patches-4.14/412-mtd-nand-Add-JEDEC-manufacturer-ID-for-Gigadevice.patch delete mode 100644 target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch delete mode 100644 target/linux/pistachio/patches-4.14/414-mtd-spi-nand-Support-Gigadevice-GD5F.patch delete mode 100644 target/linux/pistachio/patches-4.14/901-MIPS-DTS-img-marduk-add-nor-partition-name.patch delete mode 100644 target/linux/pistachio/patches-4.14/902-MIPS-DTS-img-marduk-add-nand-device-support.patch diff --git a/include/image-commands.mk b/include/image-commands.mk index f1eeb38b4..4eb7d4938 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -391,13 +391,24 @@ define Build/tplink-v2-image rm -rf $@.new endef +compat_version=$(if $(DEVICE_COMPAT_VERSION),$(DEVICE_COMPAT_VERSION),1.0) json_quote=$(subst ','\'',$(subst ",\",$(1))) #")') + +legacy_supported_message=$(SUPPORTED_DEVICES) - Image version mismatch: image $(compat_version), \ + device 1.0. Please wipe config during upgrade (force required) or reinstall. \ + $(if $(DEVICE_COMPAT_MESSAGE),Reason: $(DEVICE_COMPAT_MESSAGE),Please check documentation ...) + metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))")))) metadata_json = \ '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \ - "metadata_version": "1.0", \ - "supported_devices":[$(call metadata_devices,$(1))], \ + "metadata_version": "1.1", \ + "compat_version": "$(call json_quote,$(compat_version))", \ + $(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \ + $(if $(filter-out 1.0,$(compat_version)),"new_supported_devices": \ + [$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma) \ + "supported_devices": ["$(call json_quote,$(legacy_supported_message))"]$(comma)) \ + $(if $(filter 1.0,$(compat_version)),"supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \ "version": { \ "dist": "$(call json_quote,$(VERSION_DIST))", \ "version": "$(call json_quote,$(VERSION_NUMBER))", \ @@ -408,7 +419,7 @@ metadata_json = \ }' define Build/append-metadata - $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) + $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json) | fwtool -I - $@) [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" -o ! -s "$@" ] || { \ cp "$(BUILD_KEY).ucert" "$@.ucert" ;\ usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\ diff --git a/include/image.mk b/include/image.mk index 18ad10cfe..20c13ed19 100644 --- a/include/image.mk +++ b/include/image.mk @@ -419,6 +419,8 @@ define Device/Init BOARD_NAME := UIMAGE_NAME := + DEVICE_COMPAT_VERSION := 1.0 + DEVICE_COMPAT_MESSAGE := SUPPORTED_DEVICES := IMAGE_METADATA := @@ -426,6 +428,7 @@ define Device/Init UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-$(1) + BROKEN := DEFAULT := endef @@ -435,6 +438,7 @@ DEFAULT_DEVICE_VARS := \ VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \ DEVICE_DTS_CONFIG DEVICE_DTS_DIR SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \ IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \ + DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \ DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \ DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \ DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \ @@ -638,6 +642,7 @@ Target-Profile-Name: $(DEVICE_DISPLAY) Target-Profile-Packages: $(DEVICE_PACKAGES) Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0) Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES) +$(if $(BROKEN),Target-Profile-Broken: $(BROKEN)) $(if $(DEFAULT),Target-Profile-Default: $(DEFAULT)) Target-Profile-Description: $(DEVICE_DESCRIPTION) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index be8702ed2..2760a7214 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -8,11 +8,11 @@ endif LINUX_VERSION-4.14 = .195 LINUX_VERSION-4.19 = .138 -LINUX_VERSION-5.4 = .61 +LINUX_VERSION-5.4 = .68 LINUX_KERNEL_HASH-4.14.195 = 394f28798670240baacd9e2cce521fbd79f8da5e1fc191695b0e11381445a021 LINUX_KERNEL_HASH-4.19.138 = d15c27d05f6c527269b75b30cc72972748e55720e7e00ad8abbaa4fe3b1d5e02 -LINUX_KERNEL_HASH-5.4.61 = 86f13d050f6389c5a1727fa81510ee8eceac795297bc584f443354609617fea4 +LINUX_KERNEL_HASH-5.4.68 = 0e93876c5ae8dc0c55cbe631971a46ab02b90cf7461fed3085703a5e4e3cd6dd remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile b/package/boot/arm-trusted-firmware-mvebu/Makefile index 239c6dd33..9e917545a 100644 --- a/package/boot/arm-trusted-firmware-mvebu/Makefile +++ b/package/boot/arm-trusted-firmware-mvebu/Makefile @@ -8,15 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=arm-trusted-firmware-mvebu -PKG_VERSION:=2.2 -PKG_RELEASE:=2 +PKG_VERSION:=2.3 +PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=git -PKG_SOURCE:=$(PKG_NAME)-$(PKG_RELEASE).tar.xz -PKG_SOURCE_URL:=https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git -PKG_SOURCE_DATE:=2020-01-21 -PKG_SOURCE_VERSION:=3b3d406ebc6f5dae6b5c9170c674183026e7301b -PKG_MIRROR_HASH:=7c63da237c52808e1fe49458d5a4ac804a8eb4c365e26c6b2b709256e8fc041f +PKG_SOURCE:=trusted-firmware-a-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot +PKG_HASH:=37f917922bcef181164908c470a2f941006791c0113d738c498d39d95d543b21 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/trusted-firmware-a-$(PKG_VERSION) + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=docs/license.rst PKG_MAINTAINER:=Vladimir Vid @@ -25,29 +26,140 @@ include $(INCLUDE_DIR)/package.mk define Package/arm-trusted-firmware-mvebu SECTION:=boot CATEGORY:=Boot Loaders - TITLE:=ARM Trusted Firmware for mvebu devices + DEPENDS:=@TARGET_mvebu_cortexa53 + VARIANT:=$(subst arm-trusted-firmware-mvebu-,,$(1)) endef -define Package/arm-trusted-firmware-mvebu/uDPU -$(call Package/arm-trusted-firmware-mvebu) - BOARDNAME:=uDPU +define Package/arm-trusted-firmware-mvebu-espressobin-512mb + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin (512MB) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin + DDR_TOPOLOGY:=0 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-1cs + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V3-V5 (1GB 1CS) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin + DDR_TOPOLOGY:=2 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-1cs-emmc + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V3-V5 (1GB 1CS, eMMC) + DEPENDS:=+u-boot-espressobin-emmc + UBOOT:=espressobin-emmc + DDR_TOPOLOGY:=4 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-2cs + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V3-V5 (1GB, 2CS) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin + DDR_TOPOLOGY:=2 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-2cs-emmc + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V3-V5 (1GB 2CS, eMMC) + DEPENDS:=+u-boot-espressobin-emmc + UBOOT:=espressobin-emmc + DDR_TOPOLOGY:=2 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v3-v5-2gb + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V3-V5 (2GB) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin + DDR_TOPOLOGY:=7 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v3-v5-2gb-emmc + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V3-V5 (2GB, eMMC) + DEPENDS:=+u-boot-espressobin-emmc + UBOOT:=espressobin-emmc + DDR_TOPOLOGY:=7 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v7-1gb + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V7 (1GB) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin + DDR_TOPOLOGY:=5 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v7-1gb-emmc + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V7 (1GB, eMMC) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin-emmc + DDR_TOPOLOGY:=5 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v7-2gb + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V7 (2GB) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin + DDR_TOPOLOGY:=6 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-espressobin-v7-2gb-emmc + $(Package/arm-trusted-firmware-mvebu) + TITLE:=ARM Trusted Firmware for Marvell ESPRESSObin V7 (2GB, eMMC) + DEPENDS:=+u-boot-espressobin + UBOOT:=espressobin-emmc + DDR_TOPOLOGY:=6 + CLOCKSPRESET:=CPU_800_DDR_800 + PLAT:=a3700 +endef + +define Package/arm-trusted-firmware-mvebu-udpu + $(Package/arm-trusted-firmware-mvebu) TITLE:=ARM Trusted Firmware for Methode uDPU DEPENDS:=+u-boot-uDPU UBOOT:=uDPU + DDR_TOPOLOGY:=0 CLOCKSPRESET:=CPU_1000_DDR_800 PLAT:=a3700 endef A3700_UTILS_NAME:=a3700-utils -A3700_UTILS_RELEASE:=18.12.1 +A3700_UTILS_RELEASE:=09679790 A3700_UTILS_SOURCE=$(A3700_UTILS_NAME)-$(A3700_UTILS_RELEASE).tar.bz2 define Download/a3700-utils FILE:=$(A3700_UTILS_SOURCE) PROTO:=git URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git - VERSION:=e6bb176fb9936d9160e53ae09275000dc6440686 - MIRROR_HASH:=c3edf71cbf1fc2e5482d36e36a34c79d682d2c87fdfb909b4dc6327a171e7bd4 + VERSION:=096797908ddd69a679fd55595c41fc02809829a9 + MIRROR_HASH:=9276d63d41b2e221c2fd5cceee988ca26eff5005747787f084868b3940173b7a SUBDIR:=$(A3700_UTILS_NAME) endef @@ -81,8 +193,7 @@ define Build/Prepare $(eval $(call Download,mv-ddr-marvell)) $(eval $(call Download,gcc-linaro)) - rm -rf $(PKG_BUILD_DIR) - $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE) + $(call Build/Prepare/Default,) mkdir -p $(STAGING_DIR_IMAGE) $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE) @@ -90,23 +201,41 @@ define Build/Prepare $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(LINARO_SOURCE) endef +export GCC_HONOUR_COPTS=s + TARGET_CFLAGS = "" -MAKE_VARS= \ - CROSS_COMPILE="$(TARGET_CROSS)" - -MAKE_FLAGS = \ - CROSS_CM3=$(STAGING_DIR_IMAGE)/$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION)/bin/arm-linux-gnueabi- \ - BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \ - MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \ - WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \ - CLOCKSPRESET=$(CLOCKSPRESET) \ - PLAT=$(PLAT) \ - all \ - fip - -define Build/InstallDev - $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/flash-image.bin $(BIN_DIR)/u-boot-$(BOARDNAME)/ +define Build/Compile + $(eval $(Package/arm-trusted-firmware-mvebu-$(BUILD_VARIANT))) \ + $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + OPENSSL_DIR=$(STAGING_DIR_HOST) \ + CROSS_CM3=$(STAGING_DIR_IMAGE)/$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION)/bin/arm-linux-gnueabi- \ + BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \ + MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \ + WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \ + DDR_TOPOLOGY=$(DDR_TOPOLOGY) \ + CLOCKSPRESET=$(CLOCKSPRESET) \ + PLAT=$(PLAT) \ + all \ + fip endef -$(eval $(call BuildPackage,arm-trusted-firmware-mvebu/uDPU)) +define Build/InstallDev + $(INSTALL_DIR) $(BIN_DIR)/flash-image-$(BUILD_VARIANT) + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/flash-image.bin $(BIN_DIR)/flash-image-$(BUILD_VARIANT)/ + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/uart-images.tgz $(BIN_DIR)/flash-image-$(BUILD_VARIANT)/ +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-512mb)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-1cs)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-1cs-emmc)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-2cs)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v3-v5-1gb-2cs-emmc)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v3-v5-2gb)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v3-v5-2gb-emmc)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v7-1gb)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v7-1gb-emmc)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v7-2gb)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-espressobin-v7-2gb-emmc)) +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu-udpu)) diff --git a/package/boot/arm-trusted-firmware-mvebu/patches/200-hostssl.patch b/package/boot/arm-trusted-firmware-mvebu/patches/200-hostssl.patch new file mode 100644 index 000000000..fc1a24a8f --- /dev/null +++ b/package/boot/arm-trusted-firmware-mvebu/patches/200-hostssl.patch @@ -0,0 +1,20 @@ +--- a/tools/fiptool/Makefile ++++ b/tools/fiptool/Makefile +@@ -19,7 +19,7 @@ ifeq (${DEBUG},1) + else + HOSTCCFLAGS += -O2 + endif +-LDLIBS := -lcrypto ++LDLIBS := -L${OPENSSL_DIR}/lib -lcrypto + + ifeq (${V},0) + Q := @ +@@ -27,7 +27,7 @@ else + Q := + endif + +-INCLUDE_PATHS := -I../../include/tools_share ++INCLUDE_PATHS := -I../../include/tools_share -I${OPENSSL_DIR}/include + + HOSTCC ?= gcc + diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile index c4edddf84..b0d466f7b 100644 --- a/package/boot/at91bootstrap/Makefile +++ b/package/boot/at91bootstrap/Makefile @@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=at91bootstrap -PKG_VERSION:=v3.8.12 -PKG_RELEASE:= +PKG_VERSION:=v3.9.3 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git -PKG_SOURCE_VERSION:=28e15d07e9f24efb04b87bb0baa211a0c5640ef1 +PKG_SOURCE_VERSION:=d96833a4b6680b237708eb4dc9f10708b9e709d8 PKG_BUILD_DIR = \ - $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) include at91bootstrap.mk include $(INCLUDE_DIR)/package.mk @@ -30,112 +30,112 @@ endef define AT91Bootstrap/at91sam9x5eknf_uboot NAME:=AT91Bootstrap for AT91SAM9X5-EK board (NandFlash) BUILD_SUBTARGET:=sam9x - BUILD_DEVICES:=at91sam9x25ek at91sam9x35ek + BUILD_DEVICES:=atmel_at91sam9x25ek atmel_at91sam9x35ek endef define AT91Bootstrap/at91sam9x5eksd_uboot NAME:=AT91Bootstrap for AT91SAM9X5-EK board (SDcard) BUILD_SUBTARGET:=sam9x - BUILD_DEVICES:=at91sam9x25ek at91sam9x35ek + BUILD_DEVICES:=atmel_at91sam9x25ek atmel_at91sam9x35ek endef define AT91Bootstrap/sama5d2_xplaineddf_uboot TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained + BUILD_DEVICES:=microchip_sama5d2-xplained endef define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (QSPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained + BUILD_DEVICES:=microchip_sama5d2-xplained endef define AT91Bootstrap/sama5d2_xplainedsd_uboot TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained + BUILD_DEVICES:=microchip_sama5d2-xplained endef define AT91Bootstrap/sama5d3_xplainednf_uboot TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained + BUILD_DEVICES:=microchip_sama5d3-xplained endef define AT91Bootstrap/sama5d3_xplainedsd_uboot TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained + BUILD_DEVICES:=microchip_sama5d3-xplained endef define AT91Bootstrap/sama5d4_xplainednf_uboot_secure TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (Nand Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained + BUILD_DEVICES:=microchip_sama5d4-xplained endef define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained + BUILD_DEVICES:=microchip_sama5d4-xplained endef define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained + BUILD_DEVICES:=microchip_sama5d4-xplained endef define AT91Bootstrap/sama5d27_som1_eksd_uboot TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard0) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d27_som1_ek + BUILD_DEVICES:=microchip_sama5d27-som1-ek endef define AT91Bootstrap/sama5d27_som1_eksd1_uboot TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard1) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d27_som1_ek + BUILD_DEVICES:=microchip_sama5d27-som1-ek endef define AT91Bootstrap/sama5d27_som1_ekqspi_uboot TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (QSPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d27_som1_ek + BUILD_DEVICES:=microchip_sama5d27-som1-ek endef define AT91Bootstrap/sama5d2_ptc_eknf_uboot TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (Nand Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_ptc_ek + BUILD_DEVICES:=microchip_sama5d2-ptc-ek endef define AT91Bootstrap/sama5d2_ptc_eksd_uboot TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (SDCard) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_ptc_ek + BUILD_DEVICES:=microchip_sama5d2-ptc-ek endef AT91BOOTSTRAP_TARGETS := \ - at91sam9x5eknf_uboot \ - at91sam9x5eksd_uboot \ - sama5d2_xplaineddf_uboot \ - sama5d2_xplaineddf_qspi_uboot \ - sama5d2_xplainedsd_uboot \ - sama5d3_xplainednf_uboot \ - sama5d3_xplainedsd_uboot \ - sama5d4_xplainednf_uboot_secure \ - sama5d4_xplaineddf_uboot_secure \ - sama5d4_xplainedsd_uboot_secure \ - sama5d27_som1_eksd1_uboot \ - sama5d27_som1_ekqspi_uboot \ - sama5d2_ptc_eknf_uboot \ - sama5d2_ptc_eksd_uboot + at91sam9x5eknf_uboot \ + at91sam9x5eksd_uboot \ + sama5d2_xplaineddf_uboot \ + sama5d2_xplaineddf_qspi_uboot \ + sama5d2_xplainedsd_uboot \ + sama5d3_xplainednf_uboot \ + sama5d3_xplainedsd_uboot \ + sama5d4_xplainednf_uboot_secure \ + sama5d4_xplaineddf_uboot_secure \ + sama5d4_xplainedsd_uboot_secure \ + sama5d27_som1_eksd1_uboot \ + sama5d27_som1_ekqspi_uboot \ + sama5d2_ptc_eknf_uboot \ + sama5d2_ptc_eksd_uboot define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) + CROSS_COMPILE=$(TARGET_CROSS) endef $(eval $(call BuildPackage/AT91Bootstrap)) diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk index 60cd8c4d3..fe6577f58 100644 --- a/package/boot/at91bootstrap/at91bootstrap.mk +++ b/package/boot/at91bootstrap/at91bootstrap.mk @@ -5,7 +5,7 @@ PKG_FLAGS:=nonshared export GCC_HONOUR_COPTS=s define Package/at91bootstrap/install/default - $(CP) -avL $(PKG_BUILD_DIR)/binaries/at91bootstrap.bin $(1)/ + $(CP) -avL $(PKG_BUILD_DIR)/binaries/at91bootstrap.bin $(1)/ endef Package/at91bootstrap/install = $(Package/at91bootstrap/install/default) @@ -34,7 +34,7 @@ define Build/AT91Bootstrap/Target $(eval $(call AT91Bootstrap/Default,$(1))) $(eval $(call AT91Bootstrap/$(1),$(1))) - define Package/at91bootstrap-$(1) + define Package/at91bootstrap-$(1) SECTION:=boot CATEGORY:=Boot Loaders TITLE:= .$(NAME) @@ -45,9 +45,9 @@ define Build/AT91Bootstrap/Target DEPENDS += @$(TARGET_DEP) ifneq ($(BUILD_DEVICES),) DEFAULT := y if ($(TARGET_DEP)_Default \ - $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ - $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \ - $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) + $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ + $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \ + $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) endif endif $(if $(DEFAULT),DEFAULT:=$(DEFAULT)) @@ -61,28 +61,28 @@ endef define Build/Configure/AT91Bootstrap +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(AT91BOOTSTRAP_CONFIG)_defconfig + $(AT91BOOTSTRAP_CONFIG)_defconfig endef define Build/Compile/AT91Bootstrap +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - $(AT91BOOTSTRAP_MAKE_FLAGS) + CROSS_COMPILE=$(TARGET_CROSS) \ + $(AT91BOOTSTRAP_MAKE_FLAGS) endef define BuildPackage/AT91Bootstrap/Defaults - Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap) - Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap) + Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap) + Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap) endef define BuildPackage/AT91Bootstrap - $(eval $(call BuildPackage/AT91Bootstrap/Defaults)) - $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ - $(eval $(call Build/AT91Bootstrap/Target,$(type))) - ) - $(eval $(call Build/DefaultTargets)) - $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ - $(call BuildPackage,at91bootstrap-$(type)) - ) + $(eval $(call BuildPackage/AT91Bootstrap/Defaults)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(eval $(call Build/AT91Bootstrap/Target,$(type))) + ) + $(eval $(call Build/DefaultTargets)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(call BuildPackage,at91bootstrap-$(type)) + ) endef diff --git a/package/boot/mt7623n-preloader/Makefile b/package/boot/mt7623n-preloader/Makefile index 801c6d19b..0faaf46d3 100644 --- a/package/boot/mt7623n-preloader/Makefile +++ b/package/boot/mt7623n-preloader/Makefile @@ -30,6 +30,14 @@ define Download/BPI-R2-preloader-2k.img.gz endef $(eval $(call Download,BPI-R2-preloader-2k.img.gz)) +define Download/BPI-R64-preloader-2k.img.gz + FILE:=$(BPI_PRELOADER_PREFIX)-BPI-R64-preloader-2k.img.gz + URL:=$(BPI_PRELOADER_URL) + URL_FILE:=BPI-R64-preloader-2k.img.gz + HASH:=1a4b55da1717190aa4e790ce93850605e9b15aae4c3248bcf8734aac020ab0e4 +endef +$(eval $(call Download,BPI-R64-preloader-2k.img.gz)) + define Package/mt7623n-preloader SECTION:=boot @@ -43,10 +51,23 @@ define Package/mt7623n-preloader/description Preloader image for mt7623n based boards like Banana Pi R2. endef +define Package/mt7622-preloader + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_mediatek_mt7622 + TITLE:=mt7622-preloader + DEFAULT:=y if TARGET_mediatek +endef + +define Package/mt7622-preloader/description + Preloader image for mt7622 based boards like Banana Pi R64. +endef + define Build/Prepare rm -rf $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR) cp $(DL_DIR)/$(BPI_PRELOADER_PREFIX)-BPI-R2-preloader-DDR1600-20191024-2k.img.gz $(PKG_BUILD_DIR)/mt7623n_bpir2-preloader.bin.gz + cp $(DL_DIR)/$(BPI_PRELOADER_PREFIX)-BPI-R64-preloader-2k.img.gz $(PKG_BUILD_DIR)/mt7622_bpir64-preloader.bin.gz endef define Build/Compile @@ -59,3 +80,4 @@ define Build/InstallDev endef $(eval $(call BuildPackage,mt7623n-preloader)) +$(eval $(call BuildPackage,mt7622-preloader)) diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index 547b72f8d..f2ad9562a 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=linux4sam_6.0 -PKG_RELEASE:=1 +PKG_VERSION:=linux4sam-2020.04 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/linux4sam/u-boot-at91.git -PKG_SOURCE_VERSION:=1e7d2e5973c1fb780e55e28a801c6c574158ac14 +PKG_SOURCE_VERSION:=0e1d1b6efb7f8e27c372279a906fcd2524df09da include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -27,89 +27,89 @@ endef define U-Boot/at91sam9m10g45ek_nandflash NAME:=AT91SAM9M10G45-EK board (NandFlash) BUILD_SUBTARGET:=sam9x - BUILD_DEVICES:=at91sam9m10g45ek + BUILD_DEVICES:=atmel_at91sam9m10g45ek endef define U-Boot/at91sam9x5ek_nandflash NAME:=AT91SAM9X5-EK board (NandFlash) BUILD_SUBTARGET:=sam9x - BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek \ - at91sam9g35ek at91sam9x25ek \ - at91sam9x35ek + BUILD_DEVICES:=atmel_at91sam9g15ek atmel_at91sam9g25ek \ + atmel_at91sam9g35ek atmel_at91sam9x25ek \ + atmel_at91sam9x35ek endef define U-Boot/at91sam9x5ek_mmc NAME:=AT91SAM9X5-EK board (SDcard) BUILD_SUBTARGET:=sam9x - BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek \ - at91sam9g35ek at91sam9x25ek \ - at91sam9x35ek + BUILD_DEVICES:=atmel_at91sam9g15ek atmel_at91sam9g25ek \ + atmel_at91sam9g35ek atmel_at91sam9x25ek \ + atmel_at91sam9x35ek endef define U-Boot/sama5d3_xplained_nandflash NAME:=SAMA5D3 Xplained board (NandFlash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained + BUILD_DEVICES:=microchip_sama5d3-xplained endef define U-Boot/sama5d3_xplained_mmc NAME:=SAMA5D3 Xplained board (SDcard) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained + BUILD_DEVICES:=microchip_sama5d3-xplained endef define U-Boot/sama5d2_xplained_spiflash NAME:=SAMA5D2 Xplained board (SPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained + BUILD_DEVICES:=microchip_sama5d2-xplained endef define U-Boot/sama5d2_xplained_mmc NAME:=SAMA5D2 Xplained board (SDcard/EMMC) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained + BUILD_DEVICES:=microchip_sama5d2-xplained endef define U-Boot/sama5d4_xplained_spiflash NAME:=SAMA5D4 Xplained board (SPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained + BUILD_DEVICES:=microchip_sama5d4-xplained endef define U-Boot/sama5d4_xplained_mmc NAME:=SAMA5D4 Xplained board (SDcard) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained + BUILD_DEVICES:=microchip_sama5d4-xplained endef define U-Boot/sama5d4_xplained_nandflash NAME:=SAMA5D4 Xplained board (NandFlash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained + BUILD_DEVICES:=microchip_sama5d3-xplained endef define U-Boot/sama5d27_som1_ek_mmc1 NAME:=SAMA5D27 SOM1 Ek (SDCard1) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d27_som1_ek + BUILD_DEVICES:=microchip_sama5d27-som1-ek endef define U-Boot/sama5d27_som1_ek_qspiflash NAME:=SAMA5D27 SOM1 Ek (QSPI Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d27_som1_ek + BUILD_DEVICES:=microchip_sama5d27-som1-ek endef define U-Boot/sama5d2_ptc_ek_nandflash NAME:=SAMA5D2 PTC Ek (Nand Flash) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_ptc_ek + BUILD_DEVICES:=microchip_sama5d2-ptc-ek endef define U-Boot/sama5d2_ptc_ek_mmc NAME:=SAMA5D2 PTC Ek (SDCard) BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_ptc_ek + BUILD_DEVICES:=microchip_sama5d2-ptc-ek endef UBOOT_TARGETS := \ @@ -129,11 +129,11 @@ UBOOT_TARGETS := \ sama5d2_ptc_ek_mmc define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - DTC=$(PKG_BUILD_DIR)/scripts/dtc/dtc \ - KCFLAGS="$(filter-out -fstack-protector \ - -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + DTC=$(PKG_BUILD_DIR)/scripts/dtc/dtc \ + KCFLAGS="$(filter-out -fstack-protector \ + -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" endef $(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch b/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch index 18f9af742..23cb5828b 100644 --- a/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch +++ b/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch @@ -1,13 +1,39 @@ diff --git a/cmd/version.c b/cmd/version.c -index b2fffe9..bcbbeb1 100644 +index b2fffe99..bcbbeb18 100644 --- a/cmd/version.c +++ b/cmd/version.c @@ -18,7 +18,7 @@ static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; - + char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; + - printf(display_options_get_banner(false, buf, sizeof(buf))); + printf("%s",display_options_get_banner(false, buf, sizeof(buf))); #ifdef CC_VERSION_STRING - puts(CC_VERSION_STRING "\n"); + puts(CC_VERSION_STRING "\n"); #endif +diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c +index 3425ed11..8c2e1d5c 100644 +--- a/drivers/pinctrl/pinctrl-uclass.c ++++ b/drivers/pinctrl/pinctrl-uclass.c +@@ -368,7 +368,7 @@ int pinctrl_get_pin_name(struct udevice *dev, int selector, char *buf, + if (!ops->get_pin_name) + return -ENOSYS; + +- snprintf(buf, size, ops->get_pin_name(dev, selector)); ++ snprintf(buf, size, "%s", ops->get_pin_name(dev, selector)); + + return 0; + } +diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c +index c316bdfe..5fe8129c 100644 +--- a/lib/efi_loader/efi_variable.c ++++ b/lib/efi_loader/efi_variable.c +@@ -522,7 +522,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, + + if (old_size) + /* APPEND_WRITE */ +- s += sprintf(s, old_val); ++ s += sprintf(s, "%s", old_val); + else + s += sprintf(s, "(blob)"); + diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index b032e07c3..473704053 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=1 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index c0873c6e0..d12771442 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -19,6 +19,8 @@ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,ecb1750|\ +engenius,enh202-v1|\ +engenius,ens202ext-v1|\ etactica,eg200|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq index f4541a559..87dfac8b3 100644 --- a/package/boot/uboot-envtools/files/lantiq +++ b/package/boot/uboot-envtools/files/lantiq @@ -26,7 +26,7 @@ zyxel,p-2812hnu-f1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1" ;; buffalo,wbmr-300hpd) - idx="$(find_mtd_index ubootconfig)" + idx="$(find_mtd_index u-boot-env)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2" ;; diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 8ed1f87ea..1d3b79b96 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -15,7 +15,11 @@ board=$(board_name) case "$board" in cznic,turris-omnia) - ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000" + if grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then + ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000" + else + ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000" + fi ;; glinet,gl-mv1000) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1" diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index ca0a4d544..bfb8b4023 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -33,7 +33,14 @@ xiaomi,miwifi-nano|\ zbtlink,zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +hootoo,ht-tm05|\ +ravpower,rp-wd03) + idx="$(find_mtd_index u-boot-env)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000" + ;; linksys,ea7300-v1|\ +linksys,ea7300-v2|\ linksys,ea7500-v2|\ xiaomi,mir3p|\ xiaomi,mir3g|\ diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index 8cb20075a..bdb2c450a 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -1,9 +1,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2020.04 -PKG_RELEASE:=2 -PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 +PKG_VERSION:=2020.07 +PKG_HASH:=c1f5bf9ee6bb6e648edbf19ce2ca9452f614b08a9f886f1a566aa42e8cf05f6a include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-mediatek/patches/001-eth-mtk-add-mt7531-switch.patch b/package/boot/uboot-mediatek/patches/001-eth-mtk-add-mt7531-switch.patch deleted file mode 100644 index ced1ca9a1..000000000 --- a/package/boot/uboot-mediatek/patches/001-eth-mtk-add-mt7531-switch.patch +++ /dev/null @@ -1,1074 +0,0 @@ -From patchwork Tue Feb 18 08:49:37 2020 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Landen Chao -X-Patchwork-Id: 1239956 -X-Patchwork-Delegate: trini@ti.com -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@bilbo.ozlabs.org -Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) - smtp.mailfrom=lists.denx.de - (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; - helo=phobos.denx.de; - envelope-from=u-boot-bounces@lists.denx.de; - receiver=) -Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.a=rsa-sha256 header.s=dk header.b=NQKfnebM; - dkim-atps=neutral -Received: from phobos.denx.de (phobos.denx.de - [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) - (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) - key-exchange X25519 server-signature RSA-PSS (4096 bits)) - (No client certificate requested) - by ozlabs.org (Postfix) with ESMTPS id 48MJX54ymTz9sRf - for ; - Tue, 18 Feb 2020 22:28:53 +1100 (AEDT) -Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) - by phobos.denx.de (Postfix) with ESMTP id A68D8810D8; - Tue, 18 Feb 2020 12:28:47 +0100 (CET) -Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de -Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.b="NQKfnebM"; dkim-atps=neutral -Received: by phobos.denx.de (Postfix, from userid 109) - id 767F881217; Tue, 18 Feb 2020 09:50:00 +0100 (CET) -X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de -X-Spam-Level: -X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, - DKIM_VALID,DKIM_VALID_AU,MIME_BASE64_TEXT,RDNS_NONE,SPF_HELO_NONE, - UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no - version=3.4.2 -Received: from mailgw01.mediatek.com (unknown [210.61.82.183]) - by phobos.denx.de (Postfix) with ESMTP id 40ADE811FB - for ; Tue, 18 Feb 2020 09:49:46 +0100 (CET) -Authentication-Results: phobos.denx.de; - dmarc=pass (p=none dis=none) header.from=mediatek.com -Authentication-Results: phobos.denx.de; - spf=pass smtp.mailfrom=landen.chao@mediatek.com -X-UUID: ddaa8deb3c7d4a24ba5cbcb30775fbfd-20200218 -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=mediatek.com; s=dk; - h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; - bh=qvWp4DdC1p5SZD1XJPV3kwdXTU9lBi4hbWNZQoO2oLI=; - b=NQKfnebM0mIfPJuncOxa6aNY+g5wFOnlozbm/o8ViKaVNbkd8YSB0ISWOerj8lALM7E7sSP797r514G3R4EAQPPvuAm5B2wi2VuYKssTxHkvYJvCrALXp4wmQtGF+gJytfdWuHx6Np0wfbjTsLqw+JUtcDi/0jAa8TQ5y9UHr9Q=; -X-UUID: ddaa8deb3c7d4a24ba5cbcb30775fbfd-20200218 -Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by - mailgw01.mediatek.com (envelope-from ) - (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) - with ESMTP id 827129897; Tue, 18 Feb 2020 16:49:43 +0800 -Received: from MTKCAS06.mediatek.inc (172.21.101.30) by - mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server - (TLS) id 15.0.1395.4; Tue, 18 Feb 2020 16:48:45 +0800 -Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc - (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via - Frontend Transport; Tue, 18 Feb 2020 16:47:41 +0800 -From: Landen Chao -To: Ryder Lee , Weijie Gao , - GSS_MTK_Uboot_upstream , - Joe Hershberger , -CC: , , - , -Subject: [U-Boot 1/1] eth: mtk-eth: add mt7531 switch support in mediatek eth - driver -Date: Tue, 18 Feb 2020 16:49:37 +0800 -Message-ID: -X-Mailer: git-send-email 2.18.0 -In-Reply-To: -References: -MIME-Version: 1.0 -X-MTK: N -X-Mailman-Approved-At: Tue, 18 Feb 2020 12:28:45 +0100 -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.30rc1 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" -X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de -X-Virus-Status: Clean - -mt7531 is a 7-ports switch with 5 embedded giga phys, and uses the same -MAC design of mt7530. The cpu port6 supports SGMII only. The cpu port5 -supports RGMII or SGMII in different model. - -mt7531 is connected to mt7622 via both RGMII and SGMII interfaces. -In this patch, mt7531 cpu port5 or port6 is configured to maximum -capability to align CPU MAC setting. - -The dts has been committed in the commit 6efa450565cdc ("arm: dts: -mediatek: add ethernet and sgmii dts node for mt7622") - -Signed-off-by: Landen Chao -Tested-by: Frank Wunderlich ---- - drivers/net/mtk_eth.c | 580 +++++++++++++++++++++++++++++++++--------- - drivers/net/mtk_eth.h | 124 ++++++++- - 2 files changed, 577 insertions(+), 127 deletions(-) - -diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c -index edfa5d1ce8..f7d34a2e6b 100644 ---- a/drivers/net/mtk_eth.c -+++ b/drivers/net/mtk_eth.c -@@ -30,10 +30,12 @@ - #define RX_TOTAL_BUF_SIZE (NUM_RX_DESC * PKTSIZE_ALIGN) - #define TOTAL_PKT_BUF_SIZE (TX_TOTAL_BUF_SIZE + RX_TOTAL_BUF_SIZE) - --#define MT7530_NUM_PHYS 5 --#define MT7530_DFL_SMI_ADDR 31 -+#define MT753X_NUM_PHYS 5 -+#define MT753X_NUM_PORTS 7 -+#define MT753X_DFL_SMI_ADDR 31 -+#define MT753X_SMI_ADDR_MASK 0x1f - --#define MT7530_PHY_ADDR(base, addr) \ -+#define MT753X_PHY_ADDR(base, addr) \ - (((base) + (addr)) & 0x1f) - - #define GDMA_FWD_TO_CPU \ -@@ -131,7 +133,8 @@ struct pdma_txdesc { - - enum mtk_switch { - SW_NONE, -- SW_MT7530 -+ SW_MT7530, -+ SW_MT7531 - }; - - enum mtk_soc { -@@ -173,8 +176,8 @@ struct mtk_eth_priv { - - enum mtk_switch sw; - int (*switch_init)(struct mtk_eth_priv *priv); -- u32 mt7530_smi_addr; -- u32 mt7530_phy_base; -+ u32 mt753x_smi_addr; -+ u32 mt753x_phy_base; - - struct gpio_desc rst_gpio; - int mcm; -@@ -349,6 +352,174 @@ static int mtk_mmd_ind_write(struct mtk_eth_priv *priv, u8 addr, u8 devad, - return priv->mii_write(priv, addr, MII_MMD_ADDR_DATA_REG, val); - } - -+/* -+ * MT7530 Internal Register Address Bits -+ * ------------------------------------------------------------------- -+ * | 15 14 13 12 11 10 9 8 7 6 | 5 4 3 2 | 1 0 | -+ * |----------------------------------------|---------------|--------| -+ * | Page Address | Reg Address | Unused | -+ * ------------------------------------------------------------------- -+ */ -+ -+static int mt753x_reg_read(struct mtk_eth_priv *priv, u32 reg, u32 *data) -+{ -+ int ret, low_word, high_word; -+ -+ /* Write page address */ -+ ret = mtk_mii_write(priv, priv->mt753x_smi_addr, 0x1f, reg >> 6); -+ if (ret) -+ return ret; -+ -+ /* Read low word */ -+ low_word = mtk_mii_read(priv, priv->mt753x_smi_addr, (reg >> 2) & 0xf); -+ if (low_word < 0) -+ return low_word; -+ -+ /* Read high word */ -+ high_word = mtk_mii_read(priv, priv->mt753x_smi_addr, 0x10); -+ if (high_word < 0) -+ return high_word; -+ -+ if (data) -+ *data = ((u32)high_word << 16) | (low_word & 0xffff); -+ -+ return 0; -+} -+ -+static int mt753x_reg_write(struct mtk_eth_priv *priv, u32 reg, u32 data) -+{ -+ int ret; -+ -+ /* Write page address */ -+ ret = mtk_mii_write(priv, priv->mt753x_smi_addr, 0x1f, reg >> 6); -+ if (ret) -+ return ret; -+ -+ /* Write low word */ -+ ret = mtk_mii_write(priv, priv->mt753x_smi_addr, (reg >> 2) & 0xf, -+ data & 0xffff); -+ if (ret) -+ return ret; -+ -+ /* Write high word */ -+ return mtk_mii_write(priv, priv->mt753x_smi_addr, 0x10, data >> 16); -+} -+ -+static void mt753x_reg_rmw(struct mtk_eth_priv *priv, u32 reg, u32 clr, -+ u32 set) -+{ -+ u32 val; -+ -+ mt753x_reg_read(priv, reg, &val); -+ val &= ~clr; -+ val |= set; -+ mt753x_reg_write(priv, reg, val); -+} -+ -+/* Indirect MDIO clause 22/45 access */ -+static int mt7531_mii_rw(struct mtk_eth_priv *priv, int phy, int reg, u16 data, -+ u32 cmd, u32 st) -+{ -+ ulong timeout; -+ u32 val, timeout_ms; -+ int ret = 0; -+ -+ val = (st << MDIO_ST_S) | -+ ((cmd << MDIO_CMD_S) & MDIO_CMD_M) | -+ ((phy << MDIO_PHY_ADDR_S) & MDIO_PHY_ADDR_M) | -+ ((reg << MDIO_REG_ADDR_S) & MDIO_REG_ADDR_M); -+ -+ if (cmd == MDIO_CMD_WRITE || cmd == MDIO_CMD_ADDR) -+ val |= data & MDIO_RW_DATA_M; -+ -+ mt753x_reg_write(priv, MT7531_PHY_IAC, val | PHY_ACS_ST); -+ -+ timeout_ms = 100; -+ timeout = get_timer(0); -+ while (1) { -+ mt753x_reg_read(priv, MT7531_PHY_IAC, &val); -+ -+ if ((val & PHY_ACS_ST) == 0) -+ break; -+ -+ if (get_timer(timeout) > timeout_ms) -+ return -ETIMEDOUT; -+ } -+ -+ if (cmd == MDIO_CMD_READ || cmd == MDIO_CMD_READ_C45) { -+ mt753x_reg_read(priv, MT7531_PHY_IAC, &val); -+ ret = val & MDIO_RW_DATA_M; -+ } -+ -+ return ret; -+} -+ -+static int mt7531_mii_ind_read(struct mtk_eth_priv *priv, u8 phy, u8 reg) -+{ -+ u8 phy_addr; -+ -+ if (phy >= MT753X_NUM_PHYS) -+ return -EINVAL; -+ -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, phy); -+ -+ return mt7531_mii_rw(priv, phy_addr, reg, 0, MDIO_CMD_READ, -+ MDIO_ST_C22); -+} -+ -+static int mt7531_mii_ind_write(struct mtk_eth_priv *priv, u8 phy, u8 reg, -+ u16 val) -+{ -+ u8 phy_addr; -+ -+ if (phy >= MT753X_NUM_PHYS) -+ return -EINVAL; -+ -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, phy); -+ -+ return mt7531_mii_rw(priv, phy_addr, reg, val, MDIO_CMD_WRITE, -+ MDIO_ST_C22); -+} -+ -+int mt7531_mmd_ind_read(struct mtk_eth_priv *priv, u8 addr, u8 devad, u16 reg) -+{ -+ u8 phy_addr; -+ int ret; -+ -+ if (addr >= MT753X_NUM_PHYS) -+ return -EINVAL; -+ -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, addr); -+ -+ ret = mt7531_mii_rw(priv, phy_addr, devad, reg, MDIO_CMD_ADDR, -+ MDIO_ST_C45); -+ if (ret) -+ return ret; -+ -+ return mt7531_mii_rw(priv, phy_addr, devad, 0, MDIO_CMD_READ_C45, -+ MDIO_ST_C45); -+} -+ -+static int mt7531_mmd_ind_write(struct mtk_eth_priv *priv, u8 addr, u8 devad, -+ u16 reg, u16 val) -+{ -+ u8 phy_addr; -+ int ret; -+ -+ if (addr >= MT753X_NUM_PHYS) -+ return 0; -+ -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, addr); -+ -+ ret = mt7531_mii_rw(priv, phy_addr, devad, reg, MDIO_CMD_ADDR, -+ MDIO_ST_C45); -+ if (ret) -+ return ret; -+ -+ return mt7531_mii_rw(priv, phy_addr, devad, val, MDIO_CMD_WRITE, -+ MDIO_ST_C45); -+} -+ - static int mtk_mdio_read(struct mii_dev *bus, int addr, int devad, int reg) - { - struct mtk_eth_priv *priv = bus->priv; -@@ -387,6 +558,12 @@ static int mtk_mdio_register(struct udevice *dev) - priv->mmd_read = mtk_mmd_ind_read; - priv->mmd_write = mtk_mmd_ind_write; - break; -+ case SW_MT7531: -+ priv->mii_read = mt7531_mii_ind_read; -+ priv->mii_write = mt7531_mii_ind_write; -+ priv->mmd_read = mt7531_mmd_ind_read; -+ priv->mmd_write = mt7531_mmd_ind_write; -+ break; - default: - priv->mii_read = mtk_mii_read; - priv->mii_write = mtk_mii_write; -@@ -410,75 +587,18 @@ static int mtk_mdio_register(struct udevice *dev) - return 0; - } - --/* -- * MT7530 Internal Register Address Bits -- * ------------------------------------------------------------------- -- * | 15 14 13 12 11 10 9 8 7 6 | 5 4 3 2 | 1 0 | -- * |----------------------------------------|---------------|--------| -- * | Page Address | Reg Address | Unused | -- * ------------------------------------------------------------------- -- */ -- --static int mt7530_reg_read(struct mtk_eth_priv *priv, u32 reg, u32 *data) -+static int mt753x_core_reg_read(struct mtk_eth_priv *priv, u32 reg) - { -- int ret, low_word, high_word; -+ u8 phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, 0); - -- /* Write page address */ -- ret = mtk_mii_write(priv, priv->mt7530_smi_addr, 0x1f, reg >> 6); -- if (ret) -- return ret; -- -- /* Read low word */ -- low_word = mtk_mii_read(priv, priv->mt7530_smi_addr, (reg >> 2) & 0xf); -- if (low_word < 0) -- return low_word; -- -- /* Read high word */ -- high_word = mtk_mii_read(priv, priv->mt7530_smi_addr, 0x10); -- if (high_word < 0) -- return high_word; -- -- if (data) -- *data = ((u32)high_word << 16) | (low_word & 0xffff); -- -- return 0; -+ return priv->mmd_read(priv, phy_addr, 0x1f, reg); - } - --static int mt7530_reg_write(struct mtk_eth_priv *priv, u32 reg, u32 data) -+static void mt753x_core_reg_write(struct mtk_eth_priv *priv, u32 reg, u32 val) - { -- int ret; -- -- /* Write page address */ -- ret = mtk_mii_write(priv, priv->mt7530_smi_addr, 0x1f, reg >> 6); -- if (ret) -- return ret; -+ u8 phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, 0); - -- /* Write low word */ -- ret = mtk_mii_write(priv, priv->mt7530_smi_addr, (reg >> 2) & 0xf, -- data & 0xffff); -- if (ret) -- return ret; -- -- /* Write high word */ -- return mtk_mii_write(priv, priv->mt7530_smi_addr, 0x10, data >> 16); --} -- --static void mt7530_reg_rmw(struct mtk_eth_priv *priv, u32 reg, u32 clr, -- u32 set) --{ -- u32 val; -- -- mt7530_reg_read(priv, reg, &val); -- val &= ~clr; -- val |= set; -- mt7530_reg_write(priv, reg, val); --} -- --static void mt7530_core_reg_write(struct mtk_eth_priv *priv, u32 reg, u32 val) --{ -- u8 phy_addr = MT7530_PHY_ADDR(priv->mt7530_phy_base, 0); -- -- mtk_mmd_ind_write(priv, phy_addr, 0x1f, reg, val); -+ priv->mmd_write(priv, phy_addr, 0x1f, reg, val); - } - - static int mt7530_pad_clk_setup(struct mtk_eth_priv *priv, int mode) -@@ -496,46 +616,46 @@ static int mt7530_pad_clk_setup(struct mtk_eth_priv *priv, int mode) - } - - /* Disable MT7530 core clock */ -- mt7530_core_reg_write(priv, CORE_TRGMII_GSW_CLK_CG, 0); -+ mt753x_core_reg_write(priv, CORE_TRGMII_GSW_CLK_CG, 0); - - /* Disable MT7530 PLL */ -- mt7530_core_reg_write(priv, CORE_GSWPLL_GRP1, -+ mt753x_core_reg_write(priv, CORE_GSWPLL_GRP1, - (2 << RG_GSWPLL_POSDIV_200M_S) | - (32 << RG_GSWPLL_FBKDIV_200M_S)); - - /* For MT7530 core clock = 500Mhz */ -- mt7530_core_reg_write(priv, CORE_GSWPLL_GRP2, -+ mt753x_core_reg_write(priv, CORE_GSWPLL_GRP2, - (1 << RG_GSWPLL_POSDIV_500M_S) | - (25 << RG_GSWPLL_FBKDIV_500M_S)); - - /* Enable MT7530 PLL */ -- mt7530_core_reg_write(priv, CORE_GSWPLL_GRP1, -+ mt753x_core_reg_write(priv, CORE_GSWPLL_GRP1, - (2 << RG_GSWPLL_POSDIV_200M_S) | - (32 << RG_GSWPLL_FBKDIV_200M_S) | - RG_GSWPLL_EN_PRE); - - udelay(20); - -- mt7530_core_reg_write(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); -+ mt753x_core_reg_write(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); - - /* Setup the MT7530 TRGMII Tx Clock */ -- mt7530_core_reg_write(priv, CORE_PLL_GROUP5, ncpo1); -- mt7530_core_reg_write(priv, CORE_PLL_GROUP6, 0); -- mt7530_core_reg_write(priv, CORE_PLL_GROUP10, ssc_delta); -- mt7530_core_reg_write(priv, CORE_PLL_GROUP11, ssc_delta); -- mt7530_core_reg_write(priv, CORE_PLL_GROUP4, RG_SYSPLL_DDSFBK_EN | -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP5, ncpo1); -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP6, 0); -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP10, ssc_delta); -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP11, ssc_delta); -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP4, RG_SYSPLL_DDSFBK_EN | - RG_SYSPLL_BIAS_EN | RG_SYSPLL_BIAS_LPF_EN); - -- mt7530_core_reg_write(priv, CORE_PLL_GROUP2, -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP2, - RG_SYSPLL_EN_NORMAL | RG_SYSPLL_VODEN | - (1 << RG_SYSPLL_POSDIV_S)); - -- mt7530_core_reg_write(priv, CORE_PLL_GROUP7, -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP7, - RG_LCDDS_PCW_NCPO_CHG | (3 << RG_LCCDS_C_S) | - RG_LCDDS_PWDB | RG_LCDDS_ISO_EN); - - /* Enable MT7530 core clock */ -- mt7530_core_reg_write(priv, CORE_TRGMII_GSW_CLK_CG, -+ mt753x_core_reg_write(priv, CORE_TRGMII_GSW_CLK_CG, - REG_GSWCK_EN | REG_TRGMIICK_EN); - - return 0; -@@ -551,46 +671,33 @@ static int mt7530_setup(struct mtk_eth_priv *priv) - mtk_ethsys_rmw(priv, ETHSYS_CLKCFG0_REG, - ETHSYS_TRGMII_CLK_SEL362_5, 0); - -- /* Global reset switch */ -- if (priv->mcm) { -- reset_assert(&priv->rst_mcm); -- udelay(1000); -- reset_deassert(&priv->rst_mcm); -- mdelay(1000); -- } else if (dm_gpio_is_valid(&priv->rst_gpio)) { -- dm_gpio_set_value(&priv->rst_gpio, 0); -- udelay(1000); -- dm_gpio_set_value(&priv->rst_gpio, 1); -- mdelay(1000); -- } -- - /* Modify HWTRAP first to allow direct access to internal PHYs */ -- mt7530_reg_read(priv, HWTRAP_REG, &val); -+ mt753x_reg_read(priv, HWTRAP_REG, &val); - val |= CHG_TRAP; - val &= ~C_MDIO_BPS; -- mt7530_reg_write(priv, MHWTRAP_REG, val); -+ mt753x_reg_write(priv, MHWTRAP_REG, val); - - /* Calculate the phy base address */ - val = ((val & SMI_ADDR_M) >> SMI_ADDR_S) << 3; -- priv->mt7530_phy_base = (val | 0x7) + 1; -+ priv->mt753x_phy_base = (val | 0x7) + 1; - - /* Turn off PHYs */ -- for (i = 0; i < MT7530_NUM_PHYS; i++) { -- phy_addr = MT7530_PHY_ADDR(priv->mt7530_phy_base, i); -+ for (i = 0; i < MT753X_NUM_PHYS; i++) { -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, i); - phy_val = priv->mii_read(priv, phy_addr, MII_BMCR); - phy_val |= BMCR_PDOWN; - priv->mii_write(priv, phy_addr, MII_BMCR, phy_val); - } - - /* Force MAC link down before reset */ -- mt7530_reg_write(priv, PCMR_REG(5), FORCE_MODE); -- mt7530_reg_write(priv, PCMR_REG(6), FORCE_MODE); -+ mt753x_reg_write(priv, PMCR_REG(5), FORCE_MODE); -+ mt753x_reg_write(priv, PMCR_REG(6), FORCE_MODE); - - /* MT7530 reset */ -- mt7530_reg_write(priv, SYS_CTRL_REG, SW_SYS_RST | SW_REG_RST); -+ mt753x_reg_write(priv, SYS_CTRL_REG, SW_SYS_RST | SW_REG_RST); - udelay(100); - -- val = (1 << IPG_CFG_S) | -+ val = (IPG_96BIT_WITH_SHORT_IPG << IPG_CFG_S) | - MAC_MODE | FORCE_MODE | - MAC_TX_EN | MAC_RX_EN | - BKOFF_EN | BACKPR_EN | -@@ -598,53 +705,280 @@ static int mt7530_setup(struct mtk_eth_priv *priv) - FORCE_DPX | FORCE_LINK; - - /* MT7530 Port6: Forced 1000M/FD, FC disabled */ -- mt7530_reg_write(priv, PCMR_REG(6), val); -+ mt753x_reg_write(priv, PMCR_REG(6), val); - - /* MT7530 Port5: Forced link down */ -- mt7530_reg_write(priv, PCMR_REG(5), FORCE_MODE); -+ mt753x_reg_write(priv, PMCR_REG(5), FORCE_MODE); - - /* MT7530 Port6: Set to RGMII */ -- mt7530_reg_rmw(priv, MT7530_P6ECR, P6_INTF_MODE_M, P6_INTF_MODE_RGMII); -+ mt753x_reg_rmw(priv, MT7530_P6ECR, P6_INTF_MODE_M, P6_INTF_MODE_RGMII); - - /* Hardware Trap: Enable Port6, Disable Port5 */ -- mt7530_reg_read(priv, HWTRAP_REG, &val); -+ mt753x_reg_read(priv, HWTRAP_REG, &val); - val |= CHG_TRAP | LOOPDET_DIS | P5_INTF_DIS | - (P5_INTF_SEL_GMAC5 << P5_INTF_SEL_S) | - (P5_INTF_MODE_RGMII << P5_INTF_MODE_S); - val &= ~(C_MDIO_BPS | P6_INTF_DIS); -- mt7530_reg_write(priv, MHWTRAP_REG, val); -+ mt753x_reg_write(priv, MHWTRAP_REG, val); - - /* Setup switch core pll */ - mt7530_pad_clk_setup(priv, priv->phy_interface); - - /* Lower Tx Driving for TRGMII path */ - for (i = 0 ; i < NUM_TRGMII_CTRL ; i++) -- mt7530_reg_write(priv, MT7530_TRGMII_TD_ODT(i), -+ mt753x_reg_write(priv, MT7530_TRGMII_TD_ODT(i), - (8 << TD_DM_DRVP_S) | (8 << TD_DM_DRVN_S)); - - for (i = 0 ; i < NUM_TRGMII_CTRL; i++) -- mt7530_reg_rmw(priv, MT7530_TRGMII_RD(i), RD_TAP_M, 16); -+ mt753x_reg_rmw(priv, MT7530_TRGMII_RD(i), RD_TAP_M, 16); -+ -+ /* Turn on PHYs */ -+ for (i = 0; i < MT753X_NUM_PHYS; i++) { -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, i); -+ phy_val = priv->mii_read(priv, phy_addr, MII_BMCR); -+ phy_val &= ~BMCR_PDOWN; -+ priv->mii_write(priv, phy_addr, MII_BMCR, phy_val); -+ } -+ -+ return 0; -+} -+ -+static void mt7531_core_pll_setup(struct mtk_eth_priv *priv, int mcm) -+{ -+ /* Step 1 : Disable MT7531 COREPLL */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_EN, EN_COREPLL, 0); -+ -+ /* Step 2: switch to XTAL output */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_EN, SW_CLKSW, SW_CLKSW); -+ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_CR0, RG_COREPLL_EN, 0); -+ -+ /* Step 3: disable PLLGP and enable program PLLGP */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_EN, SW_PLLGP, SW_PLLGP); -+ -+ /* Step 4: program COREPLL output frequency to 500MHz */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_CR0, RG_COREPLL_POSDIV_M, -+ 2 << RG_COREPLL_POSDIV_S); -+ udelay(25); -+ -+ /* Currently, support XTAL 25Mhz only */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_CR0, RG_COREPLL_SDM_PCW_M, -+ 0x140000 << RG_COREPLL_SDM_PCW_S); -+ -+ /* Set feedback divide ratio update signal to high */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_CR0, RG_COREPLL_SDM_PCW_CHG, -+ RG_COREPLL_SDM_PCW_CHG); -+ -+ /* Wait for at least 16 XTAL clocks */ -+ udelay(10); -+ -+ /* Step 5: set feedback divide ratio update signal to low */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_CR0, RG_COREPLL_SDM_PCW_CHG, 0); -+ -+ /* add enable 325M clock for SGMII */ -+ mt753x_reg_write(priv, MT7531_ANA_PLLGP_CR5, 0xad0000); -+ -+ /* add enable 250SSC clock for RGMII */ -+ mt753x_reg_write(priv, MT7531_ANA_PLLGP_CR2, 0x4f40000); -+ -+ /*Step 6: Enable MT7531 PLL */ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_CR0, RG_COREPLL_EN, RG_COREPLL_EN); -+ -+ mt753x_reg_rmw(priv, MT7531_PLLGP_EN, EN_COREPLL, EN_COREPLL); -+ -+ udelay(25); -+} -+ -+static int mt7531_port_sgmii_init(struct mtk_eth_priv *priv, -+ u32 port) -+{ -+ if (port != 5 && port != 6) { -+ printf("mt7531: port %d is not a SGMII port\n", port); -+ return -EINVAL; -+ } -+ -+ /* Set SGMII GEN2 speed(2.5G) */ -+ mt753x_reg_rmw(priv, MT7531_PHYA_CTRL_SIGNAL3(port), -+ SGMSYS_SPEED_2500, SGMSYS_SPEED_2500); -+ -+ /* Disable SGMII AN */ -+ mt753x_reg_rmw(priv, MT7531_PCS_CONTROL_1(port), -+ SGMII_AN_ENABLE, 0); -+ -+ /* SGMII force mode setting */ -+ mt753x_reg_write(priv, MT7531_SGMII_MODE(port), SGMII_FORCE_MODE); -+ -+ /* Release PHYA power down state */ -+ mt753x_reg_rmw(priv, MT7531_QPHY_PWR_STATE_CTRL(port), -+ SGMII_PHYA_PWD, 0); -+ -+ return 0; -+} -+ -+static int mt7531_port_rgmii_init(struct mtk_eth_priv *priv, u32 port) -+{ -+ u32 val; -+ -+ if (port != 5) { -+ printf("error: RGMII mode is not available for port %d\n", -+ port); -+ return -EINVAL; -+ } -+ -+ mt753x_reg_read(priv, MT7531_CLKGEN_CTRL, &val); -+ val |= GP_CLK_EN; -+ val &= ~GP_MODE_M; -+ val |= GP_MODE_RGMII << GP_MODE_S; -+ val |= TXCLK_NO_REVERSE; -+ val |= RXCLK_NO_DELAY; -+ val &= ~CLK_SKEW_IN_M; -+ val |= CLK_SKEW_IN_NO_CHANGE << CLK_SKEW_IN_S; -+ val &= ~CLK_SKEW_OUT_M; -+ val |= CLK_SKEW_OUT_NO_CHANGE << CLK_SKEW_OUT_S; -+ mt753x_reg_write(priv, MT7531_CLKGEN_CTRL, val); -+ -+ return 0; -+} -+ -+static void mt7531_phy_setting(struct mtk_eth_priv *priv) -+{ -+ int i; -+ u32 val; -+ -+ for (i = 0; i < MT753X_NUM_PHYS; i++) { -+ /* Enable HW auto downshift */ -+ priv->mii_write(priv, i, 0x1f, 0x1); -+ val = priv->mii_read(priv, i, PHY_EXT_REG_14); -+ val |= PHY_EN_DOWN_SHFIT; -+ priv->mii_write(priv, i, PHY_EXT_REG_14, val); -+ -+ /* PHY link down power saving enable */ -+ val = priv->mii_read(priv, i, PHY_EXT_REG_17); -+ val |= PHY_LINKDOWN_POWER_SAVING_EN; -+ priv->mii_write(priv, i, PHY_EXT_REG_17, val); -+ -+ val = priv->mmd_read(priv, i, 0x1e, PHY_DEV1E_REG_0C6); -+ val &= ~PHY_POWER_SAVING_M; -+ val |= PHY_POWER_SAVING_TX << PHY_POWER_SAVING_S; -+ priv->mmd_write(priv, i, 0x1e, PHY_DEV1E_REG_0C6, val); -+ } -+} -+ -+static int mt7531_setup(struct mtk_eth_priv *priv) -+{ -+ u16 phy_addr, phy_val; -+ u32 val; -+ u32 pmcr; -+ u32 port5_sgmii; -+ int i; -+ -+ priv->mt753x_phy_base = (priv->mt753x_smi_addr + 1) & -+ MT753X_SMI_ADDR_MASK; -+ -+ /* Turn off PHYs */ -+ for (i = 0; i < MT753X_NUM_PHYS; i++) { -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, i); -+ phy_val = priv->mii_read(priv, phy_addr, MII_BMCR); -+ phy_val |= BMCR_PDOWN; -+ priv->mii_write(priv, phy_addr, MII_BMCR, phy_val); -+ } -+ -+ /* Force MAC link down before reset */ -+ mt753x_reg_write(priv, PMCR_REG(5), FORCE_MODE_LNK); -+ mt753x_reg_write(priv, PMCR_REG(6), FORCE_MODE_LNK); -+ -+ /* Switch soft reset */ -+ mt753x_reg_write(priv, SYS_CTRL_REG, SW_SYS_RST | SW_REG_RST); -+ udelay(100); -+ -+ /* Enable MDC input Schmitt Trigger */ -+ mt753x_reg_rmw(priv, MT7531_SMT0_IOLB, SMT_IOLB_5_SMI_MDC_EN, -+ SMT_IOLB_5_SMI_MDC_EN); -+ -+ mt7531_core_pll_setup(priv, priv->mcm); -+ -+ mt753x_reg_read(priv, MT7531_TOP_SIG_SR, &val); -+ port5_sgmii = !!(val & PAD_DUAL_SGMII_EN); -+ -+ /* port5 support either RGMII or SGMII, port6 only support SGMII. */ -+ switch (priv->phy_interface) { -+ case PHY_INTERFACE_MODE_RGMII: -+ if (!port5_sgmii) -+ mt7531_port_rgmii_init(priv, 5); -+ break; -+ case PHY_INTERFACE_MODE_SGMII: -+ mt7531_port_sgmii_init(priv, 6); -+ if (port5_sgmii) -+ mt7531_port_sgmii_init(priv, 5); -+ break; -+ default: -+ break; -+ } -+ -+ pmcr = MT7531_FORCE_MODE | -+ (IPG_96BIT_WITH_SHORT_IPG << IPG_CFG_S) | -+ MAC_MODE | MAC_TX_EN | MAC_RX_EN | -+ BKOFF_EN | BACKPR_EN | -+ FORCE_RX_FC | FORCE_TX_FC | -+ (SPEED_1000M << FORCE_SPD_S) | FORCE_DPX | -+ FORCE_LINK; -+ -+ mt753x_reg_write(priv, PMCR_REG(5), pmcr); -+ mt753x_reg_write(priv, PMCR_REG(6), pmcr); - - /* Turn on PHYs */ -- for (i = 0; i < MT7530_NUM_PHYS; i++) { -- phy_addr = MT7530_PHY_ADDR(priv->mt7530_phy_base, i); -+ for (i = 0; i < MT753X_NUM_PHYS; i++) { -+ phy_addr = MT753X_PHY_ADDR(priv->mt753x_phy_base, i); - phy_val = priv->mii_read(priv, phy_addr, MII_BMCR); - phy_val &= ~BMCR_PDOWN; - priv->mii_write(priv, phy_addr, MII_BMCR, phy_val); - } - -+ mt7531_phy_setting(priv); -+ -+ /* Enable Internal PHYs */ -+ val = mt753x_core_reg_read(priv, CORE_PLL_GROUP4); -+ val |= MT7531_BYPASS_MODE; -+ val &= ~MT7531_POWER_ON_OFF; -+ mt753x_core_reg_write(priv, CORE_PLL_GROUP4, val); -+ -+ return 0; -+} -+ -+int mt753x_switch_init(struct mtk_eth_priv *priv) -+{ -+ int ret; -+ int i; -+ -+ /* Global reset switch */ -+ if (priv->mcm) { -+ reset_assert(&priv->rst_mcm); -+ udelay(1000); -+ reset_deassert(&priv->rst_mcm); -+ mdelay(1000); -+ } else if (dm_gpio_is_valid(&priv->rst_gpio)) { -+ dm_gpio_set_value(&priv->rst_gpio, 0); -+ udelay(1000); -+ dm_gpio_set_value(&priv->rst_gpio, 1); -+ mdelay(1000); -+ } -+ -+ ret = priv->switch_init(priv); -+ if (ret) -+ return ret; -+ - /* Set port isolation */ -- for (i = 0; i < 8; i++) { -+ for (i = 0; i < MT753X_NUM_PORTS; i++) { - /* Set port matrix mode */ - if (i != 6) -- mt7530_reg_write(priv, PCR_REG(i), -+ mt753x_reg_write(priv, PCR_REG(i), - (0x40 << PORT_MATRIX_S)); - else -- mt7530_reg_write(priv, PCR_REG(i), -+ mt753x_reg_write(priv, PCR_REG(i), - (0x3f << PORT_MATRIX_S)); - - /* Set port mode to user port */ -- mt7530_reg_write(priv, PVC_REG(i), -+ mt753x_reg_write(priv, PVC_REG(i), - (0x8100 << STAG_VPID_S) | - (VLAN_ATTR_USER << VLAN_ATTR_S)); - } -@@ -658,7 +992,7 @@ static void mtk_phy_link_adjust(struct mtk_eth_priv *priv) - u8 flowctrl; - u32 mcr; - -- mcr = (1 << IPG_CFG_S) | -+ mcr = (IPG_96BIT_WITH_SHORT_IPG << IPG_CFG_S) | - (MAC_RX_PKT_LEN_1536 << MAC_RX_PKT_LEN_S) | - MAC_MODE | FORCE_MODE | - MAC_TX_EN | MAC_RX_EN | -@@ -803,7 +1137,7 @@ static void mtk_mac_init(struct mtk_eth_priv *priv) - ge_mode << SYSCFG0_GE_MODE_S(priv->gmac_id)); - - if (priv->force_mode) { -- mcr = (1 << IPG_CFG_S) | -+ mcr = (IPG_96BIT_WITH_SHORT_IPG << IPG_CFG_S) | - (MAC_RX_PKT_LEN_1536 << MAC_RX_PKT_LEN_S) | - MAC_MODE | FORCE_MODE | - MAC_TX_EN | MAC_RX_EN | -@@ -1050,7 +1384,7 @@ static int mtk_eth_probe(struct udevice *dev) - return mtk_phy_probe(dev); - - /* Initialize switch */ -- return priv->switch_init(priv); -+ return mt753x_switch_init(priv); - } - - static int mtk_eth_remove(struct udevice *dev) -@@ -1159,7 +1493,11 @@ static int mtk_eth_ofdata_to_platdata(struct udevice *dev) - if (!strcmp(str, "mt7530")) { - priv->sw = SW_MT7530; - priv->switch_init = mt7530_setup; -- priv->mt7530_smi_addr = MT7530_DFL_SMI_ADDR; -+ priv->mt753x_smi_addr = MT753X_DFL_SMI_ADDR; -+ } else if (!strcmp(str, "mt7531")) { -+ priv->sw = SW_MT7531; -+ priv->switch_init = mt7531_setup; -+ priv->mt753x_smi_addr = MT753X_DFL_SMI_ADDR; - } else { - printf("error: unsupported switch\n"); - return -EINVAL; -diff --git a/drivers/net/mtk_eth.h b/drivers/net/mtk_eth.h -index 9bb037d440..f2940c9996 100644 ---- a/drivers/net/mtk_eth.h -+++ b/drivers/net/mtk_eth.h -@@ -34,7 +34,9 @@ - - /* SGMII subsystem config registers */ - #define SGMSYS_PCS_CONTROL_1 0x0 -+#define SGMII_LINK_STATUS BIT(18) - #define SGMII_AN_ENABLE BIT(12) -+#define SGMII_AN_RESTART BIT(9) - - #define SGMSYS_SGMII_MODE 0x20 - #define SGMII_FORCE_MODE 0x31120019 -@@ -139,6 +141,11 @@ - #define FORCE_DPX BIT(1) - #define FORCE_LINK BIT(0) - -+/* Values of IPG_CFG */ -+#define IPG_96BIT 0 -+#define IPG_96BIT_WITH_SHORT_IPG 1 -+#define IPG_64BIT 2 -+ - /* MAC_RX_PKT_LEN: Max RX packet length */ - #define MAC_RX_PKT_LEN_1518 0 - #define MAC_RX_PKT_LEN_1536 1 -@@ -178,17 +185,73 @@ - #define VLAN_ATTR_TRANSLATION 2 - #define VLAN_ATTR_TRANSPARENT 3 - --#define PCMR_REG(p) (0x3000 + (p) * 0x100) --/* XXX: all fields are defined under GMAC_PORT_MCR */ -- -+#define PMCR_REG(p) (0x3000 + (p) * 0x100) -+/* XXX: all fields of MT7530 are defined under GMAC_PORT_MCR -+ * MT7531 specific fields are defined below -+ */ -+#define FORCE_MODE_EEE1G BIT(25) -+#define FORCE_MODE_EEE100 BIT(26) -+#define FORCE_MODE_TX_FC BIT(27) -+#define FORCE_MODE_RX_FC BIT(28) -+#define FORCE_MODE_DPX BIT(29) -+#define FORCE_MODE_SPD BIT(30) -+#define FORCE_MODE_LNK BIT(31) -+#define MT7531_FORCE_MODE FORCE_MODE_EEE1G | FORCE_MODE_EEE100 |\ -+ FORCE_MODE_TX_FC | FORCE_MODE_RX_FC | \ -+ FORCE_MODE_DPX | FORCE_MODE_SPD | \ -+ FORCE_MODE_LNK -+ -+/* MT7531 SGMII Registers */ -+#define MT7531_SGMII_REG_BASE 0x5000 -+#define MT7531_SGMII_REG_PORT_BASE 0x1000 -+#define MT7531_SGMII_REG(p, r) (MT7531_SGMII_REG_BASE + \ -+ (p) * MT7531_SGMII_REG_PORT_BASE + (r)) -+#define MT7531_PCS_CONTROL_1(p) MT7531_SGMII_REG(((p) - 5), 0x00) -+#define MT7531_SGMII_MODE(p) MT7531_SGMII_REG(((p) - 5), 0x20) -+#define MT7531_QPHY_PWR_STATE_CTRL(p) MT7531_SGMII_REG(((p) - 5), 0xe8) -+#define MT7531_PHYA_CTRL_SIGNAL3(p) MT7531_SGMII_REG(((p) - 5), 0x128) -+/* XXX: all fields of MT7531 SGMII are defined under SGMSYS */ -+ -+/* MT753x System Control Register */ - #define SYS_CTRL_REG 0x7000 - #define SW_PHY_RST BIT(2) - #define SW_SYS_RST BIT(1) - #define SW_REG_RST BIT(0) - --#define NUM_TRGMII_CTRL 5 -+/* MT7531 */ -+#define MT7531_PHY_IAC 0x701c -+/* XXX: all fields are defined under GMAC_PIAC_REG */ -+ -+#define MT7531_CLKGEN_CTRL 0x7500 -+#define CLK_SKEW_OUT_S 8 -+#define CLK_SKEW_OUT_M 0x300 -+#define CLK_SKEW_IN_S 6 -+#define CLK_SKEW_IN_M 0xc0 -+#define RXCLK_NO_DELAY BIT(5) -+#define TXCLK_NO_REVERSE BIT(4) -+#define GP_MODE_S 1 -+#define GP_MODE_M 0x06 -+#define GP_CLK_EN BIT(0) -+ -+/* Values of GP_MODE */ -+#define GP_MODE_RGMII 0 -+#define GP_MODE_MII 1 -+#define GP_MODE_REV_MII 2 -+ -+/* Values of CLK_SKEW_IN */ -+#define CLK_SKEW_IN_NO_CHANGE 0 -+#define CLK_SKEW_IN_DELAY_100PPS 1 -+#define CLK_SKEW_IN_DELAY_200PPS 2 -+#define CLK_SKEW_IN_REVERSE 3 -+ -+/* Values of CLK_SKEW_OUT */ -+#define CLK_SKEW_OUT_NO_CHANGE 0 -+#define CLK_SKEW_OUT_DELAY_100PPS 1 -+#define CLK_SKEW_OUT_DELAY_200PPS 2 -+#define CLK_SKEW_OUT_REVERSE 3 - - #define HWTRAP_REG 0x7800 -+/* MT7530 Modified Hardware Trap Status Registers */ - #define MHWTRAP_REG 0x7804 - #define CHG_TRAP BIT(16) - #define LOOPDET_DIS BIT(14) -@@ -222,6 +285,8 @@ - #define P6_INTF_MODE_RGMII 0 - #define P6_INTF_MODE_TRGMII 1 - -+#define NUM_TRGMII_CTRL 5 -+ - #define MT7530_TRGMII_RD(n) (0x7a10 + (n) * 8) - #define RD_TAP_S 0 - #define RD_TAP_M 0x7f -@@ -229,8 +294,34 @@ - #define MT7530_TRGMII_TD_ODT(n) (0x7a54 + (n) * 8) - /* XXX: all fields are defined under GMAC_TRGMII_TD_ODT */ - --/* MT7530 GPHY MDIO Indirect Access Registers */ -+/* TOP Signals Status Register */ -+#define MT7531_TOP_SIG_SR 0x780c -+#define PAD_MCM_SMI_EN BIT(0) -+#define PAD_DUAL_SGMII_EN BIT(1) -+ -+/* MT7531 PLLGP Registers */ -+#define MT7531_PLLGP_EN 0x7820 -+#define EN_COREPLL BIT(2) -+#define SW_CLKSW BIT(1) -+#define SW_PLLGP BIT(0) -+ -+#define MT7531_PLLGP_CR0 0x78a8 -+#define RG_COREPLL_EN BIT(22) -+#define RG_COREPLL_POSDIV_S 23 -+#define RG_COREPLL_POSDIV_M 0x3800000 -+#define RG_COREPLL_SDM_PCW_S 1 -+#define RG_COREPLL_SDM_PCW_M 0x3ffffe -+#define RG_COREPLL_SDM_PCW_CHG BIT(0) -+ -+/* MT7531 RGMII and SGMII PLL clock */ -+#define MT7531_ANA_PLLGP_CR2 0x78b0 -+#define MT7531_ANA_PLLGP_CR5 0x78bc -+ -+/* MT7531 GPIO GROUP IOLB SMT0 Control */ -+#define MT7531_SMT0_IOLB 0x7f04 -+#define SMT_IOLB_5_SMI_MDC_EN BIT(5) - -+/* MT7530 GPHY MDIO Indirect Access Registers */ - #define MII_MMD_ACC_CTL_REG 0x0d - #define MMD_CMD_S 14 - #define MMD_CMD_M 0xc000 -@@ -246,7 +337,6 @@ - #define MII_MMD_ADDR_DATA_REG 0x0e - - /* MT7530 GPHY MDIO MMD Registers */ -- - #define CORE_PLL_GROUP2 0x401 - #define RG_SYSPLL_EN_NORMAL BIT(15) - #define RG_SYSPLL_VODEN BIT(14) -@@ -254,6 +344,8 @@ - #define RG_SYSPLL_POSDIV_M 0x60 - - #define CORE_PLL_GROUP4 0x403 -+#define MT7531_BYPASS_MODE BIT(4) -+#define MT7531_POWER_ON_OFF BIT(5) - #define RG_SYSPLL_DDSFBK_EN BIT(12) - #define RG_SYSPLL_BIAS_EN BIT(11) - #define RG_SYSPLL_BIAS_LPF_EN BIT(10) -@@ -298,4 +390,24 @@ - #define REG_GSWCK_EN BIT(0) - #define REG_TRGMIICK_EN BIT(1) - -+/* Extend PHY Control Register 3 */ -+#define PHY_EXT_REG_14 0x14 -+ -+/* Fields of PHY_EXT_REG_14 */ -+#define PHY_EN_DOWN_SHFIT BIT(4) -+ -+/* Extend PHY Control Register 4 */ -+#define PHY_EXT_REG_17 0x17 -+ -+/* Fields of PHY_EXT_REG_17 */ -+#define PHY_LINKDOWN_POWER_SAVING_EN BIT(4) -+ -+/* PHY RXADC Control Register 7 */ -+#define PHY_DEV1E_REG_0C6 0x0c6 -+ -+/* Fields of PHY_DEV1E_REG_0C6 */ -+#define PHY_POWER_SAVING_S 8 -+#define PHY_POWER_SAVING_M 0x300 -+#define PHY_POWER_SAVING_TX 0x0 -+ - #endif /* _MTK_ETH_H_ */ diff --git a/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch b/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch index a45665eff..cc7ed8928 100644 --- a/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch +++ b/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch @@ -5,7 +5,6 @@ index 6b9fbd7e22..fb2a004803 100644 @@ -52,3 +52,13 @@ CONFIG_TIMER=y CONFIG_WDT_MTK=y CONFIG_LZMA=y - # CONFIG_EFI_LOADER is not set +CONFIG_CMD_BOOTZ=y +CONFIG_OF_LIBFDT_OVERLAY=y +#enables savenenv-command diff --git a/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch b/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch index a0236785d..2ac001228 100644 --- a/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch +++ b/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch @@ -37,11 +37,10 @@ diff --git a/env/fat.c b/env/fat.c index 35a1955e63..63aced9317 100644 --- a/env/fat.c +++ b/env/fat.c -@@ -29,6 +29,36 @@ - # endif +@@ -29,6 +29,34 @@ + # define LOADENV #endif -+#if defined(CMD_SAVEENV) || defined(CMD_LOADENV) +__weak int mmc_get_env_dev(void) +{ +#ifdef CONFIG_SYS_MMC_ENV_DEV @@ -69,11 +68,10 @@ index 35a1955e63..63aced9317 100644 + return CONFIG_ENV_FAT_DEVICE_AND_PART; +#endif +} -+#endif + - #ifdef CMD_SAVEENV static int env_fat_save(void) { + env_t __aligned(ARCH_DMA_MINALIGN) env_new; @@ -43,7 +71,7 @@ static int env_fat_save(void) return err; diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 6a1cd3379..9a1b5ed63 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -8,10 +8,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2019.04 +PKG_VERSION:=2020.10-rc4 PKG_RELEASE:=1 -PKG_HASH:=76b7772d156b3ddd7644c8a1736081e55b78828537ff714065d21dbade229bef +PKG_HASH:=0a7bdd2c7df2c14daf2730fcf3277fd917aadfaae935529e29c7412314bbf260 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -36,6 +36,21 @@ define U-Boot/helios4 UBOOT_IMAGE:=u-boot-spl.kwb endef +define U-Boot/espressobin + NAME:=Marvell ESPRESSObin + BUILD_DEVICES:=globalscale_espressobin globalscale_espressobin-v7 + BUILD_SUBTARGET:=cortexa53 + UBOOT_CONFIG:=mvebu_espressobin-88f3720 +endef + +define U-Boot/espressobin-emmc + NAME:=Marvell ESPRESSObin + BUILD_DEVICES:=globalscale_espressobin-emmc globalscale_espressobin-v7-emmc + BUILD_SUBTARGET:=cortexa53 + UBOOT_CONFIG:=mvebu_espressobin-88f3720 + UBOOT_MAKE_FLAGS+=DEVICE_TREE=armada-3720-espressobin-emmc +endef + define U-Boot/uDPU NAME:=Methode uDPU BUILD_DEVICES:=methode_udpu @@ -45,6 +60,8 @@ endef UBOOT_TARGETS:= \ clearfog \ helios4 \ + espressobin \ + espressobin-emmc \ uDPU Build/Exports:=$(Host/Exports) diff --git a/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch b/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch index 79b1b66e7..f1a292694 100644 --- a/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch +++ b/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch @@ -1,7 +1,7 @@ --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c -@@ -136,6 +136,7 @@ const struct flash_info spi_nor_ids[] = - { INFO("mx25u1635e", 0xc22535, 0, 64 * 1024, 32, SECT_4K) }, +@@ -151,6 +151,7 @@ const struct flash_info spi_nor_ids[] = + { INFO("mx25u3235f", 0xc22536, 0, 4 * 1024, 1024, SECT_4K) }, { INFO("mx25u6435f", 0xc22537, 0, 64 * 1024, 128, SECT_4K) }, { INFO("mx25l12805d", 0xc22018, 0, 64 * 1024, 256, 0) }, + { INFO("mx25u12835f", 0xc22538, 0, 64 * 1024, 256, SECT_4K) }, diff --git a/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch b/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch index 580270a70..c543e5126 100644 --- a/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch +++ b/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch @@ -9,5 +9,5 @@ This is required in order to boot itb images. #define CONFIG_SYS_SDRAM_BASE 0x00000000 +#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */ - #define CONFIG_NR_DRAM_BANKS 1 + /* auto boot */ diff --git a/package/boot/uboot-mvebu/patches/130-mmc-xenon_sdhci-Add-missing-common-host-capabilities.patch b/package/boot/uboot-mvebu/patches/130-mmc-xenon_sdhci-Add-missing-common-host-capabilities.patch new file mode 100644 index 000000000..fa41f0152 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/130-mmc-xenon_sdhci-Add-missing-common-host-capabilities.patch @@ -0,0 +1,43 @@ +From 264c45575ec6a3d507dc4e43954b8a78283aca6c Mon Sep 17 00:00:00 2001 +From: Andre Heider +Date: Thu, 10 Sep 2020 17:58:43 +0200 +Subject: [PATCH] mmc: xenon_sdhci: Add missing common host capabilities + +Use mmc_of_parse() to set the common host properties. That includes +"bus-width", so parsing it can be removed from the driver. + +But more importantly, "non-removable" is now respected, which fixes +the usage of eMMC. + +Signed-off-by: Andre Heider +--- + drivers/mmc/xenon_sdhci.c | 18 ++++-------------- + 1 file changed, 4 insertions(+), 14 deletions(-) + +--- a/drivers/mmc/xenon_sdhci.c ++++ b/drivers/mmc/xenon_sdhci.c +@@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udev + armada_3700_soc_pad_voltage_set(host); + + host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz; +- switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width", +- 1)) { +- case 8: +- host->host_caps |= MMC_MODE_8BIT; +- break; +- case 4: +- host->host_caps |= MMC_MODE_4BIT; +- break; +- case 1: +- break; +- default: +- printf("Invalid \"bus-width\" value\n"); +- return -EINVAL; +- } ++ ++ ret = mmc_of_parse(dev, &plat->cfg); ++ if (ret) ++ return ret; + + host->ops = &xenon_sdhci_ops; + diff --git a/package/boot/uboot-mvebu/patches/131-arm64-dts-armada-3720-espressobin-use-Linux-model-co.patch b/package/boot/uboot-mvebu/patches/131-arm64-dts-armada-3720-espressobin-use-Linux-model-co.patch new file mode 100644 index 000000000..1aef9db90 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/131-arm64-dts-armada-3720-espressobin-use-Linux-model-co.patch @@ -0,0 +1,45 @@ +From 753947e2c374820dcbc9c86626812aeb7d460653 Mon Sep 17 00:00:00 2001 +From: Andre Heider +Date: Fri, 4 Sep 2020 16:34:22 +0200 +Subject: [PATCH] arm64: dts: armada-3720-espressobin: use Linux + model/compatible strings + +Fix the actual board vendor and ease synching dts files from Linux. +--- + arch/arm/dts/armada-3720-espressobin.dts | 4 ++-- + board/Marvell/mvebu_armada-37xx/board.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm/dts/armada-3720-espressobin.dts ++++ b/arch/arm/dts/armada-3720-espressobin.dts +@@ -50,8 +50,8 @@ + #include "armada-372x.dtsi" + + / { +- model = "Marvell Armada 3720 Community Board ESPRESSOBin"; +- compatible = "marvell,armada-3720-espressobin", "marvell,armada3720", "marvell,armada3710"; ++ model = "Globalscale Marvell ESPRESSOBin Board"; ++ compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710"; + + chosen { + stdout-path = "serial0:115200n8"; +--- a/board/Marvell/mvebu_armada-37xx/board.c ++++ b/board/Marvell/mvebu_armada-37xx/board.c +@@ -201,7 +201,7 @@ static int mii_multi_chip_mode_write(str + /* Bring-up board-specific network stuff */ + int board_network_enable(struct mii_dev *bus) + { +- if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) ++ if (!of_machine_is_compatible("globalscale,espressobin")) + return 0; + + /* +@@ -253,7 +253,7 @@ int ft_board_setup(void *blob, struct bd + int part_off; + + /* Fill SPI MTD partitions for Linux kernel on Espressobin */ +- if (!of_machine_is_compatible("marvell,armada-3720-espressobin")) ++ if (!of_machine_is_compatible("globalscale,espressobin")) + return 0; + + spi_off = fdt_node_offset_by_compatible(blob, -1, "jedec,spi-nor"); diff --git a/package/boot/uboot-mvebu/patches/132-arm64-dts-armada-3720-espressobin-split-common-parts.patch b/package/boot/uboot-mvebu/patches/132-arm64-dts-armada-3720-espressobin-split-common-parts.patch new file mode 100644 index 000000000..d3af221c0 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/132-arm64-dts-armada-3720-espressobin-split-common-parts.patch @@ -0,0 +1,369 @@ +From ee59573dd531df96de0d9dc8e79b34ed3716c864 Mon Sep 17 00:00:00 2001 +From: Andre Heider +Date: Fri, 4 Sep 2020 15:38:58 +0200 +Subject: [PATCH] arm64: dts: armada-3720-espressobin: split common parts to + .dtsi + +Move most of the dts to the new common +arch/arm/dts/armada-3720-espressobin.dtsi file, just like Linux has. + +The dts itself is imported from Linux. + +Signed-off-by: Andre Heider +--- + arch/arm/dts/armada-3720-espressobin.dts | 190 ++---------------- + ...sobin.dts => armada-3720-espressobin.dtsi} | 3 - + 2 files changed, 20 insertions(+), 173 deletions(-) + rewrite arch/arm/dts/armada-3720-espressobin.dts (95%) + copy arch/arm/dts/{armada-3720-espressobin.dts => armada-3720-espressobin.dtsi} (96%) + +--- a/arch/arm/dts/armada-3720-espressobin.dts ++++ b/arch/arm/dts/armada-3720-espressobin.dts +@@ -1,170 +1,20 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + /* +- * Device Tree file for Marvell Armada 3720 community board +- * (ESPRESSOBin) ++ * Device Tree file for Globalscale Marvell ESPRESSOBin Board + * Copyright (C) 2016 Marvell + * +- * Gregory CLEMENT +- * Konstantin Porotchkin ++ * Romain Perier + * +- * This file is dual-licensed: you can use it either under the terms +- * of the GPL or the X11 license, at your option. Note that this dual +- * licensing only applies to this file, and not this project as a +- * whole. +- * +- * a) This file 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. +- * +- * This file is distributed in the hope that it will be useful +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * Or, alternatively +- * +- * b) Permission is hereby granted, free of charge, to any person +- * obtaining a copy of this software and associated documentation +- * files (the "Software"), to deal in the Software without +- * restriction, including without limitation the rights to use +- * copy, modify, merge, publish, distribute, sublicense, and/or +- * sell copies of the Software, and to permit persons to whom the +- * Software is furnished to do so, subject to the following +- * conditions: +- * +- * The above copyright notice and this permission notice shall be +- * included in all copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND +- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY +- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +- * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++/* ++ * Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics.pdf + */ + + /dts-v1/; + +-#include "armada-372x.dtsi" ++#include "armada-3720-espressobin.dtsi" + + / { + model = "Globalscale Marvell ESPRESSOBin Board"; + compatible = "globalscale,espressobin", "marvell,armada3720", "marvell,armada3710"; +- +- chosen { +- stdout-path = "serial0:115200n8"; +- }; +- +- aliases { +- ethernet0 = ð0; +- i2c0 = &i2c0; +- spi0 = &spi0; +- }; +- +- memory { +- device_type = "memory"; +- reg = <0x00000000 0x00000000 0x00000000 0x20000000>; +- }; +- +- vcc_sd_reg0: regulator@0 { +- compatible = "regulator-gpio"; +- regulator-name = "vcc_sd0"; +- regulator-min-microvolt = <1800000>; +- regulator-max-microvolt = <3300000>; +- regulator-type = "voltage"; +- states = <1800000 0x1 +- 3300000 0x0>; +- gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>; +- }; +-}; +- +-&comphy { +- max-lanes = <3>; +- phy0 { +- phy-type = ; +- phy-speed = ; +- }; +- +- phy1 { +- phy-type = ; +- phy-speed = ; +- }; +- +- phy2 { +- phy-type = ; +- phy-speed = ; +- }; +-}; +- +-ð0 { +- status = "okay"; +- pinctrl-names = "default"; +- pinctrl-0 = <&rgmii_pins>, <&smi_pins>; +- phy-mode = "rgmii"; +- phy_addr = <0x1>; +- fixed-link { +- speed = <1000>; +- full-duplex; +- }; +-}; +- +-&i2c0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2c1_pins>; +- status = "okay"; +-}; +- +-/* CON3 */ +-&sata { +- status = "okay"; +-}; +- +-&sdhci0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&sdio_pins>; +- bus-width = <4>; +- cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; +- vqmmc-supply = <&vcc_sd_reg0>; +- status = "okay"; +-}; +- +-&spi0 { +- status = "okay"; +- pinctrl-names = "default"; +- pinctrl-0 = <&spi_quad_pins>; +- +- spi-flash@0 { +- #address-cells = <1>; +- #size-cells = <1>; +- compatible = "st,m25p128", "jedec,spi-nor"; +- reg = <0>; /* Chip select 0 */ +- spi-max-frequency = <50000000>; +- m25p,fast-read; +- }; +-}; +- +-/* Exported on the micro USB connector CON32 through an FTDI */ +-&uart0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&uart1_pins>; +- status = "okay"; +-}; +- +-/* CON29 */ +-&usb2 { +- status = "okay"; +-}; +- +-/* CON31 */ +-&usb3 { +- status = "okay"; +-}; +- +-&pcie0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&pcie_pins>; +- reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; +- status = "okay"; + }; +--- /dev/null ++++ b/arch/arm/dts/armada-3720-espressobin.dtsi +@@ -0,0 +1,167 @@ ++/* ++ * Device Tree file for Marvell Armada 3720 community board ++ * (ESPRESSOBin) ++ * Copyright (C) 2016 Marvell ++ * ++ * Gregory CLEMENT ++ * Konstantin Porotchkin ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file 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. ++ * ++ * This file is distributed in the hope that it will be useful ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++ ++#include "armada-372x.dtsi" ++ ++/ { ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ aliases { ++ ethernet0 = ð0; ++ i2c0 = &i2c0; ++ spi0 = &spi0; ++ }; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x00000000 0x00000000 0x20000000>; ++ }; ++ ++ vcc_sd_reg0: regulator@0 { ++ compatible = "regulator-gpio"; ++ regulator-name = "vcc_sd0"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-type = "voltage"; ++ states = <1800000 0x1 ++ 3300000 0x0>; ++ gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++&comphy { ++ max-lanes = <3>; ++ phy0 { ++ phy-type = ; ++ phy-speed = ; ++ }; ++ ++ phy1 { ++ phy-type = ; ++ phy-speed = ; ++ }; ++ ++ phy2 { ++ phy-type = ; ++ phy-speed = ; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rgmii_pins>, <&smi_pins>; ++ phy-mode = "rgmii"; ++ phy_addr = <0x1>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; ++ status = "okay"; ++}; ++ ++/* CON3 */ ++&sata { ++ status = "okay"; ++}; ++ ++&sdhci0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio_pins>; ++ bus-width = <4>; ++ cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; ++ vqmmc-supply = <&vcc_sd_reg0>; ++ status = "okay"; ++}; ++ ++&spi0 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_quad_pins>; ++ ++ spi-flash@0 { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ compatible = "st,m25p128", "jedec,spi-nor"; ++ reg = <0>; /* Chip select 0 */ ++ spi-max-frequency = <50000000>; ++ m25p,fast-read; ++ }; ++}; ++ ++/* Exported on the micro USB connector CON32 through an FTDI */ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "okay"; ++}; ++ ++/* CON29 */ ++&usb2 { ++ status = "okay"; ++}; ++ ++/* CON31 */ ++&usb3 { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_pins>; ++ reset-gpios = <&gpiosb 3 GPIO_ACTIVE_LOW>; ++ status = "okay"; ++}; diff --git a/package/boot/uboot-mvebu/patches/133-arm64-dts-a3720-add-support-for-boards-with-populate.patch b/package/boot/uboot-mvebu/patches/133-arm64-dts-a3720-add-support-for-boards-with-populate.patch new file mode 100644 index 000000000..f35b45d0e --- /dev/null +++ b/package/boot/uboot-mvebu/patches/133-arm64-dts-a3720-add-support-for-boards-with-populate.patch @@ -0,0 +1,89 @@ +From 83908b6e2e5a7d7b0f4d040ffb4bf3ce6807b8fe Mon Sep 17 00:00:00 2001 +From: Andre Heider +Date: Fri, 4 Sep 2020 15:44:41 +0200 +Subject: [PATCH] arm64: dts: a3720: add support for boards with populated emmc + +Import armada-3720-espressobin-emmc.dts from Linux, but use sdhc1 for +emmc, since sdhc0 is used for the sd card. + +Signed-off-by: Andre Heider +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/armada-3720-espressobin-emmc.dts | 44 +++++++++++++++++++ + doc/README.marvell | 7 ++- + 3 files changed, 50 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/dts/armada-3720-espressobin-emmc.dts + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -202,6 +202,7 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harm + dtb-$(CONFIG_ARCH_MVEBU) += \ + armada-3720-db.dtb \ + armada-3720-espressobin.dtb \ ++ armada-3720-espressobin-emmc.dtb \ + armada-3720-turris-mox.dtb \ + armada-3720-uDPU.dtb \ + armada-375-db.dtb \ +--- /dev/null ++++ b/arch/arm/dts/armada-3720-espressobin-emmc.dts +@@ -0,0 +1,44 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Device Tree file for Globalscale Marvell ESPRESSOBin Board with eMMC ++ * Copyright (C) 2018 Marvell ++ * ++ * Romain Perier ++ * Konstantin Porotchkin ++ * ++ */ ++/* ++ * Schematic available at http://espressobin.net/wp-content/uploads/2017/08/ESPRESSObin_V5_Schematics.pdf ++ */ ++ ++/dts-v1/; ++ ++#include "armada-3720-espressobin.dtsi" ++ ++/ { ++ model = "Globalscale Marvell ESPRESSOBin Board (eMMC)"; ++ compatible = "globalscale,espressobin-emmc", "globalscale,espressobin", ++ "marvell,armada3720", "marvell,armada3710"; ++}; ++ ++/* U11 */ ++&sdhci1 { ++ non-removable; ++ bus-width = <8>; ++ mmc-ddr-1_8v; ++ mmc-hs400-1_8v; ++ marvell,xenon-emmc; ++ marvell,xenon-tun-count = <9>; ++ marvell,pad-type = "fixed-1-8v"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc_pins>; ++ status = "okay"; ++ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ mmccard: mmccard@0 { ++ compatible = "mmc-card"; ++ reg = <0>; ++ }; ++}; +--- a/doc/README.marvell ++++ b/doc/README.marvell +@@ -43,8 +43,11 @@ Build Procedure + In order to prevent this, the required device-tree MUST be set during compilation. + All device-tree files are located in ./arch/arm/dts/ folder. + +- For other DB boards (MacchiatoBin, EspressoBin and 3700 DB board) compile u-boot with +- just default device-tree from defconfig using: ++ For the EspressoBin board with populated eMMC device use ++ # make DEVICE_TREE=armada-3720-espressobin-emmc ++ ++ For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board) ++ compile u-boot with just default device-tree from defconfig using: + + # make + diff --git a/package/boot/uboot-mvebu/patches/134-arm-mvebu-Espressobin-Set-environment-variable-fdtfi.patch b/package/boot/uboot-mvebu/patches/134-arm-mvebu-Espressobin-Set-environment-variable-fdtfi.patch new file mode 100644 index 000000000..fd270ddae --- /dev/null +++ b/package/boot/uboot-mvebu/patches/134-arm-mvebu-Espressobin-Set-environment-variable-fdtfi.patch @@ -0,0 +1,100 @@ +From d59406482c1847959305a986376b35e57da28e69 Mon Sep 17 00:00:00 2001 +From: Andre Heider +Date: Sat, 5 Sep 2020 12:45:59 +0200 +Subject: [PATCH] arm: mvebu: Espressobin: Set environment variable fdtfile + +Required for the generic distro mechanism. + +Linux ships with 4 variants: +marvell/armada-3720-espressobin-v7-emmc.dtb +marvell/armada-3720-espressobin-v7.dtb +marvell/armada-3720-espressobin-emmc.dtb +marvell/armada-3720-espressobin.dtb + +Use available information to determine the appropriate filename. + +Tested on a v5 board without eMMC. + +Signed-off-by: Andre Heider +--- + board/Marvell/mvebu_armada-37xx/board.c | 47 +++++++++++++++++++++ + configs/mvebu_espressobin-88f3720_defconfig | 1 + + 2 files changed, 48 insertions(+) + +--- a/board/Marvell/mvebu_armada-37xx/board.c ++++ b/board/Marvell/mvebu_armada-37xx/board.c +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -50,6 +51,22 @@ DECLARE_GLOBAL_DATA_PTR; + #define MVEBU_G2_SMI_PHY_CMD_REG (24) + #define MVEBU_G2_SMI_PHY_DATA_REG (25) + ++/* ++ * Memory Controller Registers ++ * ++ * Assembled based on public information: ++ * https://gitlab.nic.cz/turris/mox-boot-builder/-/blob/master/wtmi/main.c#L332-336 ++ * https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/blob/mv_ddr-armada-18.12/drivers/mv_ddr_mc6.h#L309-L332 ++ * ++ * And checked against the written register values for the various topologies: ++ * https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/blob/mv_ddr-armada-atf-mainline/a3700/mv_ddr_tim.h ++ */ ++#define A3700_CH0_MC_CTRL2_REG MVEBU_REGISTER(0x002c4) ++#define A3700_MC_CTRL2_SDRAM_TYPE_MASK 0xf ++#define A3700_MC_CTRL2_SDRAM_TYPE_OFFS 4 ++#define A3700_MC_CTRL2_SDRAM_TYPE_DDR3 2 ++#define A3700_MC_CTRL2_SDRAM_TYPE_DDR4 3 ++ + int board_early_init_f(void) + { + return 0; +@@ -63,6 +80,36 @@ int board_init(void) + return 0; + } + ++#ifdef CONFIG_BOARD_LATE_INIT ++int board_late_init(void) ++{ ++ bool ddr4, emmc; ++ ++ if (env_get("fdtfile")) ++ return 0; ++ ++ if (!of_machine_is_compatible("globalscale,espressobin")) ++ return 0; ++ ++ /* If the memory controller has been configured for DDR4, we're running on v7 */ ++ ddr4 = ((readl(A3700_CH0_MC_CTRL2_REG) >> A3700_MC_CTRL2_SDRAM_TYPE_OFFS) ++ & A3700_MC_CTRL2_SDRAM_TYPE_MASK) == A3700_MC_CTRL2_SDRAM_TYPE_DDR4; ++ ++ emmc = of_machine_is_compatible("globalscale,espressobin-emmc"); ++ ++ if (ddr4 && emmc) ++ env_set("fdtfile", "marvell/armada-3720-espressobin-v7-emmc.dtb"); ++ else if (ddr4) ++ env_set("fdtfile", "marvell/armada-3720-espressobin-v7.dtb"); ++ else if (emmc) ++ env_set("fdtfile", "marvell/armada-3720-espressobin-emmc.dtb"); ++ else ++ env_set("fdtfile", "marvell/armada-3720-espressobin.dtb"); ++ ++ return 0; ++} ++#endif ++ + /* Board specific AHCI / SATA enable code */ + int board_ahci_enable(void) + { +--- a/configs/mvebu_espressobin-88f3720_defconfig ++++ b/configs/mvebu_espressobin-88f3720_defconfig +@@ -84,3 +84,4 @@ CONFIG_USB_ETHER_RTL8152=y + CONFIG_USB_ETHER_SMSC95XX=y + CONFIG_SHA1=y + CONFIG_SHA256=y ++CONFIG_BOARD_LATE_INIT=y diff --git a/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch b/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch index ee6c73f46..eb0b05e4c 100644 --- a/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch +++ b/package/boot/uboot-mvebu/patches/210-link-libcrypto-static.patch @@ -3,10 +3,10 @@ needed dependencies are added too. --- a/tools/Makefile +++ b/tools/Makefile -@@ -145,7 +145,7 @@ endif - # MXSImage needs LibSSL - ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),) - HOSTLOADLIBES_mkimage += \ +@@ -158,7 +158,7 @@ ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CON + HOSTCFLAGS_kwbimage.o += \ + $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") + HOSTLDLIBS_mkimage += \ - $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto") + $(shell pkg-config --libs --static libssl libcrypto 2> /dev/null || echo "-lssl -lpthread -lcrypto") diff --git a/package/boot/uboot-mvebu/patches/220-arm-dts-uDPU-switch-default-PHY-speed-to-3.125Gbit.patch b/package/boot/uboot-mvebu/patches/220-arm-dts-uDPU-switch-default-PHY-speed-to-3.125Gbit.patch deleted file mode 100644 index 0e10b2c76..000000000 --- a/package/boot/uboot-mvebu/patches/220-arm-dts-uDPU-switch-default-PHY-speed-to-3.125Gbit.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/arch/arm/dts/armada-3720-uDPU.dts -+++ b/arch/arm/dts/armada-3720-uDPU.dts -@@ -109,11 +109,11 @@ - &comphy { - phy0 { - phy-type = ; -- phy-speed = ; -+ phy-speed = ; - }; - phy1 { - phy-type = ; -- phy-speed = ; -+ phy-speed = ; - }; - - phy2 { -@@ -125,22 +125,16 @@ - ð0 { - pinctrl-0 = <&pcie_pins>; - status = "okay"; -- phy-mode = "sgmii"; -+ phy-mode = "sgmii-2500"; -+ managed = "in-band-status"; - phy = <ðphy0>; -- fixed-link { -- speed = <1000>; -- full-duplex; -- }; - }; - - ð1 { - status = "okay"; -- phy-mode = "sgmii"; -+ phy-mode = "sgmii-2500"; -+ managed = "in-band-status"; - phy = <ðphy1>; -- fixed-link { -- speed = <1000>; -- full-duplex; -- }; - }; - - &i2c0 { diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 84dc49836..d3eb14613 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -436,7 +436,7 @@ define KernelPackage/fs-nfs-v4 endef define KernelPackage/fs-nfs-v4/description - Kernel module for NFS v4 support + Kernel module for NFS v4 client support endef $(eval $(call KernelPackage,fs-nfs-v4)) diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index 0b9e9d8b1..a39a8910f 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -409,7 +409,9 @@ $(eval $(call KernelPackage,hwmon-pwmfan)) define KernelPackage/hwmon-sch5627 TITLE:=SMSC SCH5627 monitoring support - KCONFIG:=CONFIG_SENSORS_SCH5627 + KCONFIG:= \ + CONFIG_SENSORS_SCH5627 \ + CONFIG_WATCHDOG_CORE=y FILES:= \ $(LINUX_DIR)/drivers/hwmon/sch5627.ko \ $(LINUX_DIR)/drivers/hwmon/sch56xx-common.ko diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index 59ea6edbc..fe90c6b55 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -24,6 +24,20 @@ $(eval $(call KernelPackage,leds-gpio)) LED_TRIGGER_DIR=$(LINUX_DIR)/drivers/leds/trigger +define KernelPackage/ledtrig-activity + SUBMENU:=$(LEDS_MENU) + TITLE:=LED Activity Trigger + KCONFIG:=CONFIG_LEDS_TRIGGER_ACTIVITY + FILES:=$(LED_TRIGGER_DIR)/ledtrig-activity.ko + AUTOLOAD:=$(call AutoLoad,50,ledtrig-activity) +endef + +define KernelPackage/ledtrig-activity/description + Kernel module that allows LEDs to blink based on system load +endef + +$(eval $(call KernelPackage,ledtrig-activity)) + define KernelPackage/ledtrig-heartbeat SUBMENU:=$(LEDS_MENU) TITLE:=LED Heartbeat Trigger @@ -145,3 +159,19 @@ define KernelPackage/leds-pca963x/description endef $(eval $(call KernelPackage,leds-pca963x)) + + +define KernelPackage/leds-pwm + SUBMENU:=$(LEDS_MENU) + TITLE:=PWM driven LED Support + KCONFIG:=CONFIG_LEDS_PWM + DEPENDS:= @PWM_SUPPORT + FILES:=$(LINUX_DIR)/drivers/leds/leds-pwm.ko + AUTOLOAD:=$(call AutoLoad,60,leds-pwm,1) +endef + +define KernelPackage/leds-pwm/description + This option enables support for pwm driven LEDs +endef + +$(eval $(call KernelPackage,leds-pwm)) diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk index 599f02e80..944766cf8 100644 --- a/package/kernel/mac80211/ath.mk +++ b/package/kernel/mac80211/ath.mk @@ -318,3 +318,11 @@ define KernelPackage/owl-loader/description This is necessary for devices like the Cisco Meraki Z1. endef + +define KernelPackage/ar5523 + $(call KernelPackage/mac80211/Default) + TITLE:=Driver for Atheros AR5523 USB sticks + DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ar5523/ar5523.ko + AUTOLOAD:=$(call AutoProbe,ar5523) +endef diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index bfca22817..8d6e953f1 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -121,8 +121,8 @@ mac80211_hostapd_setup_base() { ieee80211n=1 ht_capab= case "$htmode" in - VHT20|HT20) ;; - HT40*|VHT40|VHT80|VHT160) + VHT20|HT20|HE20) ;; + HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160) case "$hwmode" in a) case "$(( ($channel / 4) % 2 ))" in @@ -192,19 +192,21 @@ mac80211_hostapd_setup_base() { # 802.11ac enable_ac=0 + vht_oper_chwidth=0 + vht_center_seg0= + idx="$channel" case "$htmode" in - VHT20) enable_ac=1;; - VHT40) + VHT20|HE20) enable_ac=1;; + VHT40|HE40) case "$(( ($channel / 4) % 2 ))" in 1) idx=$(($channel + 2));; 0) idx=$(($channel - 2));; esac enable_ac=1 - append base_cfg "vht_oper_chwidth=0" "$N" - append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N" + vht_center_seg0=$idx ;; - VHT80) + VHT80|HE80) case "$(( ($channel / 4) % 4 ))" in 1) idx=$(($channel + 6));; 2) idx=$(($channel + 2));; @@ -212,19 +214,20 @@ mac80211_hostapd_setup_base() { 0) idx=$(($channel - 6));; esac enable_ac=1 - append base_cfg "vht_oper_chwidth=1" "$N" - append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N" + vht_oper_chwidth=1 + vht_center_seg0=$idx ;; - VHT160) + VHT160|HE160) case "$channel" in 36|40|44|48|52|56|60|64) idx=50;; 100|104|108|112|116|120|124|128) idx=114;; esac enable_ac=1 - append base_cfg "vht_oper_chwidth=2" "$N" - append base_cfg "vht_oper_centr_freq_seg0_idx=$idx" "$N" + vht_oper_chwidth=2 + vht_center_seg0=$idx ;; esac + [ "$hwmode" = "a" ] || enable_ac=0 if [ "$enable_ac" != "0" -o "$vendor_vht" = "1" ]; then json_get_vars \ @@ -253,6 +256,9 @@ mac80211_hostapd_setup_base() { vht_cap="$(($vht_cap | $cap))" done + append base_cfg "vht_oper_chwidth=$vht_oper_chwidth" "$N" + append base_cfg "vht_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N" + cap_rx_stbc=$((($vht_cap >> 8) & 7)) [ "$rx_stbc" -lt "$cap_rx_stbc" ] && cap_rx_stbc="$rx_stbc" vht_cap="$(( ($vht_cap & ~(0x700)) | ($cap_rx_stbc << 8) ))" @@ -323,6 +329,25 @@ mac80211_hostapd_setup_base() { [ -n "$vht_capab" ] && append base_cfg "vht_capab=$vht_capab" "$N" fi + # 802.11ax + enable_ax=0 + case "$htmode" in + HE*) enable_ax=1 ;; + esac + + if [ "$enable_ax" != "0" ]; then + append base_cfg "ieee80211ax=1" "$N" + [ "$hwmode" = "a" ] && { + append base_cfg "he_oper_chwidth=$vht_oper_chwidth" "$N" + append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N" + } + append base_cfg "he_default_pe_duration=4" "$N" + append base_cfg "he_rts_threshold=1023" "$N" + append base_cfg "he_su_beamformer=1" "$N" + append base_cfg "he_su_beamformee=1" "$N" + append base_cfg "he_mu_beamformer=1023" "$N" + fi + hostapd_prepare_device_config "$hostapd_conf_file" nl80211 cat >> "$hostapd_conf_file" <sk && sk_fullsock(skb->sk) && -+ skb->sk->sk_pacing_shift != 6) -+ skb->sk->sk_pacing_shift = 6; -+#endif -+ - if (unlikely(ieee80211_multicast_to_unicast(skb, dev))) { - struct sk_buff_head queue; - diff --git a/package/kernel/mac80211/patches/subsys/310-mac80211-reduce-packet-loss-event-false-positives.patch b/package/kernel/mac80211/patches/subsys/310-mac80211-reduce-packet-loss-event-false-positives.patch index 85094389a..62f2419dd 100644 --- a/package/kernel/mac80211/patches/subsys/310-mac80211-reduce-packet-loss-event-false-positives.patch +++ b/package/kernel/mac80211/patches/subsys/310-mac80211-reduce-packet-loss-event-false-positives.patch @@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau unsigned long last_ack; --- a/net/mac80211/status.c +++ b/net/mac80211/status.c -@@ -749,12 +749,16 @@ static void ieee80211_report_used_skb(st +@@ -757,12 +757,16 @@ static void ieee80211_report_used_skb(st * - current throughput (higher value for higher tpt)? */ #define STA_LOST_PKT_THRESHOLD 50 @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau /* If driver relies on its own algorithm for station kickout, skip * mac80211 packet loss mechanism. */ -@@ -767,21 +771,20 @@ static void ieee80211_lost_packet(struct +@@ -775,21 +779,20 @@ static void ieee80211_lost_packet(struct return; sta->status_stats.lost_packets++; @@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau return; cfg80211_cqm_pktloss_notify(sta->sdata->dev, sta->sta.addr, -@@ -1034,9 +1037,7 @@ static void __ieee80211_tx_status(struct +@@ -1042,9 +1045,7 @@ static void __ieee80211_tx_status(struct sta->status_stats.lost_packets = 0; /* Track when last TDLS packet was ACKed */ @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau } else if (noack_success) { /* nothing to do here, do not account as lost */ } else { -@@ -1169,9 +1170,8 @@ void ieee80211_tx_status_ext(struct ieee +@@ -1177,9 +1178,8 @@ void ieee80211_tx_status_ext(struct ieee if (sta->status_stats.lost_packets) sta->status_stats.lost_packets = 0; @@ -104,7 +104,7 @@ Signed-off-by: Felix Fietkau } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { return; } else if (noack_success) { -@@ -1260,8 +1260,7 @@ void ieee80211_tx_status_8023(struct iee +@@ -1268,8 +1268,7 @@ void ieee80211_tx_status_8023(struct iee if (sta->status_stats.lost_packets) sta->status_stats.lost_packets = 0; diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch b/package/kernel/mac80211/patches/subsys/314-mac80211-add-missing-queue-hash-initialization-to-80.patch similarity index 86% rename from package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch rename to package/kernel/mac80211/patches/subsys/314-mac80211-add-missing-queue-hash-initialization-to-80.patch index 1ec22dbbc..eb56a2cac 100644 --- a/package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch +++ b/package/kernel/mac80211/patches/subsys/314-mac80211-add-missing-queue-hash-initialization-to-80.patch @@ -1,7 +1,7 @@ From: Felix Fietkau Date: Mon, 17 Aug 2020 13:55:56 +0200 -Subject: [PATCH] mac80211: add missing queue/hash initialization to 802.3 - xmit +Subject: [PATCH] mac80211: add missing queue/hash initialization to + 802.3 xmit Fixes AQL for encap-offloaded tx @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4206,6 +4206,12 @@ static void ieee80211_8023_xmit(struct i +@@ -4200,6 +4200,12 @@ static void ieee80211_8023_xmit(struct i if (is_zero_ether_addr(ra)) goto out_free; diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch b/package/kernel/mac80211/patches/subsys/315-mac80211-check-and-refresh-aggregation-session-in-en.patch similarity index 88% rename from package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch rename to package/kernel/mac80211/patches/subsys/315-mac80211-check-and-refresh-aggregation-session-in-en.patch index 5c149e7d9..e411d5972 100644 --- a/package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch +++ b/package/kernel/mac80211/patches/subsys/315-mac80211-check-and-refresh-aggregation-session-in-en.patch @@ -1,7 +1,7 @@ From: Felix Fietkau Date: Mon, 17 Aug 2020 21:11:25 +0200 -Subject: [PATCH] mac80211: check and refresh aggregation session in encap - offload tx +Subject: [PATCH] mac80211: check and refresh aggregation session in + encap offload tx Update the last_tx timestamp to avoid tearing down the aggregation session early. Fall back to the slow path if the session setup is still running @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4195,6 +4195,8 @@ static void ieee80211_8023_xmit(struct i +@@ -4189,6 +4189,8 @@ static void ieee80211_8023_xmit(struct i bool authorized = false; bool multicast; unsigned char *ra = ehdr->h_dest; @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau if (IS_ERR(sta) || (sta && !sta->uploaded)) sta = NULL; -@@ -4232,6 +4234,22 @@ static void ieee80211_8023_xmit(struct i +@@ -4226,6 +4228,22 @@ static void ieee80211_8023_xmit(struct i memset(info, 0, sizeof(*info)); diff --git a/package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch b/package/kernel/mac80211/patches/subsys/316-mac80211-skip-encap-offload-for-tx-multicast-control.patch similarity index 74% rename from package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch rename to package/kernel/mac80211/patches/subsys/316-mac80211-skip-encap-offload-for-tx-multicast-control.patch index 6ea9c3c91..6dce21db1 100644 --- a/package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch +++ b/package/kernel/mac80211/patches/subsys/316-mac80211-skip-encap-offload-for-tx-multicast-control.patch @@ -10,31 +10,9 @@ using an AP_VLAN. Signed-off-by: Felix Fietkau --- ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -378,7 +378,8 @@ static bool ieee80211_set_sdata_offload_ - if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC || - key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || - key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 || -- key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256 || -+ !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) - continue; - if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP || - !(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -@@ -1448,7 +1449,8 @@ static void ieee80211_set_vif_encap_ops( - if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC || - key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || - key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 || -- key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256 || -+ !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) - continue; - if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) - enabled = false; --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4190,88 +4190,47 @@ static void ieee80211_8023_xmit(struct i +@@ -4184,88 +4184,47 @@ static void ieee80211_8023_xmit(struct i struct sk_buff *skb) { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); @@ -137,15 +115,15 @@ Signed-off-by: Felix Fietkau if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) sdata = container_of(sdata->bss, -@@ -4292,6 +4251,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 +@@ -4286,6 +4245,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8 struct net_device *dev) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ethhdr *ehdr = (struct ethhdr *)skb->data; struct sta_info *sta; - if (unlikely(skb->len < ETH_HLEN)) { -@@ -4303,6 +4263,10 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + if (WARN_ON(!sdata->hw_80211_encap)) { +@@ -4302,6 +4262,10 @@ netdev_tx_t ieee80211_subif_start_xmit_8 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) kfree_skb(skb); diff --git a/package/kernel/mac80211/patches/subsys/326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch b/package/kernel/mac80211/patches/subsys/317-mac80211-set-info-control.hw_key-for-encap-offload-p.patch similarity index 79% rename from package/kernel/mac80211/patches/subsys/326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch rename to package/kernel/mac80211/patches/subsys/317-mac80211-set-info-control.hw_key-for-encap-offload-p.patch index 2b7579b24..cb5a98631 100644 --- a/package/kernel/mac80211/patches/subsys/326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch +++ b/package/kernel/mac80211/patches/subsys/317-mac80211-set-info-control.hw_key-for-encap-offload-p.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4191,6 +4191,7 @@ static void ieee80211_8023_xmit(struct i +@@ -4185,6 +4185,7 @@ static void ieee80211_8023_xmit(struct i { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_local *local = sdata->local; @@ -18,8 +18,8 @@ Signed-off-by: Felix Fietkau struct tid_ampdu_tx *tid_tx; u8 tid; -@@ -4239,6 +4240,10 @@ static void ieee80211_8023_xmit(struct i - info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP; +@@ -4233,6 +4234,10 @@ static void ieee80211_8023_xmit(struct i + info->control.flags |= IEEE80211_TX_CTRL_HW_80211_ENCAP; info->control.vif = &sdata->vif; + key = rcu_dereference(sta->ptk[sta->ptk_idx]); diff --git a/package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch b/package/kernel/mac80211/patches/subsys/318-mac80211-rework-tx-encapsulation-offload-API.patch similarity index 82% rename from package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch rename to package/kernel/mac80211/patches/subsys/318-mac80211-rework-tx-encapsulation-offload-API.patch index 22697718f..7593c41da 100644 --- a/package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch +++ b/package/kernel/mac80211/patches/subsys/318-mac80211-rework-tx-encapsulation-offload-API.patch @@ -198,34 +198,6 @@ Signed-off-by: Felix Fietkau }; /** ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -504,6 +504,7 @@ static int ieee80211_del_key(struct wiph - struct ieee80211_local *local = sdata->local; - struct sta_info *sta; - struct ieee80211_key *key = NULL; -+ bool recalc_offload = false; - int ret; - - mutex_lock(&local->sta_mtx); -@@ -528,6 +529,7 @@ static int ieee80211_del_key(struct wiph - goto out_unlock; - } - -+ recalc_offload = key->conf.cipher == WLAN_CIPHER_SUITE_TKIP; - ieee80211_key_free(key, sdata->vif.type == NL80211_IFTYPE_STATION); - - ret = 0; -@@ -535,6 +537,9 @@ static int ieee80211_del_key(struct wiph - mutex_unlock(&local->key_mtx); - mutex_unlock(&local->sta_mtx); - -+ if (recalc_offload) -+ ieee80211_recalc_offload(local); -+ - return ret; - } - --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -408,6 +408,7 @@ static const char *hw_flag_names[] = { @@ -287,16 +259,15 @@ Signed-off-by: Felix Fietkau bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata) { -@@ -348,6 +349,99 @@ static int ieee80211_check_queues(struct +@@ -348,6 +349,85 @@ static int ieee80211_check_queues(struct return 0; } +static bool ieee80211_iftype_supports_encap_offload(enum nl80211_iftype iftype) +{ + switch (iftype) { ++ /* P2P GO and client are mapped to AP/STATION types */ + case NL80211_IFTYPE_AP: -+ case NL80211_IFTYPE_P2P_GO: -+ case NL80211_IFTYPE_P2P_CLIENT: + case NL80211_IFTYPE_STATION: + return true; + default: @@ -307,7 +278,6 @@ Signed-off-by: Felix Fietkau +static bool ieee80211_set_sdata_offload_flags(struct ieee80211_sub_if_data *sdata) +{ + struct ieee80211_local *local = sdata->local; -+ struct ieee80211_key *key; + u32 flags; + + flags = sdata->vif.offload_flags; @@ -315,18 +285,6 @@ Signed-off-by: Felix Fietkau + if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) && + ieee80211_iftype_supports_encap_offload(sdata->vif.type)) { + flags |= IEEE80211_OFFLOAD_ENCAP_ENABLED; -+ mutex_lock(&local->key_mtx); -+ list_for_each_entry(key, &sdata->key_list, list) { -+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC || -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 || -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) -+ continue; -+ if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP || -+ !(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -+ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; -+ } -+ mutex_unlock(&local->key_mtx); + + if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) && + local->hw.wiphy->frag_threshold != (u32)-1) @@ -387,7 +345,7 @@ Signed-off-by: Felix Fietkau void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata, const int offset) { -@@ -587,6 +681,7 @@ int ieee80211_do_open(struct wireless_de +@@ -587,6 +667,7 @@ int ieee80211_do_open(struct wireless_de if (rtnl_dereference(sdata->bss->beacon)) { ieee80211_vif_vlan_copy_chanctx(sdata); netif_carrier_on(dev); @@ -395,7 +353,7 @@ Signed-off-by: Felix Fietkau } else { netif_carrier_off(dev); } -@@ -616,6 +711,7 @@ int ieee80211_do_open(struct wireless_de +@@ -616,6 +697,7 @@ int ieee80211_do_open(struct wireless_de ieee80211_adjust_monitor_flags(sdata, 1); ieee80211_configure_filter(local); @@ -403,7 +361,7 @@ Signed-off-by: Felix Fietkau mutex_lock(&local->mtx); ieee80211_recalc_idle(local); mutex_unlock(&local->mtx); -@@ -625,10 +721,13 @@ int ieee80211_do_open(struct wireless_de +@@ -625,10 +707,13 @@ int ieee80211_do_open(struct wireless_de default: if (coming_up) { ieee80211_del_virtual_monitor(local); @@ -417,7 +375,7 @@ Signed-off-by: Felix Fietkau res = ieee80211_check_queues(sdata, ieee80211_vif_type_p2p(&sdata->vif)); if (res) -@@ -1286,61 +1385,6 @@ static const struct net_device_ops ieee8 +@@ -1286,61 +1371,6 @@ static const struct net_device_ops ieee8 }; @@ -479,7 +437,7 @@ Signed-off-by: Felix Fietkau static void ieee80211_if_free(struct net_device *dev) { free_percpu(netdev_tstats(dev)); -@@ -1371,6 +1415,51 @@ static void ieee80211_if_setup_no_queue( +@@ -1371,6 +1401,32 @@ static void ieee80211_if_setup_no_queue( #endif } @@ -487,7 +445,6 @@ Signed-off-by: Felix Fietkau +{ + struct ieee80211_local *local = sdata->local; + struct ieee80211_sub_if_data *bss = sdata; -+ struct ieee80211_key *key; + bool enabled; + + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { @@ -506,24 +463,6 @@ Signed-off-by: Felix Fietkau + !(bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_4ADDR)) + enabled = false; + -+ /* -+ * Encapsulation offload cannot be used with software crypto, and a per-VLAN -+ * key may have been set -+ */ -+ if (enabled && sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { -+ mutex_lock(&local->key_mtx); -+ list_for_each_entry(key, &sdata->key_list, list) { -+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC || -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 || -+ key->conf.cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) -+ continue; -+ if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -+ enabled = false; -+ } -+ mutex_unlock(&local->key_mtx); -+ } -+ + sdata->dev->netdev_ops = enabled ? &ieee80211_dataif_8023_ops : + &ieee80211_dataif_ops; +} @@ -531,7 +470,7 @@ Signed-off-by: Felix Fietkau static void ieee80211_iface_work(struct work_struct *work) { struct ieee80211_sub_if_data *sdata = -@@ -1553,7 +1642,6 @@ static void ieee80211_setup_sdata(struct +@@ -1553,7 +1609,6 @@ static void ieee80211_setup_sdata(struct sdata->vif.bss_conf.txpower = INT_MIN; /* unset */ sdata->noack_map = 0; @@ -539,7 +478,7 @@ Signed-off-by: Felix Fietkau /* only monitor/p2p-device differ */ if (sdata->dev) { -@@ -1688,6 +1776,7 @@ static int ieee80211_runtime_change_ifty +@@ -1688,6 +1743,7 @@ static int ieee80211_runtime_change_ifty ieee80211_teardown_sdata(sdata); @@ -547,7 +486,7 @@ Signed-off-by: Felix Fietkau ret = drv_change_interface(local, sdata, internal_type, p2p); if (ret) type = ieee80211_vif_type_p2p(&sdata->vif); -@@ -1700,6 +1789,7 @@ static int ieee80211_runtime_change_ifty +@@ -1700,6 +1756,7 @@ static int ieee80211_runtime_change_ifty ieee80211_check_queues(sdata, type); ieee80211_setup_sdata(sdata, type); @@ -586,40 +525,6 @@ Signed-off-by: Felix Fietkau case WLAN_CIPHER_SUITE_AES_CMAC: case WLAN_CIPHER_SUITE_BIP_CMAC_256: case WLAN_CIPHER_SUITE_BIP_GMAC_128: -@@ -824,6 +809,7 @@ int ieee80211_key_link(struct ieee80211_ - */ - bool delay_tailroom = sdata->vif.type == NL80211_IFTYPE_STATION; - int ret = -EOPNOTSUPP; -+ bool recalc_offload = false; - - mutex_lock(&sdata->local->key_mtx); - -@@ -864,11 +850,15 @@ int ieee80211_key_link(struct ieee80211_ - key->local = sdata->local; - key->sdata = sdata; - key->sta = sta; -+ recalc_offload = !old_key && key->conf.cipher == WLAN_CIPHER_SUITE_TKIP; - - increment_tailroom_need_count(sdata); - - ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key); - -+ if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -+ recalc_offload = true; -+ - if (!ret) { - ieee80211_debugfs_key_add(key); - ieee80211_key_destroy(old_key, delay_tailroom); -@@ -879,6 +869,9 @@ int ieee80211_key_link(struct ieee80211_ - out: - mutex_unlock(&sdata->local->key_mtx); - -+ if (recalc_offload) -+ ieee80211_recalc_offload(sdata->local); -+ - return ret; - } - --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -2733,6 +2733,12 @@ TRACE_EVENT(drv_get_ftm_responder_stats, @@ -637,15 +542,72 @@ Signed-off-by: Felix Fietkau #undef TRACE_INCLUDE_PATH --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4270,11 +4270,6 @@ netdev_tx_t ieee80211_subif_start_xmit_8 - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct sta_info *sta; +@@ -4181,11 +4181,10 @@ static bool ieee80211_tx_8023(struct iee + static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata, + struct net_device *dev, struct sta_info *sta, +- struct sk_buff *skb) ++ struct ieee80211_key *key, struct sk_buff *skb) + { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_local *local = sdata->local; +- struct ieee80211_key *key; + struct tid_ampdu_tx *tid_tx; + u8 tid; + +@@ -4234,7 +4233,6 @@ static void ieee80211_8023_xmit(struct i + info->control.flags |= IEEE80211_TX_CTRL_HW_80211_ENCAP; + info->control.vif = &sdata->vif; + +- key = rcu_dereference(sta->ptk[sta->ptk_idx]); + if (key) + info->control.hw_key = &key->conf; + +@@ -4251,12 +4249,9 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ethhdr *ehdr = (struct ethhdr *)skb->data; ++ struct ieee80211_key *key; + struct sta_info *sta; +- - if (WARN_ON(!sdata->hw_80211_encap)) { - kfree_skb(skb); - return NETDEV_TX_OK; - } -- ++ bool offload = true; + if (unlikely(skb->len < ETH_HLEN)) { kfree_skb(skb); - return NETDEV_TX_OK; +@@ -4265,15 +4260,26 @@ netdev_tx_t ieee80211_subif_start_xmit_8 + + rcu_read_lock(); + +- if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) ++ if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) { + kfree_skb(skb); +- else if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded || +- !test_sta_flag(sta, WLAN_STA_AUTHORIZED) || +- sdata->control_port_protocol == ehdr->h_proto)) +- ieee80211_subif_start_xmit(skb, dev); ++ goto out; ++ } ++ ++ if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded || ++ !test_sta_flag(sta, WLAN_STA_AUTHORIZED) || ++ sdata->control_port_protocol == ehdr->h_proto)) ++ offload = false; ++ else if ((key = rcu_dereference(sta->ptk[sta->ptk_idx])) && ++ (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) || ++ key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)) ++ offload = false; ++ ++ if (offload) ++ ieee80211_8023_xmit(sdata, dev, sta, key, skb); + else +- ieee80211_8023_xmit(sdata, dev, sta, skb); ++ ieee80211_subif_start_xmit(skb, dev); + ++out: + rcu_read_unlock(); + + return NETDEV_TX_OK; diff --git a/package/kernel/mac80211/patches/subsys/315-mac80211-reduce-duplication-in-tx-status-functions.patch b/package/kernel/mac80211/patches/subsys/319-mac80211-reduce-duplication-in-tx-status-functions.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/315-mac80211-reduce-duplication-in-tx-status-functions.patch rename to package/kernel/mac80211/patches/subsys/319-mac80211-reduce-duplication-in-tx-status-functions.patch diff --git a/package/kernel/mac80211/patches/subsys/316-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/316-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch rename to package/kernel/mac80211/patches/subsys/320-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch diff --git a/package/kernel/mac80211/patches/subsys/317-mac80211-optimize-station-connection-monitor.patch b/package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/317-mac80211-optimize-station-connection-monitor.patch rename to package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch diff --git a/package/kernel/mac80211/patches/subsys/318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch b/package/kernel/mac80211/patches/subsys/322-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch similarity index 97% rename from package/kernel/mac80211/patches/subsys/318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch rename to package/kernel/mac80211/patches/subsys/322-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch index a0ce6a2b1..b9069ef9b 100644 --- a/package/kernel/mac80211/patches/subsys/318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch +++ b/package/kernel/mac80211/patches/subsys/322-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch @@ -198,7 +198,7 @@ Signed-off-by: Felix Fietkau goto encap_out; if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) { -@@ -4253,7 +4253,7 @@ static void ieee80211_8023_xmit(struct i +@@ -4230,7 +4230,7 @@ static void ieee80211_8023_xmit(struct i sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap); @@ -206,8 +206,8 @@ Signed-off-by: Felix Fietkau + info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP; info->control.vif = &sdata->vif; - ieee80211_tx_8023(sdata, skb, skb->len, sta, false); -@@ -4357,7 +4357,7 @@ static bool ieee80211_tx_pending_skb(str + if (key) +@@ -4355,7 +4355,7 @@ static bool ieee80211_tx_pending_skb(str sdata = vif_to_sdata(info->control.vif); @@ -216,7 +216,7 @@ Signed-off-by: Felix Fietkau chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); if (unlikely(!chanctx_conf)) { dev_kfree_skb(skb); -@@ -4365,7 +4365,7 @@ static bool ieee80211_tx_pending_skb(str +@@ -4363,7 +4363,7 @@ static bool ieee80211_tx_pending_skb(str } info->band = chanctx_conf->def.chan->band; result = ieee80211_tx(sdata, NULL, skb, true, 0); diff --git a/package/kernel/mac80211/patches/subsys/319-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch b/package/kernel/mac80211/patches/subsys/323-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/319-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch rename to package/kernel/mac80211/patches/subsys/323-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch diff --git a/package/kernel/mac80211/patches/subsys/322-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch b/package/kernel/mac80211/patches/subsys/324-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/322-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch rename to package/kernel/mac80211/patches/subsys/324-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch diff --git a/package/kernel/mac80211/patches/subsys/323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch b/package/kernel/mac80211/patches/subsys/325-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch similarity index 98% rename from package/kernel/mac80211/patches/subsys/323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch rename to package/kernel/mac80211/patches/subsys/325-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch index c0f2b7b10..e8b29bb4c 100644 --- a/package/kernel/mac80211/patches/subsys/323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch +++ b/package/kernel/mac80211/patches/subsys/325-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch @@ -1,7 +1,7 @@ From: Felix Fietkau Date: Fri, 21 Aug 2020 05:49:07 +0200 -Subject: [PATCH] mac80211: extend ieee80211_tx_status_ext to support bulk - free +Subject: [PATCH] mac80211: extend ieee80211_tx_status_ext to support + bulk free Store processed skbs ready to be freed in a list so the driver bulk free them diff --git a/package/kernel/mac80211/patches/subsys/324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch b/package/kernel/mac80211/patches/subsys/326-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch similarity index 97% rename from package/kernel/mac80211/patches/subsys/324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch rename to package/kernel/mac80211/patches/subsys/326-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch index abfb5b76d..5ad5ac6a7 100644 --- a/package/kernel/mac80211/patches/subsys/324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch +++ b/package/kernel/mac80211/patches/subsys/326-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau /** --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1698,6 +1698,7 @@ static int ieee80211_change_station(stru +@@ -1693,6 +1693,7 @@ static int ieee80211_change_station(stru rcu_assign_pointer(vlansdata->u.vlan.sta, sta); __ieee80211_check_fast_rx_iface(vlansdata); diff --git a/package/kernel/mac80211/patches/subsys/327-mac80211-reorganize-code-to-remove-a-forward-declara.patch b/package/kernel/mac80211/patches/subsys/327-mac80211-reorganize-code-to-remove-a-forward-declara.patch new file mode 100644 index 000000000..a3d600152 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/327-mac80211-reorganize-code-to-remove-a-forward-declara.patch @@ -0,0 +1,1110 @@ +From: Felix Fietkau +Date: Tue, 8 Sep 2020 12:16:26 +0200 +Subject: [PATCH] mac80211: reorganize code to remove a forward + declaration + +Remove the newly added ieee80211_set_vif_encap_ops declaration. +No further code changes + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -43,7 +43,6 @@ + */ + + static void ieee80211_iface_work(struct work_struct *work); +-static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata); + + bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata) + { +@@ -349,6 +348,511 @@ static int ieee80211_check_queues(struct + return 0; + } + ++static int ieee80211_open(struct net_device *dev) ++{ ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); ++ int err; ++ ++ /* fail early if user set an invalid address */ ++ if (!is_valid_ether_addr(dev->dev_addr)) ++ return -EADDRNOTAVAIL; ++ ++ err = ieee80211_check_concurrent_iface(sdata, sdata->vif.type); ++ if (err) ++ return err; ++ ++ return ieee80211_do_open(&sdata->wdev, true); ++} ++ ++static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ++ bool going_down) ++{ ++ struct ieee80211_local *local = sdata->local; ++ unsigned long flags; ++ struct sk_buff *skb, *tmp; ++ u32 hw_reconf_flags = 0; ++ int i, flushed; ++ struct ps_data *ps; ++ struct cfg80211_chan_def chandef; ++ bool cancel_scan; ++ struct cfg80211_nan_func *func; ++ ++ clear_bit(SDATA_STATE_RUNNING, &sdata->state); ++ ++ cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; ++ if (cancel_scan) ++ ieee80211_scan_cancel(local); ++ ++ /* ++ * Stop TX on this interface first. ++ */ ++ if (sdata->dev) ++ netif_tx_stop_all_queues(sdata->dev); ++ ++ ieee80211_roc_purge(local, sdata); ++ ++ switch (sdata->vif.type) { ++ case NL80211_IFTYPE_STATION: ++ ieee80211_mgd_stop(sdata); ++ break; ++ case NL80211_IFTYPE_ADHOC: ++ ieee80211_ibss_stop(sdata); ++ break; ++ case NL80211_IFTYPE_MONITOR: ++ if (sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES) ++ break; ++ list_del_rcu(&sdata->u.mntr.list); ++ break; ++ default: ++ break; ++ } ++ ++ /* ++ * Remove all stations associated with this interface. ++ * ++ * This must be done before calling ops->remove_interface() ++ * because otherwise we can later invoke ops->sta_notify() ++ * whenever the STAs are removed, and that invalidates driver ++ * assumptions about always getting a vif pointer that is valid ++ * (because if we remove a STA after ops->remove_interface() ++ * the driver will have removed the vif info already!) ++ * ++ * In WDS mode a station must exist here and be flushed, for ++ * AP_VLANs stations may exist since there's nothing else that ++ * would have removed them, but in other modes there shouldn't ++ * be any stations. ++ */ ++ flushed = sta_info_flush(sdata); ++ WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP_VLAN && ++ ((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) || ++ (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1))); ++ ++ /* don't count this interface for allmulti while it is down */ ++ if (sdata->flags & IEEE80211_SDATA_ALLMULTI) ++ atomic_dec(&local->iff_allmultis); ++ ++ if (sdata->vif.type == NL80211_IFTYPE_AP) { ++ local->fif_pspoll--; ++ local->fif_probe_req--; ++ } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { ++ local->fif_probe_req--; ++ } ++ ++ if (sdata->dev) { ++ netif_addr_lock_bh(sdata->dev); ++ spin_lock_bh(&local->filter_lock); ++ __hw_addr_unsync(&local->mc_list, &sdata->dev->mc, ++ sdata->dev->addr_len); ++ spin_unlock_bh(&local->filter_lock); ++ netif_addr_unlock_bh(sdata->dev); ++ } ++ ++ del_timer_sync(&local->dynamic_ps_timer); ++ cancel_work_sync(&local->dynamic_ps_enable_work); ++ ++ cancel_work_sync(&sdata->recalc_smps); ++ sdata_lock(sdata); ++ mutex_lock(&local->mtx); ++ sdata->vif.csa_active = false; ++ if (sdata->vif.type == NL80211_IFTYPE_STATION) ++ sdata->u.mgd.csa_waiting_bcn = false; ++ if (sdata->csa_block_tx) { ++ ieee80211_wake_vif_queues(local, sdata, ++ IEEE80211_QUEUE_STOP_REASON_CSA); ++ sdata->csa_block_tx = false; ++ } ++ mutex_unlock(&local->mtx); ++ sdata_unlock(sdata); ++ ++ cancel_work_sync(&sdata->csa_finalize_work); ++ ++ cancel_delayed_work_sync(&sdata->dfs_cac_timer_work); ++ ++ if (sdata->wdev.cac_started) { ++ chandef = sdata->vif.bss_conf.chandef; ++ WARN_ON(local->suspended); ++ mutex_lock(&local->mtx); ++ ieee80211_vif_release_channel(sdata); ++ mutex_unlock(&local->mtx); ++ cfg80211_cac_event(sdata->dev, &chandef, ++ NL80211_RADAR_CAC_ABORTED, ++ GFP_KERNEL); ++ } ++ ++ /* APs need special treatment */ ++ if (sdata->vif.type == NL80211_IFTYPE_AP) { ++ struct ieee80211_sub_if_data *vlan, *tmpsdata; ++ ++ /* down all dependent devices, that is VLANs */ ++ list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans, ++ u.vlan.list) ++ dev_close(vlan->dev); ++ WARN_ON(!list_empty(&sdata->u.ap.vlans)); ++ } else if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { ++ /* remove all packets in parent bc_buf pointing to this dev */ ++ ps = &sdata->bss->ps; ++ ++ spin_lock_irqsave(&ps->bc_buf.lock, flags); ++ skb_queue_walk_safe(&ps->bc_buf, skb, tmp) { ++ if (skb->dev == sdata->dev) { ++ __skb_unlink(skb, &ps->bc_buf); ++ local->total_ps_buffered--; ++ ieee80211_free_txskb(&local->hw, skb); ++ } ++ } ++ spin_unlock_irqrestore(&ps->bc_buf.lock, flags); ++ } ++ ++ if (going_down) ++ local->open_count--; ++ ++ switch (sdata->vif.type) { ++ case NL80211_IFTYPE_AP_VLAN: ++ mutex_lock(&local->mtx); ++ list_del(&sdata->u.vlan.list); ++ mutex_unlock(&local->mtx); ++ RCU_INIT_POINTER(sdata->vif.chanctx_conf, NULL); ++ /* see comment in the default case below */ ++ ieee80211_free_keys(sdata, true); ++ /* no need to tell driver */ ++ break; ++ case NL80211_IFTYPE_MONITOR: ++ if (sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES) { ++ local->cooked_mntrs--; ++ break; ++ } ++ ++ local->monitors--; ++ if (local->monitors == 0) { ++ local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR; ++ hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR; ++ } ++ ++ ieee80211_adjust_monitor_flags(sdata, -1); ++ break; ++ case NL80211_IFTYPE_NAN: ++ /* clean all the functions */ ++ spin_lock_bh(&sdata->u.nan.func_lock); ++ ++ idr_for_each_entry(&sdata->u.nan.function_inst_ids, func, i) { ++ idr_remove(&sdata->u.nan.function_inst_ids, i); ++ cfg80211_free_nan_func(func); ++ } ++ idr_destroy(&sdata->u.nan.function_inst_ids); ++ ++ spin_unlock_bh(&sdata->u.nan.func_lock); ++ break; ++ case NL80211_IFTYPE_P2P_DEVICE: ++ /* relies on synchronize_rcu() below */ ++ RCU_INIT_POINTER(local->p2p_sdata, NULL); ++ /* fall through */ ++ default: ++ cancel_work_sync(&sdata->work); ++ /* ++ * When we get here, the interface is marked down. ++ * Free the remaining keys, if there are any ++ * (which can happen in AP mode if userspace sets ++ * keys before the interface is operating, and maybe ++ * also in WDS mode) ++ * ++ * Force the key freeing to always synchronize_net() ++ * to wait for the RX path in case it is using this ++ * interface enqueuing frames at this very time on ++ * another CPU. ++ */ ++ ieee80211_free_keys(sdata, true); ++ skb_queue_purge(&sdata->skb_queue); ++ } ++ ++ spin_lock_irqsave(&local->queue_stop_reason_lock, flags); ++ for (i = 0; i < IEEE80211_MAX_QUEUES; i++) { ++ skb_queue_walk_safe(&local->pending[i], skb, tmp) { ++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ if (info->control.vif == &sdata->vif) { ++ __skb_unlink(skb, &local->pending[i]); ++ ieee80211_free_txskb(&local->hw, skb); ++ } ++ } ++ } ++ spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); ++ ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) ++ ieee80211_txq_remove_vlan(local, sdata); ++ ++ sdata->bss = NULL; ++ ++ if (local->open_count == 0) ++ ieee80211_clear_tx_pending(local); ++ ++ sdata->vif.bss_conf.beacon_int = 0; ++ ++ /* ++ * If the interface goes down while suspended, presumably because ++ * the device was unplugged and that happens before our resume, ++ * then the driver is already unconfigured and the remainder of ++ * this function isn't needed. ++ * XXX: what about WoWLAN? If the device has software state, e.g. ++ * memory allocated, it might expect teardown commands from ++ * mac80211 here? ++ */ ++ if (local->suspended) { ++ WARN_ON(local->wowlan); ++ WARN_ON(rtnl_dereference(local->monitor_sdata)); ++ return; ++ } ++ ++ switch (sdata->vif.type) { ++ case NL80211_IFTYPE_AP_VLAN: ++ break; ++ case NL80211_IFTYPE_MONITOR: ++ if (local->monitors == 0) ++ ieee80211_del_virtual_monitor(local); ++ ++ mutex_lock(&local->mtx); ++ ieee80211_recalc_idle(local); ++ mutex_unlock(&local->mtx); ++ ++ if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) ++ break; ++ ++ /* fall through */ ++ default: ++ if (going_down) ++ drv_remove_interface(local, sdata); ++ } ++ ++ ieee80211_recalc_ps(local); ++ ++ if (cancel_scan) ++ flush_delayed_work(&local->scan_work); ++ ++ if (local->open_count == 0) { ++ ieee80211_stop_device(local); ++ ++ /* no reconfiguring after stop! */ ++ return; ++ } ++ ++ /* do after stop to avoid reconfiguring when we stop anyway */ ++ ieee80211_configure_filter(local); ++ ieee80211_hw_config(local, hw_reconf_flags); ++ ++ if (local->monitors == local->open_count) ++ ieee80211_add_virtual_monitor(local); ++} ++ ++static int ieee80211_stop(struct net_device *dev) ++{ ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); ++ ++ ieee80211_do_stop(sdata, true); ++ ++ return 0; ++} ++ ++static void ieee80211_set_multicast_list(struct net_device *dev) ++{ ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); ++ struct ieee80211_local *local = sdata->local; ++ int allmulti, sdata_allmulti; ++ ++ allmulti = !!(dev->flags & IFF_ALLMULTI); ++ sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI); ++ ++ if (allmulti != sdata_allmulti) { ++ if (dev->flags & IFF_ALLMULTI) ++ atomic_inc(&local->iff_allmultis); ++ else ++ atomic_dec(&local->iff_allmultis); ++ sdata->flags ^= IEEE80211_SDATA_ALLMULTI; ++ } ++ ++ spin_lock_bh(&local->filter_lock); ++ __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len); ++ spin_unlock_bh(&local->filter_lock); ++ ieee80211_queue_work(&local->hw, &local->reconfig_filter); ++} ++ ++/* ++ * Called when the netdev is removed or, by the code below, before ++ * the interface type changes. ++ */ ++static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata) ++{ ++ int i; ++ ++ /* free extra data */ ++ ieee80211_free_keys(sdata, false); ++ ++ ieee80211_debugfs_remove_netdev(sdata); ++ ++ for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) ++ __skb_queue_purge(&sdata->fragments[i].skb_list); ++ sdata->fragment_next = 0; ++ ++ if (ieee80211_vif_is_mesh(&sdata->vif)) ++ ieee80211_mesh_teardown_sdata(sdata); ++} ++ ++static void ieee80211_uninit(struct net_device *dev) ++{ ++ ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev)); ++} ++ ++#if LINUX_VERSION_IS_GEQ(5,2,0) ++static u16 ieee80211_netdev_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ struct net_device *sb_dev) ++#elif LINUX_VERSION_IS_GEQ(4,19,0) ++static u16 ieee80211_netdev_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ struct net_device *sb_dev, ++ select_queue_fallback_t fallback) ++#elif LINUX_VERSION_IS_GEQ(3,14,0) || \ ++ (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI > 30) ++static u16 ieee80211_netdev_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ void *accel_priv, ++ select_queue_fallback_t fallback) ++#elif LINUX_VERSION_IS_GEQ(3,13,0) ++static u16 ieee80211_netdev_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ void *accel_priv) ++#else ++static u16 ieee80211_netdev_select_queue(struct net_device *dev, ++ struct sk_buff *skb) ++#endif ++{ ++ return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); ++} ++ ++static void ++ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) ++{ ++ int i; ++ ++ for_each_possible_cpu(i) { ++ const struct pcpu_sw_netstats *tstats; ++ u64 rx_packets, rx_bytes, tx_packets, tx_bytes; ++ unsigned int start; ++ ++ tstats = per_cpu_ptr(netdev_tstats(dev), i); ++ ++ do { ++ start = u64_stats_fetch_begin_irq(&tstats->syncp); ++ rx_packets = tstats->rx_packets; ++ tx_packets = tstats->tx_packets; ++ rx_bytes = tstats->rx_bytes; ++ tx_bytes = tstats->tx_bytes; ++ } while (u64_stats_fetch_retry_irq(&tstats->syncp, start)); ++ ++ stats->rx_packets += rx_packets; ++ stats->tx_packets += tx_packets; ++ stats->rx_bytes += rx_bytes; ++ stats->tx_bytes += tx_bytes; ++ } ++} ++#if LINUX_VERSION_IS_LESS(4,11,0) ++/* Just declare it here to keep sparse happy */ ++struct rtnl_link_stats64 *bp_ieee80211_get_stats64(struct net_device *dev, ++ struct rtnl_link_stats64 *stats); ++struct rtnl_link_stats64 * ++bp_ieee80211_get_stats64(struct net_device *dev, ++ struct rtnl_link_stats64 *stats){ ++ ieee80211_get_stats64(dev, stats); ++ return stats; ++} ++#endif ++ ++static const struct net_device_ops ieee80211_dataif_ops = { ++ .ndo_open = ieee80211_open, ++ .ndo_stop = ieee80211_stop, ++ .ndo_uninit = ieee80211_uninit, ++ .ndo_start_xmit = ieee80211_subif_start_xmit, ++ .ndo_set_rx_mode = ieee80211_set_multicast_list, ++ .ndo_set_mac_address = ieee80211_change_mac, ++ .ndo_select_queue = ieee80211_netdev_select_queue, ++#if LINUX_VERSION_IS_GEQ(4,11,0) ++ .ndo_get_stats64 = ieee80211_get_stats64, ++#else ++ .ndo_get_stats64 = bp_ieee80211_get_stats64, ++#endif ++ ++}; ++ ++#if LINUX_VERSION_IS_GEQ(5,2,0) ++static u16 ieee80211_monitor_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ struct net_device *sb_dev) ++#elif LINUX_VERSION_IS_GEQ(4,19,0) ++static u16 ieee80211_monitor_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ struct net_device *sb_dev, ++ select_queue_fallback_t fallback) ++#elif LINUX_VERSION_IS_GEQ(3,14,0) || \ ++ (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI > 30) ++static u16 ieee80211_monitor_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ void *accel_priv, ++ select_queue_fallback_t fallback) ++#elif LINUX_VERSION_IS_GEQ(3,13,0) ++static u16 ieee80211_monitor_select_queue(struct net_device *dev, ++ struct sk_buff *skb, ++ void *accel_priv) ++#else ++static u16 ieee80211_monitor_select_queue(struct net_device *dev, ++ struct sk_buff *skb) ++#endif ++{ ++ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); ++ struct ieee80211_local *local = sdata->local; ++ struct ieee80211_hdr *hdr; ++ struct ieee80211_radiotap_header *rtap = (void *)skb->data; ++ ++ if (local->hw.queues < IEEE80211_NUM_ACS) ++ return 0; ++ ++ if (skb->len < 4 || ++ skb->len < le16_to_cpu(rtap->it_len) + 2 /* frame control */) ++ return 0; /* doesn't matter, frame will be dropped */ ++ ++ hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len)); ++ ++ return ieee80211_select_queue_80211(sdata, skb, hdr); ++} ++ ++static const struct net_device_ops ieee80211_monitorif_ops = { ++ .ndo_open = ieee80211_open, ++ .ndo_stop = ieee80211_stop, ++ .ndo_uninit = ieee80211_uninit, ++ .ndo_start_xmit = ieee80211_monitor_start_xmit, ++ .ndo_set_rx_mode = ieee80211_set_multicast_list, ++ .ndo_set_mac_address = ieee80211_change_mac, ++ .ndo_select_queue = ieee80211_monitor_select_queue, ++#if LINUX_VERSION_IS_GEQ(4,11,0) ++ .ndo_get_stats64 = ieee80211_get_stats64, ++#else ++ .ndo_get_stats64 = bp_ieee80211_get_stats64, ++#endif ++ ++}; ++ ++static const struct net_device_ops ieee80211_dataif_8023_ops = { ++ .ndo_open = ieee80211_open, ++ .ndo_stop = ieee80211_stop, ++ .ndo_uninit = ieee80211_uninit, ++ .ndo_start_xmit = ieee80211_subif_start_xmit_8023, ++ .ndo_set_rx_mode = ieee80211_set_multicast_list, ++ .ndo_set_mac_address = ieee80211_change_mac, ++ .ndo_select_queue = ieee80211_netdev_select_queue, ++#if LINUX_VERSION_IS_GEQ(4,11,0) ++ .ndo_get_stats64 = ieee80211_get_stats64, ++#else ++ .ndo_get_stats64 = bp_ieee80211_get_stats64, ++#endif ++ ++}; ++ + static bool ieee80211_iftype_supports_encap_offload(enum nl80211_iftype iftype) + { + switch (iftype) { +@@ -389,6 +893,31 @@ static bool ieee80211_set_sdata_offload_ + return true; + } + ++static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata) ++{ ++ struct ieee80211_local *local = sdata->local; ++ struct ieee80211_sub_if_data *bss = sdata; ++ bool enabled; ++ ++ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { ++ if (!sdata->bss) ++ return; ++ ++ bss = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap); ++ } ++ ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) || ++ !ieee80211_iftype_supports_encap_offload(bss->vif.type)) ++ return; ++ ++ enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ if (sdata->wdev.use_4addr && ++ !(bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_4ADDR)) ++ enabled = false; ++ ++ sdata->dev->netdev_ops = enabled ? &ieee80211_dataif_8023_ops : ++ &ieee80211_dataif_ops; ++} + + static void ieee80211_recalc_sdata_offload(struct ieee80211_sub_if_data *sdata) + { +@@ -866,511 +1395,6 @@ int ieee80211_do_open(struct wireless_de + return res; + } + +-static int ieee80211_open(struct net_device *dev) +-{ +- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +- int err; +- +- /* fail early if user set an invalid address */ +- if (!is_valid_ether_addr(dev->dev_addr)) +- return -EADDRNOTAVAIL; +- +- err = ieee80211_check_concurrent_iface(sdata, sdata->vif.type); +- if (err) +- return err; +- +- return ieee80211_do_open(&sdata->wdev, true); +-} +- +-static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, +- bool going_down) +-{ +- struct ieee80211_local *local = sdata->local; +- unsigned long flags; +- struct sk_buff *skb, *tmp; +- u32 hw_reconf_flags = 0; +- int i, flushed; +- struct ps_data *ps; +- struct cfg80211_chan_def chandef; +- bool cancel_scan; +- struct cfg80211_nan_func *func; +- +- clear_bit(SDATA_STATE_RUNNING, &sdata->state); +- +- cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; +- if (cancel_scan) +- ieee80211_scan_cancel(local); +- +- /* +- * Stop TX on this interface first. +- */ +- if (sdata->dev) +- netif_tx_stop_all_queues(sdata->dev); +- +- ieee80211_roc_purge(local, sdata); +- +- switch (sdata->vif.type) { +- case NL80211_IFTYPE_STATION: +- ieee80211_mgd_stop(sdata); +- break; +- case NL80211_IFTYPE_ADHOC: +- ieee80211_ibss_stop(sdata); +- break; +- case NL80211_IFTYPE_MONITOR: +- if (sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES) +- break; +- list_del_rcu(&sdata->u.mntr.list); +- break; +- default: +- break; +- } +- +- /* +- * Remove all stations associated with this interface. +- * +- * This must be done before calling ops->remove_interface() +- * because otherwise we can later invoke ops->sta_notify() +- * whenever the STAs are removed, and that invalidates driver +- * assumptions about always getting a vif pointer that is valid +- * (because if we remove a STA after ops->remove_interface() +- * the driver will have removed the vif info already!) +- * +- * In WDS mode a station must exist here and be flushed, for +- * AP_VLANs stations may exist since there's nothing else that +- * would have removed them, but in other modes there shouldn't +- * be any stations. +- */ +- flushed = sta_info_flush(sdata); +- WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP_VLAN && +- ((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) || +- (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1))); +- +- /* don't count this interface for allmulti while it is down */ +- if (sdata->flags & IEEE80211_SDATA_ALLMULTI) +- atomic_dec(&local->iff_allmultis); +- +- if (sdata->vif.type == NL80211_IFTYPE_AP) { +- local->fif_pspoll--; +- local->fif_probe_req--; +- } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { +- local->fif_probe_req--; +- } +- +- if (sdata->dev) { +- netif_addr_lock_bh(sdata->dev); +- spin_lock_bh(&local->filter_lock); +- __hw_addr_unsync(&local->mc_list, &sdata->dev->mc, +- sdata->dev->addr_len); +- spin_unlock_bh(&local->filter_lock); +- netif_addr_unlock_bh(sdata->dev); +- } +- +- del_timer_sync(&local->dynamic_ps_timer); +- cancel_work_sync(&local->dynamic_ps_enable_work); +- +- cancel_work_sync(&sdata->recalc_smps); +- sdata_lock(sdata); +- mutex_lock(&local->mtx); +- sdata->vif.csa_active = false; +- if (sdata->vif.type == NL80211_IFTYPE_STATION) +- sdata->u.mgd.csa_waiting_bcn = false; +- if (sdata->csa_block_tx) { +- ieee80211_wake_vif_queues(local, sdata, +- IEEE80211_QUEUE_STOP_REASON_CSA); +- sdata->csa_block_tx = false; +- } +- mutex_unlock(&local->mtx); +- sdata_unlock(sdata); +- +- cancel_work_sync(&sdata->csa_finalize_work); +- +- cancel_delayed_work_sync(&sdata->dfs_cac_timer_work); +- +- if (sdata->wdev.cac_started) { +- chandef = sdata->vif.bss_conf.chandef; +- WARN_ON(local->suspended); +- mutex_lock(&local->mtx); +- ieee80211_vif_release_channel(sdata); +- mutex_unlock(&local->mtx); +- cfg80211_cac_event(sdata->dev, &chandef, +- NL80211_RADAR_CAC_ABORTED, +- GFP_KERNEL); +- } +- +- /* APs need special treatment */ +- if (sdata->vif.type == NL80211_IFTYPE_AP) { +- struct ieee80211_sub_if_data *vlan, *tmpsdata; +- +- /* down all dependent devices, that is VLANs */ +- list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans, +- u.vlan.list) +- dev_close(vlan->dev); +- WARN_ON(!list_empty(&sdata->u.ap.vlans)); +- } else if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +- /* remove all packets in parent bc_buf pointing to this dev */ +- ps = &sdata->bss->ps; +- +- spin_lock_irqsave(&ps->bc_buf.lock, flags); +- skb_queue_walk_safe(&ps->bc_buf, skb, tmp) { +- if (skb->dev == sdata->dev) { +- __skb_unlink(skb, &ps->bc_buf); +- local->total_ps_buffered--; +- ieee80211_free_txskb(&local->hw, skb); +- } +- } +- spin_unlock_irqrestore(&ps->bc_buf.lock, flags); +- } +- +- if (going_down) +- local->open_count--; +- +- switch (sdata->vif.type) { +- case NL80211_IFTYPE_AP_VLAN: +- mutex_lock(&local->mtx); +- list_del(&sdata->u.vlan.list); +- mutex_unlock(&local->mtx); +- RCU_INIT_POINTER(sdata->vif.chanctx_conf, NULL); +- /* see comment in the default case below */ +- ieee80211_free_keys(sdata, true); +- /* no need to tell driver */ +- break; +- case NL80211_IFTYPE_MONITOR: +- if (sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES) { +- local->cooked_mntrs--; +- break; +- } +- +- local->monitors--; +- if (local->monitors == 0) { +- local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR; +- hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR; +- } +- +- ieee80211_adjust_monitor_flags(sdata, -1); +- break; +- case NL80211_IFTYPE_NAN: +- /* clean all the functions */ +- spin_lock_bh(&sdata->u.nan.func_lock); +- +- idr_for_each_entry(&sdata->u.nan.function_inst_ids, func, i) { +- idr_remove(&sdata->u.nan.function_inst_ids, i); +- cfg80211_free_nan_func(func); +- } +- idr_destroy(&sdata->u.nan.function_inst_ids); +- +- spin_unlock_bh(&sdata->u.nan.func_lock); +- break; +- case NL80211_IFTYPE_P2P_DEVICE: +- /* relies on synchronize_rcu() below */ +- RCU_INIT_POINTER(local->p2p_sdata, NULL); +- /* fall through */ +- default: +- cancel_work_sync(&sdata->work); +- /* +- * When we get here, the interface is marked down. +- * Free the remaining keys, if there are any +- * (which can happen in AP mode if userspace sets +- * keys before the interface is operating, and maybe +- * also in WDS mode) +- * +- * Force the key freeing to always synchronize_net() +- * to wait for the RX path in case it is using this +- * interface enqueuing frames at this very time on +- * another CPU. +- */ +- ieee80211_free_keys(sdata, true); +- skb_queue_purge(&sdata->skb_queue); +- } +- +- spin_lock_irqsave(&local->queue_stop_reason_lock, flags); +- for (i = 0; i < IEEE80211_MAX_QUEUES; i++) { +- skb_queue_walk_safe(&local->pending[i], skb, tmp) { +- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +- if (info->control.vif == &sdata->vif) { +- __skb_unlink(skb, &local->pending[i]); +- ieee80211_free_txskb(&local->hw, skb); +- } +- } +- } +- spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); +- +- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) +- ieee80211_txq_remove_vlan(local, sdata); +- +- sdata->bss = NULL; +- +- if (local->open_count == 0) +- ieee80211_clear_tx_pending(local); +- +- sdata->vif.bss_conf.beacon_int = 0; +- +- /* +- * If the interface goes down while suspended, presumably because +- * the device was unplugged and that happens before our resume, +- * then the driver is already unconfigured and the remainder of +- * this function isn't needed. +- * XXX: what about WoWLAN? If the device has software state, e.g. +- * memory allocated, it might expect teardown commands from +- * mac80211 here? +- */ +- if (local->suspended) { +- WARN_ON(local->wowlan); +- WARN_ON(rtnl_dereference(local->monitor_sdata)); +- return; +- } +- +- switch (sdata->vif.type) { +- case NL80211_IFTYPE_AP_VLAN: +- break; +- case NL80211_IFTYPE_MONITOR: +- if (local->monitors == 0) +- ieee80211_del_virtual_monitor(local); +- +- mutex_lock(&local->mtx); +- ieee80211_recalc_idle(local); +- mutex_unlock(&local->mtx); +- +- if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) +- break; +- +- /* fall through */ +- default: +- if (going_down) +- drv_remove_interface(local, sdata); +- } +- +- ieee80211_recalc_ps(local); +- +- if (cancel_scan) +- flush_delayed_work(&local->scan_work); +- +- if (local->open_count == 0) { +- ieee80211_stop_device(local); +- +- /* no reconfiguring after stop! */ +- return; +- } +- +- /* do after stop to avoid reconfiguring when we stop anyway */ +- ieee80211_configure_filter(local); +- ieee80211_hw_config(local, hw_reconf_flags); +- +- if (local->monitors == local->open_count) +- ieee80211_add_virtual_monitor(local); +-} +- +-static int ieee80211_stop(struct net_device *dev) +-{ +- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +- +- ieee80211_do_stop(sdata, true); +- +- return 0; +-} +- +-static void ieee80211_set_multicast_list(struct net_device *dev) +-{ +- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +- struct ieee80211_local *local = sdata->local; +- int allmulti, sdata_allmulti; +- +- allmulti = !!(dev->flags & IFF_ALLMULTI); +- sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI); +- +- if (allmulti != sdata_allmulti) { +- if (dev->flags & IFF_ALLMULTI) +- atomic_inc(&local->iff_allmultis); +- else +- atomic_dec(&local->iff_allmultis); +- sdata->flags ^= IEEE80211_SDATA_ALLMULTI; +- } +- +- spin_lock_bh(&local->filter_lock); +- __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len); +- spin_unlock_bh(&local->filter_lock); +- ieee80211_queue_work(&local->hw, &local->reconfig_filter); +-} +- +-/* +- * Called when the netdev is removed or, by the code below, before +- * the interface type changes. +- */ +-static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata) +-{ +- int i; +- +- /* free extra data */ +- ieee80211_free_keys(sdata, false); +- +- ieee80211_debugfs_remove_netdev(sdata); +- +- for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) +- __skb_queue_purge(&sdata->fragments[i].skb_list); +- sdata->fragment_next = 0; +- +- if (ieee80211_vif_is_mesh(&sdata->vif)) +- ieee80211_mesh_teardown_sdata(sdata); +-} +- +-static void ieee80211_uninit(struct net_device *dev) +-{ +- ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev)); +-} +- +-#if LINUX_VERSION_IS_GEQ(5,2,0) +-static u16 ieee80211_netdev_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- struct net_device *sb_dev) +-#elif LINUX_VERSION_IS_GEQ(4,19,0) +-static u16 ieee80211_netdev_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- struct net_device *sb_dev, +- select_queue_fallback_t fallback) +-#elif LINUX_VERSION_IS_GEQ(3,14,0) || \ +- (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI > 30) +-static u16 ieee80211_netdev_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- void *accel_priv, +- select_queue_fallback_t fallback) +-#elif LINUX_VERSION_IS_GEQ(3,13,0) +-static u16 ieee80211_netdev_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- void *accel_priv) +-#else +-static u16 ieee80211_netdev_select_queue(struct net_device *dev, +- struct sk_buff *skb) +-#endif +-{ +- return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); +-} +- +-static void +-ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) +-{ +- int i; +- +- for_each_possible_cpu(i) { +- const struct pcpu_sw_netstats *tstats; +- u64 rx_packets, rx_bytes, tx_packets, tx_bytes; +- unsigned int start; +- +- tstats = per_cpu_ptr(netdev_tstats(dev), i); +- +- do { +- start = u64_stats_fetch_begin_irq(&tstats->syncp); +- rx_packets = tstats->rx_packets; +- tx_packets = tstats->tx_packets; +- rx_bytes = tstats->rx_bytes; +- tx_bytes = tstats->tx_bytes; +- } while (u64_stats_fetch_retry_irq(&tstats->syncp, start)); +- +- stats->rx_packets += rx_packets; +- stats->tx_packets += tx_packets; +- stats->rx_bytes += rx_bytes; +- stats->tx_bytes += tx_bytes; +- } +-} +-#if LINUX_VERSION_IS_LESS(4,11,0) +-/* Just declare it here to keep sparse happy */ +-struct rtnl_link_stats64 *bp_ieee80211_get_stats64(struct net_device *dev, +- struct rtnl_link_stats64 *stats); +-struct rtnl_link_stats64 * +-bp_ieee80211_get_stats64(struct net_device *dev, +- struct rtnl_link_stats64 *stats){ +- ieee80211_get_stats64(dev, stats); +- return stats; +-} +-#endif +- +-static const struct net_device_ops ieee80211_dataif_ops = { +- .ndo_open = ieee80211_open, +- .ndo_stop = ieee80211_stop, +- .ndo_uninit = ieee80211_uninit, +- .ndo_start_xmit = ieee80211_subif_start_xmit, +- .ndo_set_rx_mode = ieee80211_set_multicast_list, +- .ndo_set_mac_address = ieee80211_change_mac, +- .ndo_select_queue = ieee80211_netdev_select_queue, +-#if LINUX_VERSION_IS_GEQ(4,11,0) +- .ndo_get_stats64 = ieee80211_get_stats64, +-#else +- .ndo_get_stats64 = bp_ieee80211_get_stats64, +-#endif +- +-}; +- +-#if LINUX_VERSION_IS_GEQ(5,2,0) +-static u16 ieee80211_monitor_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- struct net_device *sb_dev) +-#elif LINUX_VERSION_IS_GEQ(4,19,0) +-static u16 ieee80211_monitor_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- struct net_device *sb_dev, +- select_queue_fallback_t fallback) +-#elif LINUX_VERSION_IS_GEQ(3,14,0) || \ +- (LINUX_VERSION_CODE == KERNEL_VERSION(3,13,11) && UTS_UBUNTU_RELEASE_ABI > 30) +-static u16 ieee80211_monitor_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- void *accel_priv, +- select_queue_fallback_t fallback) +-#elif LINUX_VERSION_IS_GEQ(3,13,0) +-static u16 ieee80211_monitor_select_queue(struct net_device *dev, +- struct sk_buff *skb, +- void *accel_priv) +-#else +-static u16 ieee80211_monitor_select_queue(struct net_device *dev, +- struct sk_buff *skb) +-#endif +-{ +- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_hdr *hdr; +- struct ieee80211_radiotap_header *rtap = (void *)skb->data; +- +- if (local->hw.queues < IEEE80211_NUM_ACS) +- return 0; +- +- if (skb->len < 4 || +- skb->len < le16_to_cpu(rtap->it_len) + 2 /* frame control */) +- return 0; /* doesn't matter, frame will be dropped */ +- +- hdr = (void *)((u8 *)skb->data + le16_to_cpu(rtap->it_len)); +- +- return ieee80211_select_queue_80211(sdata, skb, hdr); +-} +- +-static const struct net_device_ops ieee80211_monitorif_ops = { +- .ndo_open = ieee80211_open, +- .ndo_stop = ieee80211_stop, +- .ndo_uninit = ieee80211_uninit, +- .ndo_start_xmit = ieee80211_monitor_start_xmit, +- .ndo_set_rx_mode = ieee80211_set_multicast_list, +- .ndo_set_mac_address = ieee80211_change_mac, +- .ndo_select_queue = ieee80211_monitor_select_queue, +-#if LINUX_VERSION_IS_GEQ(4,11,0) +- .ndo_get_stats64 = ieee80211_get_stats64, +-#else +- .ndo_get_stats64 = bp_ieee80211_get_stats64, +-#endif +- +-}; +- +-static const struct net_device_ops ieee80211_dataif_8023_ops = { +- .ndo_open = ieee80211_open, +- .ndo_stop = ieee80211_stop, +- .ndo_uninit = ieee80211_uninit, +- .ndo_start_xmit = ieee80211_subif_start_xmit_8023, +- .ndo_set_rx_mode = ieee80211_set_multicast_list, +- .ndo_set_mac_address = ieee80211_change_mac, +- .ndo_select_queue = ieee80211_netdev_select_queue, +-#if LINUX_VERSION_IS_GEQ(4,11,0) +- .ndo_get_stats64 = ieee80211_get_stats64, +-#else +- .ndo_get_stats64 = bp_ieee80211_get_stats64, +-#endif +- +-}; +- + static void ieee80211_if_free(struct net_device *dev) + { + free_percpu(netdev_tstats(dev)); +@@ -1401,32 +1425,6 @@ static void ieee80211_if_setup_no_queue( + #endif + } + +-static void ieee80211_set_vif_encap_ops(struct ieee80211_sub_if_data *sdata) +-{ +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_sub_if_data *bss = sdata; +- bool enabled; +- +- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { +- if (!sdata->bss) +- return; +- +- bss = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap); +- } +- +- if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) || +- !ieee80211_iftype_supports_encap_offload(bss->vif.type)) +- return; +- +- enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED; +- if (sdata->wdev.use_4addr && +- !(bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_4ADDR)) +- enabled = false; +- +- sdata->dev->netdev_ops = enabled ? &ieee80211_dataif_8023_ops : +- &ieee80211_dataif_ops; +-} +- + static void ieee80211_iface_work(struct work_struct *work) + { + struct ieee80211_sub_if_data *sdata = diff --git a/package/kernel/mac80211/patches/subsys/328-mac80211-extend-AQL-aggregation-estimation-to-HE-and.patch b/package/kernel/mac80211/patches/subsys/328-mac80211-extend-AQL-aggregation-estimation-to-HE-and.patch new file mode 100644 index 000000000..3d687f834 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/328-mac80211-extend-AQL-aggregation-estimation-to-HE-and.patch @@ -0,0 +1,49 @@ +From: Felix Fietkau +Date: Thu, 27 Aug 2020 12:44:36 +0200 +Subject: [PATCH] mac80211: extend AQL aggregation estimation to HE and fix + unit mismatch + +The unit of the return value of ieee80211_get_rate_duration is nanoseconds, not +milliseconds. Adjust the duration checks to account for that. +For higher data rates, allow larger estimated aggregation sizes, and add some +values for HE as well, which can use much larger aggregates. +Since small packets with high data rates can now lead to duration values too +small for info->tx_time_est, return a minimum of 4us. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/airtime.c ++++ b/net/mac80211/airtime.c +@@ -668,20 +668,26 @@ u32 ieee80211_calc_expected_tx_airtime(s + * This will not be very accurate, but much better than simply + * assuming un-aggregated tx in all cases. + */ +- if (duration > 400) /* <= VHT20 MCS2 1S */ ++ if (duration > 400 * 1024) /* <= VHT20 MCS2 1S */ + agg_shift = 1; +- else if (duration > 250) /* <= VHT20 MCS3 1S or MCS1 2S */ ++ else if (duration > 250 * 1024) /* <= VHT20 MCS3 1S or MCS1 2S */ + agg_shift = 2; +- else if (duration > 150) /* <= VHT20 MCS5 1S or MCS3 2S */ ++ else if (duration > 150 * 1024) /* <= VHT20 MCS5 1S or MCS2 2S */ + agg_shift = 3; +- else ++ else if (duration > 70 * 1024) /* <= VHT20 MCS5 2S */ + agg_shift = 4; ++ else if (stat.encoding != RX_ENC_HE || ++ duration > 20 * 1024) /* <= HE40 MCS6 2S */ ++ agg_shift = 5; ++ else ++ agg_shift = 6; + + duration *= len; + duration /= AVG_PKT_SIZE; + duration /= 1024; ++ duration += (overhead >> agg_shift); + +- return duration + (overhead >> agg_shift); ++ return max_t(u32, duration, 4); + } + + if (!conf) diff --git a/package/kernel/mac80211/patches/subsys/329-mac80211-add-AQL-support-for-VHT160-tx-rates.patch b/package/kernel/mac80211/patches/subsys/329-mac80211-add-AQL-support-for-VHT160-tx-rates.patch new file mode 100644 index 000000000..e22a09e71 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/329-mac80211-add-AQL-support-for-VHT160-tx-rates.patch @@ -0,0 +1,23 @@ +From: Felix Fietkau +Date: Thu, 27 Aug 2020 12:47:48 +0200 +Subject: [PATCH] mac80211: add AQL support for VHT160 tx rates + +When converting from struct ieee80211_tx_rate to ieee80211_rx_status, +there was one check missing to fill in the bandwidth for 160 MHz + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/airtime.c ++++ b/net/mac80211/airtime.c +@@ -560,7 +560,9 @@ static int ieee80211_fill_rx_status(stru + if (rate->idx < 0 || !rate->count) + return -1; + +- if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH) ++ if (rate->flags & IEEE80211_TX_RC_160_MHZ_WIDTH) ++ stat->bw = RATE_INFO_BW_160; ++ else if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH) + stat->bw = RATE_INFO_BW_80; + else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) + stat->bw = RATE_INFO_BW_40; diff --git a/package/kernel/mac80211/patches/subsys/330-mac80211-allow-bigger-A-MSDU-sizes-in-VHT-even-if-HT.patch b/package/kernel/mac80211/patches/subsys/330-mac80211-allow-bigger-A-MSDU-sizes-in-VHT-even-if-HT.patch new file mode 100644 index 000000000..b67030d13 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/330-mac80211-allow-bigger-A-MSDU-sizes-in-VHT-even-if-HT.patch @@ -0,0 +1,26 @@ +From: Felix Fietkau +Date: Wed, 16 Sep 2020 18:43:46 +0200 +Subject: [PATCH] mac80211: allow bigger A-MSDU sizes in VHT, even if HT is + limited + +Some APs (e.g. Asus RT-AC88U) have been observed to report an HT MSDU size +limit of 3839 and a VHT limit of 7991. These APs can handle bigger frames +than 3839 bytes just fine, so we should remove the VHT limit based on the +HT capabilities. This improves tx throughput. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/vht.c ++++ b/net/mac80211/vht.c +@@ -315,10 +315,6 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(stru + + sta->sta.bandwidth = ieee80211_sta_cur_vht_bw(sta); + +- /* If HT IE reported 3839 bytes only, stay with that size. */ +- if (sta->sta.max_amsdu_len == IEEE80211_MAX_MPDU_LEN_HT_3839) +- return; +- + switch (vht_cap->cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) { + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454: + sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_11454; diff --git a/package/kernel/mac80211/patches/subsys/331-mac80211-do-not-allow-bigger-VHT-MPDUs-than-the-hard.patch b/package/kernel/mac80211/patches/subsys/331-mac80211-do-not-allow-bigger-VHT-MPDUs-than-the-hard.patch new file mode 100644 index 000000000..a799d9625 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/331-mac80211-do-not-allow-bigger-VHT-MPDUs-than-the-hard.patch @@ -0,0 +1,34 @@ +From: Felix Fietkau +Date: Thu, 17 Sep 2020 12:07:19 +0200 +Subject: [PATCH] mac80211: do not allow bigger VHT MPDUs than the hardware + supports + +Limit maximum VHT MPDU size by local capability + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/vht.c ++++ b/net/mac80211/vht.c +@@ -168,10 +168,7 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(stru + /* take some capabilities as-is */ + cap_info = le32_to_cpu(vht_cap_ie->vht_cap_info); + vht_cap->cap = cap_info; +- vht_cap->cap &= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 | +- IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 | +- IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 | +- IEEE80211_VHT_CAP_RXLDPC | ++ vht_cap->cap &= IEEE80211_VHT_CAP_RXLDPC | + IEEE80211_VHT_CAP_VHT_TXOP_PS | + IEEE80211_VHT_CAP_HTC_VHT | + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK | +@@ -180,6 +177,9 @@ ieee80211_vht_cap_ie_to_sta_vht_cap(stru + IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN | + IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN; + ++ vht_cap->cap |= min_t(u32, cap_info & IEEE80211_VHT_CAP_MAX_MPDU_MASK, ++ own_cap.cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK); ++ + /* and some based on our own capabilities */ + switch (own_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) { + case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: diff --git a/package/kernel/mac80211/patches/subsys/332-mac80211-fix-regression-in-sta-connection-monitor.patch b/package/kernel/mac80211/patches/subsys/332-mac80211-fix-regression-in-sta-connection-monitor.patch new file mode 100644 index 000000000..72b6ed56c --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/332-mac80211-fix-regression-in-sta-connection-monitor.patch @@ -0,0 +1,38 @@ +From: Felix Fietkau +Date: Mon, 21 Sep 2020 17:43:06 +0200 +Subject: [PATCH] mac80211: fix regression in sta connection monitor + +When a frame was acked and probe frames were sent, the connection monitoring +needs to be reset, otherwise it will keep probing until the connection is +considered dead, even though frames have been acked in the mean time. + +Fixes: 9abf4e49830d ("mac80211: optimize station connection monitor") +Reported-by: Georgi Valkov +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -1129,6 +1129,8 @@ void ieee80211_tx_status_ext(struct ieee + noack_success = !!(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED); + + if (pubsta) { ++ struct ieee80211_sub_if_data *sdata = sta->sdata; ++ + if (!acked && !noack_success) + sta->status_stats.retry_failed++; + sta->status_stats.retry_count += retry_count; +@@ -1143,6 +1145,13 @@ void ieee80211_tx_status_ext(struct ieee + /* Track when last packet was ACKed */ + sta->status_stats.last_pkt_time = jiffies; + ++ /* Reset connection monitor */ ++ if (sdata->vif.type == NL80211_IFTYPE_STATION && ++ unlikely(sdata->u.mgd.probe_send_count > 0)) { ++ sdata->u.mgd.probe_send_count = 0; ++ ieee80211_queue_work(&local->hw, &sdata->work); ++ } ++ + if (info->status.is_valid_ack_signal) { + sta->status_stats.last_ack_signal = + (s8)info->status.ack_signal; diff --git a/package/kernel/mac80211/patches/subsys/370-mac80211-fix-misplaced-while-instead-of-if.patch b/package/kernel/mac80211/patches/subsys/370-mac80211-fix-misplaced-while-instead-of-if.patch new file mode 100644 index 000000000..38144013f --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/370-mac80211-fix-misplaced-while-instead-of-if.patch @@ -0,0 +1,31 @@ +From 5981fe5b0529ba25d95f37d7faa434183ad618c5 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Mon, 3 Aug 2020 11:02:10 +0200 +Subject: [PATCH] mac80211: fix misplaced while instead of if + +This never was intended to be a 'while' loop, it should've +just been an 'if' instead of 'while'. Fix this. + +I noticed this while applying another patch from Ben that +intended to fix a busy loop at this spot. + +Cc: stable@vger.kernel.org +Fixes: b16798f5b907 ("mac80211: mark station unauthorized before key removal") +Reported-by: Ben Greear +Link: https://lore.kernel.org/r/20200803110209.253009ae41ff.I3522aad099392b31d5cf2dcca34cbac7e5832dde@changeid +Signed-off-by: Johannes Berg +--- + net/mac80211/sta_info.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -1051,7 +1051,7 @@ static void __sta_info_destroy_part2(str + might_sleep(); + lockdep_assert_held(&local->sta_mtx); + +- while (sta->sta_state == IEEE80211_STA_AUTHORIZED) { ++ if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { + ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); + WARN_ON_ONCE(ret); + } diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index 1487e10f4..8db3a758a 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -18,7 +18,7 @@ const u8 *addr); --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1519,6 +1519,7 @@ enum ieee80211_smps_mode { +@@ -1521,6 +1521,7 @@ enum ieee80211_smps_mode { * * @power_level: requested transmit power (in dBm), backward compatibility * value only that is set to the minimum of all interfaces @@ -26,7 +26,7 @@ * * @chandef: the channel definition to tune to * @radar_enabled: whether radar detection is enabled -@@ -1539,6 +1540,7 @@ enum ieee80211_smps_mode { +@@ -1541,6 +1542,7 @@ enum ieee80211_smps_mode { struct ieee80211_conf { u32 flags; int power_level, dynamic_ps_timeout; @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2615,6 +2615,19 @@ static int ieee80211_get_tx_power(struct +@@ -2611,6 +2611,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -4045,6 +4058,7 @@ const struct cfg80211_ops mac80211_confi +@@ -4041,6 +4054,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index 3c935078f..70ed5a934 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -29,8 +29,7 @@ sed -i 's/services/nas/g' /usr/lib/lua/luci/view/minidlna_status.htm ln -sf /sbin/ip /usr/bin/ip -sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf -sed -i 's/http:/https:/g' /etc/opkg/distfeeds.conf +sed -i 's#http://downloads.openwrt.org#https://mirrors.cloud.tencent.com/lede#g' /etc/opkg/distfeeds.conf sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow sed -i "s/# //g" /etc/opkg/distfeeds.conf diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 3aa17b4d3..6966ebdb8 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=4 +PKG_RELEASE:=11 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -68,6 +68,9 @@ CONFIG_VARIANT:=$(LOCAL_VARIANT) ifeq ($(LOCAL_VARIANT),mesh) CONFIG_VARIANT:=full endif +ifeq ($(LOCAL_VARIANT),hs20) + CONFIG_VARIANT:=full +endif include $(INCLUDE_DIR)/package.mk @@ -108,6 +111,10 @@ ifeq ($(SSL_VARIANT),openssl) ifeq ($(LOCAL_VARIANT),full) DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y endif + ifeq ($(LOCAL_VARIANT),hs20) + DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_DPP=y CONFIG_HS20=y CONFIG_INTERWORKING=y + endif + endif ifeq ($(SSL_VARIANT),wolfssl) @@ -168,6 +175,15 @@ endef Package/hostapd-openssl/description = $(Package/hostapd/description) +define Package/hostapd-hs20 +$(call Package/hostapd/Default,$(1)) + TITLE+= (OpenSSL with Hotspot 2.0) + VARIANT:=hs20-openssl + DEPENDS+=+libopenssl +endef + +Package/hostapd-hs20/description = $(Package/hostapd/description) + define Package/hostapd-wolfssl $(call Package/hostapd/Default,$(1)) TITLE+= (wolfSSL full) @@ -453,7 +469,9 @@ define Build/Configure $(if $(wildcard ./files/hostapd-$(CONFIG_VARIANT).config), \ $(CP) ./files/hostapd-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \ ) - $(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config + $(if $(wildcard ./files/wpa_supplicant-$(CONFIG_VARIANT).config), \ + $(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config + ) endef TARGET_CPPFLAGS := \ @@ -567,6 +585,7 @@ define Package/hostapd/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/ endef Package/hostapd-basic/install = $(Package/hostapd/install) +Package/hostapd-hs20/install = $(Package/hostapd/install) Package/hostapd-mini/install = $(Package/hostapd/install) Package/hostapd-openssl/install = $(Package/hostapd/install) Package/hostapd-wolfssl/install = $(Package/hostapd/install) @@ -635,6 +654,7 @@ endif $(eval $(call BuildPackage,hostapd)) $(eval $(call BuildPackage,hostapd-basic)) +$(eval $(call BuildPackage,hostapd-hs20)) $(eval $(call BuildPackage,hostapd-mini)) $(eval $(call BuildPackage,hostapd-openssl)) $(eval $(call BuildPackage,hostapd-wolfssl)) diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 0ecce423e..ab9d13aae 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -384,7 +384,7 @@ CONFIG_TAXONOMY=y #CONFIG_OWE=y # Airtime policy support -#CONFIG_AIRTIME_POLICY=y +CONFIG_AIRTIME_POLICY=y # Override default value for the wpa_disable_eapol_key_retries configuration # parameter. See that parameter in hostapd.conf for more details. diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index f01e8596e..d45c976f7 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -1,4 +1,5 @@ . /lib/functions/network.sh +. /lib/functions.sh wpa_supplicant_add_rate() { local var="$1" @@ -70,6 +71,8 @@ hostapd_append_wpa_key_mgmt() { append wpa_key_mgmt "OWE" ;; esac + + [ "$auth_osen" = "1" ] && append wpa_key_mgmt "OSEN" } hostapd_add_log_config() { @@ -111,7 +114,7 @@ hostapd_prepare_device_config() { local base_cfg= json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required vendor_vht + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode vendor_vht hostapd_set_log_options base_cfg @@ -119,6 +122,7 @@ hostapd_prepare_device_config() { set_default spectrum_mgmt_required 0 set_default doth 1 set_default legacy_rates 1 + set_default airtime_mode 0 [ "$hwmode" = "b" ] && legacy_rates=1 @@ -166,6 +170,7 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" append base_cfg "dtim_period=$dtim_period" "$N" + [ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N" json_get_values opts hostapd_options for val in $opts; do @@ -258,10 +263,21 @@ hostapd_common_add_bss_config() { config_add_int mcast_rate config_add_array basic_rate config_add_array supported_rates - + config_add_boolean sae_require_mfp - + config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string' + + config_add_boolean hs20 disable_dgaf osen + config_add_int anqp_domain_id + config_add_int hs20_deauth_req_timeout + config_add_array hs20_oper_friendly_name + config_add_array osu_provider + config_add_array operator_icon + config_add_array hs20_conn_capab + config_add_string osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + + config_add_int airtime_bss_weight airtime_bss_limit } hostapd_set_vlan_file() { @@ -297,6 +313,66 @@ hostapd_set_psk() { for_each_station hostapd_set_psk_file ${ifname} } +append_hs20_oper_friendly_name() { + append bss_conf "hs20_oper_friendly_name=$1" "$N" +} + +append_osu_provider_service_desc() { + append bss_conf "osu_service_desc=$1" "$N" +} + +append_hs20_icon() { + local width height lang type path + config_get width "$1" width + config_get height "$1" height + config_get lang "$1" lang + config_get type "$1" type + config_get path "$1" path + + append bss_conf "hs20_icon=$width:$height:$lang:$type:$1:$path" "$N" +} + +append_hs20_icons() { + config_load wireless + config_foreach append_hs20_icon hs20-icon +} + +append_operator_icon() { + append bss_conf "operator_icon=$1" "$N" +} + +append_osu_icon() { + append bss_conf "osu_icon=$1" "$N" +} + +append_osu_provider() { + local cfgtype osu_server_uri osu_friendly_name osu_nai osu_nai2 osu_method_list + + config_load wireless + config_get cfgtype "$1" TYPE + [ "$cfgtype" != "osu-provider" ] && return + + append bss_conf "# provider $1" "$N" + config_get osu_server_uri "$1" osu_server_uri + config_get osu_nai "$1" osu_nai + config_get osu_nai2 "$1" osu_nai2 + config_get osu_method_list "$1" osu_method + + append bss_conf "osu_server_uri=$osu_server_uri" "$N" + append bss_conf "osu_nai=$osu_nai" "$N" + append bss_conf "osu_nai2=$osu_nai2" "$N" + append bss_conf "osu_method_list=$osu_method_list" "$N" + + config_list_foreach "$1" osu_service_desc append_osu_provider_service_desc + config_list_foreach "$1" osu_icon append_osu_icon + + append bss_conf "$N" +} + +append_hs20_conn_capab() { + [ -n "$1" ] && append bss_conf "hs20_conn_capab=$1" "$N" +} + hostapd_set_bss_options() { local var="$1" local phy="$2" @@ -317,7 +393,8 @@ hostapd_set_bss_options() { iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ acct_server acct_secret acct_port acct_interval \ bss_load_update_period chan_util_avg_period sae_require_mfp \ - multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key + multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key \ + airtime_bss_weight airtime_bss_limit set_default isolate 0 set_default maxassoc 0 @@ -335,6 +412,8 @@ hostapd_set_bss_options() { set_default chan_util_avg_period 600 set_default utf8_ssid 1 set_default multi_ap 0 + set_default airtime_bss_weight 0 + set_default airtime_bss_limit 0 append bss_conf "ctrl_interface=/var/run/hostapd" if [ "$isolate" -gt 0 ]; then @@ -347,6 +426,9 @@ hostapd_set_bss_options() { append bss_conf "ap_max_inactivity=$max_inactivity" "$N" fi + [ "$airtime_bss_weight" -gt 0 ] && append bss_conf "airtime_bss_weight=$airtime_bss_weight" "$N" + [ "$airtime_bss_limit" -gt 0 ] && append bss_conf "airtime_bss_limit=$airtime_bss_limit" "$N" + append bss_conf "bss_load_update_period=$bss_load_update_period" "$N" append bss_conf "chan_util_avg_period=$chan_util_avg_period" "$N" append bss_conf "disassoc_low_ack=$disassoc_low_ack" "$N" @@ -690,6 +772,34 @@ hostapd_set_bss_options() { } } + local hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ + osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + json_get_vars hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \ + osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp + + set_default hs20 0 + set_default disable_dgaf $hs20 + set_default osen 0 + set_default anqp_domain_id 0 + set_default hs20_deauth_req_timeout 60 + if [ "$hs20" = "1" ]; then + append bss_conf "hs20=1" "$N" + append_hs20_icons + append bss_conf "disable_dgaf=$disable_dgaf" "$N" + append bss_conf "osen=$osen" "$N" + append bss_conf "anqp_domain_id=$anqp_domain_id" "$N" + append bss_conf "hs20_deauth_req_timeout=$hs20_deauth_req_timeout" "$N" + [ -n "$osu_ssid" ] && append bss_conf "osu_ssid=$osu_ssid" "$N" + [ -n "$hs20_wan_metrics" ] && append bss_conf "hs20_wan_metrics=$hs20_wan_metrics" "$N" + [ -n "$hs20_operating_class" ] && append bss_conf "hs20_operating_class=$hs20_operating_class" "$N" + [ -n "$hs20_t_c_filename" ] && append bss_conf "hs20_t_c_filename=$hs20_t_c_filename" "$N" + [ -n "$hs20_t_c_timestamp" ] && append bss_conf "hs20_t_c_timestamp=$hs20_t_c_timestamp" "$N" + json_for_each_item append_hs20_conn_capab hs20_conn_capab + json_for_each_item append_hs20_oper_friendly_name hs20_oper_friendly_name + json_for_each_item append_osu_provider osu_provider + json_for_each_item append_operator_icon operator_icon + fi + bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1) append bss_conf "config_id=$bss_md5sum" "$N" diff --git a/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch b/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch new file mode 100644 index 000000000..a7b540960 --- /dev/null +++ b/package/network/services/hostapd/patches/110-wolfssl-compile-fix.patch @@ -0,0 +1,10 @@ +--- a/src/crypto/tls_wolfssl.c ++++ b/src/crypto/tls_wolfssl.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST) + #define HAVE_AESGCM diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index aeea31059..d816f2c03 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -108,6 +108,54 @@ void hostapd_ubus_free_iface(struct hostapd_iface *iface) return; } +static void hostapd_notify_ubus(struct ubus_object *obj, char *bssname, char *event) +{ + char *event_type; + + if (!ctx || !obj) + return; + + if (asprintf(&event_type, "bss.%s", event) < 0) + return; + + blob_buf_init(&b, 0); + blobmsg_add_string(&b, "name", bssname); + ubus_notify(ctx, obj, event_type, b.head, -1); + free(event_type); +} + +static void hostapd_send_procd_event(char *bssname, char *event) +{ + char *name, *s; + uint32_t id; + void *v; + + if (!ctx || ubus_lookup_id(ctx, "service", &id)) + return; + + if (asprintf(&name, "hostapd.%s.%s", bssname, event) < 0) + return; + + blob_buf_init(&b, 0); + + s = blobmsg_alloc_string_buffer(&b, "type", strlen(name) + 1); + sprintf(s, "%s", name); + blobmsg_add_string_buffer(&b); + + v = blobmsg_open_table(&b, "data"); + blobmsg_close_table(&b, v); + + ubus_invoke(ctx, id, "event", b.head, NULL, NULL, 1000); + + free(name); +} + +static void hostapd_send_shared_event(struct ubus_object *obj, char *bssname, char *event) +{ + hostapd_send_procd_event(bssname, event); + hostapd_notify_ubus(obj, bssname, event); +} + static void hostapd_bss_del_ban(void *eloop_data, void *user_ctx) { @@ -152,7 +200,10 @@ hostapd_bss_reload(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - return hostapd_reload_config(hapd->iface, 1); + int ret = hostapd_reload_config(hapd->iface, 1); + + hostapd_send_shared_event(&hapd->iface->interfaces->ubus, hapd->conf->iface, "reload"); + return ret; } static int @@ -799,7 +850,6 @@ hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *tb_l[__NR_SET_LIST_MAX]; struct blob_attr *tb[ARRAY_SIZE(nr_e_policy)]; struct blob_attr *cur; - int ret = 0; int rem; hostapd_rrm_nr_enable(hapd); @@ -813,32 +863,47 @@ hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj, struct wpa_ssid_value ssid; struct wpabuf *data; u8 bssid[ETH_ALEN]; - char *s; + char *s, *nr_s; blobmsg_parse_array(nr_e_policy, ARRAY_SIZE(nr_e_policy), tb, blobmsg_data(cur), blobmsg_data_len(cur)); if (!tb[0] || !tb[1] || !tb[2]) goto invalid; - s = blobmsg_get_string(tb[0]); - if (hwaddr_aton(s, bssid)) - goto invalid; - - s = blobmsg_get_string(tb[1]); - ssid.ssid_len = strlen(s); - if (ssid.ssid_len > sizeof(ssid.ssid)) - goto invalid; - - memcpy(&ssid, s, ssid.ssid_len); - data = wpabuf_parse_bin(blobmsg_get_string(tb[2])); + /* Neighbor Report binary */ + nr_s = blobmsg_get_string(tb[2]); + data = wpabuf_parse_bin(nr_s); if (!data) goto invalid; + /* BSSID */ + s = blobmsg_get_string(tb[0]); + if (strlen(s) == 0) { + /* Copy BSSID from neighbor report */ + if (hwaddr_compact_aton(nr_s, bssid)) + goto invalid; + } else if (hwaddr_aton(s, bssid)) { + goto invalid; + } + + /* SSID */ + s = blobmsg_get_string(tb[1]); + if (strlen(s) == 0) { + /* Copy SSID from hostapd BSS conf */ + memcpy(&ssid, &hapd->conf->ssid, sizeof(ssid)); + } else { + ssid.ssid_len = strlen(s); + if (ssid.ssid_len > sizeof(ssid.ssid)) + goto invalid; + + memcpy(&ssid, s, ssid.ssid_len); + } + hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0); wpabuf_free(data); continue; invalid: - ret = UBUS_STATUS_INVALID_ARGUMENT; + return UBUS_STATUS_INVALID_ARGUMENT; } return 0; @@ -1086,6 +1151,8 @@ void hostapd_ubus_add_bss(struct hostapd_data *hapd) obj->n_methods = bss_object_type.n_methods; ret = ubus_add_object(ctx, obj); hostapd_ubus_ref_inc(); + + hostapd_send_shared_event(&hapd->iface->interfaces->ubus, hapd->conf->iface, "add"); } void hostapd_ubus_free_bss(struct hostapd_data *hapd) @@ -1096,6 +1163,8 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) if (!ctx) return; + hostapd_send_shared_event(&hapd->iface->interfaces->ubus, hapd->conf->iface, "remove"); + if (obj->id) { ubus_remove_object(ctx, obj); hostapd_ubus_ref_dec(); diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h index 35356b232..9856756d9 100644 --- a/package/network/services/hostapd/src/src/utils/build_features.h +++ b/package/network/services/hostapd/src/src/utils/build_features.h @@ -46,6 +46,10 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_WEP if (!strcmp(feat, "wep")) return 1; +#endif +#ifdef CONFIG_HS20 + if (!strcmp(feat, "hs20")) + return 1; #endif return 0; } diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index dd529b528..843349082 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -42,13 +42,8 @@ netgear,wndap660) netgear,wndr4700) ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20" ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx" - ucidef_set_led_usbport "usb3" "USB3" "wndr4700:blue:usb" "usb2-port1" "usb2-port2" "usb3-port1" "usb3-port2" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "wndr4700:blue:wlan" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "wndr4700:blue:wlan" "phy1tpt" ;; -*) - ;; esac board_config_flush diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ee58901d1..dcdcf4dc4 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -7,27 +7,9 @@ board=$(board_name) case "$FIRMWARE" in -"pci_wmac0.eeprom") - case $board in - netgear,wndr4700) - . /lib/upgrade/nand.sh - - if [ -n "$(nand_find_volume ubi0 caldata)" ]; then - caldata_extract_ubi "caldata" 0x5000 0x1000 - else - caldata_extract "wifi_data" 0x5000 0x1000 - ath9k_patch_mac $(mtd_get_mac_binary wifi_data 0xc) - fi - ;; - *) - caldata_die "board $board is not supported yet" - ;; - esac - ;; - -"pci_wmac1.eeprom") - case $board in - netgear,wndr4700) +"ath9k-eeprom-pci-0000:43:00.0.bin") + case $board in + netgear,wndr4700) . /lib/upgrade/nand.sh if [ -n "$(nand_find_volume ubi0 caldata)" ]; then @@ -42,4 +24,22 @@ case "$FIRMWARE" in ;; esac ;; + +"ath9k-eeprom-pci-0000:44:00.0.bin") + case $board in + netgear,wndr4700) + . /lib/upgrade/nand.sh + + if [ -n "$(nand_find_volume ubi0 caldata)" ]; then + caldata_extract_ubi "caldata" 0x5000 0x1000 + else + caldata_extract "wifi_data" 0x5000 0x1000 + ath9k_patch_mac $(mtd_get_mac_binary wifi_data 0xc) + fi + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; esac diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index a78a1054f..6c7748589 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -16,6 +16,4 @@ netgear,wndap620|\ netgear,wndap660) macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress ;; -*) - ;; esac diff --git a/target/linux/apm821xx/base-files/lib/preinit/79_move_config b/target/linux/apm821xx/base-files/lib/preinit/79_move_config index 1796e9f5f..7a301a925 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/79_move_config +++ b/target/linux/apm821xx/base-files/lib/preinit/79_move_config @@ -12,8 +12,6 @@ move_config() { [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" / fi ;; - *) - ;; esac } diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh index cc095b36a..cdcab6c3f 100644 --- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh @@ -43,8 +43,5 @@ platform_copy_config() { wd,mybooklive-duo) mbl_copy_config ;; - - *) - ;; esac } diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi index 65032ba21..5be4487be 100644 --- a/target/linux/apm821xx/dts/apm82181.dtsi +++ b/target/linux/apm821xx/dts/apm82181.dtsi @@ -1,24 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Device Tree for Bluestone (APM821xx) board. * * Copyright (c) 2010, Applied Micro Circuits Corporation * Author: Tirumala R Marri - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * */ #include @@ -40,7 +25,7 @@ #address-cells = <1>; #size-cells = <0>; - CPU00: cpu@0 { + CPU0: cpu@0 { device_type = "cpu"; model = "PowerPC,apm82181"; reg = <0x00000000>; @@ -170,7 +155,7 @@ dcr-reg = <0x240 0x009>; interrupts = <0x1a IRQ_TYPE_LEVEL_HIGH>; interrupt-parent = <&UIC2>; - + status = "disabled"; }; TRNG: trng@110000 { @@ -306,6 +291,8 @@ reg = <0xef600800 0x00000014>; interrupt-parent = <&UIC0>; interrupts = <0x03 IRQ_TYPE_LEVEL_HIGH>; + #address-cells = <1>; + #size-cells = <0>; status = "disabled"; }; @@ -407,6 +394,8 @@ dmas = <&AHBDMA0 0 0 1>; dma-names = "sata-dma"; status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; }; SATA1: sata@bffd1800 { @@ -417,6 +406,8 @@ dmas = <&AHBDMA0 1 0 2>; dma-names = "sata-dma"; status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; }; MSI: ppc4xx-msi@c10000000 { @@ -457,7 +448,8 @@ dcr-reg = <0x100 0x020>; sdr-base = <0x300>; - /* Outbound ranges, one memory and one IO, + /* + * Outbound ranges, one memory and one IO, * later cannot be changed */ ranges = <0x02000000 0x00000000 0x80000000 0x0000000e 0x00000000 0x00000000 0x80000000>, @@ -470,7 +462,8 @@ /* This drives busses 0x40 to 0x7f */ bus-range = <0x40 0x7f>; - /* Legacy interrupts (note the weird polarity, the bridge seems + /* + * Legacy interrupts (note the weird polarity, the bridge seems * to invert PCIe legacy interrupts). * We are de-swizzling here because the numbers are actually for * port of the root complex virtual P2P bridge. But I want diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 8fdef7c17..660cf8f78 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Meraki MR24 (Ikarem) * * Copyright (C) 2016 Chris Blake * * Based on Cisco Meraki GPL Release r23-20150601 MR24 DTS - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; @@ -182,6 +179,59 @@ &PCIE0 { status = "okay"; + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0 + * +-03.0-[44]----00.0 + * + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@65,0 { + /* IDT PES3T3 PCI Express Switch */ + compatible = "pci111d,8039"; + reg = <0x00410000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@66,2 { + compatible = "pci111d,8039"; + reg = <0x00421000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@67,0 { + /* Atheros AR9380 2.4GHz */ + compatible = "pci168c,0030"; + reg = <0x00430000 0 0 0 0>; + interrupts = <3>; /* INTC 4.1.1 */ + }; + }; + + bridge@66,3 { + compatible = "pci111d,8039"; + reg = <0x00421800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1: wifi@68,0 { + /* Atheros AR9380 5GHz */ + compatible = "pci168c,0030"; + reg = <0x00440000 0 0 0 0>; + interrupts = <4>; /* INTD 4.1.1 */ + }; + }; + }; + }; }; &MSI { diff --git a/target/linux/apm821xx/dts/meraki-mx60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts index 3620005e4..9bddbdd25 100644 --- a/target/linux/apm821xx/dts/meraki-mx60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -1,13 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Meraki MX60/MX60W (Buckminster) * * Copyright (C) 2016 Chris Blake * * Based on Cisco Meraki DTS extracted from release wired-12-217818 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; @@ -175,6 +172,26 @@ &PCIE0 { /* Leave this enabled as u-boot on the MX60 will disable it for us */ status = "okay"; + + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0 + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@65,0 { + /* Atheros AR9380 2.4/5GHz */ + compatible = "pci168c,0030"; + reg = <0x00410000 0 0 0 0>; + interrupts = <1>; /* INTA */ + }; + }; }; &MSI { diff --git a/target/linux/apm821xx/dts/netgear-wndap620.dts b/target/linux/apm821xx/dts/netgear-wndap620.dts index 87b4e51a8..d72aef4de 100644 --- a/target/linux/apm821xx/dts/netgear-wndap620.dts +++ b/target/linux/apm821xx/dts/netgear-wndap620.dts @@ -1,10 +1,4 @@ -/* - * Device Tree Source for Netgear WNDAP620 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. - */ +// SPDX-License-Identifier: GPL-2.0-only /dts-v1/; @@ -26,3 +20,25 @@ gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; }; }; + +&PCIE0 { + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0 + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@65,0 { + /* Atheros AR9380 5GHz */ + compatible = "pci168c,0030"; + reg = <0x00410000 0 0 0 0>; + interrupts = <1>; /* INTA */ + }; + }; +}; diff --git a/target/linux/apm821xx/dts/netgear-wndap660.dts b/target/linux/apm821xx/dts/netgear-wndap660.dts index 3e5daac83..e9f45abe0 100644 --- a/target/linux/apm821xx/dts/netgear-wndap660.dts +++ b/target/linux/apm821xx/dts/netgear-wndap660.dts @@ -1,10 +1,4 @@ -/* - * Device Tree Source for Netgear WNDAP660 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. - */ +// SPDX-License-Identifier: GPL-2.0-only /dts-v1/; @@ -36,3 +30,59 @@ gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; }; }; + +&PCIE0 { + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0 + * +-03.0-[44]----00.0 + * + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@65,0 { + /* IDT PES3T3 PCI Express Switch */ + compatible = "pci111d,8039"; + reg = <0x00410000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@66,2 { + compatible = "pci111d,8039"; + reg = <0x00421000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@67,0 { + /* Atheros AR9380 2.4/5GHz */ + compatible = "pci168c,0030"; + reg = <0x00430000 0 0 0 0>; + interrupts = <3>; /* INTC */ + }; + }; + + bridge@66,3 { + compatible = "pci111d,8039"; + reg = <0x00421800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1: wifi@68,0 { + /* Atheros AR9380 2.4/5GHz */ + compatible = "pci168c,0030"; + reg = <0x00440000 0 0 0 0>; + interrupts = <4>; /* INTD */ + }; + }; + }; + }; +}; diff --git a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi index 2d135d64d..eac54011e 100644 --- a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi +++ b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Netgear WNDAP620 and WNDAP660 - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ #include "apm82181.dtsi" diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 8972d2b03..0a1b2f4f3 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Device Tree Source for Netgear WNDR4700/WNDR4720 Series * * Copyright 2008 DENX Software Engineering, Stefan Roese - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; @@ -15,7 +12,7 @@ / { model = "Netgear WNDR4700/WNDR4720 Series"; - compatible = "netgear,wndr4700"; + compatible = "netgear,wndr4700", "apm,bluestone"; aliases { serial0 = &UART0; @@ -381,6 +378,9 @@ usb-blue { label = "wndr4700:blue:usb"; gpios = <&GPIO0 10 GPIO_ACTIVE_HIGH>; + trigger-sources = <&usb2_port 1>, <&usb2_port 2>, + <&usb3_port 1>, <&usb3_port 2>; + linux,default-trigger = "usbport"; }; logo-white { @@ -412,12 +412,106 @@ wlan-blue { label = "wndr4700:blue:wlan"; gpios = <&GPIO0 18 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; }; }; }; &PCIE0 { status = "okay"; + + /* + * relevant lspci topology: + * + * -+-[0000:40]---00.0-[41-7f]----00.0-[42-45]--+-02.0-[43]----00.0 + * +-03.0-[44]----00.0 + * \-04.0-[45]----00.0 + * + */ + + bridge@64,0 { + reg = <0x00400000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@65,0 { + /* IDT PES4T4 PCI Express Switch */ + compatible = "pci111d,803a"; + reg = <0x00410000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + bridge@66,2 { + compatible = "pci111d,803a"; + reg = <0x00421000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi0: wifi@67,0 { + /* Atheros AR9380 5GHz */ + compatible = "pci168c,0030"; + reg = <0x00430000 0 0 0 0>; + interrupts = <3>; /* INTC */ + qca,no-eeprom; + /* wifi CAL & MAC is stored in nvram */ + + /* + * Because this was such a pain. + * Here's the full device path: + * pci0000:40/0000:40:00.0/0000:41:00.0/0000:42:02.0/0000:43:00.0 + */ + }; + }; + + bridge@66,3 { + compatible = "pci111d,803a"; + reg = <0x00421800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi1: wifi@68,0 { + /* Atheros AR9381 2.4GHz */ + compatible = "pci168c,0033"; + reg = <0x00440000 0 0 0 0>; + interrupts = <4>; /* INTD */ + qca,no-eeprom; + /* wifi CAL & MAC is stored in nvram */ + }; + }; + + bridge@66,4 { + compatible = "pci111d,803a"; + reg = <0x00422000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + usb1: usb@69,0 { + /* Renesas uPD720202 */ + compatible = "pci1912,0015"; + reg = <0x00450000 0 0 0 0>; + interrupts = <1>; /* INTA */ + + #address-cells = <1>; + #size-cells = <0>; + + usb2_port: port@1 { + reg = <1>; + #trigger-source-cells = <1>; + }; + + usb3_port: port@2 { + reg = <2>; + #trigger-source-cells = <1>; + }; + }; + }; + }; + }; }; &MSI { diff --git a/target/linux/apm821xx/dts/wd-mybooklive.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts index 82e9497ec..3fd636cb2 100644 --- a/target/linux/apm821xx/dts/wd-mybooklive.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -1,10 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2008 DENX Software Engineering, Stefan Roese * (c) Copyright 2010 Western Digital Technologies, Inc. All Rights Reserved. - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without - * any warranty of any kind, whether express or implied. */ /dts-v1/; diff --git a/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c b/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c deleted file mode 100644 index f50f43f3d..000000000 --- a/target/linux/apm821xx/files/arch/powerpc/platforms/44x/wndr4700.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Netgear Centria N900 WNDR4700/WNDR4720 platform support - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. - * - * This implemention is based on the simple platform support for the - * PowerPC 44x chips. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -static const struct of_device_id ppc44x_of_bus[] __initconst = { - { .compatible = "ibm,plb4", }, - { .compatible = "ibm,opb", }, - { .compatible = "ibm,ebc", }, - { .compatible = "simple-bus", }, - {}, -}; - -static int __init ppc44x_device_probe(void) -{ - of_platform_bus_probe(NULL, ppc44x_of_bus, NULL); - - return 0; -} -machine_device_initcall(wndr4700, ppc44x_device_probe); - -static char *board[] __initdata = { - "netgear,wndr4700", -}; - -static int __init ppc44x_probe(void) -{ - unsigned long root = of_get_flat_dt_root(); - int i = 0; - - pcie_bus_config = PCIE_BUS_PEER2PEER; /* force 128 Byte MPS */ - - for (i = 0; i < ARRAY_SIZE(board); i++) { - if (of_flat_dt_is_compatible(root, board[i])) { - pci_set_flags(PCI_REASSIGN_ALL_RSRC); /* PCI_PROBE_ONLY */ - return 1; - } - } - - return 0; -} - -define_machine(wndr4700) { - .name = "WNDR4700 Platform", - .probe = ppc44x_probe, - .progress = udbg_progress, - .init_IRQ = uic_init_tree, - .get_irq = uic_get_irq, - .restart = ppc4xx_reset_system, - .calibrate_decr = generic_calibrate_decr, -}; - -static struct ath9k_platform_data ar9380_wmac0_data = { - .led_pin = -1, - .eeprom_name = "pci_wmac1.eeprom", -}; -static struct ath9k_platform_data ar9580_wmac1_data = { - .led_pin = -1, - .eeprom_name = "pci_wmac0.eeprom", -}; - -static int __init wndr4700_ath9k_eeprom_load(void) -{ - struct pci_dev *dev; - - dev = pci_get_device(PCI_VENDOR_ID_ATHEROS, 0x0030, NULL); - if (dev) - dev->dev.platform_data = &ar9380_wmac0_data; - - dev = pci_get_device(PCI_VENDOR_ID_ATHEROS, 0x0033, NULL); - if (dev) - dev->dev.platform_data = &ar9580_wmac1_data; - - return 0; -} -machine_device_initcall(wndr4700, wndr4700_ath9k_eeprom_load); diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index f53167f75..e1874f616 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -48,5 +48,4 @@ CONFIG_SENSORS_LM90=y CONFIG_SENSORS_TC654=y CONFIG_SWCONFIG=y CONFIG_SWCONFIG_LEDS=y -CONFIG_WNDR4700=y diff --git a/target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch deleted file mode 100644 index b0619852b..000000000 --- a/target/linux/apm821xx/patches-5.4/202-add-netgear-wndr4700-support.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/arch/powerpc/platforms/44x/Makefile -+++ b/arch/powerpc/platforms/44x/Makefile -@@ -4,6 +4,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y) - obj-y += idle.o - endif - obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o -+obj-$(CONFIG_WNDR4700) += wndr4700.o - obj-$(CONFIG_EBONY) += ebony.o - obj-$(CONFIG_SAM440EP) += sam440ep.o - obj-$(CONFIG_WARP) += warp.o ---- a/arch/powerpc/platforms/44x/Kconfig -+++ b/arch/powerpc/platforms/44x/Kconfig -@@ -243,6 +243,19 @@ config ICON - help - This option enables support for the AMCC PPC440SPe evaluation board. - -+config WNDR4700 -+ bool "WNDR4700" -+ depends on 44x -+ default n -+ select APM821xx -+ select PCI_MSI -+ select PPC4xx_MSI -+ select PPC4xx_PCI_EXPRESS -+ select IBM_EMAC_RGMII -+ select 460EX -+ help -+ This option enables support for the Netgear WNDR4700/WNDR4720 board. -+ - config XILINX_VIRTEX440_GENERIC_BOARD - bool "Generic Xilinx Virtex 5 FXT board support" - depends on 44x diff --git a/target/linux/arc770/config-4.14 b/target/linux/arc770/config-4.14 deleted file mode 100644 index 525075f1b..000000000 --- a/target/linux/arc770/config-4.14 +++ /dev/null @@ -1,200 +0,0 @@ -# CONFIG_16KSTACKS is not set -CONFIG_ARC=y -# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set -# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set -CONFIG_ARCH_HAS_SG_CHAIN=y -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -# CONFIG_ARCH_WANTS_THP_SWAP is not set -CONFIG_ARC_BUILTIN_DTB_NAME="" -CONFIG_ARC_CACHE=y -CONFIG_ARC_CACHE_LINE_SHIFT=5 -CONFIG_ARC_CACHE_PAGES=y -# CONFIG_ARC_CACHE_VIPT_ALIASING is not set -# CONFIG_ARC_CANT_LLSC is not set -# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set -# CONFIG_ARC_CPU_750D is not set -CONFIG_ARC_CPU_770=y -CONFIG_ARC_CURR_IN_REG=y -CONFIG_ARC_DBG=y -# CONFIG_ARC_DBG_TLB_PARANOIA is not set -CONFIG_ARC_DW2_UNWIND=y -CONFIG_ARC_EMUL_UNALIGNED=y -# CONFIG_ARC_FPU_SAVE_RESTORE is not set -CONFIG_ARC_HAS_DCACHE=y -# CONFIG_ARC_HAS_DCCM is not set -CONFIG_ARC_HAS_ICACHE=y -# CONFIG_ARC_HAS_ICCM is not set -CONFIG_ARC_HAS_LLSC=y -CONFIG_ARC_HAS_SWAPE=y -CONFIG_ARC_KVADDR_SIZE=256 -# CONFIG_ARC_METAWARE_HLINK is not set -# CONFIG_ARC_MMU_V1 is not set -# CONFIG_ARC_MMU_V2 is not set -CONFIG_ARC_MMU_V3=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set -CONFIG_ARC_PAGE_SIZE_8K=y -CONFIG_ARC_PLAT_AXS10X=y -# CONFIG_ARC_PLAT_EZNPS is not set -# CONFIG_ARC_PLAT_TB10X is not set -# CONFIG_ARC_SOC_HSDK is not set -CONFIG_ARC_TIMERS=y -CONFIG_ARC_UBOOT_SUPPORT=y -CONFIG_AXS101=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_NO_EFFICIENT_FFS=y -CONFIG_CRC16=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_DMA_NOOP_OPS is not set -# CONFIG_DMA_VIRT_OPS is not set -# CONFIG_DRM_LIB_RANDOM is not set -CONFIG_DTC=y -CONFIG_DWMAC_ANARION=y -# CONFIG_DWMAC_DWC_QOS_ETH is not set -CONFIG_DWMAC_GENERIC=y -CONFIG_DW_APB_ICTL=y -CONFIG_EXPORTFS=y -CONFIG_EXT4_FS=y -# CONFIG_EZNPS_GIC is not set -CONFIG_FIXED_PHY=y -CONFIG_FS_MBCACHE=y -CONFIG_FUTEX_PI=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CSUM=y -CONFIG_GENERIC_FIND_FIRST_BIT=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_DWAPB=y -CONFIG_GPIO_GENERIC=y -# CONFIG_GRO_CELLS is not set -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -# CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_FUTEX_CMPXCHG=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IOREMAP_PROT=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HZ_PERIODIC=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_WORK=y -CONFIG_ISA_ARCOMPACT=y -# CONFIG_ISA_ARCV2 is not set -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -CONFIG_KERNEL_GZIP=y -CONFIG_LIBFDT=y -CONFIG_LINUX_LINK_BASE=0x80000000 -CONFIG_LINUX_RAM_BASE=0x80000000 -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_K3 is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_NATIONAL_PHY=y -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_NET_CADENCE is not set -CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NET_VENDOR_ARC is not set -# CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_NET_VENDOR_INTEL is not set -# CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_QUALCOMM is not set -# CONFIG_NET_VENDOR_ROCKER is not set -# CONFIG_NET_VENDOR_SAMSUNG is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_VIA is not set -# CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_NO_BOOTMEM=y -CONFIG_NO_IOPORT_MAP=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_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_RCU=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_MMIO=y -CONFIG_RESET_CONTROLLER=y -# CONFIG_SCHED_INFO is not set -# CONFIG_SCSI_DMA is not set -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -# CONFIG_SERIAL_8250_FSL is not set -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -CONFIG_SERIAL_ARC=y -CONFIG_SERIAL_ARC_CONSOLE=y -CONFIG_SERIAL_ARC_NR_PORTS=1 -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SRCU=y -CONFIG_STACKTRACE=y -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_SWPHY=y -CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW=y -CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN=y -CONFIG_TASKS_RCU=y -CONFIG_THIN_ARCHIVES=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TREE_SRCU=y -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB_SUPPORT=y diff --git a/target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch deleted file mode 100644 index e63c2e934..000000000 --- a/target/linux/arc770/patches-4.14/700-stmmac-Disable-frame-filtering-completely.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0031b9011cb2b2b1de4dbb4f9620303aec760db4 Mon Sep 17 00:00:00 2001 -From: Alexey Brodkin -Date: Wed, 27 Jul 2016 11:33:14 +0300 -Subject: [PATCH] stmmac: Disable frame filtering completely - -For some [still unknown] reason in ARC SDP boards -DW GMAC doesn't enter promiscuous mode if eth0 gets -added to the br-lan interface before Ethernet PHY finishes -autonegotiation (PHY gets reset on DW GMAC start). - -As a work-around we completely disable frame filtering -in GMAC hardware which gives us working bridge that consists -of eth0 and wlan0 (USB Wi-Fi dongle). I.e. we finally have -working "Dumb AP" setup made of ARC AXS10x boards. - -Signed-off-by: Alexey Brodkin ---- - drivers/net/ethernet/stmicro/stmmac/common.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -46,7 +46,7 @@ - #define STMMAC_GET_ENTRY(x, size) ((x + 1) & (size - 1)) - - #undef FRAME_FILTER_DEBUG --/* #define FRAME_FILTER_DEBUG */ -+#define FRAME_FILTER_DEBUG - - /* Extra statistic and debug information exposed by ethtool */ - struct stmmac_extra_stats { diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile index 4780210f3..e941f3466 100644 --- a/target/linux/at91/Makefile +++ b/target/linux/at91/Makefile @@ -12,7 +12,7 @@ BOARDNAME:=Microchip (Atmel AT91) FEATURES:=ext4 squashfs targz usb usbgadget ubifs SUBTARGETS:=sama5 sam9x -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=5.4 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/at91/base-files/etc/board.d/02_network b/target/linux/at91/base-files/etc/board.d/02_network index 66f9d88fa..306dfe375 100755 --- a/target/linux/at91/base-files/etc/board.d/02_network +++ b/target/linux/at91/base-files/etc/board.d/02_network @@ -9,7 +9,7 @@ board_config_update case "$(board_name)" in -sama5d3_xplained) +atmel,sama5d3-xplained) ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; diff --git a/target/linux/at91/base-files/lib/at91.sh b/target/linux/at91/base-files/lib/at91.sh deleted file mode 100644 index 19a63e120..000000000 --- a/target/linux/at91/base-files/lib/at91.sh +++ /dev/null @@ -1,92 +0,0 @@ -# -# Copyright (C) 2014 OpenWrt.org -# - -AT91_BOARD_NAME= -AT91_MODEL= - -at91_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - *"Atmel at91sam9263ek") - name="at91sam9263ek" - ;; - *"Atmel AT91SAM9G15-EK") - name="at91sam9g15ek" - ;; - *"Atmel at91sam9g20ek") - name="at91sam9g20ek" - ;; - *"Atmel at91sam9g20ek 2 mmc") - name="at91sam9g20ek_2mmc" - ;; - *"Atmel AT91SAM9G25-EK") - name="at91sam9g25ek" - ;; - *"Atmel AT91SAM9G35-EK") - name="at91sam9g35ek" - ;; - *"Atmel AT91SAM9M10G45-EK") - name="at91sam9m10g45ek" - ;; - *"Atmel AT91SAM9X25-EK") - name="at91sam9x25ek" - ;; - *"Atmel AT91SAM9X35-EK") - name="at91sam9x35ek" - ;; - *"SAMA5D3 Xplained") - name="sama5d3_xplained" - ;; - *"Atmel SAMA5D27 SOM1 EK") - name="sama5d27_som1_ek" - ;; - *"Atmel SAMA5D2 PTC EK") - name="sama5d2_ptc_ek" - ;; - *"SAMA5D2 Xplained") - name="sama5d2_xplained" - ;; - *"SAMA5D4 Xplained") - name="sama5d4_xplained" - ;; - *"CalAmp LMU5000") - name="lmu5000" - ;; - *"Calao TNY A9260") - name="tny_a9260" - ;; - *"Calao TNY A9263") - name="tny_a9263" - ;; - *"Calao TNY A9G20") - name="tny_a9g20" - ;; - *"Calao USB A9260") - name="usb_a9260" - ;; - *"Calao USB A9263") - name="usb_a9263" - ;; - *"Calao USB A9G20") - name="usb_a9g20" - ;; - *"Ethernut 5") - name="ethernut5" - ;; - esac - - [ -z "$name" ] && name="unknown" - - [ -z "$AT91_BOARD_NAME" ] && AT91_BOARD_NAME="$name" - [ -z "$AT91_MODEL" ] && AT91_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$AT91_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$AT91_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/at91/base-files/lib/preinit/01_preinit_do_at91.sh b/target/linux/at91/base-files/lib/preinit/01_preinit_do_at91.sh deleted file mode 100644 index c81232956..000000000 --- a/target/linux/at91/base-files/lib/preinit/01_preinit_do_at91.sh +++ /dev/null @@ -1,7 +0,0 @@ -do_at91() { - . /lib/at91.sh - - at91_board_detect -} - -boot_hook_add preinit_main do_at91 diff --git a/target/linux/at91/config-4.14 b/target/linux/at91/config-4.14 deleted file mode 100644 index b1b49054a..000000000 --- a/target/linux/at91/config-4.14 +++ /dev/null @@ -1,562 +0,0 @@ -CONFIG_ALIGNMENT_TRAP=y -CONFIG_ARCH_AT91=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_SET_MEMORY=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_NR_GPIO=0 -CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y -CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARM=y -CONFIG_ARM_AT91_CPUIDLE=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_ARM_HEAVY_MB=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_L1_CACHE_SHIFT_6=y -# CONFIG_ARM_LPAE is not set -CONFIG_ARM_PATCH_IDIV=y -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_ARM_THUMB=y -# CONFIG_ARM_THUMBEE is not set -CONFIG_ARM_UNWIND=y -CONFIG_ARM_VIRT_EXT=y -CONFIG_AT91SAM9X_WATCHDOG=y -CONFIG_AT91_ADC=y -CONFIG_AT91_SAMA5D2_ADC=y -CONFIG_AT91_SOC_ID=y -CONFIG_ATMEL_AIC5_IRQ=y -CONFIG_ATMEL_EBI=y -CONFIG_ATMEL_PIT=y -CONFIG_ATMEL_PM=y -CONFIG_ATMEL_SDRAMC=y -CONFIG_ATMEL_SSC=y -CONFIG_ATMEL_TCB_CLKSRC=y -CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 -CONFIG_ATMEL_TCLIB=y -CONFIG_AT_HDMAC=y -CONFIG_AT_XDMAC=y -CONFIG_AUTO_ZRELADDR=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_PWM=y -CONFIG_BATTERY_ACT8945A=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=4 -CONFIG_BLK_DEV_RAM_SIZE=8192 -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_SCSI_REQUEST=y -CONFIG_CACHE_L2X0=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CMA=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -# CONFIG_CMA_DEBUG is not set -# CONFIG_CMA_DEBUGFS is not set -CONFIG_CMA_SIZE_MBYTES=16 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw" -CONFIG_COMMON_CLK=y -CONFIG_COMMON_CLK_AT91=y -CONFIG_CONFIGFS_FS=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_COREDUMP=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_HAS_ASID=y -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_PM=y -CONFIG_CPU_SPECTRE=y -CONFIG_CPU_THUMB_CAPABLE=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_V7=y -CONFIG_CRASH_CORE=y -CONFIG_CRASH_DUMP=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CCM=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CTR=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_DRBG=y -CONFIG_CRYPTO_DRBG_HMAC=y -CONFIG_CRYPTO_DRBG_MENU=y -CONFIG_CRYPTO_GCM=y -CONFIG_CRYPTO_GF128MUL=y -CONFIG_CRYPTO_GHASH=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_RNG_DEFAULT=y -CONFIG_CRYPTO_SEQIV=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_DEBUG_MEMORY_INIT=y -# CONFIG_DEBUG_UART_8250 is not set -CONFIG_DEBUG_USER=y -CONFIG_DEFAULT_IOSCHED="noop" -CONFIG_DEFAULT_NOOP=y -CONFIG_DMADEVICES=y -CONFIG_DMA_CMA=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_DNOTIFY=y -CONFIG_DRM=y -CONFIG_DRM_ATMEL_HLCDC=y -CONFIG_DRM_BRIDGE=y -CONFIG_DRM_FBDEV_EMULATION=y -CONFIG_DRM_FBDEV_OVERALLOC=100 -CONFIG_DRM_GEM_CMA_HELPER=y -CONFIG_DRM_KMS_CMA_HELPER=y -CONFIG_DRM_KMS_FB_HELPER=y -CONFIG_DRM_KMS_HELPER=y -CONFIG_DRM_PANEL=y -CONFIG_DRM_PANEL_BRIDGE=y -CONFIG_DRM_PANEL_SIMPLE=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_EEPROM_AT24=y -CONFIG_ELF_CORE=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_EXT4_FS=y -CONFIG_FAT_FS=y -CONFIG_FB=y -# CONFIG_FB_ATMEL is not set -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_DEFERRED_IO=y -# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_FOPS=y -CONFIG_FB_SYS_IMAGEBLIT=y -CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -CONFIG_FORCE_MAX_ZONEORDER=15 -CONFIG_FREEZER=y -CONFIG_FS_MBCACHE=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GLOB=y -CONFIG_GPIOLIB=y -CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_SYSFS=y -# CONFIG_GRO_CELLS is not set -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDEN_BRANCH_PREDICTOR=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARM_SMCCC=y -CONFIG_HAVE_AT91_AUDIO_PLL=y -CONFIG_HAVE_AT91_GENERATED_CLK=y -CONFIG_HAVE_AT91_H32MX=y -CONFIG_HAVE_AT91_SMD=y -CONFIG_HAVE_AT91_USB_CLK=y -CONFIG_HAVE_AT91_UTMI=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -CONFIG_HAVE_EBPF_JIT=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FB_ATMEL=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HDMI=y -CONFIG_HID=y -CONFIG_HID_GENERIC=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_ATMEL=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_ALGOBIT=y -CONFIG_I2C_AT91=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_GPIO=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_IIO=y -CONFIG_IIO_BUFFER=y -CONFIG_IIO_KFIFO_BUF=y -CONFIG_IIO_TRIGGER=y -CONFIG_IIO_TRIGGERED_BUFFER=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -CONFIG_INPUT_EVDEV=y -CONFIG_INPUT_KEYBOARD=y -CONFIG_INPUT_LEDS=y -CONFIG_INPUT_TOUCHSCREEN=y -CONFIG_IOMMU_HELPER=y -# CONFIG_IOSCHED_DEADLINE is not set -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_DEBUG=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -# CONFIG_JFFS2_FS is not set -CONFIG_KERNEL_GZIP=y -# CONFIG_KERNEL_XZ is not set -CONFIG_KEXEC=y -CONFIG_KEXEC_CORE=y -CONFIG_KEYBOARD_GPIO=y -CONFIG_KEYBOARD_QT1070=y -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_PWM=y -CONFIG_LEDS_TRIGGER_CPU=y -# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set -CONFIG_LEDS_TRIGGER_GPIO=y -CONFIG_LEDS_TRIGGER_HEARTBEAT=y -CONFIG_LIBFDT=y -CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOG_BUF_SHIFT=16 -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MACB=y -CONFIG_MACB_USE_HWSTAMP=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_MANDATORY_FILE_LOCKING=y -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MEDIA_CAMERA_SUPPORT=y -CONFIG_MEDIA_SUPPORT=y -CONFIG_MEDIA_USB_SUPPORT=y -CONFIG_MEMORY=y -CONFIG_MEMORY_ISOLATION=y -CONFIG_MFD_ACT8945A=y -CONFIG_MFD_ATMEL_FLEXCOM=y -CONFIG_MFD_ATMEL_HLCDC=y -CONFIG_MFD_ATMEL_SMC=y -CONFIG_MFD_CORE=y -CONFIG_MFD_SYSCON=y -CONFIG_MICREL_PHY=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_ATMELMCI=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_OF_AT91=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MTD_CFI_AMDSTD is not set -# CONFIG_MTD_CFI_INTELEXT is not set -CONFIG_MTD_CMDLINE_PARTS=y -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_M25P80=y -CONFIG_MTD_NAND=y -CONFIG_MTD_NAND_ATMEL=y -CONFIG_MTD_NAND_ECC=y -# CONFIG_MTD_PHYSMAP_OF is not set -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_BLOCK is not set -CONFIG_MTD_UBI_FASTMAP=y -# CONFIG_MTD_UBI_GLUEBI is not set -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MULTI_IRQ_HANDLER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_PER_CPU_KM=y -CONFIG_NEON=y -CONFIG_NLS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_850=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NLS_UTF8=y -CONFIG_NO_BOOTMEM=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=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_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PARTITION_ADVANCED is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PINCTRL=y -CONFIG_PINCTRL_AT91=y -CONFIG_PINCTRL_AT91PIO4=y -# CONFIG_PINCTRL_SINGLE is not set -# CONFIG_PL310_ERRATA_588369 is not set -# CONFIG_PL310_ERRATA_727915 is not set -# CONFIG_PL310_ERRATA_753970 is not set -# CONFIG_PL310_ERRATA_769419 is not set -CONFIG_PM=y -CONFIG_PM_ADVANCED_DEBUG=y -CONFIG_PM_CLK=y -CONFIG_PM_DEBUG=y -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_DEBUG=y -# CONFIG_PM_TEST_SUSPEND is not set -CONFIG_POWER_RESET=y -CONFIG_POWER_RESET_AT91_POWEROFF=y -CONFIG_POWER_RESET_AT91_RESET=y -CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y -CONFIG_POWER_SUPPLY=y -# CONFIG_PREVENT_FIRMWARE_BUILD is not set -CONFIG_PRINTK_TIME=y -CONFIG_PROC_VMCORE=y -CONFIG_PWM=y -CONFIG_PWM_ATMEL=y -CONFIG_PWM_ATMEL_HLCDC_PWM=y -CONFIG_PWM_ATMEL_TCB=y -CONFIG_PWM_SYSFS=y -CONFIG_RATIONAL=y -# CONFIG_RCU_NEED_SEGCBLIST is not set -# CONFIG_RCU_STALL_COMMON is not set -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPI=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_ACT8865=y -CONFIG_REGULATOR_ACT8945A=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_AT91RM9200=y -# CONFIG_RTC_DRV_AT91SAM9 is not set -# CONFIG_RTC_DRV_CMOS is not set -CONFIG_RTC_I2C_AND_SPI=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_SAMA5D4_WATCHDOG=y -# CONFIG_SCHED_INFO is not set -CONFIG_SCSI=y -# CONFIG_SCSI_LOWLEVEL is not set -# CONFIG_SERIAL_8250 is not set -CONFIG_SERIAL_ATMEL=y -CONFIG_SERIAL_ATMEL_CONSOLE=y -CONFIG_SERIAL_ATMEL_PDC=y -# CONFIG_SERIAL_ATMEL_TTYAT is not set -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SG_POOL=y -CONFIG_SND=y -CONFIG_SND_ARM=y -# CONFIG_SND_AT73C213 is not set -# CONFIG_SND_AT91_SOC_SAM9G20_WM8731 is not set -# CONFIG_SND_AT91_SOC_SAM9X5_WM8731 is not set -CONFIG_SND_ATMEL_SOC=y -CONFIG_SND_ATMEL_SOC_CLASSD=y -CONFIG_SND_ATMEL_SOC_DMA=y -# CONFIG_SND_ATMEL_SOC_PDMIC is not set -CONFIG_SND_ATMEL_SOC_SSC=y -CONFIG_SND_ATMEL_SOC_SSC_DMA=y -# CONFIG_SND_ATMEL_SOC_TSE850_PCM5142 is not set -CONFIG_SND_ATMEL_SOC_WM8904=y -# CONFIG_SND_COMPRESS_OFFLOAD is not set -CONFIG_SND_DMAENGINE_PCM=y -CONFIG_SND_JACK=y -CONFIG_SND_JACK_INPUT_DEV=y -CONFIG_SND_PCM=y -CONFIG_SND_PCM_TIMER=y -CONFIG_SND_SOC=y -CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y -CONFIG_SND_SOC_I2C_AND_SPI=y -CONFIG_SND_SOC_WM8904=y -CONFIG_SND_SPI=y -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_TIMER=y -CONFIG_SOC_BUS=y -CONFIG_SOC_SAMA5=y -CONFIG_SOC_SAMA5D2=y -CONFIG_SOC_SAMA5D3=y -CONFIG_SOC_SAMA5D4=y -CONFIG_SOC_SAM_V7=y -CONFIG_SOUND=y -CONFIG_SOUND_OSS_CORE=y -# CONFIG_SOUND_OSS_CORE_PRECLAIM is not set -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_ATMEL=y -CONFIG_SPI_ATMEL_QUADSPI=y -CONFIG_SPI_BITBANG=y -CONFIG_SPI_GPIO=y -CONFIG_SPI_MASTER=y -# CONFIG_SQUASHFS is not set -CONFIG_SRAM=y -CONFIG_SRAM_EXEC=y -CONFIG_SRCU=y -# CONFIG_STANDALONE is not set -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_SWIOTLB=y -CONFIG_SWPHY=y -# CONFIG_SWP_EMULATE is not set -CONFIG_SYNC_FILE=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -# CONFIG_THUMB2_KERNEL is not set -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TINY_SRCU=y -CONFIG_TOUCHSCREEN_ATMEL_MXT=y -CONFIG_TOUCHSCREEN_PROPERTIES=y -CONFIG_UACCESS_WITH_MEMCPY=y -CONFIG_UBIFS_FS=y -CONFIG_UBIFS_FS_ADVANCED_COMPR=y -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_USB=y -CONFIG_USB_ACM=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -# CONFIG_USB_AT91 is not set -# CONFIG_USB_ATMEL_USBA is not set -CONFIG_USB_COMMON=y -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_AT91=y -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_GADGET=y -CONFIG_USB_HID=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_AT91=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -# CONFIG_USB_PWC is not set -CONFIG_USB_SERIAL=y -# CONFIG_USB_SERIAL_CONSOLE is not set -CONFIG_USB_SERIAL_FTDI_SIO=y -CONFIG_USB_SERIAL_PL2303=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USE_OF=y -CONFIG_V4L_PLATFORM_DRIVERS=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VFAT_FS=y -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_VIDEOMODE_HELPERS=y -# CONFIG_VIDEO_ATMEL_ISI is not set -# CONFIG_VIDEO_CPIA2 is not set -CONFIG_VIDEO_DEV=y -CONFIG_VIDEO_V4L2=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile index ff801dae8..05f0b58af 100644 --- a/target/linux/at91/image/Makefile +++ b/target/linux/at91/image/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR := 0x20008000 define Build/at91-install-zImage - $(CP) $(KDIR)/zImage $@ + $(CP) $(KDIR)/zImage $@ endef include $(SUBTARGET).mk @@ -24,7 +24,8 @@ define Device/Default $(Device/default-nand) PROFILES := Default FILESYSTEMS := squashfs ubifs ext4 - DEVICE_DTS := $(1) + DEVICE_DTS = $(lastword $(subst _, ,$(1))) + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) KERNEL_NAME := zImage KERNEL_SIZE := 4096k KERNEL := kernel-bin | append-dtb | lzma | uImage lzma @@ -55,17 +56,14 @@ endef define Device/evaluation-dtb $(Device/evaluation) $(Device/dtb) - $(Device/evaluation-zImage) - IMAGES += dtb - IMAGE/dtb := install-dtb KERNEL_SUFFIX := -fit-zImage.itb - KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL = kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb endef define Device/evaluation-fit $(Device/evaluation) KERNEL_SUFFIX := -fit-uImage.itb - KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(DEVICE_DTS).dtb endef define Device/production @@ -77,8 +75,8 @@ endef define Device/production-dtb $(Device/production) $(Device/dtb) - IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \ - | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) | \ + append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef $(eval $(call BuildImage)) diff --git a/target/linux/at91/image/sam9x.mk b/target/linux/at91/image/sam9x.mk index beff34672..bbe410fbf 100644 --- a/target/linux/at91/image/sam9x.mk +++ b/target/linux/at91/image/sam9x.mk @@ -1,3 +1,4 @@ + define Device/default-nand BLOCKSIZE := 128k PAGESIZE := 2048 @@ -15,169 +16,181 @@ define Build/at91-sdcard ::$(DEVICE_NAME)-fit.itb mcopy -i $@.boot \ - $(BIN_DIR)/u-boot-at91sam9x5ek_mmc/u-boot.bin \ - ::u-boot.bin + $(BIN_DIR)/u-boot-at91sam9x5ek_mmc/u-boot.bin \ + ::u-boot.bin mcopy -i $@.boot \ - $(BIN_DIR)/at91bootstrap-at91sam9x5eksd_uboot/at91bootstrap.bin \ - ::BOOT.bin + $(BIN_DIR)/at91bootstrap-at91sam9x5eksd_uboot/at91bootstrap.bin \ + ::BOOT.bin $(CP) uboot-env.txt $@-uboot-env.txt sed -i '2d;3d' $@-uboot-env.txt sed -i '2i board='"$(DEVICE_NAME)"'' $@-uboot-env.txt - sed -i '3i board_name='"$(DEVICE_NAME)"'' $@-uboot-env.txt + sed -i '3i board_name='"$(firstword $(SUPPORTED_DEVICES))"'' $@-uboot-env.txt mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt mcopy -i $@.boot $@-uboot.env ::uboot.env ./gen_at91_sdcard_img.sh \ - $@.img \ - $@.boot \ - $(KDIR)/root.ext4 \ - $(AT91_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) + $@.img \ + $@.boot \ + $(KDIR)/root.ext4 \ + $(AT91_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) gzip -nc9 $@.img > $@ rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt) endef -define Device/at91sam9263ek +define Device/atmel_at91sam9263ek $(Device/evaluation-dtb) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9263-EK endef -TARGET_DEVICES += at91sam9263ek +TARGET_DEVICES += atmel_at91sam9263ek -define Device/at91sam9g15ek +define Device/atmel_at91sam9g15ek $(Device/evaluation) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9G15-EK endef -TARGET_DEVICES += at91sam9g15ek +TARGET_DEVICES += atmel_at91sam9g15ek -define Device/at91sam9g20ek +define Device/atmel_at91sam9g20ek $(Device/evaluation-dtb) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9G20-EK endef -TARGET_DEVICES += at91sam9g20ek +TARGET_DEVICES += atmel_at91sam9g20ek -define Device/at91sam9g20ek_2mmc +define Device/atmel_at91sam9g20ek-2mmc $(Device/evaluation-dtb) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9G20-EK DEVICE_VARIANT := 2MMC + DEVICE_DTS := at91sam9g20ek_2mmc + SUPPORTED_DEVICES := atmel,at91sam9g20ek_2mmc endef -TARGET_DEVICES += at91sam9g20ek_2mmc +TARGET_DEVICES += atmel_at91sam9g20ek-2mmc -define Device/at91sam9g25ek +define Device/atmel_at91sam9g25ek $(Device/evaluation) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9G25-EK endef -TARGET_DEVICES += at91sam9g25ek +TARGET_DEVICES += atmel_at91sam9g25ek -define Device/at91sam9g35ek +define Device/atmel_at91sam9g35ek $(Device/evaluation) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9G35-EK endef -TARGET_DEVICES += at91sam9g35ek +TARGET_DEVICES += atmel_at91sam9g35ek -define Device/at91sam9m10g45ek +define Device/atmel_at91sam9m10g45ek $(Device/evaluation) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9M10G45-EK endef -TARGET_DEVICES += at91sam9m10g45ek +TARGET_DEVICES += atmel_at91sam9m10g45ek -define Device/at91sam9x25ek +define Device/atmel_at91sam9x25ek $(Device/evaluation-dtb) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9X25-EK $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91sam9x25ek +TARGET_DEVICES += atmel_at91sam9x25ek -define Device/at91sam9x35ek +define Device/atmel_at91sam9x35ek $(Device/evaluation-dtb) DEVICE_VENDOR := Atmel DEVICE_MODEL := AT91SAM9X35-EK $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91sam9x35ek +TARGET_DEVICES += atmel_at91sam9x35ek -define Device/lmu5000 +define Device/calamp_lmu5000 $(Device/production) DEVICE_VENDOR := CalAmp DEVICE_MODEL := LMU5000 DEVICE_PACKAGES := kmod-rtc-pcf2123 kmod-usb-acm kmod-usb-serial \ kmod-usb-serial-option kmod-usb-serial-sierrawireless kmod-gpio-mcp23s08 endef -TARGET_DEVICES += lmu5000 +TARGET_DEVICES += calamp_lmu5000 -define Device/tny_a9260 +define Device/calao_tny-a9260 $(Device/production-dtb) DEVICE_VENDOR := Calao - DEVICE_MODEL := TNYA9260 + DEVICE_MODEL := TNY A9260 + DEVICE_DTS := tny_a9260 endef -TARGET_DEVICES += tny_a9260 +TARGET_DEVICES += calao_tny-a9260 -define Device/tny_a9263 +define Device/calao_tny-a9263 $(Device/production-dtb) DEVICE_VENDOR := Calao - DEVICE_MODEL := TNYA9263 + DEVICE_MODEL := TNY A9263 + DEVICE_DTS := tny_a9263 + SUPPORTED_DEVICES := atmel,tny-a9263 endef -TARGET_DEVICES += tny_a9263 +TARGET_DEVICES += calao_tny-a9263 -define Device/tny_a9g20 +define Device/calao_tny-a9g20 $(Device/production-dtb) DEVICE_VENDOR := Calao - DEVICE_MODEL := TNYA9G20 + DEVICE_MODEL := TNY A9G20 + DEVICE_DTS := tny_a9g20 endef -TARGET_DEVICES += tny_a9g20 +TARGET_DEVICES += calao_tny-a9g20 -define Device/usb_a9260 +define Device/calao_usb-a9260 $(Device/production-dtb) DEVICE_VENDOR := Calao - DEVICE_MODEL := USBA9260 + DEVICE_MODEL := USB A9260 + DEVICE_DTS := usb_a9260 endef -TARGET_DEVICES += usb_a9260 +TARGET_DEVICES += calao_usb-a9260 -define Device/usb_a9263 +define Device/calao_usb-a9263 $(Device/production-dtb) DEVICE_VENDOR := Calao - DEVICE_MODEL := USBA9263 + DEVICE_MODEL := USB A9263 + DEVICE_DTS := usb_a9263 + SUPPORTED_DEVICES := atmel,usb-a9263 endef -TARGET_DEVICES += usb_a9263 +TARGET_DEVICES += calao_usb-a9263 -define Device/usb_a9g20 +define Device/calao_usb-a9g20 $(Device/production-dtb) DEVICE_VENDOR := Calao - DEVICE_MODEL := USBA9G20 + DEVICE_MODEL := USB A9G20 + DEVICE_DTS := usb_a9g20 endef -TARGET_DEVICES += usb_a9g20 +TARGET_DEVICES += calao_usb-a9g20 -define Device/ethernut5 +define Device/egnite_ethernut5 $(Device/evaluation) DEVICE_VENDOR := egnite DEVICE_MODEL := Ethernut 5 UBINIZE_OPTS := -E 5 endef -TARGET_DEVICES += ethernut5 +TARGET_DEVICES += egnite_ethernut5 -define Device/at91-q5xr5 +define Device/exegin_q5xr5 $(Device/production-dtb) DEVICE_VENDOR := Exegin - DEVICE_MODEL := Q5XR5 + DEVICE_MODEL := Q5x + DEVICE_VARIANT := rev5 + DEVICE_DTS := at91-q5xr5 KERNEL_SIZE := 2048k DEFAULT := n endef -TARGET_DEVICES += at91-q5xr5 +TARGET_DEVICES += exegin_q5xr5 -define Device/wb45n +define Device/laird_wb45n $(Device/evaluation-fit) DEVICE_VENDOR := Laird DEVICE_MODEL := WB45N @@ -190,4 +203,4 @@ define Device/wb45n SUBPAGESIZE := 2048 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 endef -TARGET_DEVICES += wb45n +TARGET_DEVICES += laird_wb45n diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk index 031e62587..d644f8926 100644 --- a/target/linux/at91/image/sama5.mk +++ b/target/linux/at91/image/sama5.mk @@ -13,87 +13,94 @@ define Build/at91-sdcard mcopy -i $@.boot \ $(KDIR)/$(DEVICE_NAME)-fit-zImage.itb \ - ::$(DEVICE_NAME:at91-%=%)-fit.itb + ::$(DEVICE_NAME)-fit.itb - $(if $(findstring at91-sama5d27_som1_ek,$@), \ + $(if $(findstring sama5d27-som1-ek,$@), \ mcopy -i $@.boot \ - $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc1/u-boot.bin \ + $(BIN_DIR)/u-boot-$(DEVICE_DTS:at91-%=%)_mmc1/u-boot.bin \ ::u-boot.bin mcopy -i $@.boot \ - $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd1_uboot/at91bootstrap.bin \ + $(BIN_DIR)/at91bootstrap-$(DEVICE_DTS:at91-%=%)sd1_uboot/at91bootstrap.bin \ ::BOOT.bin, mcopy -i $@.boot \ - $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc/u-boot.bin \ + $(BIN_DIR)/u-boot-$(DEVICE_DTS:at91-%=%)_mmc/u-boot.bin \ ::u-boot.bin - $(if $(findstring sama5d4_xplained, $@), \ + $(if $(findstring sama5d4-xplained,$@), \ mcopy -i $@.boot \ - $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot_secure/at91bootstrap.bin \ + $(BIN_DIR)/at91bootstrap-$(DEVICE_DTS:at91-%=%)sd_uboot_secure/at91bootstrap.bin \ ::BOOT.bin, mcopy -i $@.boot \ - $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot/at91bootstrap.bin \ + $(BIN_DIR)/at91bootstrap-$(DEVICE_DTS:at91-%=%)sd_uboot/at91bootstrap.bin \ ::BOOT.bin)) $(CP) uboot-env.txt $@-uboot-env.txt sed -i '2d;3d' $@-uboot-env.txt - sed -i '2i board='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt - sed -i '3i board_name='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt + sed -i '2i board='"$(DEVICE_NAME)"'' $@-uboot-env.txt + sed -i '3i board_name='"$(firstword $(SUPPORTED_DEVICES))"'' $@-uboot-env.txt mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt mcopy -i $@.boot $@-uboot.env ::uboot.env ./gen_at91_sdcard_img.sh \ - $@.img \ - $@.boot \ - $(KDIR)/root.ext4 \ - $(AT91_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) + $@.img \ + $@.boot \ + $(KDIR)/root.ext4 \ + $(AT91_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) gzip -nc9 $@.img > $@ rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt) endef -define Device/at91-sama5d2_xplained +define Device/microchip_sama5d2-xplained $(Device/evaluation-dtb) DEVICE_VENDOR := Microchip DEVICE_MODEL := SAMA5D2 Xplained + DEVICE_DTS := at91-sama5d2_xplained + SUPPORTED_DEVICES := atmel,sama5d2-xplained KERNEL_SIZE := 6144k $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91-sama5d2_xplained +TARGET_DEVICES += microchip_sama5d2-xplained -define Device/at91-sama5d27_som1_ek +define Device/microchip_sama5d27-som1-ek $(Device/evaluation-dtb) DEVICE_VENDOR := Microchip DEVICE_MODEL := SAMA5D27 SOM1 Ek + DEVICE_DTS := at91-sama5d27_som1_ek + SUPPORTED_DEVICES := atmel,sama5d27-som1-ek KERNEL_SIZE := 6144k $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91-sama5d27_som1_ek +TARGET_DEVICES += microchip_sama5d27-som1-ek -define Device/at91-sama5d2_ptc_ek +define Device/microchip_sama5d2-ptc-ek $(Device/evaluation-dtb) DEVICE_VENDOR := Microchip DEVICE_MODEL := SAMA5D2 PTC Ek + DEVICE_DTS := at91-sama5d2_ptc_ek + SUPPORTED_DEVICES := atmel,sama5d2-ptc_ek KERNEL_SIZE := 6144k $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91-sama5d2_ptc_ek +TARGET_DEVICES += microchip_sama5d2-ptc-ek - -define Device/at91-sama5d3_xplained +define Device/microchip_sama5d3-xplained $(Device/evaluation-dtb) DEVICE_VENDOR := Microchip DEVICE_MODEL := SAMA5D3 Xplained + DEVICE_DTS := at91-sama5d3_xplained + SUPPORTED_DEVICES := atmel,sama5d3-xplained KERNEL_SIZE := 6144k $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91-sama5d3_xplained +TARGET_DEVICES += microchip_sama5d3-xplained ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"") - define Device/wb50n + define Device/laird_wb50n $(Device/evaluation-fit) DEVICE_VENDOR := Laird DEVICE_MODEL := WB50N @@ -106,15 +113,16 @@ ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") SUBPAGESIZE := 2048 MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 endef - TARGET_DEVICES += wb50n + TARGET_DEVICES += laird_wb50n endif endif - -define Device/at91-sama5d4_xplained +define Device/microchip_sama5d4-xplained $(Device/evaluation-dtb) DEVICE_VENDOR := Microchip DEVICE_MODEL := SAMA5D4 Xplained + DEVICE_DTS := at91-sama5d4_xplained + SUPPORTED_DEVICES := atmel,sama5d4-xplained KERNEL_SIZE := 6144k BLOCKSIZE := 256k PAGESIZE := 4096 @@ -122,4 +130,4 @@ define Device/at91-sama5d4_xplained MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 $(Device/evaluation-sdimage) endef -TARGET_DEVICES += at91-sama5d4_xplained +TARGET_DEVICES += microchip_sama5d4-xplained diff --git a/target/linux/at91/image/uboot-env.txt b/target/linux/at91/image/uboot-env.txt index 80d051b72..9cdccc9a2 100644 --- a/target/linux/at91/image/uboot-env.txt +++ b/target/linux/at91/image/uboot-env.txt @@ -1,13 +1,13 @@ /* Do Not remove First 2 lines, Makefile will modify these lines with proper board names */ -board=at91sam9x25ek -board_name=at91sam9x25ek +board=atmel_at91sam9x25ek +board_name=atmel,at91sam9x25ek bootargs=console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 bootargsd2=console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait rootfstype=ext4 bootargsxx=console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 bootcmd=run setbootargs; run fatload_mmc; bootm 0x21000000 bootdelay=1 -fatload_mmc=if test ${board_name} = sama5d2_xplained || test ${board_name} = sama5d27_som1_ek; then fatload mmc 1:1 0x21000000 ${board_name}-fit.itb; else fatload mmc 0:1 0x21000000 ${board_name}-fit.itb; fi -setbootargs=if test ${board_name} = sama5d2_xplained || test ${board_name} = sama5d27_som1_ek; then setenv bootargs ${bootargsd2}; else setenv bootargs ${bootargsxx}; fi +fatload_mmc=if test ${board_name} = atmel,sama5d2-xplained || test ${board_name} = atmel,sama5d27-som1-ek; then fatload mmc 1:1 0x21000000 ${board}-fit.itb; else fatload mmc 0:1 0x21000000 ${board}-fit.itb; fi +setbootargs=if test ${board_name} = atmel,sama5d2-xplained || test ${board_name} = atmel,sama5d27-som1-ek; then setenv bootargs ${bootargsd2}; else setenv bootargs ${bootargsxx}; fi ethact=gmac0 stderr=serial stdin=serial diff --git a/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch deleted file mode 100644 index c0eb6dafb..000000000 --- a/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -33,6 +33,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ - usb_a9g20.dtb \ - usb_a9g20_lpw.dtb \ - at91sam9m10g45ek.dtb \ -+ lmu5000.dtb \ - pm9g45.dtb \ - at91sam9n12ek.dtb \ - at91sam9rlek.dtb \ diff --git a/target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch b/target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch deleted file mode 100644 index b3bede41d..000000000 --- a/target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch +++ /dev/null @@ -1,434 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -50,6 +50,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ - wb45n.dtb - dtb-$(CONFIG_SOC_SAM_V7) += \ - at91-kizbox2.dtb \ -+ at91-sama5d2_ptc_ek.dtb \ - at91-sama5d27_som1_ek.dtb \ - at91-sama5d2_xplained.dtb \ - at91-sama5d3_xplained.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts -@@ -0,0 +1,421 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR X11) -+/* -+ * at91-sama5d2_ptc_ek.dts - Device Tree file for SAMA5D2 PTC EK board -+ * -+ * Copyright (C) 2017 Microchip/Atmel, -+ * 2017 Wenyou Yang -+ * 2017 Ludovic Desroches -+ */ -+/dts-v1/; -+#include "sama5d2.dtsi" -+#include "sama5d2-pinfunc.h" -+#include -+#include -+#include -+ -+/ { -+ model = "Atmel SAMA5D2 PTC EK"; -+ compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5"; -+ -+ aliases { -+ serial0 = &uart0; -+ i2c0 = &i2c0; -+ i2c1 = &i2c1; -+ i2c2 = &i2c2; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ memory { -+ reg = <0x20000000 0x80000>; -+ }; -+ -+ clocks { -+ slow_xtal { -+ clock-frequency = <32768>; -+ }; -+ -+ main_xtal { -+ clock-frequency = <24000000>; -+ }; -+ }; -+ -+ ahb { -+ usb0: gadget@00300000 { -+ atmel,vbus-gpio = <&pioA PIN_PB11 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usba_vbus>; -+ status = "okay"; -+ }; -+ -+ usb1: ohci@00400000 { -+ num-ports = <3>; -+ atmel,vbus-gpio = <0 -+ &pioA PIN_PB12 GPIO_ACTIVE_HIGH -+ 0 -+ >; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usb_default>; -+ status = "okay"; -+ }; -+ -+ usb2: ehci@00500000 { -+ status = "okay"; -+ }; -+ -+ nand0: nand@80000000 { -+ nand-bus-width = <8>; -+ nand-ecc-mode = "hw"; -+ nand-on-flash-bbt; -+ atmel,has-pmecc; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_nand_default>; -+ status = "okay"; /* conflicts with sdmmc1 and qspi0 */ -+ -+ at91bootstrap@0 { -+ label = "bootstrap"; -+ reg = <0x0 0x40000>; -+ }; -+ -+ bootloader@40000 { -+ label = "bootloader"; -+ reg = <0x40000 0xc0000>; -+ }; -+ -+ bootloaderenv@0x100000 { -+ label = "bootloader env"; -+ reg = <0x100000 0x40000>; -+ }; -+ -+ bootloaderenvred@0x140000 { -+ label = "bootloader env redundant"; -+ reg = <0x140000 0x40000>; -+ }; -+ -+ dtb@180000 { -+ label = "device tree"; -+ reg = <0x180000 0x80000>; -+ }; -+ -+ kernel@200000 { -+ label = "kernel"; -+ reg = <0x200000 0x600000>; -+ }; -+ -+ rootfs@800000 { -+ label = "rootfs"; -+ reg = <0x800000 0x1f800000>; -+ }; -+ }; -+ -+ sdmmc0: sdio-host@a0000000 { -+ bus-width = <8>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_sdmmc0_default>; -+ status = "okay"; -+ }; -+ -+ apb { -+ pmc: pmc@f0014000 { -+ pmc_fast_restart { -+ compatible = "atmel,sama5d2-pmc-fast-startup"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ atmel,wakeup-rtc-timer; -+ -+ wkpin: input@0 { -+ reg = <0>; -+ }; -+ -+ gmac_wol: input@10 { -+ reg = <10>; -+ atmel,wakeup-active-high; -+ }; -+ }; -+ }; -+ -+ spi0: spi@f8000000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_spi0_default>; -+ status = "okay"; -+ -+ /* -+ m25p80@0 { -+ compatible = "atmel,at25df321a"; -+ reg = <0>; -+ spi-max-frequency = <50000000>; -+ }; -+ */ -+ }; -+ -+ macb0: ethernet@f8008000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>; -+ phy-mode = "rmii"; -+ status = "okay"; -+ -+ ethernet-phy@1 { -+ reg = <0x1>; -+ interrupt-parent = <&pioA>; -+ interrupts = <56 IRQ_TYPE_LEVEL_LOW>; -+ }; -+ }; -+ -+ uart0: serial@f801c000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart0_default>; -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ status = "okay"; -+ }; -+ -+ uart2: serial@f8024000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart2_default>; -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ status = "okay"; -+ }; -+ -+ i2c0: i2c@f8028000 { -+ dmas = <0>, <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c0_default>; -+ i2c-sda-hold-time-ns = <350>; -+ status = "okay"; -+ }; -+ -+ flx0: flexcom@f8034000 { -+ atmel,flexcom-mode = ; -+ status = "okay"; -+ -+ i2c2: i2c@600 { -+ compatible = "atmel,sama5d2-i2c"; -+ reg = <0x600 0x200>; -+ interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>; -+ dmas = <0>, <0>; -+ dma-names = "tx", "rx"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ clocks = <&flx0_clk>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flx0_default>; -+ atmel,fifo-size = <16>; -+ status = "okay"; -+ }; -+ }; -+ -+ shdwc@f8048010 { -+ atmel,shdwc-debouncer = <976>; -+ -+ input@0 { -+ reg = <0>; -+ atmel,wakeup-type = "low"; -+ }; -+ }; -+ -+ watchdog@f8048040 { -+ status = "okay"; -+ }; -+ -+ spi1: spi@fc000000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_spi1_default>; -+ status = "okay"; -+ }; -+ -+ i2c1: i2c@fc028000 { -+ dmas = <0>, <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c1_default>; -+ status = "okay"; -+ -+ at24@50 { -+ compatible = "24c02"; -+ reg = <0x50>; -+ pagesize = <8>; -+ }; -+ }; -+ -+ pinctrl@fc038000 { -+ pinctrl_flx0_default: flx0_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_i2c0_default: i2c0_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_i2c1_default: i2c1_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_key_gpio_default: key_gpio_default { -+ pinmux = ; -+ bias-pull-up; -+ }; -+ -+ pinctrl_led_gpio_default: led_gpio_default { -+ pinmux = , -+ , -+ ; -+ bias-pull-up; -+ }; -+ -+ pinctrl_macb0_default: macb0_default { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_macb0_phy_irq: macb0_phy_irq { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_nand_default: nand_default { -+ re_we_data { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-pull-up; -+ }; -+ -+ ale_cle_rdy_cs { -+ pinmux = , -+ , -+ , -+ ; -+ bias-pull-up; -+ }; -+ }; -+ -+ pinctrl_sdmmc0_default: sdmmc0_default { -+ cmd_data { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-pull-up; -+ }; -+ -+ ck_cd_vddsel { -+ pinmux = , -+ , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ pinctrl_spi0_default: spi0_default { -+ pinmux = , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_spi1_default: spi1_default { -+ pinmux = , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_uart0_default: uart0_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_uart2_default: uart2_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_usb_default: usb_default { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_usba_vbus: usba_vbus { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ }; -+ -+ ptc@fc060000 { -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_key_gpio_default>; -+ -+ bp1 { -+ label = "PB_USER"; -+ gpios = <&pioA PIN_PA10 GPIO_ACTIVE_LOW>; -+ linux,code = <0x104>; -+ wakeup-source; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_led_gpio_default>; -+ status = "okay"; -+ -+ red { -+ label = "red"; -+ gpios = <&pioA PIN_PB10 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ green { -+ label = "green"; -+ gpios = <&pioA PIN_PB8 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ blue { -+ label = "blue"; -+ gpios = <&pioA PIN_PB6 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ }; -+}; diff --git a/target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-5.4/101-ARM-at91-build-dtb-for-q5xr5.patch similarity index 74% rename from target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch rename to target/linux/at91/patches-5.4/101-ARM-at91-build-dtb-for-q5xr5.patch index 6c84c9401..b736b99f7 100644 --- a/target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch +++ b/target/linux/at91/patches-5.4/101-ARM-at91-build-dtb-for-q5xr5.patch @@ -1,10 +1,10 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -41,6 +41,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ +@@ -38,6 +38,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ at91-ariettag25.dtb \ at91-cosino_mega2560.dtb \ at91-kizboxmini.dtb \ + at91-q5xr5.dtb \ + at91-wb45n.dtb \ at91sam9g15ek.dtb \ at91sam9g25ek.dtb \ - at91sam9g35ek.dtb \ diff --git a/target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-5.4/102-ARM-at91-build-dtb-for-wb45n.patch similarity index 74% rename from target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch rename to target/linux/at91/patches-5.4/102-ARM-at91-build-dtb-for-wb45n.patch index f6190c495..c35ecc510 100644 --- a/target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch +++ b/target/linux/at91/patches-5.4/102-ARM-at91-build-dtb-for-wb45n.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -46,7 +46,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ +@@ -44,7 +44,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ at91sam9g25ek.dtb \ at91sam9g35ek.dtb \ at91sam9x25ek.dtb \ @@ -9,4 +9,4 @@ + wb45n.dtb dtb-$(CONFIG_SOC_SAM_V7) += \ at91-kizbox2.dtb \ - at91-sama5d27_som1_ek.dtb \ + at91-nattis-2-natte-2.dtb \ diff --git a/target/linux/at91/patches-5.4/102-ARM-at91-wb45n-fix-duplicate-label.patch b/target/linux/at91/patches-5.4/102-ARM-at91-wb45n-fix-duplicate-label.patch new file mode 100644 index 000000000..9d060426e --- /dev/null +++ b/target/linux/at91/patches-5.4/102-ARM-at91-wb45n-fix-duplicate-label.patch @@ -0,0 +1,20 @@ +--- a/arch/arm/boot/dts/wb45n.dts ++++ b/arch/arm/boot/dts/wb45n.dts +@@ -126,7 +126,7 @@ + }; + }; + +- usb0: ohci@00600000 { ++ usb0: ohci@600000 { + status = "okay"; + num-ports = <2>; + atmel,vbus-gpio = < +@@ -136,7 +136,7 @@ + atmel,oc-gpio = <&pioB 13 GPIO_ACTIVE_LOW>; + }; + +- usb1: ehci@00700000 { ++ usb1: ehci@700000 { + status = "okay"; + }; + diff --git a/target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-5.4/103-ARM-at91-build-dtb-for-wb50n.patch similarity index 85% rename from target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch rename to target/linux/at91/patches-5.4/103-ARM-at91-build-dtb-for-wb50n.patch index 324017c51..ab5d7afcb 100644 --- a/target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch +++ b/target/linux/at91/patches-5.4/103-ARM-at91-build-dtb-for-wb50n.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -63,7 +63,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \ +@@ -66,7 +66,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \ at91-sama5d4_ma5d4evk.dtb \ at91-sama5d4_xplained.dtb \ at91-sama5d4ek.dtb \ diff --git a/target/linux/at91/patches-5.4/103-ARM-at91-wb50n-fix-duplicate-label.patch b/target/linux/at91/patches-5.4/103-ARM-at91-wb50n-fix-duplicate-label.patch new file mode 100644 index 000000000..bfe6e5a9b --- /dev/null +++ b/target/linux/at91/patches-5.4/103-ARM-at91-wb50n-fix-duplicate-label.patch @@ -0,0 +1,39 @@ +--- a/arch/arm/boot/dts/wb50n.dts ++++ b/arch/arm/boot/dts/wb50n.dts +@@ -60,15 +60,15 @@ + }; + }; + +- usb0: gadget@00500000 { ++ usb0: gadget@500000 { + status = "okay"; + }; + +- usb1: ohci@00600000 { ++ usb1: ohci@600000 { + status = "okay"; + }; + +- usb2: ehci@00700000 { ++ usb2: ehci@700000 { + status = "okay"; + }; + }; +--- a/arch/arm/boot/dts/wb50n.dtsi ++++ b/arch/arm/boot/dts/wb50n.dtsi +@@ -185,13 +185,13 @@ + + }; + +- usb0: gadget@00500000 { ++ usb0: gadget@500000 { + atmel,vbus-gpio = <&pioB 13 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usba_vbus>; + }; + +- usb1: ohci@00600000 { ++ usb1: ohci@600000 { + num-ports = <3>; + atmel,vbus-gpio = <&pioA 2 GPIO_ACTIVE_LOW>; + atmel,oc-gpio = <&pioA 4 GPIO_ACTIVE_LOW>; diff --git a/target/linux/at91/sam9x/config-default b/target/linux/at91/sam9x/config-default index a8923a6ef..a05831fe1 100644 --- a/target/linux/at91/sam9x/config-default +++ b/target/linux/at91/sam9x/config-default @@ -1,18 +1,53 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_BINFMT_FLAT=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_DMA_WRITE_COMBINE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_KCOV=y +CONFIG_ARCH_HAS_KEEPINITRD=y +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_ARCH_HAS_PHYS_TO_DMA=y +CONFIG_ARCH_HAS_SETUP_DMA_OPS=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y # CONFIG_ARCH_MULTI_V4 is not set CONFIG_ARCH_MULTI_V4T=y CONFIG_ARCH_MULTI_V4_V5=y CONFIG_ARCH_MULTI_V5=y -# CONFIG_ARCH_MULTI_V7 is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set -# CONFIG_ARM_AT91_CPUIDLE is not set +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +CONFIG_ARM_HAS_SG_CHAIN=y CONFIG_ARM_L1_CACHE_SHIFT=5 -# CONFIG_AT91RM9200_WATCHDOG is not set -# CONFIG_AT91_SAMA5D2_ADC is not set -CONFIG_ATMEL_AIC_IRQ=y -CONFIG_ATMEL_ST=y -CONFIG_BACKLIGHT_ATMEL_LCDC=y -# CONFIG_CACHE_L2X0 is not set -CONFIG_CMA_DEBUGFS=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_CC_HAS_KASAN_GENERIC=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y CONFIG_CPU_32v4T=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV4T=y @@ -23,42 +58,131 @@ CONFIG_CPU_ARM926T=y CONFIG_CPU_CACHE_V4WT=y CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y # CONFIG_CPU_DCACHE_WRITETHROUGH is not set -# CONFIG_CPU_IDLE_GOV_MENU is not set CONFIG_CPU_NO_EFFICIENT_FFS=y CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_THUMB_CAPABLE=y CONFIG_CPU_TLB_V4WBI=y CONFIG_CPU_USE_DOMAINS=y CONFIG_CRC7=y CONFIG_CRC_CCITT=y CONFIG_CRC_ITU_T=y +CONFIG_CRYPTO_RNG2=y CONFIG_DEBUG_INFO=y -CONFIG_FB_ATMEL=y -CONFIG_FB_BACKLIGHT=y -CONFIG_FB_MODE_HELPERS=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DMA_REMAP=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y -# CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HZ=128 -CONFIG_HZ_FIXED=128 +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PCI=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HZ=100 +CONFIG_HZ_100=y +CONFIG_HZ_FIXED=0 CONFIG_HZ_PERIODIC=y -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_ATMEL_FLEXCOM is not set -# CONFIG_MMC_SDHCI is not set -CONFIG_MMC_SPI=y -# CONFIG_MTD_SPI_NOR is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MEMFD_CREATE=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_OF_AT91=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_KUSER_HELPERS=y -# CONFIG_NO_HZ_IDLE is not set -# CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC is not set -# CONFIG_REGULATOR_ACT8865 is not set -CONFIG_RTC_DRV_AT91SAM9=y -# CONFIG_SAMA5D4_WATCHDOG is not set -# CONFIG_SND_ARM is not set -# CONFIG_SND_ATMEL_SOC_CLASSD is not set -# CONFIG_SND_DRIVERS is not set -# CONFIG_SND_SPI is not set -CONFIG_SOC_AT91RM9200=y -CONFIG_SOC_AT91SAM9=y -CONFIG_SOC_SAM_V4_V5=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_NET=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_RATIONAL=y +CONFIG_REFCOUNT_FULL=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SPARSE_IRQ=y CONFIG_SPLIT_PTLOCK_CPUS=999999 -CONFIG_TOUCHSCREEN_ADS7846=y -# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set +CONFIG_SRCU=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +# CONFIG_VFP is not set +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default index e69de29bb..1f4967850 100644 --- a/target/linux/at91/sama5/config-default +++ b/target/linux/at91/sama5/config-default @@ -0,0 +1,561 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_AT91=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_BINFMT_FLAT=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_KCOV=y +CONFIG_ARCH_HAS_KEEPINITRD=y +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_ARCH_HAS_PHYS_TO_DMA=y +CONFIG_ARCH_HAS_SETUP_DMA_OPS=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_KEEP_MEMBLOCK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +CONFIG_ARM_AT91_CPUIDLE=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_AT91SAM9X_WATCHDOG=y +CONFIG_AT91_ADC=y +CONFIG_AT91_SAMA5D2_ADC=y +CONFIG_AT91_SOC_ID=y +CONFIG_ATMEL_AIC5_IRQ=y +# CONFIG_ATMEL_CLOCKSOURCE_PIT is not set +CONFIG_ATMEL_CLOCKSOURCE_TCB=y +CONFIG_ATMEL_EBI=y +CONFIG_ATMEL_PM=y +CONFIG_ATMEL_SDRAMC=y +CONFIG_ATMEL_SSC=y +CONFIG_ATMEL_TCB_CLKSRC=y +CONFIG_ATMEL_TCLIB=y +CONFIG_AT_HDMAC=y +CONFIG_AT_XDMAC=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_PWM=y +CONFIG_BATTERY_ACT8945A=y +CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=4 +CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_PM=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_CACHE_L2X0=y +CONFIG_CC_HAS_KASAN_GENERIC=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw" +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_AT91=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_CONFIGFS_FS=y +CONFIG_CONTIG_ALLOC=y +CONFIG_COREDUMP=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRASH_CORE=y +CONFIG_CRASH_DUMP=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CCM=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CTR=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_GCM=y +CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_GHASH=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DEBUG_MEMORY_INIT=y +CONFIG_DEBUG_USER=y +CONFIG_DMADEVICES=y +CONFIG_DMA_CMA=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_REMAP=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DNOTIFY=y +CONFIG_DRM=y +CONFIG_DRM_ATMEL_HLCDC=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +CONFIG_DRM_GEM_CMA_HELPER=y +CONFIG_DRM_KMS_CMA_HELPER=y +CONFIG_DRM_KMS_FB_HELPER=y +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y +CONFIG_DRM_PANEL_SIMPLE=y +# CONFIG_DRM_TVE200 is not set +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +CONFIG_ELF_CORE=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_EXT4_FS=y +CONFIG_FAT_FS=y +CONFIG_FB=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_CMDLINE=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_SYS_IMAGEBLIT=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FORCE_MAX_ZONEORDER=15 +CONFIG_FREEZER=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_AT91_AUDIO_PLL=y +CONFIG_HAVE_AT91_GENERATED_CLK=y +CONFIG_HAVE_AT91_H32MX=y +CONFIG_HAVE_AT91_I2S_MUX_CLK=y +CONFIG_HAVE_AT91_SMD=y +CONFIG_HAVE_AT91_USB_CLK=y +CONFIG_HAVE_AT91_UTMI=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PCI=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_SMP=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HDMI=y +CONFIG_HID=y +CONFIG_HID_GENERIC=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_ATMEL=y +CONFIG_HZ=100 +CONFIG_HZ_100=y +CONFIG_HZ_FIXED=0 +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_AT91=y +# CONFIG_I2C_AT91_SLAVE_EXPERIMENTAL is not set +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_COMPAT=y +CONFIG_I2C_GPIO=y +CONFIG_I2C_HELPER_AUTO=y +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +CONFIG_IIO_KFIFO_BUF=y +CONFIG_IIO_TRIGGER=y +CONFIG_IIO_TRIGGERED_BUFFER=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_INPUT_EVDEV=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INPUT_LEDS=y +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +# CONFIG_JFFS2_FS is not set +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_XZ is not set +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_KEYBOARD_GPIO=y +CONFIG_KEYBOARD_QT1070=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_PWM=y +CONFIG_LEDS_TRIGGER_CPU=y +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LIBFDT=y +CONFIG_LOCALVERSION_AUTO=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOG_BUF_SHIFT=16 +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACB=y +CONFIG_MACB_USE_HWSTAMP=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MANDATORY_FILE_LOCKING=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_SUPPORT=y +CONFIG_MEDIA_USB_SUPPORT=y +CONFIG_MEMFD_CREATE=y +CONFIG_MEMORY=y +CONFIG_MEMORY_ISOLATION=y +CONFIG_MFD_ACT8945A=y +CONFIG_MFD_AT91_USART=y +CONFIG_MFD_ATMEL_FLEXCOM=y +CONFIG_MFD_ATMEL_HLCDC=y +CONFIG_MFD_ATMEL_SMC=y +CONFIG_MFD_CORE=y +CONFIG_MFD_SYSCON=y +CONFIG_MICREL_PHY=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_ATMELMCI=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_OF_AT91=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MTD_CFI_AMDSTD is not set +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_BLOCK is not set +CONFIG_MTD_UBI_FASTMAP=y +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +# CONFIG_NEON is not set +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_UTF8=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NVMEM=y +CONFIG_NVMEM_SYSFS=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_OF_NET=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PAGE_OFFSET=0xC0000000 +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_AT91=y +CONFIG_PINCTRL_AT91PIO4=y +# CONFIG_PINCTRL_SINGLE is not set +CONFIG_PM=y +CONFIG_PM_ADVANCED_DEBUG=y +CONFIG_PM_CLK=y +CONFIG_PM_DEBUG=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_DEBUG=y +# CONFIG_PM_TEST_SUSPEND is not set +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_AT91_POWEROFF=y +CONFIG_POWER_RESET_AT91_RESET=y +CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y +CONFIG_POWER_SUPPLY=y +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +CONFIG_PRINTK_TIME=y +CONFIG_PROC_VMCORE=y +CONFIG_PWM=y +CONFIG_PWM_ATMEL=y +CONFIG_PWM_ATMEL_HLCDC_PWM=y +CONFIG_PWM_ATMEL_TCB=y +CONFIG_PWM_SYSFS=y +CONFIG_RATIONAL=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_ACT8865=y +CONFIG_REGULATOR_ACT8945A=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_AT91RM9200=y +# CONFIG_RTC_DRV_AT91SAM9 is not set +# CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_SAMA5D4_WATCHDOG=y +CONFIG_SCSI=y +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SERIAL_8250 is not set +CONFIG_SERIAL_ATMEL=y +CONFIG_SERIAL_ATMEL_CONSOLE=y +CONFIG_SERIAL_ATMEL_PDC=y +# CONFIG_SERIAL_ATMEL_TTYAT is not set +CONFIG_SERIAL_MCTRL_GPIO=y +CONFIG_SGL_ALLOC=y +CONFIG_SG_POOL=y +CONFIG_SND=y +CONFIG_SND_ARM=y +# CONFIG_SND_AT73C213 is not set +# CONFIG_SND_AT91_SOC_SAM9G20_WM8731 is not set +# CONFIG_SND_AT91_SOC_SAM9X5_WM8731 is not set +CONFIG_SND_ATMEL_SOC=y +CONFIG_SND_ATMEL_SOC_CLASSD=y +CONFIG_SND_ATMEL_SOC_DMA=y +CONFIG_SND_ATMEL_SOC_I2S=y +CONFIG_SND_ATMEL_SOC_PDC=y +# CONFIG_SND_ATMEL_SOC_PDMIC is not set +CONFIG_SND_ATMEL_SOC_SSC=y +CONFIG_SND_ATMEL_SOC_SSC_DMA=y +# CONFIG_SND_ATMEL_SOC_SSC_PDC is not set +# CONFIG_SND_ATMEL_SOC_TSE850_PCM5142 is not set +CONFIG_SND_ATMEL_SOC_WM8904=y +# CONFIG_SND_COMPRESS_OFFLOAD is not set +CONFIG_SND_DMAENGINE_PCM=y +CONFIG_SND_JACK=y +CONFIG_SND_JACK_INPUT_DEV=y +# CONFIG_SND_MCHP_SOC_I2S_MCC is not set +CONFIG_SND_PCM=y +CONFIG_SND_PCM_TIMER=y +CONFIG_SND_SOC=y +CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y +CONFIG_SND_SOC_I2C_AND_SPI=y +CONFIG_SND_SOC_MIKROE_PROTO=y +CONFIG_SND_SOC_WM8731=y +CONFIG_SND_SOC_WM8904=y +CONFIG_SND_SPI=y +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_TIMER=y +CONFIG_SOC_BUS=y +CONFIG_SOC_SAMA5=y +CONFIG_SOC_SAMA5D2=y +CONFIG_SOC_SAMA5D3=y +CONFIG_SOC_SAMA5D4=y +CONFIG_SOC_SAM_V7=y +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +# CONFIG_SPI_AT91_USART is not set +CONFIG_SPI_ATMEL=y +CONFIG_SPI_ATMEL_QUADSPI=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_GPIO=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +# CONFIG_SQUASHFS is not set +CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y +CONFIG_SRCU=y +# CONFIG_STANDALONE is not set +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +CONFIG_SWPHY=y +# CONFIG_SWP_EMULATE is not set +CONFIG_SYNC_FILE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_TOUCHSCREEN_ATMEL_MXT=y +CONFIG_TOUCHSCREEN_PROPERTIES=y +CONFIG_UACCESS_WITH_MEMCPY=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UBIFS_FS_ZSTD=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNWINDER_ARM=y +CONFIG_USB=y +CONFIG_USB_ACM=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +# CONFIG_USB_AT91 is not set +# CONFIG_USB_ATMEL_USBA is not set +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_AT91=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +CONFIG_USB_GADGET=y +CONFIG_USB_HID=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_AT91=y +CONFIG_USB_OHCI_HCD_PLATFORM=y +# CONFIG_USB_PWC is not set +CONFIG_USB_SERIAL=y +# CONFIG_USB_SERIAL_CONSOLE is not set +CONFIG_USB_SERIAL_FTDI_SIO=y +CONFIG_USB_SERIAL_PL2303=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_V4L_PLATFORM_DRIVERS=y +CONFIG_VFAT_FS=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VIDEOMODE_HELPERS=y +# CONFIG_VIDEO_ATMEL_ISI is not set +# CONFIG_VIDEO_CPIA2 is not set +CONFIG_VIDEO_DEV=y +CONFIG_VIDEO_V4L2=y +CONFIG_VIDEO_V4L2_I2C=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +CONFIG_XXHASH=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/ath25/Makefile b/target/linux/ath25/Makefile index f88511246..8b175fc19 100644 --- a/target/linux/ath25/Makefile +++ b/target/linux/ath25/Makefile @@ -11,7 +11,7 @@ BOARD:=ath25 BOARDNAME:=Atheros AR231x/AR5312 FEATURES:=squashfs low_mem small_flash -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=5.4 define Target/Description Build firmware images for Atheros SoC boards diff --git a/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros b/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros index 235ba4bef..b795aac45 100644 --- a/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros +++ b/target/linux/ath25/base-files/lib/preinit/15_preinit_iface_atheros @@ -1,12 +1,10 @@ -# reset button only supported on ar5315+ at the moment preinit_ip() { if [ -z "$pi_ifname" ]; then grep -q 'Atheros AR231[567]' /proc/cpuinfo && { if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \ -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then - vconfig set_name_type DEV_PLUS_VID_NO_PAD ip link set eth0 up - vconfig add eth0 1 + ip link add link eth0 name eth0.1 type vlan id 1 ifname=eth0.1 else ifname=eth0 @@ -20,13 +18,10 @@ preinit_ip() { } } - -# reset button only supported on ar5315+ at the moment - preinit_ip_deconfig() { if [ -e "/sys/bus/mdio_bus/drivers/Infineon ADM6996/0:00" -o \ -e "/sys/bus/mdio_bus/drivers/Marvell 88E6060/0:10" ]; then - vconfig rem eth0.1 2>/dev/null + ip link del eth0.1 2>/dev/null ip link set $pi_ifname down elif [ -n "$pi_ifname" ]; then ip -4 addr flush dev $pi_ifname diff --git a/target/linux/ath25/config-4.14 b/target/linux/ath25/config-5.4 similarity index 76% rename from target/linux/ath25/config-4.14 rename to target/linux/ath25/config-5.4 index 4d3f0c697..f59f48f65 100644 --- a/target/linux/ath25/config-4.14 +++ b/target/linux/ath25/config-5.4 @@ -1,26 +1,26 @@ CONFIG_ADM6996_PHY=y CONFIG_AR2315_WDT=y CONFIG_AR8216_PHY=y -CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y +CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y +CONFIG_ARCH_HAS_DMA_WRITE_COMBINE=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set -# CONFIG_ARCH_HAS_SG_CHAIN is not set -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set +CONFIG_ARCH_HAS_PHYS_TO_DMA=y +CONFIG_ARCH_HAS_PTE_SPECIAL=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y +CONFIG_ARCH_HAS_UNCACHED_SEGMENT=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_MMAP_RND_BITS_MAX=15 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_MEMREMAP_PROT=y CONFIG_ARCH_USE_QUEUED_RWLOCKS=y CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ATH25=y CONFIG_BLK_MQ_PCI=y @@ -29,8 +29,10 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="console=ttyS0,9600 rootfstype=squashfs,jffs2" CONFIG_CMDLINE_BOOL=y # CONFIG_CMDLINE_OVERRIDE is not set +CONFIG_COMPAT_32BIT_TIME=y CONFIG_CPU_BIG_ENDIAN=y CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_LOAD_STORE_LR=y CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_SYNC=y CONFIG_CPU_MIPS32=y @@ -38,23 +40,34 @@ CONFIG_CPU_MIPS32_R1=y CONFIG_CPU_MIPSR1=y CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y CONFIG_CPU_R4K_CACHE_TLB=y -CONFIG_CPU_R4K_FPU=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y CONFIG_DMA_NONCOHERENT=y +CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y CONFIG_EARLY_PRINTK=y +CONFIG_EFI_EARLYCON=y CONFIG_ETHERNET_PACKET_MANGLE=y +CONFIG_FONT_8x16=y +CONFIG_FONT_AUTOSELECT=y +CONFIG_FONT_SUPPORT=y +CONFIG_FORCE_PCI=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_IO=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_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y @@ -62,49 +75,48 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIO_AR2315=y CONFIG_GPIO_AR5312=y -CONFIG_GPIO_SYSFS=y -# CONFIG_GRO_CELLS 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_HAVE_64BIT_ALIGNED_ACCESS is not set -# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_COMPILER_H=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_ASM_MODVERSIONS=y CONFIG_HAVE_CBPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_COPY_THREAD_TLS=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FAST_GUP=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_GENERIC_VDSO=y CONFIG_HAVE_IDE=y +CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y -CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PCI=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HW_HAS_PCI=y CONFIG_HW_RANDOM=y +CONFIG_HZ=250 +CONFIG_HZ_250=y CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IP17XX_PHY=y @@ -113,17 +125,19 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y CONFIG_LEDS_GPIO=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y +CONFIG_MEMFD_CREATE=y +CONFIG_MIGRATION=y CONFIG_MIPS=y CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_CBPF_JIT=y CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_MIPS_MACHINE is not set CONFIG_MODULES_USE_ELF_REL=y CONFIG_MTD_AR2315=y CONFIG_MTD_CFI_ADV_OPTIONS=y @@ -138,7 +152,6 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_AR231X=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y -# CONFIG_NO_IOPORT_MAP is not set # CONFIG_OF is not set CONFIG_PCI=y CONFIG_PCI_AR2315=y @@ -148,13 +161,9 @@ CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y -# CONFIG_RCU_NEED_SEGCBLIST is not set -# CONFIG_RCU_STALL_COMMON is not set -# CONFIG_SCHED_INFO is not set -# CONFIG_SCSI_DMA is not set -# CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 +CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SOC_AR2315=y CONFIG_SOC_AR5312=y CONFIG_SRCU=y @@ -166,6 +175,7 @@ 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_TARGET_ISA_REV=1 CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y diff --git a/target/linux/ath25/image/Makefile b/target/linux/ath25/image/Makefile index 8066ba61a..afc6c9125 100644 --- a/target/linux/ath25/image/Makefile +++ b/target/linux/ath25/image/Makefile @@ -73,43 +73,45 @@ define Device/generic endef TARGET_DEVICES += generic -define Device/ubnt2-pico2 +define Device/ubnt_picostation-2 DEVICE_VENDOR := Ubiquiti - DEVICE_MODEL := XS2-8 + DEVICE_MODEL := Picostation 2 (XS2-8) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2-8 -v XS2.ar2316 endef -TARGET_DEVICES += ubnt2-pico2 +TARGET_DEVICES += ubnt_picostation-2 -define Device/ubnt2 +define Device/ubnt_nanostation-2 DEVICE_VENDOR := Ubiquiti - DEVICE_MODEL := XS2 + DEVICE_MODEL := Nanostation 2 (XS2) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2 -v XS2.ar2316 + DEFAULT := n endef -TARGET_DEVICES += ubnt2 +TARGET_DEVICES += ubnt_nanostation-2 -define Device/ubnt5 +define Device/ubnt_nanostation-5 DEVICE_VENDOR := Ubiquiti - DEVICE_MODEL := XS5 + DEVICE_MODEL := Nanostation 5 (XS5) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS5 -v XS5.ar2313 + DEFAULT := n endef -TARGET_DEVICES += ubnt5 +TARGET_DEVICES += ubnt_nanostation-5 -define Device/np25g +define Device/compex_np25g DEVICE_VENDOR := Compex DEVICE_MODEL := NP25G KERNEL := kernel-bin | gzip-kernel IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw np25g BROKEN := y endef -TARGET_DEVICES += np25g +TARGET_DEVICES += compex_np25g -define Device/wpe53g +define Device/compex_wpe53g DEVICE_VENDOR := Compex DEVICE_MODEL := WPE53G KERNEL := kernel-bin | gzip-kernel IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw wpe53g BROKEN := y endef -TARGET_DEVICES += wpe53g +TARGET_DEVICES += compex_wpe53g $(eval $(call BuildImage)) diff --git a/target/linux/ath25/patches-4.14/107-ar5312_gpio.patch b/target/linux/ath25/patches-5.4/107-ar5312_gpio.patch similarity index 92% rename from target/linux/ath25/patches-4.14/107-ar5312_gpio.patch rename to target/linux/ath25/patches-5.4/107-ar5312_gpio.patch index e74e20b05..cd7b27d63 100644 --- a/target/linux/ath25/patches-4.14/107-ar5312_gpio.patch +++ b/target/linux/ath25/patches-5.4/107-ar5312_gpio.patch @@ -52,7 +52,7 @@ if (!ath25_board.radio) --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -105,6 +105,13 @@ config GPIO_AMDPT +@@ -113,6 +113,13 @@ config GPIO_AMDPT driver for GPIO functionality on Promontory IOHub Require ACPI ASL code to enumerate as a platform device. @@ -68,14 +68,14 @@ depends on (ARCH_ASPEED || COMPILE_TEST) && OF_GPIO --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile -@@ -29,6 +29,7 @@ obj-$(CONFIG_GPIO_ALTERA) += gpio-alte - obj-$(CONFIG_GPIO_ALTERA_A10SR) += gpio-altera-a10sr.o - obj-$(CONFIG_GPIO_AMD8111) += gpio-amd8111.o - obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o -+obj-$(CONFIG_GPIO_AR5312) += gpio-ar5312.o - obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o - obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o - obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o +@@ -30,6 +30,7 @@ obj-$(CONFIG_GPIO_ALTERA) += gpio-alt + obj-$(CONFIG_GPIO_AMD8111) += gpio-amd8111.o + obj-$(CONFIG_GPIO_AMD_FCH) += gpio-amd-fch.o + obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o ++obj-$(CONFIG_GPIO_AR5312) += gpio-ar5312.o + obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o + obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o + obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o --- /dev/null +++ b/drivers/gpio/gpio-ar5312.c @@ -0,0 +1,121 @@ @@ -202,7 +202,7 @@ +subsys_initcall(ar5312_gpio_init); --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -175,6 +175,7 @@ config ATH25 +@@ -189,6 +189,7 @@ config ATH25 select CEVT_R4K select CSRC_R4K select DMA_NONCOHERENT diff --git a/target/linux/ath25/patches-4.14/108-ar2315_gpio.patch b/target/linux/ath25/patches-5.4/108-ar2315_gpio.patch similarity index 95% rename from target/linux/ath25/patches-4.14/108-ar2315_gpio.patch rename to target/linux/ath25/patches-5.4/108-ar2315_gpio.patch index 749b308b8..e198cecf1 100644 --- a/target/linux/ath25/patches-4.14/108-ar2315_gpio.patch +++ b/target/linux/ath25/patches-5.4/108-ar2315_gpio.patch @@ -75,7 +75,7 @@ * workaround. Attempt to jump to the mips reset location - --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -105,6 +105,13 @@ config GPIO_AMDPT +@@ -113,6 +113,13 @@ config GPIO_AMDPT driver for GPIO functionality on Promontory IOHub Require ACPI ASL code to enumerate as a platform device. @@ -91,14 +91,14 @@ default y if SOC_AR5312 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile -@@ -29,6 +29,7 @@ obj-$(CONFIG_GPIO_ALTERA) += gpio-alte - obj-$(CONFIG_GPIO_ALTERA_A10SR) += gpio-altera-a10sr.o - obj-$(CONFIG_GPIO_AMD8111) += gpio-amd8111.o - obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o -+obj-$(CONFIG_GPIO_AR2315) += gpio-ar2315.o - obj-$(CONFIG_GPIO_AR5312) += gpio-ar5312.o - obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o - obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o +@@ -30,6 +30,7 @@ obj-$(CONFIG_GPIO_ALTERA) += gpio-alt + obj-$(CONFIG_GPIO_AMD8111) += gpio-amd8111.o + obj-$(CONFIG_GPIO_AMD_FCH) += gpio-amd-fch.o + obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o ++obj-$(CONFIG_GPIO_AR2315) += gpio-ar2315.o + obj-$(CONFIG_GPIO_AR5312) += gpio-ar5312.o + obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o + obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o --- /dev/null +++ b/drivers/gpio/gpio-ar2315.c @@ -0,0 +1,233 @@ diff --git a/target/linux/ath25/patches-4.14/110-ar2313_ethernet.patch b/target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch similarity index 98% rename from target/linux/ath25/patches-4.14/110-ar2313_ethernet.patch rename to target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch index a2b149225..57c18abf6 100644 --- a/target/linux/ath25/patches-4.14/110-ar2313_ethernet.patch +++ b/target/linux/ath25/patches-5.4/110-ar2313_ethernet.patch @@ -1,22 +1,22 @@ --- a/drivers/net/ethernet/atheros/Makefile +++ b/drivers/net/ethernet/atheros/Makefile -@@ -8,3 +8,4 @@ obj-$(CONFIG_ATL2) += atlx/ +@@ -9,3 +9,4 @@ obj-$(CONFIG_ATL2) += atlx/ obj-$(CONFIG_ATL1E) += atl1e/ obj-$(CONFIG_ATL1C) += atl1c/ obj-$(CONFIG_ALX) += alx/ +obj-$(CONFIG_NET_AR231X) += ar231x/ --- a/drivers/net/ethernet/atheros/Kconfig +++ b/drivers/net/ethernet/atheros/Kconfig -@@ -5,7 +5,7 @@ +@@ -6,7 +6,7 @@ config NET_VENDOR_ATHEROS bool "Atheros devices" default y -- depends on PCI -+ depends on (PCI || ATH25) +- depends on (PCI || ATH79) ++ depends on (PCI || ATH25 || ATH79) ---help--- If you have a network (Ethernet) card belonging to this class, say Y. -@@ -78,4 +78,10 @@ config ALX +@@ -87,4 +87,10 @@ config ALX To compile this driver as a module, choose M here. The module will be called alx. @@ -33,7 +33,7 @@ +obj-$(CONFIG_NET_AR231X) += ar231x.o --- /dev/null +++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c -@@ -0,0 +1,1119 @@ +@@ -0,0 +1,1120 @@ +/* + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device. + * @@ -225,6 +225,7 @@ + + sp = netdev_priv(dev); + sp->dev = dev; ++ sp->pdev = pdev; + sp->cfg = pdev->dev.platform_data; + + sprintf(buf, "eth%d_membase", pdev->id); @@ -787,7 +788,7 @@ + break; + } + /* done with this descriptor */ -+ dma_unmap_single(NULL, txdesc->addr, ++ dma_unmap_single(&sp->pdev->dev, txdesc->addr, + txdesc->devcs & DMA_TX1_BSIZE_MASK, + DMA_TO_DEVICE); + txdesc->status = 0; @@ -1014,7 +1015,7 @@ + /* Setup the transmit descriptor. */ + td->devcs = ((skb->len << DMA_TX1_BSIZE_SHIFT) | + (DMA_TX1_LS | DMA_TX1_IC | DMA_TX1_CHAINED)); -+ td->addr = dma_map_single(NULL, skb->data, skb->len, DMA_TO_DEVICE); ++ td->addr = dma_map_single(&sp->pdev->dev, skb->data, skb->len, DMA_TO_DEVICE); + td->status = DMA_TX_OWN; + + /* kick transmitter last */ @@ -1113,6 +1114,7 @@ + +static int ar231x_mdiobus_probe(struct net_device *dev) +{ ++ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; + struct ar231x_private *const sp = netdev_priv(dev); + struct phy_device *phydev = NULL; + @@ -1134,16 +1136,15 @@ + } + + /* mask with MAC supported features */ -+ phydev->supported &= (SUPPORTED_10baseT_Half -+ | SUPPORTED_10baseT_Full -+ | SUPPORTED_100baseT_Half -+ | SUPPORTED_100baseT_Full -+ | SUPPORTED_Autoneg -+ /* | SUPPORTED_Pause | SUPPORTED_Asym_Pause */ -+ | SUPPORTED_MII -+ | SUPPORTED_TP); ++ linkmode_set_bit_array(phy_10_100_features_array, ++ ARRAY_SIZE(phy_10_100_features_array), ++ mask); ++ linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, mask); ++ linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask); ++ linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT, mask); + -+ phydev->advertising = phydev->supported; ++ linkmode_and(phydev->supported, phydev->supported, mask); ++ linkmode_copy(phydev->advertising, phydev->supported); + + sp->phy_dev = phydev; + @@ -1155,7 +1156,7 @@ + --- /dev/null +++ b/drivers/net/ethernet/atheros/ar231x/ar231x.h -@@ -0,0 +1,281 @@ +@@ -0,0 +1,282 @@ +/* + * ar231x.h: Linux driver for the Atheros AR231x Ethernet device. + * @@ -1379,6 +1380,7 @@ + */ +struct ar231x_private { + struct net_device *dev; ++ struct platform_device *pdev; + int version; + u32 mb[2]; + @@ -1713,7 +1715,7 @@ + void __init ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk) { - struct uart_port s; + #ifdef CONFIG_SERIAL_8250_CONSOLE --- a/arch/mips/include/asm/mach-ath25/ath25_platform.h +++ b/arch/mips/include/asm/mach-ath25/ath25_platform.h @@ -71,4 +71,15 @@ struct ar231x_board_config { diff --git a/target/linux/ath25/patches-4.14/120-spiflash.patch b/target/linux/ath25/patches-5.4/120-spiflash.patch similarity index 98% rename from target/linux/ath25/patches-4.14/120-spiflash.patch rename to target/linux/ath25/patches-5.4/120-spiflash.patch index 0a2161fb7..52460f89d 100644 --- a/target/linux/ath25/patches-4.14/120-spiflash.patch +++ b/target/linux/ath25/patches-5.4/120-spiflash.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig -@@ -130,6 +130,10 @@ config MTD_BCM47XXSFLASH +@@ -114,6 +114,10 @@ config MTD_BCM47XXSFLASH registered by bcma as platform devices. This enables driver for serial flash memories. @@ -13,7 +13,7 @@ help --- a/drivers/mtd/devices/Makefile +++ b/drivers/mtd/devices/Makefile -@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_M25P80) += m25p80.o +@@ -15,6 +15,7 @@ obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataf obj-$(CONFIG_MTD_MCHP23K256) += mchp23k256.o obj-$(CONFIG_MTD_SPEAR_SMI) += spear_smi.o obj-$(CONFIG_MTD_SST25L) += sst25l.o @@ -23,7 +23,7 @@ obj-$(CONFIG_MTD_POWERNV_FLASH) += powernv_flash.o --- /dev/null +++ b/drivers/mtd/devices/ar2315.c -@@ -0,0 +1,459 @@ +@@ -0,0 +1,456 @@ + +/* + * MTD driver for the SPI Flash Memory support on Atheros AR2315 @@ -284,9 +284,6 @@ + + mutex_unlock(&priv->lock); + -+ instr->state = MTD_ERASE_DONE; -+ mtd_erase_callback(instr); -+ + return 0; +} + diff --git a/target/linux/ath25/patches-4.14/130-watchdog.patch b/target/linux/ath25/patches-5.4/130-watchdog.patch similarity index 98% rename from target/linux/ath25/patches-4.14/130-watchdog.patch rename to target/linux/ath25/patches-5.4/130-watchdog.patch index 01904d69a..8a5bd8341 100644 --- a/target/linux/ath25/patches-4.14/130-watchdog.patch +++ b/target/linux/ath25/patches-5.4/130-watchdog.patch @@ -212,7 +212,7 @@ +MODULE_ALIAS("platform:" DRIVER_NAME); --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig -@@ -1647,6 +1647,13 @@ config PIC32_DMT +@@ -1830,6 +1830,13 @@ config PIC32_DMT To compile this driver as a loadable module, choose M here. The module will be called pic32-dmt. @@ -228,7 +228,7 @@ # POWERPC Architecture --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile -@@ -166,6 +166,7 @@ obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o +@@ -161,6 +161,7 @@ obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o obj-$(CONFIG_PNX833X_WDT) += pnx833x_wdt.o obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o obj-$(CONFIG_AR7_WDT) += ar7_wdt.o diff --git a/target/linux/ath25/patches-4.14/140-redboot_boardconfig.patch b/target/linux/ath25/patches-5.4/140-redboot_boardconfig.patch similarity index 81% rename from target/linux/ath25/patches-4.14/140-redboot_boardconfig.patch rename to target/linux/ath25/patches-5.4/140-redboot_boardconfig.patch index 6aad761cb..0ffa12eec 100644 --- a/target/linux/ath25/patches-4.14/140-redboot_boardconfig.patch +++ b/target/linux/ath25/patches-5.4/140-redboot_boardconfig.patch @@ -1,6 +1,6 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -30,6 +30,8 @@ +--- a/drivers/mtd/parsers/redboot.c ++++ b/drivers/mtd/parsers/redboot.c +@@ -16,6 +16,8 @@ #include #include @@ -9,7 +9,7 @@ struct fis_image_desc { unsigned char name[16]; // Null terminated name uint32_t flash_base; // Address within FLASH of image -@@ -60,6 +62,7 @@ static int parse_redboot_partitions(stru +@@ -67,6 +69,7 @@ static int parse_redboot_partitions(stru const struct mtd_partition **pparts, struct mtd_part_parser_data *data) { @@ -17,7 +17,7 @@ int nrparts = 0; struct fis_image_desc *buf; struct mtd_partition *parts; -@@ -225,14 +228,15 @@ static int parse_redboot_partitions(stru +@@ -234,14 +237,15 @@ static int parse_redboot_partitions(stru } } #endif @@ -35,7 +35,7 @@ #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED if (nulllen > 0) { strcpy(nullname, nullstring); -@@ -251,6 +255,8 @@ static int parse_redboot_partitions(stru +@@ -260,6 +264,8 @@ static int parse_redboot_partitions(stru } #endif for ( ; iimg->size; parts[i].offset = fl->img->flash_base; parts[i].name = names; -@@ -284,6 +290,13 @@ static int parse_redboot_partitions(stru +@@ -293,6 +299,13 @@ static int parse_redboot_partitions(stru fl = fl->next; kfree(tmp_fl); } diff --git a/target/linux/ath25/patches-4.14/141-redboot_partition_scan.patch b/target/linux/ath25/patches-5.4/141-redboot_partition_scan.patch similarity index 76% rename from target/linux/ath25/patches-4.14/141-redboot_partition_scan.patch rename to target/linux/ath25/patches-5.4/141-redboot_partition_scan.patch index d1d281eaf..3302d6d24 100644 --- a/target/linux/ath25/patches-4.14/141-redboot_partition_scan.patch +++ b/target/linux/ath25/patches-5.4/141-redboot_partition_scan.patch @@ -1,8 +1,8 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -79,12 +79,18 @@ static int parse_redboot_partitions(stru - static char nullstring[] = "unallocated"; - #endif +--- a/drivers/mtd/parsers/redboot.c ++++ b/drivers/mtd/parsers/redboot.c +@@ -88,12 +88,18 @@ static int parse_redboot_partitions(stru + + parse_redboot_of(master); + buf = vmalloc(master->erasesize); + if (!buf) @@ -19,7 +19,7 @@ return -EIO; } offset -= master->erasesize; -@@ -97,10 +103,6 @@ static int parse_redboot_partitions(stru +@@ -106,10 +112,6 @@ static int parse_redboot_partitions(stru goto nogood; } } @@ -30,7 +30,7 @@ printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n", master->name, offset); -@@ -173,6 +175,11 @@ static int parse_redboot_partitions(stru +@@ -182,6 +184,11 @@ static int parse_redboot_partitions(stru } if (i == numslots) { /* Didn't find it */ diff --git a/target/linux/ath25/patches-4.14/142-redboot_various_erase_size_fix.patch b/target/linux/ath25/patches-5.4/142-redboot_various_erase_size_fix.patch similarity index 81% rename from target/linux/ath25/patches-4.14/142-redboot_various_erase_size_fix.patch rename to target/linux/ath25/patches-5.4/142-redboot_various_erase_size_fix.patch index ce039df9f..2ac0eb92b 100644 --- a/target/linux/ath25/patches-4.14/142-redboot_various_erase_size_fix.patch +++ b/target/linux/ath25/patches-5.4/142-redboot_various_erase_size_fix.patch @@ -1,7 +1,7 @@ ---- a/drivers/mtd/redboot.c -+++ b/drivers/mtd/redboot.c -@@ -58,6 +58,22 @@ static inline int redboot_checksum(struc - return 1; +--- a/drivers/mtd/parsers/redboot.c ++++ b/drivers/mtd/parsers/redboot.c +@@ -65,6 +65,22 @@ static void parse_redboot_of(struct mtd_ + directory = dirblock; } +static uint32_t mtd_get_offset_erasesize(struct mtd_info *mtd, uint64_t offset) @@ -23,7 +23,7 @@ static int parse_redboot_partitions(struct mtd_info *master, const struct mtd_partition **pparts, struct mtd_part_parser_data *data) -@@ -74,6 +90,7 @@ static int parse_redboot_partitions(stru +@@ -81,6 +97,7 @@ static int parse_redboot_partitions(stru int namelen = 0; int nulllen = 0; int numslots; @@ -31,7 +31,7 @@ unsigned long offset; #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED static char nullstring[] = "unallocated"; -@@ -186,7 +203,10 @@ static int parse_redboot_partitions(stru +@@ -195,7 +212,10 @@ static int parse_redboot_partitions(stru goto out; } @@ -43,7 +43,7 @@ struct fis_list *new_fl, **prev; if (buf[i].name[0] == 0xff) { -@@ -262,12 +282,13 @@ static int parse_redboot_partitions(stru +@@ -271,12 +291,13 @@ static int parse_redboot_partitions(stru } #endif for ( ; iimg->name); #ifdef CONFIG_MTD_REDBOOT_PARTS_READONLY if (!memcmp(names, "RedBoot", 8) || -@@ -297,7 +318,9 @@ static int parse_redboot_partitions(stru +@@ -306,7 +327,9 @@ static int parse_redboot_partitions(stru fl = fl->next; kfree(tmp_fl); } diff --git a/target/linux/ath25/patches-4.14/210-reset_button.patch b/target/linux/ath25/patches-5.4/210-reset_button.patch similarity index 100% rename from target/linux/ath25/patches-4.14/210-reset_button.patch rename to target/linux/ath25/patches-5.4/210-reset_button.patch diff --git a/target/linux/ath25/patches-4.14/220-enet_micrel_workaround.patch b/target/linux/ath25/patches-5.4/220-enet_micrel_workaround.patch similarity index 88% rename from target/linux/ath25/patches-4.14/220-enet_micrel_workaround.patch rename to target/linux/ath25/patches-5.4/220-enet_micrel_workaround.patch index 91b979251..9051e1b46 100644 --- a/target/linux/ath25/patches-4.14/220-enet_micrel_workaround.patch +++ b/target/linux/ath25/patches-5.4/220-enet_micrel_workaround.patch @@ -41,7 +41,7 @@ static int ar231x_probe(struct platform_device *pdev) { struct net_device *dev; -@@ -273,6 +300,24 @@ static int ar231x_probe(struct platform_ +@@ -274,6 +301,24 @@ static int ar231x_probe(struct platform_ mdiobus_register(sp->mii_bus); @@ -66,7 +66,7 @@ if (ar231x_mdiobus_probe(dev) != 0) { printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name); rx_tasklet_cleanup(dev); -@@ -326,8 +371,10 @@ static int ar231x_remove(struct platform +@@ -327,8 +372,10 @@ static int ar231x_remove(struct platform rx_tasklet_cleanup(dev); ar231x_init_cleanup(dev); unregister_netdev(dev); @@ -79,7 +79,7 @@ kfree(dev); return 0; } -@@ -870,7 +917,8 @@ static int ar231x_open(struct net_device +@@ -871,7 +918,8 @@ static int ar231x_open(struct net_device sp->eth_regs->mac_control |= MAC_CONTROL_RE; @@ -89,7 +89,7 @@ return 0; } -@@ -951,7 +999,8 @@ static int ar231x_close(struct net_devic +@@ -952,7 +1000,8 @@ static int ar231x_close(struct net_devic #endif @@ -99,7 +99,7 @@ return 0; } -@@ -995,6 +1044,9 @@ static int ar231x_ioctl(struct net_devic +@@ -996,6 +1045,9 @@ static int ar231x_ioctl(struct net_devic { struct ar231x_private *sp = netdev_priv(dev); diff --git a/target/linux/ath25/patches-4.14/330-board_leds.patch b/target/linux/ath25/patches-5.4/330-board_leds.patch similarity index 100% rename from target/linux/ath25/patches-4.14/330-board_leds.patch rename to target/linux/ath25/patches-5.4/330-board_leds.patch diff --git a/target/linux/ath79/Makefile b/target/linux/ath79/Makefile index 9b203cf48..f41d48364 100644 --- a/target/linux/ath79/Makefile +++ b/target/linux/ath79/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk ARCH:=mips BOARD:=ath79 -BOARDNAME:=Atheros ATH79 (DTS) +BOARDNAME:=Atheros ATH79 CPU_TYPE:=24kc SUBTARGETS:=generic mikrotik nand tiny diff --git a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts index 536432e25..89ddf1299 100644 --- a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts +++ b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "iodata,wn-ag300dgr", "qca,ar9344"; model = "I-O DATA WN-AG300DGR"; diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts index c08a1277c..bc20d70ee 100644 --- a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts +++ b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "Sitecom WLR-7100 v1 002 (X7 AC1200)"; compatible = "sitecom,wlr-7100", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index fe88cfab2..2617c6852 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include + #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi b/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi index 58753b6d4..733479ff4 100644 --- a/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi +++ b/target/linux/ath79/dts/ar7100_mikrotik_routerboard-4xx.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-1.0-or-later OR MIT +#include "ar7100.dtsi" + #include #include -#include "ar7100.dtsi" - / { aliases { led-boot = &led_user; diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts b/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts index 1745ac76f..d1339c569 100644 --- a/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1800-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_adtran_bsap1880.dtsi" diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts b/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts index 38b87a1e3..3237b8f71 100644 --- a/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1840.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_adtran_bsap1880.dtsi" diff --git a/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi b/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi index b60718dd7..17e42d7ba 100644 --- a/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi +++ b/target/linux/ath79/dts/ar7161_adtran_bsap1880.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7100.dtsi" + #include #include -#include "ar7100.dtsi" - / { chosen { bootargs = "console=ttyS0,115200n8"; diff --git a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts index d2a56f83c..d7f1a0711 100644 --- a/target/linux/ath79/dts/ar7161_aruba_ap-105.dts +++ b/target/linux/ath79/dts/ar7161_aruba_ap-105.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7100.dtsi" #include #include -#include "ar7100.dtsi" - / { compatible = "aruba,ap-105", "qca,ar7161"; model = "Aruba AP-105"; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-600dhp.dts b/target/linux/ath79/dts/ar7161_buffalo_wzr-600dhp.dts new file mode 100644 index 000000000..6ef437638 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-600dhp.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7161_buffalo_wzr-hp-ag300h.dtsi" + +/ { + compatible = "buffalo,wzr-600dhp", "qca,ar7161"; + model = "Buffalo WZR-600DHP"; +}; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts index 43f35683b..2e32af5d6 100644 --- a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dts @@ -1,272 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; -#include -#include - -#include "ar7100.dtsi" +#include "ar7161_buffalo_wzr-hp-ag300h.dtsi" / { compatible = "buffalo,wzr-hp-ag300h", "qca,ar7161"; - model = "Buffalo WZR-HP-AG300H/WZR-600DHP"; - - aliases { - led-boot = &led_diag; - led-failsafe = &led_diag; - led-upgrade = &led_diag; - }; - - extosc: ref { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-output-names = "ref"; - clock-frequency = <40000000>; - }; - - leds { - compatible = "gpio-leds"; - - led_diag: diag { - label = "buffalo:red:diag"; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - }; - }; - - ath9k-leds { - compatible = "gpio-leds"; - - band2g_a { - label = "buffalo:amber:band2g"; - gpios = <&ath9k0 1 GPIO_ACTIVE_LOW>; - }; - - usb { - label = "buffalo:green:usb"; - gpios = <&ath9k0 3 GPIO_ACTIVE_LOW>; - trigger-sources = <&usb_ohci_port>, <&usb_ehci_port>; - linux,default-trigger = "usbport"; - }; - - band2g_g { - label = "buffalo:green:band2g"; - gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; - }; - - band5g_g { - label = "buffalo:green:band5g"; - gpios = <&ath9k1 1 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; - }; - - router { - label = "buffalo:green:router"; - gpios = <&ath9k1 3 GPIO_ACTIVE_LOW>; - }; - - movie_engine { - label = "buffalo:blue:movie_engine"; - gpios = <&ath9k1 4 GPIO_ACTIVE_LOW>; - }; - - band5g_a { - label = "buffalo:amber:band5g"; - gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - linux,code = ; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - usb { - linux,code = ; - gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - aoss { - linux,code = ; - gpios = <&gpio 5 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - router_auto { - linux,code = ; - gpios = <&gpio 6 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - router_off { - linux,code = ; - gpios = <&gpio 7 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - movie_engine { - linux,code = ; - gpios = <&gpio 8 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - - gpio-export { - compatible = "gpio-export"; - - gpio_usb_power { - gpio-export,name = "buffalo:power:usb"; - gpio-export,output = <1>; - gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; - }; - }; - - flash { - compatible = "mtd-concat"; - - devices = <&flash0 &flash1>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - partition@0 { - label = "u-boot"; - reg = <0x0000000 0x0040000>; - read-only; - }; - - partition@40000 { - label = "u-boot-env"; - reg = <0x0040000 0x0010000>; - read-only; - }; - - art: partition@50000 { - label = "art"; - reg = <0x0050000 0x0010000>; - read-only; - }; - - partition@60000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x0060000 0x1f90000>; - }; - - partition@1ff0000 { - label = "user_property"; - reg = <0x1ff0000 0x0010000>; - read-only; - }; - }; - }; -}; - -&usb_phy { - status = "okay"; -}; - -&usb1 { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - usb_ohci_port: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; -}; - -&usb2 { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; - - usb_ehci_port: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; -}; - -&pcie0 { - status = "okay"; - - ath9k0: wifi@0,11 { - compatible = "pci168c,0029"; - reg = <0x8800 0 0 0 0>; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; - }; - - ath9k1: wifi@0,12 { - compatible = "pci168c,0029"; - reg = <0x9000 0 0 0 0>; - qca,no-eeprom; - #gpio-cells = <2>; - gpio-controller; - }; -}; - -&uart { - status = "okay"; -}; - -&pll { - clocks = <&extosc>; -}; - -&spi { - status = "okay"; - - num-cs = <2>; - cs-gpios = <0>, <0>; - - flash0: flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <50000000>; - m25p,fast-read; - }; - - flash1: flash@1 { - compatible = "jedec,spi-nor"; - reg = <1>; - spi-max-frequency = <50000000>; - m25p,fast-read; - }; -}; - -&mdio0 { - status = "okay"; - - phy4: ethernet-phy@4 { - reg = <4>; - phy-mode = "rgmii"; - }; -}; - -ð0 { - status = "okay"; - - mtd-mac-address = <&art 0x120c>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -ð1 { - status = "okay"; - - mtd-mac-address = <&art 0x520c>; - mtd-mac-address-increment = <1>; - - phy-handle = <&phy4>; + model = "Buffalo WZR-HP-AG300H"; }; diff --git a/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi new file mode 100644 index 000000000..1a509d864 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_buffalo_wzr-hp-ag300h.dtsi @@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7100.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_diag; + led-failsafe = &led_diag; + led-upgrade = &led_diag; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "ref"; + clock-frequency = <40000000>; + }; + + leds { + compatible = "gpio-leds"; + + led_diag: diag { + label = "buffalo:red:diag"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + band2g_a { + label = "buffalo:amber:band2g"; + gpios = <&ath9k0 1 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "buffalo:green:usb"; + gpios = <&ath9k0 3 GPIO_ACTIVE_LOW>; + trigger-sources = <&usb_ohci_port>, <&usb_ehci_port>; + linux,default-trigger = "usbport"; + }; + + band2g_g { + label = "buffalo:green:band2g"; + gpios = <&ath9k0 5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + band5g_g { + label = "buffalo:green:band5g"; + gpios = <&ath9k1 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + router { + label = "buffalo:green:router"; + gpios = <&ath9k1 3 GPIO_ACTIVE_LOW>; + }; + + movie_engine { + label = "buffalo:blue:movie_engine"; + gpios = <&ath9k1 4 GPIO_ACTIVE_LOW>; + }; + + band5g_a { + label = "buffalo:amber:band5g"; + gpios = <&ath9k1 5 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + usb { + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + aoss { + linux,code = ; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + router_auto { + linux,code = ; + linux,input-type = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + router_off { + linux,code = ; + linux,input-type = ; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + movie_engine { + linux,code = ; + linux,input-type = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_usb_power { + gpio-export,name = "buffalo:power:usb"; + gpio-export,output = <1>; + gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + }; + }; + + flash { + compatible = "mtd-concat"; + + devices = <&flash0 &flash1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x0040000 0x0010000>; + read-only; + }; + + art: partition@50000 { + label = "art"; + reg = <0x0050000 0x0010000>; + read-only; + }; + + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0060000 0x1f90000>; + }; + + partition@1ff0000 { + label = "user_property"; + reg = <0x1ff0000 0x0010000>; + read-only; + }; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + usb_ohci_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb2 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + usb_ehci_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { + compatible = "pci168c,0029"; + reg = <0x8800 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { + compatible = "pci168c,0029"; + reg = <0x9000 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&uart { + status = "okay"; +}; + +&pll { + clocks = <&extosc>; +}; + +&spi { + status = "okay"; + + num-cs = <2>; + cs-gpios = <0>, <0>; + + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + }; + + flash1: flash@1 { + compatible = "jedec,spi-nor"; + reg = <1>; + spi-max-frequency = <50000000>; + m25p,fast-read; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x120c>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x520c>; + mtd-mac-address-increment = <1>; + + phy-handle = <&phy4>; +}; diff --git a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts index f9e94a587..c67b94b11 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7100.dtsi" #include #include -#include "ar7100.dtsi" - / { compatible = "dlink,dir-825-b1", "qca,ar7161"; model = "D-Link DIR825B1"; diff --git a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts index cce95d7de..abcecd040 100644 --- a/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts +++ b/target/linux/ath79/dts/ar7161_jjplus_ja76pf2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7100.dtsi" #include #include -#include "ar7100.dtsi" - / { model = "jjPlus JA76PF2"; compatible = "jjplus,ja76pf2", "qca,ar7161"; diff --git a/target/linux/ath79/dts/ar7161_meraki_mr16.dts b/target/linux/ath79/dts/ar7161_meraki_mr16.dts new file mode 100644 index 000000000..fa7e60728 --- /dev/null +++ b/target/linux/ath79/dts/ar7161_meraki_mr16.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7100.dtsi" + +#include +#include + +/ { + compatible = "meraki,mr16", "qca,ar7161"; + model = "Meraki MR16"; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_green; + led-upgrade = &led_power_orange; + }; + + extosc: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-output-names = "ref"; + clock-frequency = <40000000>; + }; + + leds { + compatible = "gpio-leds"; + + wifi1 { + label = "mr16:green:wifi1"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + wifi2 { + label = "mr16:green:wifi2"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wifi3 { + label = "mr16:green:wifi3"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + wifi4 { + label = "mr16:green:wifi4"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "mr16:green:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_power_orange: power_orange { + label = "mr16:orange:power"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + panic-indicator; + }; + + led_power_green: power_green { + label = "mr16:green:power"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; + + ath9k0: wifi@0,11 { /* 2.4 GHz */ + compatible = "pci168c,0029"; + reg = <0x8800 0 0 0 0>; + qca,no-eeprom; + mtd-mac-address = <&config 0x66>; + mtd-mac-address-increment = <1>; + #gpio-cells = <2>; + gpio-controller; + }; + + ath9k1: wifi@0,12 { /* 5 GHz */ + compatible = "pci168c,0029"; + reg = <0x9000 0 0 0 0>; + qca,no-eeprom; + mtd-mac-address = <&config 0x66>; + mtd-mac-address-increment = <2>; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&pll { + clocks = <&extosc>; +}; + +&uart { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&config 0x66>; + + pll-data = <0x00110000 0x00001099 0x00991099>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x40000>; + read-only; + }; + + config: partition@80000 { + label = "config"; + reg = <0x80000 0x20000>; + read-only; + }; + + partition@a0000 { + label = "firmware"; + reg = <0xa0000 0xf40000>; + compatible = "denx,uimage"; + }; + + partition@fe0000 { + label = "art"; + reg = <0xfe0000 0x20000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/dts/ar7161_mikrotik_routerboard-493g.dts b/target/linux/ath79/dts/ar7161_mikrotik_routerboard-493g.dts index 4a5deb8a4..23c1b63ea 100644 --- a/target/linux/ath79/dts/ar7161_mikrotik_routerboard-493g.dts +++ b/target/linux/ath79/dts/ar7161_mikrotik_routerboard-493g.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-1.0-or-later OR MIT -/dts-v1/; #include "ar7100_mikrotik_routerboard-4xx.dtsi" diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi index 87c619aa0..db4712662 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar7161_netgear_wndr.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7100.dtsi" + #include #include -#include "ar7100.dtsi" - / { aliases { led-boot = &led_power_orange; diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts index 202b443a0..0543c4711 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts index 3ca92837e..955dd2edf 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts index d55d43015..41fe401dd 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts index 8eca5b960..79569adba 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3800ch.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts index d2dbcaacd..65d2393c6 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts index 872eecca3..f7641203c 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndrmac-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts b/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts index 5ebfb4c87..22ae58929 100644 --- a/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts +++ b/target/linux/ath79/dts/ar7161_siemens_ws-ap3610.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7100.dtsi" #include #include -#include "ar7100.dtsi" - / { compatible = "siemens,ws-ap3610", "qca,ar7161"; model = "Siemens WS-AP3610"; diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation-pro.dts b/target/linux/ath79/dts/ar7161_ubnt_routerstation-pro.dts index 1ffb1239b..87ac9df1f 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation-pro.dts +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation-pro.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_ubnt_routerstation.dtsi" diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts index d3e631530..012fef67a 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7161_ubnt_routerstation.dtsi" diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi index cf4095379..16407128a 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7100.dtsi" + #include #include -#include "ar7100.dtsi" - / { aliases { led-boot = &led_rf; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index cd61bdb45..576f84d88 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7240.dtsi" #include #include -#include "ar7240.dtsi" - / { compatible = "buffalo,whr-g301n", "qca,ar7240"; model = "Buffalo WHR-G301N"; diff --git a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts index 22a1aeb0d..511216838 100644 --- a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts +++ b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7240.dtsi" #include #include -#include "ar7240.dtsi" - / { model = "D-Link DIR-615 E4"; compatible = "dlink,dir-615-e4", "qca,ar7240"; diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts new file mode 100644 index 000000000..d8f98ba6c --- /dev/null +++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7240.dtsi" + +#include +#include + +/ { + compatible = "engenius,enh202-v1", "qca,ar7240"; + model = "EnGenius ENH202 v1"; + + aliases { + led-boot = &led_rssihigh; + led-failsafe = &led_rssihigh; + led-running = &led_rssihigh; + led-upgrade = &led_rssihigh; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins &clks_disable_pins>; + + rssilow { + label = "enh202-v1:red:rssilow"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "enh202-v1:amber:rssimedium"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_rssihigh: rssihigh { + label = "enh202-v1:green:rssihigh"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "enh202-v1:amber:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "enh202-v1:green:wan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wlan { + label = "enh202-v1:green:wlan"; + gpios = <&ath9k 1 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <20000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x50000 0x50000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0xa0000 0x10000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0xb0000 0xf0000>; + }; + + partition@1a0000 { + label = "fakeroot"; + reg = <0x1a0000 0x10000>; + }; + + firmware1: partition@1b0000 { + label = "firmware1"; + reg = <0x1b0000 0x4c0000>; + }; + + partition@670000 { + label = "failsafe"; + reg = <0x670000 0x180000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0 { + compatible = "pci168c,002a"; + reg = <0x0000 0 0 0 0>; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts index 8ae2a128e..ec0001b86 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7240.dtsi" #include #include -#include "ar7240.dtsi" - / { compatible = "netgear,wnr1000-v2", "qca,ar7240"; model = "Netgear WNR1000 v2"; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts index 41dbe709a..6ae70ab67 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_netgear_wnr612-v2.dtsi" diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index e270dfa5c..f3d06b5fd 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7240.dtsi" + #include #include -#include "ar7240.dtsi" - / { aliases { led-boot = &led_power; diff --git a/target/linux/ath79/dts/ar7240_on_n150r.dts b/target/linux/ath79/dts/ar7240_on_n150r.dts index 832227621..8136445f2 100644 --- a/target/linux/ath79/dts/ar7240_on_n150r.dts +++ b/target/linux/ath79/dts/ar7240_on_n150r.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_netgear_wnr612-v2.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink.dtsi b/target/linux/ath79/dts/ar7240_tplink.dtsi index de0b36bbf..7e54cd46b 100644 --- a/target/linux/ath79/dts/ar7240_tplink.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7240.dtsi" + #include #include -#include "ar7240.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa701nd-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wa701nd-v1.dts index 6dd50018b..eda5ae4eb 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa701nd-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa701nd-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa730re-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wa730re-v1.dts index e1277a812..93e59dcda 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa730re-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa730re-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa801nd-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wa801nd-v1.dts index 2db22c0e2..c86f8f0e5 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa801nd-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa801nd-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa830re-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wa830re-v1.dts index f74ddc04e..e84dc6b3c 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa830re-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa830re-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa901nd-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wa901nd-v1.dts index 5422e5c60..008da2ecf 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa901nd-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa901nd-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v1.dts index c49272bcb..8b38c5add 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wr.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v3.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v3.dts index 23867a252..71f361cd2 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v3.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr740n-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wr.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr741-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wr741-v1.dts index 38d7f2af6..d6fde1b37 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr741-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr741-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wr.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr743nd-v1.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wr743nd-v1.dts index 6cfaa9905..756f64c9d 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr743nd-v1.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr743nd-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wr.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr841-v5.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wr841-v5.dts index c030342d2..a90d6f7f5 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr841-v5.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr841-v5.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wr.dtsi" diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr941-v4.dts b/target/linux/ath79/dts/ar7240_tplink_tl-wr941-v4.dts index c8fe835e7..d0b2ca038 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr941-v4.dts +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr941-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240_tplink_tl-wr.dtsi" diff --git a/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts index 73626f1ff..7dd2c7b27 100644 --- a/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts +++ b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7240.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts index b4765d1a1..1b303711a 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7241.dtsi" #include #include -#include "ar7241.dtsi" - / { compatible = "netgear,wnr2000-v3", "qca,ar7241"; model = "Netgear WNR2000 v3"; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts index d182b58c0..2c7443654 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241_netgear_wnr2200.dtsi" diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts index e926c1789..c23cb6e00 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241_netgear_wnr2200.dtsi" diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi index afd521b67..ec4dd871c 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7241.dtsi" + #include #include -#include "ar7241.dtsi" - / { chosen { bootargs = "console=ttyS0,115200n8"; diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index f83985cc5..3cbedc3bf 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7241.dtsi" + #include #include -#include "ar7241.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-mr3220-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-mr3220-v1.dts index 7a16d0fad..9d0f34924 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-mr3220-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-mr3220-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241_tplink_tl-mr3x20.dtsi" diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-mr3420-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-mr3420-v1.dts index 7d36ed55d..e39f2ee3f 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-mr3420-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-mr3420-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241_tplink_tl-mr3x20.dtsi" diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr841-v7.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr841-v7.dts index b79e3c735..cc138cd59 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr841-v7.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr841-v7.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241_tplink.dtsi" 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 72913bfa2..c02154a90 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7241.dtsi" #include #include -#include "ar7241.dtsi" - / { compatible = "tplink,tl-wr842n-v1", "qca,ar7241"; model = "TP-Link TL-WR842N/ND v1"; diff --git a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts index 9da1c45b4..db192cd30 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts index 261ee5435..00a11b44b 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts index 4c4fd19d3..77ed9b1f0 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts index 4ccb1d50a..55476a2d1 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts index fff4ec704..71c686058 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts b/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts index 4bb13e618..f5647837f 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts index e14bfbfa8..e2df1ff13 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts b/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts index 3e716dec6..e0342ec08 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7241.dtsi" #include "ar724x_ubnt_xm.dtsi" diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index 4bccdd2e4..963c241d8 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7241.dtsi" #include #include -#include "ar7241.dtsi" - / { compatible = "ubnt,unifi", "qca,ar7241"; model = "Ubiquiti UniFi"; diff --git a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts index 14c80963d..c4af52a76 100644 --- a/target/linux/ath79/dts/ar7242_avm_fritz300e.dts +++ b/target/linux/ath79/dts/ar7242_avm_fritz300e.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7242.dtsi" #include #include -#include "ar7242.dtsi" - / { compatible = "avm,fritz300e", "qca,ar7242"; model = "AVM FRITZ!WLAN Repeater 300E"; diff --git a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts index d62878e50..46d7e0f33 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_bhr-4grv.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7242_buffalo_wzr-bhr.dtsi" diff --git a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi index 589896d9f..89e77224c 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-bhr.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar7242.dtsi" + #include #include -#include "ar7242.dtsi" - / { aliases { led-boot = &led_diag; 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 71769ef9f..1a3aec00f 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 @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7242.dtsi" #include #include -#include "ar7242.dtsi" - / { compatible = "buffalo,wzr-hp-g302h-a1a0", "qca,ar7242"; model = "Buffalo WZR-HP-G302H A1A0"; 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 16a617a25..8bf89e4ec 100644 --- a/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts +++ b/target/linux/ath79/dts/ar7242_buffalo_wzr-hp-g450h.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7242_buffalo_wzr-bhr.dtsi" 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 56b850c99..0ac10a56f 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7242.dtsi" #include #include -#include "ar7242.dtsi" - / { compatible = "tplink,tl-wr2543-v1", "qca,ar7242"; model = "TP-Link TL-WR2543N/ND"; diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts index f524b2e88..85e85d841 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-5xp.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7242_ubnt_sw.dtsi" diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts index c7ec5cddc..b640badb3 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts +++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar7242_ubnt_sw.dtsi" diff --git a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi index 15f204729..43b24dae5 100644 --- a/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi +++ b/target/linux/ath79/dts/ar7242_ubnt_sw.dtsi @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar7242.dtsi" #include #include -#include "ar7242.dtsi" - / { compatible = "qca,ar7242"; model = "Ubiquiti Networks SW board"; diff --git a/target/linux/ath79/dts/ar724x.dtsi b/target/linux/ath79/dts/ar724x.dtsi index 2d7383c36..e9daae067 100644 --- a/target/linux/ath79/dts/ar724x.dtsi +++ b/target/linux/ath79/dts/ar724x.dtsi @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include + #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/ar9132.dtsi b/target/linux/ath79/dts/ar9132.dtsi index 226499427..ac87884a4 100644 --- a/target/linux/ath79/dts/ar9132.dtsi +++ b/target/linux/ath79/dts/ar9132.dtsi @@ -1,5 +1,5 @@ -// SPDX-License-Identifier: GPL-2.0 -#include +// SPDX-License-Identifier: GPL-2.0-only + #include "ath79.dtsi" / { 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 6542ce9e4..662ffa2e5 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9132.dtsi" #include #include -#include "ar9132.dtsi" - / { compatible = "tplink,tl-wa901nd-v2", "qca,ar9132"; model = "TP-Link TL-WA901ND v2"; 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 c16bcb05f..3ff992a84 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9132.dtsi" #include #include -#include "ar9132.dtsi" - / { compatible = "tplink,tl-wr1043nd-v1", "qca,ar9132"; model = "TP-Link TL-WR1043ND v1"; 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 11de522ae..a35dbc2d1 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9132.dtsi" #include #include -#include "ar9132.dtsi" - / { compatible = "tplink,tl-wr941-v2", "qca,ar9132"; model = "TP-Link TL-WR941N/ND v2/v3"; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 7d2f74122..78f80b9f7 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include + #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts index 7fe5c8abe..b0d68fb35 100644 --- a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts +++ b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9330.dtsi" #include #include -#include "ar9330.dtsi" - / { model = "D-Link DIR-505"; compatible = "dlink,dir-505", "qca,ar9330"; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index b8c6959d5..389c6d1e4 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9330.dtsi" #include #include -#include "ar9330.dtsi" - / { model = "GL.iNet GL-AR150"; compatible = "glinet,gl-ar150", "qca,ar9330"; diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 2d7f79ee8..a551a4a4f 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9330.dtsi" #include #include -#include "ar9330.dtsi" - / { model = "PQI Air-Pen"; compatible = "pqi,air-pen", "qca,ar9330"; diff --git a/target/linux/ath79/dts/ar9331.dtsi b/target/linux/ath79/dts/ar9331.dtsi index 5ce755a59..2141f3386 100644 --- a/target/linux/ath79/dts/ar9331.dtsi +++ b/target/linux/ath79/dts/ar9331.dtsi @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT + #include "ar9330.dtsi" / { diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index f35f1850f..de6d9f85d 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "8devices Carambola2"; compatible = "8dev,carambola2", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts index d1b49b2c2..53c2af3b1 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "ALFA Network AP121F"; compatible = "alfa-network,ap121f", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_arduino_yun.dts b/target/linux/ath79/dts/ar9331_arduino_yun.dts index 0237fe58b..e00a8c638 100644 --- a/target/linux/ath79/dts/ar9331_arduino_yun.dts +++ b/target/linux/ath79/dts/ar9331_arduino_yun.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "Arduino Yun"; compatible = "arduino,yun", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index 614c31e1e..d0f9f9b72 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "Embedded Wireless Dorin"; compatible = "embeddedwireless,dorin", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index 3cf72a321..9df6de168 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "eTactica EG200"; compatible = "etactica,eg200", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_glinet_6408.dts b/target/linux/ath79/dts/ar9331_glinet_6408.dts index 121560746..8bf5d4390 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6408.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6408.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_glinet_64xx.dtsi" diff --git a/target/linux/ath79/dts/ar9331_glinet_6416.dts b/target/linux/ath79/dts/ar9331_glinet_6416.dts index 5f10b6aad..2039ce6ea 100644 --- a/target/linux/ath79/dts/ar9331_glinet_6416.dts +++ b/target/linux/ath79/dts/ar9331_glinet_6416.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_glinet_64xx.dtsi" diff --git a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi index fd6791915..c96aaa222 100644 --- a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi +++ b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9331.dtsi" + #include #include -#include "ar9331.dtsi" - / { aliases { serial0 = &uart; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts index e969007fc..ead81adc5 100644 --- a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts +++ b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { compatible = "glinet,gl-mifi", "qca,ar9331"; model = "GL.iNet GL-MiFi"; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts index 565c236f6..40ebcccd2 100644 --- a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "Pisen TS-D084"; compatible = "pisen,ts-d084", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index 6b746bb15..812b5b0ec 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "Pisen WMM003N"; compatible = "pisen,wmm003n", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-mr10u.dts b/target/linux/ath79/dts/ar9331_tplink_tl-mr10u.dts index 648020f96..3597a0d1b 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr10u.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr10u.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr703n_tl-mr10u.dtsi" 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 704f7c41a..5ea2569fe 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "TP-Link TL-MR3020 V1"; compatible = "tplink,tl-mr3020-v1", "qca,ar9331"; 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 d0a479712..2c8dddbe5 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9331.dtsi" #include #include -#include "ar9331.dtsi" - / { model = "TP-Link TL-MR3040 V2"; compatible = "tplink,tl-mr3040-v2", "qca,ar9331"; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n.dts index 21707d08f..0806bcc17 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr703n.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr703n.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr703n_tl-mr10u.dtsi" 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 c2bc50a50..236609d95 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 @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9331.dtsi" + #include #include -#include "ar9331.dtsi" - / { aliases { serial0 = &uart; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts index 634b56d3b..3a0db9fc7 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr710n-8m.dtsi" diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts index 48d44000e..4cc802324 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr710n-8m.dtsi" diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi index e37c43f4a..b8a4fe96b 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9331.dtsi" + #include #include -#include "ar9331.dtsi" - / { aliases { serial0 = &uart; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v4.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v4.dts index 6775a7467..43f0484cd 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v4.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr741nd-v4.dtsi" diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v5.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v5.dts index a031bf387..99d85c58e 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v5.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr740n-v5.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr741nd-v4.dtsi" diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dts index 31c5a0b1b..6436db85a 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9331_tplink_tl-wr741nd-v4.dtsi" 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 8e36c6851..ed120b477 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9331.dtsi" + #include #include -#include "ar9331.dtsi" - / { compatible = "tplink,tl-wr741n-v4", "qca,ar9331"; model = "TP-Link TL-WR741N/ND v4"; diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts new file mode 100644 index 000000000..354e276f7 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341.dtsi" + +#include +#include + +/ { + model = "Engenius ENS202EXT v1"; + compatible = "engenius,ens202ext-v1", "qca,ar9341"; + + aliases { + serial0 = &uart; + 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 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "ens202ext-v1:amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan { + label = "ens202ext-v1:amber:wlan"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + rssilow { + label = "ens202ext-v1:red:rssilow"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "ens202ext-v1:amber:rssimedium"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "ens202ext-v1:green:rssihigh"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&firmware1 &firmware2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,okli"; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + 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 = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + label = "loader"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + firmware2: partition@b0000 { + label = "firmware2"; + reg = <0x0b0000 0x170000>; + }; + + partition@220000 { + label = "fakeroot"; + reg = <0x220000 0x010000>; + }; + + firmware1: partition@230000 { + label = "firmware1"; + reg = <0x230000 0xbc0000>; + }; + + partition@df0000 { + label = "failsafe"; + reg = <0xdf0000 0x200000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 6d780eff1..d3fd4f114 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9341.dtsi" #include #include -#include "ar9341.dtsi" - / { model = "PowerCloud Systems CR3000"; compatible = "pcs,cr3000", "qca,ar9341"; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index 40a838f82..685afa5b7 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9341.dtsi" #include #include -#include "ar9341.dtsi" - / { model = "PISEN WMB001N"; compatible = "pisen,wmb001n", "qca,ar9341"; diff --git a/target/linux/ath79/dts/ar9341_tplink.dtsi b/target/linux/ath79/dts/ar9341_tplink.dtsi index c96dbe191..dc97b103a 100644 --- a/target/linux/ath79/dts/ar9341_tplink.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9341.dtsi" + #include #include -#include "ar9341.dtsi" - / { aliases { serial0 = &uart; 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 e6cf6ef86..460277c07 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9341_tplink.dtsi" diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi index 07cf2063d..70c290987 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9341.dtsi" + #include #include -#include "ar9341.dtsi" - / { aliases { serial0 = &uart; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa850re-v1.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wa850re-v1.dts index bb0b498b6..b3de436e9 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa850re-v1.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa850re-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9341_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa860re-v1.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wa860re-v1.dts index 237a40d69..36abbb1c3 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa860re-v1.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa860re-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9341_tplink_tl-wa.dtsi" diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts index 4abdd60c3..420d03861 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9341_tplink_tl-wa.dtsi" 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 95a047c6d..9f2e680b6 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9341_tplink.dtsi" 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 4df0feae9..0932fe9da 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9341_tplink.dtsi" diff --git a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts index 1ced60d5f..bd088a39c 100644 --- a/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts +++ b/target/linux/ath79/dts/ar9342_iodata_etg3-r.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "iodata,etg3-r", "qca,ar9344"; model = "I-O DATA ETG3-R"; diff --git a/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts index a636ce727..0101820ec 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_bullet-m-xw.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9342_ubnt_xw.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts index 78567622b..4055bbd52 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "ar9342_ubnt_wa.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts b/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts index 3c7050753..2e2cdec78 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_litebeam-ac-gen2.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "ar9342_ubnt_wa.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts index 3d0b4d8c5..38cd05813 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanobeam-ac.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "ar9342_ubnt_wa.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts index 1a3875570..8357632db 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac-loco.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "ar9342_ubnt_wa.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts index d8aebaeb0..4fcb7cd13 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-ac.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "ar9342_ubnt_wa.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw.dts index fe28c14bb..5a7448eb1 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-loco-m-xw.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9342_ubnt_xw.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_nanostation-m-xw.dts b/target/linux/ath79/dts/ar9342_ubnt_nanostation-m-xw.dts index 70758644d..c8e153e54 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_nanostation-m-xw.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_nanostation-m-xw.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9342_ubnt_xw.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts index 6b60ed256..68b608a01 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_powerbeam-5ac-gen2.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "ar9342_ubnt_wa.dtsi" diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index 1f2f8e37f..3a4fc80b7 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -1,10 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "ubnt,wa", "qca,ar9342"; model = "Ubiquiti Networks WA board"; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index 1d9df2170..a0012a746 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344.dtsi" + #include #include -#include "ar9344.dtsi" - / { compatible = "ubnt,xw", "qca,ar9342"; model = "Ubiquiti Networks XW board"; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts index 347f12fce..c3ac48647 100644 --- a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "aerohive,hiveap-121", "qca,ar9344"; model = "Aerohive HiveAP 121"; 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 b4a5bb470..0bbde9ebf 100644 --- a/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts +++ b/target/linux/ath79/dts/ar9344_comfast_cf-e120a-v3.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "comfast,cf-e120a-v3", "qca,ar9344"; model = "COMFAST CF-E120A v3"; diff --git a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts index 4ce280f86..c2dfa6ba2 100644 --- a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "compex,wpj344-16m", "qca,ar9344"; model = "Compex WPJ344 (16MB flash)"; diff --git a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts index 90702a0a9..59ec9451f 100644 --- a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts +++ b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "Devolo Magic 2 Wifi"; compatible = "devolo,magic-2-wifi", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts b/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts index 882ec5e13..2c242a1b0 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts +++ b/target/linux/ath79/dts/ar9344_dlink_dir-825-c1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_dlink_dir-8x5.dtsi" diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts b/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts index 48853a270..17c58073d 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts +++ b/target/linux/ath79/dts/ar9344_dlink_dir-835-a1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_dlink_dir-8x5.dtsi" diff --git a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi index 82d232d44..8f6859185 100644 --- a/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi +++ b/target/linux/ath79/dts/ar9344_dlink_dir-8x5.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344.dtsi" + #include #include -#include "ar9344.dtsi" - / { keys { compatible = "gpio-keys"; diff --git a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts index 20ff48cc2..35d6c55b5 100644 --- a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts +++ b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "enterasys,ws-ap3705i", "qca,ar9344"; model = "Enterasys WS-AP3705i"; diff --git a/target/linux/ath79/dts/ar9344_mercury_mw4530r-v1.dts b/target/linux/ath79/dts/ar9344_mercury_mw4530r-v1.dts new file mode 100644 index 000000000..7fa4b7c55 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mercury_mw4530r-v1.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_tplink_tl-wdr4300.dtsi" + +/ { + model = "Mercury MW4530R v1"; + compatible = "mercury,mw4530r-v1", "qca,ar9344"; +}; 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 100976e2c..e95ffc787 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344.dtsi" + #include #include -#include "ar9344.dtsi" - / { compatible = "mikrotik,routerboard-sxt-5n", "qca,ar9344"; model = "MikroTik SXT 5N platform"; @@ -122,13 +122,13 @@ read-only; }; - partition@10000 { - label = "bootloader2"; - reg = <0x10000 0x0>; - read-only; + soft_config { }; - soft_config { + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0x10000>; + read-only; }; }; }; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts index 82b78c85b..3d0b941c2 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_mikrotik_routerboard-sxt-5n.dtsi" diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index f2909061d..ad9caa690 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344.dtsi" + #include #include -#include "ar9344.dtsi" - / { chosen { bootargs = "console=ttyS0,115200n8"; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts index a7756f1d4..9b5d3649c 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_netgear_wndr.dtsi" #include "ar9344_netgear_wndr_wan.dtsi" diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts index 235181d8d..b9b8b78e7 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_netgear_wndr.dtsi" #include "ar9344_netgear_wndr_wan.dtsi" diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts index 7643b3c14..178215e17 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_netgear_wndr.dtsi" #include "ar9344_netgear_wndr_wan.dtsi" diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts index bed85a387..4961119fc 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_netgear_wndr.dtsi" diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index f01ad769d..428f35cd2 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "OCEDO Raccoon"; compatible = "ocedo,raccoon", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index efd9d6262..5a1ac2102 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "PowerCloud Systems CAP324"; compatible = "pcs,cap324", "qca,ar9344"; @@ -59,12 +58,12 @@ }; lan_amber { - label = "pcs:lan:amber"; + label = "pcs:amber:lan"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; lan_green { - label = "pcs:lan:green"; + label = "pcs:green:lan"; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index 3b0716e79..9886c3dee 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "PowerCloud Systems CR5000"; compatible = "pcs,cr5000", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_qihoo_c301.dts b/target/linux/ath79/dts/ar9344_qihoo_c301.dts index 2b5d920b8..9d1cd5244 100644 --- a/target/linux/ath79/dts/ar9344_qihoo_c301.dts +++ b/target/linux/ath79/dts/ar9344_qihoo_c301.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "Qihoo 360 C301"; compatible = "qihoo,c301"; diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts index 862776a4d..7a5bda64c 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955-h7v3c0.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_teltonika_rut9xx.dtsi" #include diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts index c4e114873..b158d8709 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut955.dts +++ b/target/linux/ath79/dts/ar9344_teltonika_rut955.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_teltonika_rut9xx.dtsi" diff --git a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi index 0025e5d8b..5e1d810b1 100644 --- a/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi +++ b/target/linux/ath79/dts/ar9344_teltonika_rut9xx.dtsi @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { compatible = "teltonika,rut9xx", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi index 9a6f0ea5a..6917e5e95 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344.dtsi" + #include #include -#include "ar9344.dtsi" - / { aliases { label-mac-device = &wmac; @@ -72,12 +72,12 @@ partition@0 { label = "kernel"; - reg = <0x000000 0x200000>; + reg = <0x000000 0x300000>; }; - partition@200000 { + partition@300000 { label = "rootfs"; - reg = <0x200000 0x580000>; + reg = <0x300000 0x480000>; }; }; @@ -100,7 +100,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x08>; + mtd-mac-address = <&info 0x8>; }; ð0 { diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts index 95604f07c..49b1e99f4 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe210-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts b/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts index 4a737378b..73bc246f4 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe220-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts index 483fdf4e6..b1fe2364c 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts b/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts index 7348bf755..99856030c 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_1port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts b/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts index 20a16c3d3..5a9d0d4c3 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_1port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts b/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts index de4139707..3b89b7741 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe610-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe610-v2.dts b/target/linux/ath79/dts/ar9344_tplink_cpe610-v2.dts index c00f21a51..346c2aa19 100644 --- a/target/linux/ath79/dts/ar9344_tplink_cpe610-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_cpe610-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe.dtsi" 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 e709e6b54..af992249f 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3500-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_tl-wdrxxxx.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts index 42f40d52a..63cca7884 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr3600-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_tl-wdr4300.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1-il.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1-il.dts index a84285d69..fa81e8566 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1-il.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1-il.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_tl-wdr4300.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts index f8f05d24b..a248ac3ac 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_tl-wdr4300.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4310-v1.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4310-v1.dts index 3fa4af518..287b02143 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4310-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4310-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_tl-wdr4300.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi index 489408520..68d79a674 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344.dtsi" + #include #include -#include "ar9344.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs210-v1.dts b/target/linux/ath79/dts/ar9344_tplink_wbs210-v1.dts index b89c0e29a..74a6b9adc 100644 --- a/target/linux/ath79/dts/ar9344_tplink_wbs210-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_wbs210-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts b/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts index 8c5535754..866838b13 100644 --- a/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_wbs210-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts b/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts index 28ea727b3..ff5b4dd11 100644 --- a/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts +++ b/target/linux/ath79/dts/ar9344_tplink_wbs510-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts b/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts index 8ce47a513..2b3baeb65 100644 --- a/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts +++ b/target/linux/ath79/dts/ar9344_tplink_wbs510-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "ar9344_tplink_cpe_2port.dtsi" diff --git a/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts new file mode 100644 index 000000000..c0b0f0bd4 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_ubnt_unifi-ap-pro.dts @@ -0,0 +1,157 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + model = "Ubiquiti UniFi AP Pro"; + compatible = "ubnt,unifi-ap-pro"; + + aliases { + led-boot = &led_white; + led-failsafe = &led_white; + led-running = &led_blue; + led-upgrade = &led_blue; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_white: led-white { + label = "ubnt:white:dome"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + led_blue: led-blue { + label = "ubnt:blue:dome"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xf60000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x300000>; + /* Can be resized w/o issues. + * U-Boot can load kernel from the + * entirety of the "firmware" partition space. + */ + }; + + partition@300000 { + label = "rootfs"; + reg = <0x300000 0xc60000>; + }; + }; + + partition@fb0000 { + label = "cfg"; + reg = <0xfb0000 0x40000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "pci168c,0033"; + reg = <0 0 0 0 0>; + qca,no-eeprom; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x4 0x7600000 /* PORT0 PAD MODE CTRL */ + 0x10 0x80000080 /* POWER_ON_STRAP */ + 0x7c 0x7e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x6000000 0x101 0x1616>; + + mtd-mac-address = <&art 0x0>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts index 18a52458a..00ae776f0 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "Western Digital My Net N750"; compatible = "wd,mynet-n750", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts index 3df601a73..77e0a0b20 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "Western Digital My Net Wi-Fi Range Extender"; compatible = "wd,mynet-wifi-rangeextender", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts index 4ee3ace82..c897b2301 100644 --- a/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts +++ b/target/linux/ath79/dts/ar9344_winchannel_wb2000.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "Winchannel WB2000"; compatible = "winchannel,wb2000", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index 3fb37f2ae..58780a041 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "ar9344.dtsi" #include #include -#include "ar9344.dtsi" - / { model = "ZBT WD323"; compatible = "zbtlink,zbt-wd323", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 763d1c8af..b1339ab36 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include - #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/ath79.dtsi b/target/linux/ath79/dts/ath79.dtsi index 1d1424590..89d905841 100644 --- a/target/linux/ath79/dts/ath79.dtsi +++ b/target/linux/ath79/dts/ath79.dtsi @@ -1,4 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include + / { #address-cells = <1>; #size-cells = <1>; diff --git a/target/linux/ath79/dts/qca9531_8dev_lima.dts b/target/linux/ath79/dts/qca9531_8dev_lima.dts index c3bac8822..266807b83 100644 --- a/target/linux/ath79/dts/qca9531_8dev_lima.dts +++ b/target/linux/ath79/dts/qca9531_8dev_lima.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "8dev,lima", "qca,qca9531"; model = "8devices Lima"; 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 a6ef6ad99..ac1df6bf6 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e130n-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-e130n-v2", "qca,qca9531"; model = "COMFAST CF-E130N v2"; @@ -122,18 +121,9 @@ &uart { status = "okay"; - -}; - -ð0 { - compatible = "syscon", "simple-mfd"; }; ð1 { - status = "okay"; - - phy-handle = <&swphy0>; - mtd-mac-address = <&art 0x0>; gmac-config { diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts index 382011966..a7c2571fd 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-e313ac", "qca,qca9531"; model = "COMFAST CF-E313AC"; 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 5c83170cc..ff975567d 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-e314n-v2", "qca,qca9531"; model = "COMFAST CF-E314N v2"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index 50d602fbb..d5711334f 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-e5", "qca,qca9531"; model = "COMFAST CF-E5/E7"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts index d1c2628d8..847dae689 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-e560ac", "qca,qca9531"; model = "COMFAST CF-E560AC"; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts index 5ed63e0b2..ad5275c0a 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-ew72", "qca,qca9531"; model = "COMFAST CF-EW72"; 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 4530c5903..467dfaeb1 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-wr752ac-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-wr752ac-v1", "qca,qca9531"; model = "COMFAST CF-WR752AC v1"; diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts index 4fb2f8495..4b4e23e1a 100644 --- a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "compex,wpj531-16m", "qca,qca9531"; model = "Compex WPJ531 (16MB flash)"; 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 5d6aebf92..b3fc8ea0b 100644 --- a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts +++ b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "dlink,dch-g020-a1", "qca,qca9531"; model = "D-Link DCH-G020 A1"; diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts index c8bfd2c8b..5ca651cfc 100644 --- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts +++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "engenius,ews511ap", "qca,qca9531"; model = "EnGenius EWS511AP"; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts index 0eeda5c3c..5a92d8366 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-lite.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9531_glinet_gl-ar300m.dtsi" / { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts index 00f9f5c82..e08f66bf2 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nand.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9531_glinet_gl-ar300m.dtsi" / { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts index 34f48f5f6..15cf1c57c 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m-nor.dts @@ -1,5 +1,3 @@ -/dts-v1/; - #include "qca9531_glinet_gl-ar300m.dtsi" / { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index c65f81032..617076b07 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -1,9 +1,8 @@ +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { aliases { led-boot = &led_status; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts index 328b667f7..0851d414d 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m16.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9531_glinet_gl-ar300m.dtsi" / { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts index 2726d8ea0..1bc41839d 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "glinet,gl-ar750", "qca,qca9531"; model = "GL.iNet GL-AR750"; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index 18769c9e0..b463be0ec 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "glinet,gl-e750", "qca,qca9531"; model = "GL.iNet GL-E750"; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index 3582dd4ac..f423e709f 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "glinet,gl-x750", "qca,qca9531"; model = "GL.iNet GL-X750"; diff --git a/target/linux/ath79/dts/qca9531_telco_t1.dts b/target/linux/ath79/dts/qca9531_telco_t1.dts index bc2a0c48b..98b52a7b2 100644 --- a/target/linux/ath79/dts/qca9531_telco_t1.dts +++ b/target/linux/ath79/dts/qca9531_telco_t1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "telco,t1", "qca,qca9531"; model = "Telco T1"; 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 0937a0b47..65b85a78f 100644 --- a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "tplink,archer-d50-v1", "qca,qca9531"; model = "TP-Link Archer D50 v1"; 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 978ad859f..92da0b1a5 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "tplink,tl-mr3420-v3", "qca,qca9531"; model = "TP-Link TL-MR3420 v3"; 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 7299257cd..6ab63ebde 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr6400-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "tplink,tl-mr6400-v1", "qca,qca9531"; model = "TP-Link TL-MR6400 v1"; diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts index eccfc4860..c792df60d 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca953x_tplink_tl-wr810n.dtsi" 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 0e338fe01..e6fc12822 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr902ac-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "tplink,tl-wr902ac-v1", "qca,qca9531"; model = "TP-Link TL-WR902AC v1"; @@ -126,9 +125,15 @@ reg = <0x020000 0x730000>; }; - tplink: partition@750000 { + info: partition@750000 { + label = "info"; + reg = <0x750000 0x010000>; + read-only; + }; + + partition@760000 { label = "tplink"; - reg = <0x750000 0x0a0000>; + reg = <0x760000 0x090000>; read-only; }; @@ -146,7 +151,7 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&tplink 0x8>; + mtd-mac-address = <&info 0x8>; mtd-mac-address-increment = <1>; }; @@ -158,7 +163,7 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&tplink 0x8>; + mtd-mac-address = <&info 0x8>; }; &pcie0 { diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index 1ff45e91c..4a0fa4947 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { model = "YunCore A770"; compatible = "yuncore,a770", "qca,qca9531"; 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 074363b17..7643717c0 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "comfast,cf-e110n-v2", "qca,qca9533"; model = "COMFAST CF-E110N v2"; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts index 3ec36ad9d..3a1d4f9af 100644 --- a/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_dlink_dap-13xx.dtsi" diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts index 3b153740c..5c118e73f 100644 --- a/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_dlink_dap-13xx.dtsi" diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi index 8823312d0..9b3a66f70 100644 --- a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi +++ b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { aliases { led-boot = &led_power; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi index 8af8601da..539c07c32 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { keys { compatible = "gpio-keys"; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts index 024ddd980..1866b7dd3 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_mikrotik_routerboard-lhg-hb.dtsi" diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi index 32cc6d373..f54e757c6 100644 --- a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi @@ -68,19 +68,20 @@ }; ð0 { - compatible = "syscon", "simple-mfd"; -}; - -ð1 { status = "okay"; phy-handle = <&swphy0>; gmac-config { device = <&gmac>; + switch-phy-swap = <1>; }; }; +ð1 { + compatible = "syscon", "simple-mfd"; +}; + &pinmux { led_wan_pin: pinmux_led_wan_pin { pinctrl-single,bits = <0x4 0x0 0xff>; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts b/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts index 020dae67a..57d4d94bb 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe210-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_cpe210.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts index fd24ecc2d..2500e309f 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe210-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_cpe210.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts index 813430590..2722c59b0 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_cpexxx.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi index 1180cc46c..387bd6ba1 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { aliases { led-boot = &led_link4; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v3.dts index c809dd6e7..21d208748 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wa801nd.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v4.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v4.dts index cf9c61c5d..76188bce2 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v4.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wa801nd.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi index 19d101f8c..efe892e28 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa801nd.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { aliases { label-mac-device = &wmac; 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 e103b66cb..537c57791 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "tplink,tl-wa850re-v2", "qca,qca9533"; model = "TP-Link TL-WA850RE v2"; @@ -125,9 +124,21 @@ compatible = "tplink,firmware"; }; - config: partition@3b0000 { + partition@3b0000 { + label = "partition-table"; + reg = <0x3b0000 0x010000>; + read-only; + }; + + info: partition@3c0000 { + label = "info"; + reg = <0x3c0000 0x010000>; + read-only; + }; + + partition@3d0000 { label = "config"; - reg = <0x3b0000 0x040000>; + reg = <0x3d0000 0x020000>; read-only; }; @@ -145,7 +156,7 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&config 0x10008>; + mtd-mac-address = <&info 0x8>; }; ð1 { @@ -156,5 +167,5 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&config 0x10008>; + mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v1.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v1.dts index 229c5fa7b..71f76bd2d 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v1.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wr802n.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v2.dts index cbfd275d2..b3eafbe5f 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wr802n.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi index 0fadab9f6..8bb708c6b 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts index 497fdd6ba..1b57e486f 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr810n-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca953x_tplink_tl-wr810n.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts index 9d6a32352..4566831c4 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v10.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wr841.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts index 6c91757ce..f8884805b 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wr841-v11.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts index 1b7db6199..c95926582 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v12.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wr841-v11.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts index 6de3ab36b..0c2ff7af6 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9533_tplink_tl-wr841.dtsi" diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index 249a3e1ee..e85f37f42 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { aliases { label-mac-device = &wmac; 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 e169d98c8..25447b8bf 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "tplink,tl-wr842n-v3", "qca,qca9533"; model = "TP-Link TL-WR842N v3"; diff --git a/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts index e266066e2..449e7fe45 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca953x.dtsi" #include #include -#include "qca953x.dtsi" - / { compatible = "ubnt,acb-isp", "qca,qca9533"; model = "Ubiquiti airCube ISP"; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index af85e8482..1c2c1350f 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include + #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index 3b4b1a57e..6c1d583f0 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca953x.dtsi" + #include #include -#include "qca953x.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi index 9d1899539..400f8eb97 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi +++ b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { keys { compatible = "gpio-keys"; diff --git a/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts b/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts index 772588fa9..43bf582b5 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts +++ b/target/linux/ath79/dts/qca9556_avm_fritz1750e.dts @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include - #include "qca9556_avm_fritz-repeater.dtsi" +#include + / { compatible = "avm,fritz1750e", "qca,qca9556"; model = "AVM FRITZ!WLAN Repeater 1750E"; diff --git a/target/linux/ath79/dts/qca9556_avm_fritz450e.dts b/target/linux/ath79/dts/qca9556_avm_fritz450e.dts index a6ffef7dc..86cd7153e 100644 --- a/target/linux/ath79/dts/qca9556_avm_fritz450e.dts +++ b/target/linux/ath79/dts/qca9556_avm_fritz450e.dts @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include - #include "qca9556_avm_fritz-repeater.dtsi" +#include + / { compatible = "avm,fritz450e", "qca,qca9556"; model = "AVM FRITZ!WLAN Repeater 450E"; 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 c5c51b687..572dc0220 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 @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "mikrotik,routerboard-wap-g-5hact2hnd", "qca,qca9556"; model = "MikroTik RouterBOARD wAP G-5HacT2HnD"; diff --git a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts index cf1c00c64..3b714a2fb 100644 --- a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts +++ b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "8dev,rambutan", "qca,qca9557"; model = "8devices Rambutan"; diff --git a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts index d7380bac3..d629c751d 100644 --- a/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts +++ b/target/linux/ath79/dts/qca9557_buffalo_bhr-4grv2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "buffalo,bhr-4grv2", "qca,qca9557"; model = "Buffalo BHR-4GRV2"; diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi index 78ee3a39d..d4aa0d742 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_power; diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac1167dgr.dts b/target/linux/ath79/dts/qca9557_iodata_wn-ac1167dgr.dts index 3dd84f142..e259cb026 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac1167dgr.dts +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac1167dgr.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9557_iodata_wn-ac-dgr.dtsi" diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts index 12da5a24f..205464330 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9557_iodata_wn-ac-dgr.dtsi" diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts index 771e55b41..388bd3ef0 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9557_iodata_wn-ac-dgr.dtsi" diff --git a/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts index 81fe766fd..5898518f2 100644 --- a/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts +++ b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca955x_zyxel_nbg6x16.dtsi" diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts index 6d7eeb263..d825eb005 100644 --- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts +++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { model = "ALLNET ALL-WAP02860AC"; compatible = "allnet,all-wap02860ac", "qca,qca9558"; 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 c87e350e6..d04f61193 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_comfast_cf-wr650ac.dtsi" 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 47eb4063e..6edd75d61 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_comfast_cf-wr650ac.dtsi" diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi index 59926ef44..b57bcc394 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { keys { compatible = "gpio-keys"; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts index 74506c2a8..3164d783f 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200e.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_devolo_dvl1xxx.dtsi" diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts index 4ccde031a..11ac6fd18 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1200i.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_devolo_dvl1xxx.dtsi" diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts index 6dbef96ae..11325a69c 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750c.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_devolo_dvl1xxx.dtsi" diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts index f8394ca86..7de8ee0bd 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750e.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_devolo_dvl1xxx.dtsi" diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts index 002d8b213..7ba011faf 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750i.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_devolo_dvl1xxx.dtsi" diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts b/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts index 2263292e4..a113097f6 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1750x.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_devolo_dvl1xxx.dtsi" diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index 62b947440..0ec955bd1 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -10,11 +10,11 @@ * antennas and number of spatial streams. */ +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { keys { compatible = "gpio-keys"; 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 2c17ab8b6..2cd05d915 100644 --- a/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts +++ b/target/linux/ath79/dts/qca9558_dlink_dap-2695-a1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "dlink,dap-2695-a1", "qca,qca9558"; model = "D-link DAP-2695-A1"; diff --git a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts index 876e3d118..776e92cee 100644 --- a/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts +++ b/target/linux/ath79/dts/qca9558_domywifi_dw33d.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "domywifi,dw33d", "qca,qca9558"; model = "DomyWifi DW33D"; diff --git a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts index a1efcaffe..e4e3ca340 100644 --- a/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts +++ b/target/linux/ath79/dts/qca9558_engenius_ecb1750.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "engenius,ecb1750", "qca,qca9558"; model = "EnGenius ECB1750"; diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts index eccd3a968..aa14fd4f3 100644 --- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts +++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { model = "EnGenius EPG5000"; compatible = "engenius,epg5000", "qca,qca9558"; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index 3a2ae598f..ccead91cf 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "librerouter,librerouter-v1", "qca,qca9558"; model = "LibreRouter v1"; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-921gs-5hpacd-15s.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-921gs-5hpacd-15s.dts index 8cd0fa750..222de8878 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-921gs-5hpacd-15s.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-921gs-5hpacd-15s.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_mikrotik_routerboard-92x.dtsi" 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 92a1772e2..3936fd993 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_mikrotik_routerboard-92x.dtsi" diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi index 85dd65f7a..57aeedd67 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_user; diff --git a/target/linux/ath79/dts/qca9558_netgear_ex6400.dts b/target/linux/ath79/dts/qca9558_netgear_ex6400.dts index 8b61331f9..273c872b6 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex6400.dts +++ b/target/linux/ath79/dts/qca9558_netgear_ex6400.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_netgear_ex7300.dtsi" diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dts b/target/linux/ath79/dts/qca9558_netgear_ex7300.dts index 23102bf93..9802210b3 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dts +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_netgear_ex7300.dtsi" diff --git a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi index c15c5c023..bbecdfce8 100644 --- a/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi +++ b/target/linux/ath79/dts/qca9558_netgear_ex7300.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_power_green; diff --git a/target/linux/ath79/dts/qca9558_ocedo_koala.dts b/target/linux/ath79/dts/qca9558_ocedo_koala.dts index ff4230c3b..eefa839b8 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_koala.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_koala.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "ocedo,koala", "qca,qca9558"; model = "OCEDO Koala"; diff --git a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts index a97e36aad..eb93201ab 100644 --- a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts +++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "ocedo,ursus", "qca,qca9558"; model = "OCEDO Ursus"; 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 2c8401d73..51a22f09a 100644 --- a/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts +++ b/target/linux/ath79/dts/qca9558_openmesh_om5p-ac-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "openmesh,om5p-ac-v2", "qca,qca9558"; model = "OpenMesh OM5P-AC V2"; diff --git a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts index ba3a33891..0b191149c 100644 --- a/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts +++ b/target/linux/ath79/dts/qca9558_sitecom_wlr-8100.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { model = "Sitecom WLR-8100 (X8 AC1750)"; compatible = "sitecom,wlr-8100", "qca,qca9558"; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi index cd602a2a7..83458df56 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_system; 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 261f65575..c8381296c 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c5-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_archer-c.dtsi" 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 098835998..ee35fa659 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_archer-c.dtsi" 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 7040d9b52..634c23c35 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c7-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_archer-c.dtsi" 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 8fae6545e..689e478e1 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_archer-d7.dtsi" diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi index 2d6367170..6d7e0dd5e 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_system; 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 31563d9c4..227329822 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_archer-d7b-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_archer-d7.dtsi" diff --git a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts index 887b6eea5..3e57326e0 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re350k-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { model = "TP-Link RE350K v1"; compatible = "tplink,re350k-v1", "qca,qca9558"; @@ -100,7 +99,7 @@ phy-handle = <&phy4>; pll-data = <0x9e000000 0x80000101 0x80001313>; - mtd-mac-address = <&config 0x10008>; + mtd-mac-address = <&info 0x8>; gmac-config { device = <&gmac>; @@ -144,9 +143,21 @@ reg = <0x020000 0xd70000>; }; - config: partition@d90000 { + partition@d90000 { + label = "partition-table"; + reg = <0xd90000 0x010000>; + read-only; + }; + + info: partition@da0000 { + label = "info"; + reg = <0xda0000 0x020000>; + read-only; + }; + + partition@dc0000 { label = "config"; - reg = <0xd90000 0x260000>; + reg = <0xdc0000 0x230000>; read-only; }; @@ -167,5 +178,5 @@ status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&config 0x10008>; + mtd-mac-address = <&info 0x8>; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts index 4f017786d..f8ad48c3c 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re355-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_rex5x.dtsi" diff --git a/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts b/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts index b9b1bd18b..86d7be540 100644 --- a/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts +++ b/target/linux/ath79/dts/qca9558_tplink_re450-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_rex5x.dtsi" diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi index 2f753f761..0c11d786c 100644 --- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_power; 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 70fcfd352..70e14c4eb 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "tplink,tl-wdr4900-v2", "qca,qca9558"; model = "TP-Link TL-WDR4900 v2"; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v2.dts index cd510632e..37b81b7d3 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_tl-wr1043nd.dtsi" diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v3.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v3.dts index 3564a4392..474fd8ede 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v3.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_tl-wr1043nd.dtsi" diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index 9c5e2c7d5..6173a5ca7 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts b/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts index 9ae3670aa..86d0a3906 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1045nd-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9558_tplink_tl-wr1043nd.dtsi" 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 bcd9e4d18..82dee361b 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 @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "tplink,tl-wr941n-v7-cn", "qca,qca9558"; model = "TP-Link TL-WR941N v7 (CN)"; diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts index 6e7faf598..881e3c88a 100644 --- a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts +++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - / { compatible = "trendnet,tew-823dru", "qca,qca9558"; model = "TRENDNET TEW-823DRU"; 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 c41b9e542..3d90531a3 100644 --- a/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts +++ b/target/linux/ath79/dts/qca9558_ubnt_powerbeam-5ac-500.dts @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-only #include "qca955x_ubnt_xc.dtsi" diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts index 90328078d..5dd06803e 100644 --- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts +++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca955x_zyxel_nbg6x16.dtsi" diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index 4883965db..f910d2a82 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include + #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi index b27a9c2fe..569ba3a72 100644 --- a/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi +++ b/target/linux/ath79/dts/qca955x_ubnt_xc.dtsi @@ -1,10 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only + +#include "qca955x.dtsi" #include #include -#include "qca955x.dtsi" - &uart { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi index dfc6728be..849063b6d 100644 --- a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi +++ b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca955x.dtsi" + #include #include -#include "qca955x.dtsi" - / { keys: keys { compatible = "gpio-keys"; diff --git a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts index c4a50536b..e05f4bb45 100644 --- a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts +++ b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { compatible = "avm,fritz4020", "qca,qca9560"; model = "AVM FRITZ!Box 4020"; 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 7078da479..02f54097f 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c25-v1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { compatible = "tplink,archer-c25-v1", "qca,qca9561"; model = "TP-Link Archer C25 v1"; 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 db2e38bbc..464bc40b4 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c58-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9561_tplink_archer-c5x.dtsi" @@ -28,8 +27,8 @@ read-only; }; - mac: partition@10000 { - label = "mac"; + info: partition@10000 { + label = "info"; reg = <0x010000 0x010000>; read-only; }; 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 773b071a3..fe8569c42 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9561_tplink_archer-c5x.dtsi" @@ -52,8 +51,8 @@ read-only; }; - mac: partition@10000 { - label = "mac"; + info: partition@10000 { + label = "info"; reg = <0x010000 0x010000>; read-only; }; 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 e70afbffd..2d6294442 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c59-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9561_tplink_archer-c5x.dtsi" @@ -58,8 +57,8 @@ read-only; }; - mac: partition@30000 { - label = "mac"; + info: partition@30000 { + label = "info"; reg = <0x030000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi index aa33d13c8..a5933d27e 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { compatible = "tplink,archer-c5x", "qca,qca9560"; @@ -130,7 +130,7 @@ phy-handle = <&swphy0>; - mtd-mac-address = <&mac 0x8>; + mtd-mac-address = <&info 0x8>; mtd-mac-address-increment = <1>; gmac-config { @@ -144,12 +144,12 @@ ð1 { status = "okay"; - mtd-mac-address = <&mac 0x8>; + mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&mac 0x8>; + 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 a83b5881d..a46b537d3 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9561_tplink_archer-c6x.dtsi" @@ -40,8 +39,8 @@ read-only; }; - mac: partition@10000 { - label = "mac"; + info: partition@10000 { + label = "info"; reg = <0x010000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts index c19e4e973..5c8564154 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9561_tplink_archer-c6x.dtsi" @@ -40,8 +39,8 @@ read-only; }; - mac: partition@1fb00 { - label = "mac"; + info: partition@1fb00 { + label = "info"; reg = <0x01fb00 0x000500>; read-only; }; 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 444d54b00..67cef957c 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9561_tplink_archer-c6x.dtsi" @@ -35,8 +34,8 @@ read-only; }; - mac: partition@1fb00 { - label = "mac"; + info: partition@1fb00 { + label = "info"; reg = <0x01fb00 0x000500>; read-only; }; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi index 993c6acc5..9c46a1b22 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_power; @@ -76,19 +76,19 @@ phy-handle = <&swphy4>; - mtd-mac-address = <&mac 0x8>; + mtd-mac-address = <&info 0x8>; mtd-mac-address-increment = <1>; }; ð1 { status = "okay"; - mtd-mac-address = <&mac 0x8>; + mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&mac 0x8>; + 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 new file mode 100644 index 000000000..0e93e06e2 --- /dev/null +++ b/target/linux/ath79/dts/qca9561_tplink_eap225-wall-v2.dts @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + compatible = "tplink,eap225-wall-v2", "qca,qca9561"; + model = "TP-Link EAP225-Wall v2"; + + aliases { + label-mac-device = ð1; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + led { + label = "LED button"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "tp-link:white:status"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + poe_passthrough { + gpio-export,name = "tp-link:poe-passthrough:enable"; + gpio-export,output = <0>; + gpios = <&gpio 20 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "partition-table"; + reg = <0x020000 0x010000>; + read-only; + }; + + info: partition@30000 { + label = "info"; + reg = <0x030000 0x010000>; + read-only; + }; + + partition@40000 { + compatible = "openwrt,elf"; + label = "firmware"; + reg = <0x040000 0xd80000>; + }; + + partition@dc0000 { + label = "config"; + reg = <0xdc0000 0x030000>; + read-only; + }; + + /* df0000-f30000 undefined in vendor firmware */ + + partition@f30000 { + label = "mutil-log"; + reg = <0xf30000 0x080000>; + read-only; + }; + + partition@fb0000 { + label = "oops"; + reg = <0xfb0000 0x040000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð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_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts index 360e9cd41..077724d4b 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -1,11 +1,10 @@ -// SPDX-License-Identifier: GPL-2.0+ OR MIT -/dts-v1/; +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { compatible = "xiaomi,mi-router-4q", "qca,qca9560"; model = "Xiaomi Mi Router 4Q"; diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts index ae9dd5c46..a85f99881 100644 --- a/target/linux/ath79/dts/qca9563_compex_wpj563.dts +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { model = "Compex WPJ563"; compatible = "compex,wpj563", "qca,qca9563"; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi index 0d8063de3..754d5fad1 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { keys { compatible = "gpio-keys"; diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts index 444034ed5..de7ad15cc 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_dlink_dir-842-c.dtsi" diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts b/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts index 56485a287..de0e554b7 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_dlink_dir-842-c.dtsi" diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts b/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts index d1467ab5f..6954a330d 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_dlink_dir-842-c.dtsi" diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts index 25580b1c9..0197921ec 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { model = "D-Link DIR-859 A1"; compatible = "dlink,dir-859-a1", "qca,qca9563"; 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 01a8c2133..c4450fea1 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-1750ghbk2-i.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_elecom_wrc-ghbk2-i.dtsi" 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 df926ebe3..18074c72b 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-300ghbk2-i.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_elecom_wrc-ghbk2-i.dtsi" 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 8df752a2e..ebe4a0ff5 100644 --- a/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi +++ b/target/linux/ath79/dts/qca9563_elecom_wrc-ghbk2-i.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_power; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts index 3fe8a35b9..433ed9d6a 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor-nand.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9563_glinet_gl-ar750s.dtsi" / { diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts index 271cef516..4203e1f66 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9563_glinet_gl-ar750s.dtsi" / { diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index f5c64c07e..762cc895e 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { compatible = "glinet,gl-ar750s", "qca,qca9563"; model = "GL.iNet GL-AR750S"; diff --git a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts index 399777756..d5a14ab47 100644 --- a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts +++ b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { model = "NEC Aterm WG1200CR"; compatible = "nec,wg1200cr", "qca,qca9563"; diff --git a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts index 09df26621..607db3ca2 100644 --- a/target/linux/ath79/dts/qca9563_nec_wg800hp.dts +++ b/target/linux/ath79/dts/qca9563_nec_wg800hp.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { model = "NEC Aterm WG800HP"; compatible = "nec,wg800hp", "qca,qca9563"; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index 111d073aa..173dfdd55 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_power_amber; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr4300-v2.dts b/target/linux/ath79/dts/qca9563_netgear_wndr4300-v2.dts index e4b4ba2ac..07e2ad054 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr4300-v2.dts +++ b/target/linux/ath79/dts/qca9563_netgear_wndr4300-v2.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9563_netgear_wndr.dtsi" / { diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts b/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts index 95e30ea84..d5cd01eac 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts +++ b/target/linux/ath79/dts/qca9563_netgear_wndr4500-v3.dts @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; - #include "qca9563_netgear_wndr.dtsi" / { diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts index 802641bbc..94a10d45f 100644 --- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts +++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { model = "Phicomm K2T"; compatible = "phicomm,k2t", "qca,qca9563"; diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index 34c95b593..d37e1aed3 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { model = "ROSINSON WR818"; compatible = "rosinson,wr818", "qca,qca9563"; 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 db6e5fb7f..eecfe3545 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-a7-v5.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_archer-x7-v5.dtsi" 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 97d36d76d..2ef5bee28 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { compatible = "tplink,archer-c2-v3", "qca,qca9563"; model = "TP-Link Archer C2 v3"; 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 3a6f00bf4..d09ee56d5 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 @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_archer-x6-v2.dtsi" @@ -96,8 +95,8 @@ read-only; }; - mac: partition@20000 { - label = "mac"; + info: partition@20000 { + label = "info"; reg = <0x020000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts index e7ceec9b3..9f4386c2c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c6-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_archer-x6-v2.dtsi" @@ -96,8 +95,8 @@ read-only; }; - mac: partition@20000 { - label = "mac"; + info: partition@20000 { + label = "info"; reg = <0x020000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts index 5c0e2e0f8..5f6657001 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -1,11 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; + +#include "qca956x.dtsi" #include #include -#include "qca956x.dtsi" - / { compatible = "tplink,archer-c7-v4", "qca,qca9563"; model = "TP-Link Archer C7 v4"; 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 7e735adbd..da8d0c1fc 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v5.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_archer-x7-v5.dtsi" 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 275f71316..8e46cd87f 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { label-mac-device = ð0; @@ -42,12 +42,12 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - mtd-mac-address = <&mac 0x8>; + mtd-mac-address = <&info 0x8>; }; &wmac { status = "okay"; mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&mac 0x8>; + 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 633543e73..7f79165cb 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_system; diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts new file mode 100644 index 000000000..321b6296d --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include + +/ { + compatible = "tplink,eap245-v3", "qca,qca9563"; + model = "TP-Link EAP245 v3"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_amber; + led-running = &led_status_green; + led-upgrade = &led_status_amber; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "tp-link:green:status"; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_status_amber: status_amber { + label = "tp-link:amber:status"; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "factory-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot"; + reg = <0x040000 0x040000>; + read-only; + }; + + partition@80000 { + label = "partition-table"; + reg = <0x080000 0x010000>; + read-only; + }; + + info: partition@90000 { + label = "info"; + reg = <0x090000 0x010000>; + read-only; + }; + + art: partition@a0000 { + label = "art"; + reg = <0x0a0000 0x010000>; + read-only; + }; + + partition@b0000 { + label = "extra-para"; + reg = <0x0b0000 0x010000>; + read-only; + }; + + partition@c0000 { + compatible = "openwrt,elf"; + label = "firmware"; + reg = <0x0c0000 0xe40000>; + }; + + partition@f00000 { + label = "config"; + reg = <0xf00000 0x030000>; + read-only; + }; + + partition@f30000 { + label = "mutil-log"; + reg = <0xf30000 0x080000>; + read-only; + }; + + partition@fb0000 { + label = "oops"; + reg = <0xfb0000 0x040000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x1>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,ar8327-initvals = < + 0x04 0x00080080 /* PAD0 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0xe0 0xc74164de /* SGMII_CTRL */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + phy-mode = "sgmii"; + + 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_re450-v2.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts index 4446163a5..d0356d668 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v2.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_re450.dtsi" diff --git a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts index f85f02428..695f78ed0 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_re450-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_re450.dtsi" diff --git a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi index 8d20f1375..ed8d90710 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { label-mac-device = ð0; 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 0dd14896f..4df03efb4 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_tl-wpa8630.dtsi" diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi index 14602a1c2..49fa914bd 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_power; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts index afcb47167..4c04d4f96 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_tl-wpa8630p-v2.dtsi" @@ -9,8 +8,8 @@ }; &partitions { - mac: partition@630000 { - label = "mac"; + info: partition@630000 { + label = "info"; reg = <0x630000 0x010000>; read-only; }; 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 8655283f5..22a808201 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,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_tl-wpa8630p-v2.dtsi" @@ -15,8 +14,8 @@ read-only; }; - mac: partition@7e0000 { - label = "mac"; + info: partition@7e0000 { + label = "info"; reg = <0x7e0000 0x010000>; read-only; }; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi index 2d3128e03..be691a843 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi @@ -35,9 +35,9 @@ }; ð0 { - mtd-mac-address = <&mac 0x8>; + mtd-mac-address = <&info 0x8>; }; &wmac { - mtd-mac-address = <&mac 0x8>; + 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 b4c7e9b45..208a5ca88 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n-v5.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_tl-wr1043n.dtsi" diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi index b84985802..2704d4c8c 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_system; 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 9e220539d..7603898de 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043nd-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_tplink_tl-wr1043n.dtsi" diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts index 4ab4197a8..512d2e457 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_ubnt_unifiac-lite.dtsi" diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts index 3128081b5..00cc3acd0 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_ubnt_unifiac-lite.dtsi" diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts index 97d976304..0c0bb9cb7 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_ubnt_unifiac-pro.dtsi" diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts index b3d652bdf..ba7268b64 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_ubnt_unifiac-lite.dtsi" diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts index 48c9e105e..65b7123ca 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_ubnt_unifiac-pro.dtsi" diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index e904bb75c..51cefa3f3 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { led-boot = &led_white; diff --git a/target/linux/ath79/dts/qca9563_yuncore_a782.dts b/target/linux/ath79/dts/qca9563_yuncore_a782.dts index 27360bbe9..3774b7536 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_a782.dts +++ b/target/linux/ath79/dts/qca9563_yuncore_a782.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_yuncore_xd4200.dtsi" diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts index ab8d85588..5865e9526 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "qca9563_yuncore_xd4200.dtsi" diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index 81aa8dc93..a14cf4834 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { label-mac-device = ð0; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index 081e29e78..6489efbf0 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include + #include "ath79.dtsi" / { diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v4.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v4.dts index 69080feb2..19f7e6e77 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v4.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "tp9343_tplink_tl-wa901nd.dtsi" diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v5.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v5.dts index 7d9e8e8f6..e0fbd73d3 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v5.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wa901nd-v5.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "tp9343_tplink_tl-wa901nd.dtsi" diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts index 171cc6096..d8920379c 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v3.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "tp9343_tplink_tl-wr940n-v3.dtsi" 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 54e355530..88aff2c4c 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v4.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "tp9343_tplink_tl-wr94x.dtsi" 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 31f0c14af..5a6e65464 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "tp9343_tplink_tl-wr94x.dtsi" diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts index 121267f60..74ea95f50 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wr941nd-v6.dts @@ -1,5 +1,4 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/dts-v1/; #include "tp9343_tplink_tl-wr940n-v3.dtsi" diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi index 94fd95c5d..30e2cb643 100644 --- a/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi +++ b/target/linux/ath79/dts/tp9343_tplink_tl-wx.dtsi @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "qca956x.dtsi" + #include #include -#include "qca956x.dtsi" - / { aliases { label-mac-device = &wmac; 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 32101ed5b..ef7a0d4e3 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -144,6 +144,20 @@ dlink,dap-1365-a1) dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; +engenius,enh202-v1) + ucidef_set_led_switch "lan" "LAN" "$boardname:amber:lan" "switch0" "0x10" + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:amber:rssimedium" "wlan0" "33" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "67" "100" + ;; +engenius,ens202ext-v1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:amber:rssimedium" "wlan0" "33" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "67" "100" + ;; engenius,ews511ap) ucidef_set_led_netdev "lan1" "LAN1" "$boardname:blue:lan1" "eth1" ucidef_set_led_netdev "lan2" "LAN2" "$boardname:blue:lan2" "eth0" @@ -169,6 +183,9 @@ glinet,gl-mifi) glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ;; +meraki,mr16) + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0" + ;; netgear,wnr2200-8m|\ netgear,wnr2200-16m) ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" "eth0" @@ -182,7 +199,7 @@ netgear,wnr2200-16m) ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" "switch0" "0x10" "0x02" ;; pcs,cap324) - ucidef_set_led_netdev "lan" "LAN" "pcs:lan:green" "eth0" + ucidef_set_led_netdev "lan" "LAN" "pcs:green:lan" "eth0" ;; pcs,cr3000) ucidef_set_led_netdev "wan" "WAN" "pcs:blue:wan" "eth1" @@ -341,7 +358,7 @@ ubnt,powerbeam-5ac-gen2) wd,mynet-wifi-rangeextender) ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" ucidef_set_rssimon "wlan0" "200000" "1" - ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:rssi-low" "wlan0" "1" "100" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:blue:rssi-low" "wlan0" "1" "100" ucidef_set_led_rssi "rssimedium" "RSSIMED" "$boardname:blue:rssi-med" "wlan0" "33" "100" ucidef_set_led_rssi "rssihigh" "RSSIMAX" "$boardname:blue:rssi-max" "wlan0" "66" "100" ;; 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 f655abe74..518ca6f91 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -30,6 +30,7 @@ ath79_setup_interfaces() engenius,ecb1750|\ enterasys,ws-ap3705i|\ glinet,gl-ar300m-lite|\ + meraki,mr16|\ netgear,ex6400|\ netgear,ex7300|\ ocedo,koala|\ @@ -93,6 +94,7 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0" ;; + buffalo,wzr-600dhp|\ buffalo,wzr-hp-ag300h|\ tplink,archer-c25-v1|\ tplink,archer-c60-v1|\ @@ -186,6 +188,16 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan:3" "3:lan:2" ;; + engenius,enh202-v1) + ucidef_set_interface_wan "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "4:lan:1" + ;; + engenius,ens202ext-v1) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" + ;; engenius,ews511ap) ucidef_set_interface_lan "eth0 eth1" "dhcp" ;; @@ -212,6 +224,19 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "5:wan" "6@eth1" "4:lan" ;; + mercury,mw4530r-v1|\ + tplink,archer-a7-v5|\ + tplink,archer-c6-v2|\ + tplink,archer-c6-v2-us|\ + tplink,archer-c7-v4|\ + tplink,archer-c7-v5|\ + tplink,tl-wdr3600-v1|\ + tplink,tl-wdr4300-v1|\ + tplink,tl-wdr4300-v1-il|\ + tplink,tl-wdr4310-v1) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" + ;; nec,wg1200cr|\ ubnt,nanostation-ac|\ yuncore,a782|\ @@ -262,18 +287,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" ;; - tplink,archer-a7-v5|\ - tplink,archer-c6-v2|\ - tplink,archer-c6-v2-us|\ - tplink,archer-c7-v4|\ - tplink,archer-c7-v5|\ - tplink,tl-wdr3600-v1|\ - tplink,tl-wdr4300-v1|\ - tplink,tl-wdr4300-v1-il|\ - tplink,tl-wdr4310-v1) - ucidef_add_switch "switch0" \ - "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" - ;; tplink,archer-c5-v1|\ tplink,archer-c7-v1|\ tplink,archer-c7-v2|\ @@ -290,6 +303,14 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "3:lan:3" "4:lan:2" "5:lan:1" "6@eth0" "2:wan:4" "1:wan:5" ;; + tplink,eap225-wall-v2) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + ;; + tplink,eap245-v3) + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:1" "5:lan:2" + ;; tplink,tl-mr6400-v1) ucidef_set_interfaces_lan_wan "eth0.1 eth1" "usb0" ucidef_add_switch "switch0" \ @@ -350,6 +371,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" ;; + ubnt,unifi-ap-pro) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" + ;; zbtlink,zbt-wd323|\ xiaomi,mi-router-4q) ucidef_set_interface_wan "eth1" @@ -372,7 +397,8 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_binary "Board data" 2) label_mac=$lan_mac ;; - alfa-network,ap121f) + alfa-network,ap121f|\ + engenius,ens202ext-v1) label_mac=$(mtd_get_mac_binary art 0x1002) ;; arduino,yun) @@ -443,6 +469,19 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) label_mac=$(mtd_get_mac_ascii u-boot-env athaddr) ;; + engenius,enh202-v1|\ + ubnt,airrouter|\ + ubnt,bullet-m-ar7240|\ + ubnt,bullet-m-ar7241|\ + ubnt,nanobridge-m|\ + ubnt,nanostation-loco-m|\ + ubnt,nanostation-m|\ + ubnt,picostation-m|\ + ubnt,powerbridge-m|\ + ubnt,rocket-m|\ + ubnt,unifi) + label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) + ;; engenius,epg5000) lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) @@ -473,6 +512,13 @@ ath79_setup_macs() wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n alias/ethaddr) lan_mac=$(macaddr_add "$wan_mac" 1) ;; + mercury,mw4530r-v1|\ + tplink,tl-wdr3600-v1|\ + tplink,tl-wdr4300-v1|\ + tplink,tl-wdr4300-v1-il) + base_mac=$(mtd_get_mac_binary u-boot 0x1fc00) + wan_mac=$(macaddr_add "$base_mac" 1) + ;; nec,wg800hp) lan_mac=$(mtd_get_mac_text board_data 0x280) wan_mac=$(mtd_get_mac_text board_data 0x480) @@ -507,29 +553,11 @@ ath79_setup_macs() base_mac=$(mtd_get_mac_binary info 0x8) wan_mac=$(macaddr_add "$base_mac" 1) ;; - tplink,tl-wdr3600-v1|\ - tplink,tl-wdr4300-v1|\ - tplink,tl-wdr4300-v1-il) - base_mac=$(mtd_get_mac_binary u-boot 0x1fc00) - wan_mac=$(macaddr_add "$base_mac" 1) - ;; trendnet,tew-823dru) lan_mac=$(mtd_get_mac_text mac 0x4) wan_mac=$(mtd_get_mac_text mac 0x18) label_mac=$wan_mac ;; - ubnt,airrouter|\ - ubnt,bullet-m-ar7240|\ - ubnt,bullet-m-ar7241|\ - ubnt,nanobridge-m|\ - ubnt,nanostation-loco-m|\ - ubnt,nanostation-m|\ - ubnt,picostation-m|\ - ubnt,powerbridge-m|\ - ubnt,rocket-m|\ - ubnt,unifi) - label_mac=$(cat /sys/class/ieee80211/phy0/macaddress) - ;; ubnt,litebeam-ac-gen2|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2) 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 90752a8f9..88d43e25c 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 @@ -74,7 +74,8 @@ case "$FIRMWARE" in avm,fritz300e) caldata_extract_reverse "urloader" 0x1541 0x440 ;; - buffalo,wzr-hp-g302h-a1a0) + buffalo,wzr-hp-g302h-a1a0|\ + engenius,enh202-v1) caldata_extract "art" 0x1000 0xeb8 ;; buffalo,wzr-hp-g450h) @@ -89,6 +90,7 @@ case "$FIRMWARE" in caldata_extract "calibrate" 0x5000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0) ;; + mercury,mw4530r-v1|\ ocedo,raccoon|\ tplink,tl-wdr3500-v1|\ tplink,tl-wdr3600-v1|\ @@ -96,6 +98,7 @@ case "$FIRMWARE" in tplink,tl-wdr4300-v1-il|\ tplink,tl-wdr4310-v1|\ tplink,tl-wdr4900-v2|\ + ubnt,unifi-ap-pro|\ winchannel,wb2000) caldata_extract "art" 0x5000 0x440 ;; @@ -130,6 +133,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|\ @@ -143,6 +147,9 @@ case "$FIRMWARE" in caldata_extract "caldata" 0x1000 0xeb8 ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c ;; + meraki,mr16) + caldata_extract "art" 0x11000 0xeb8 + ;; *) caldata_die "board $board is not supported yet" ;; @@ -150,6 +157,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|\ @@ -163,6 +171,9 @@ case "$FIRMWARE" in caldata_extract "caldata" 0x5000 0xeb8 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c ;; + meraki,mr16) + caldata_extract "art" 0x15000 0xeb8 + ;; *) caldata_die "board $board is not supported yet" ;; 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 1c93fe332..89a64fbf3 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 @@ -98,7 +98,8 @@ case "$FIRMWARE" in tplink,archer-c2-v3|\ tplink,archer-c7-v4|\ tplink,archer-c7-v5|\ - tplink,archer-c25-v1) + tplink,archer-c25-v1|\ + tplink,tl-wr902ac-v1) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1) ;; @@ -118,7 +119,7 @@ case "$FIRMWARE" in ;; tplink,re350k-v1) caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2) + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +2) ;; tplink,re355-v1|\ tplink,re450-v1) @@ -134,10 +135,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) +1) ;; - tplink,tl-wr902ac-v1) - caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary tplink 0x8) -1) - ;; esac ;; "ath10k/cal-pci-0000:01:00.0.bin") @@ -193,14 +190,24 @@ 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) + 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,eap225-wall-v2|\ tplink,tl-wpa8630p-v2-eu|\ tplink,tl-wpa8630p-v2-int) caldata_extract "art" 0x5000 0x2f20 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1) + 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,eap245-v3) + caldata_extract "art" 0x5000 0x2f20 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) + ;; yuncore,a782|\ yuncore,xd4200) caldata_extract "art" 0x5000 0x2f20 diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration index 2dcdf7b00..15cf20573 100644 --- a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration @@ -21,6 +21,17 @@ engenius,epg5000) glinet,gl-mifi) migrate_leds ":net=:3g4g" ;; +pcs,cap324) + migrate_leds "lan:amber=amber:lan" "lan:green=green:lan" + ;; +mercury,mw4530r-v1|\ +tplink,archer-c7-v2|\ +tplink,tl-wdr3600-v1|\ +tplink,tl-wdr4300-v1|\ +tplink,tl-wdr4300-v1-il|\ +tplink,tl-wdr4310-v1) + migrate_leds ":blue:=:green:" + ;; tplink,archer-c25-v1|\ tplink,archer-c58-v1|\ tplink,archer-c59-v1|\ @@ -32,13 +43,6 @@ tplink,archer-c7-v5|\ tplink,tl-wr902ac-v1) migrate_leds "^$boardonly:=tp-link:" ;; -tplink,archer-c7-v2|\ -tplink,tl-wdr3600-v1|\ -tplink,tl-wdr4300-v1|\ -tplink,tl-wdr4300-v1-il|\ -tplink,tl-wdr4310-v1) - migrate_leds ":blue:=:green:" - ;; tplink,re355-v1) migrate_leds "re355:=tp-link:" ;; diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/ath79/generic/base-files/etc/uci-defaults/05_fix-compat-version new file mode 100644 index 000000000..af5fb80f2 --- /dev/null +++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,10 @@ +. /lib/functions.sh + +case "$(board_name)" in + meraki,mr16) + uci set system.@system[0].compat_version="2.0" + uci commit system + ;; +esac + +exit 0 diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index a555cfc6d..4b4a67fd4 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -19,11 +19,6 @@ define Build/loader-kernel $(call Build/loader-common,LOADER_DATA="$@") endef -define Build/loader-kernel-cmdline - $(call Build/loader-common,LOADER_DATA="$@") -endef - - define Build/loader-okli-compile $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0) endef diff --git a/target/linux/ath79/image/common-buffalo.mk b/target/linux/ath79/image/common-buffalo.mk index d62b7eea9..31936b823 100644 --- a/target/linux/ath79/image/common-buffalo.mk +++ b/target/linux/ath79/image/common-buffalo.mk @@ -1,3 +1,5 @@ +DEVICE_VARS += BUFFALO_PRODUCT BUFFALO_HWVER + define Build/buffalo-tag $(eval product=$(word 1,$(1))) $(eval hwver=$(word 2,$(1))) @@ -17,3 +19,16 @@ define Build/buffalo-tftp-header ) > $@.new mv $@.new $@ endef + + +define Device/buffalo_common + DEVICE_VENDOR := Buffalo + BUFFALO_PRODUCT := + BUFFALO_HWVER := 3 + IMAGES += factory.bin tftp.bin + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ + pad-rootfs | check-size + IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc $$$$(BUFFALO_PRODUCT) 1.99 | \ + buffalo-tag $$$$(BUFFALO_PRODUCT) $$$$(BUFFALO_HWVER) + IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header +endef diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 7128d853f..22d1ac8a9 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -362,6 +362,37 @@ define Device/tplink_cpe610-v2 endef TARGET_DEVICES += tplink_cpe610-v2 +define Device/tplink-eap2x5 + $(Device/tplink-safeloader) + LOADER_TYPE := elf + KERNEL := kernel-bin | append-dtb | lzma | loader-kernel + KERNEL_INITRAMFS := $$(KERNEL) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory | \ + pad-extra 128 +endef + +define Device/tplink_eap225-wall-v2 + $(Device/tplink-eap2x5) + SOC := qca9561 + IMAGE_SIZE := 13824k + DEVICE_MODEL := EAP225-Wall + DEVICE_VARIANT := v2 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + TPLINK_BOARD_ID := EAP225-WALL-V2 +endef +TARGET_DEVICES += tplink_eap225-wall-v2 + +define Device/tplink_eap245-v3 + $(Device/tplink-eap2x5) + SOC := qca9563 + IMAGE_SIZE := 14592k + DEVICE_MODEL := EAP245 + DEVICE_VARIANT := v3 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca99x0-ct + TPLINK_BOARD_ID := EAP245-V3 +endef +TARGET_DEVICES += tplink_eap245-v3 + define Device/tplink_re350k-v1 $(Device/tplink-safeloader) SOC := qca9558 diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index b94518377..6939edd25 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -13,6 +13,14 @@ define Build/mkubntimage -k $(IMAGE_KERNEL) -r $@ -o $@ endef +define Build/mkubntimage2 + -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \ + -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \ + -p jffs2:0x50000:0xf60000:0:0:$@ \ + -o $@.new + @mv $@.new $@ +endef + # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when # booting the image, the size doesn't matter. define Build/mkubntimage-split @@ -369,3 +377,20 @@ define Device/ubnt_unifiac-pro SUPPORTED_DEVICES += unifiac-pro endef TARGET_DEVICES += ubnt_unifiac-pro + +define Device/ubnt_unifi-ap-pro + SOC := ar9344 + DEVICE_VENDOR := Ubiquiti + DEVICE_MODEL := UniFi AP Pro + UBNT_TYPE := BZ + UBNT_CHIP := ar934x + KERNEL_SIZE := 3072k + IMAGE_SIZE := 15744k + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0 + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\ + pad-rootfs | append-metadata | check-size + IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2 + SUPPORTED_DEVICES += uap-pro +endef +TARGET_DEVICES += ubnt_unifi-ap-pro diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 4327512e1..3f3a65105 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -6,7 +6,7 @@ include ./common-yuncore.mk DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK DEVICE_VARS += KERNEL_INITRAMFS_PREFIX -DEVICE_VARS += DAP_SIGNATURE +DEVICE_VARS += DAP_SIGNATURE ENGENIUS_IMGNAME define Build/add-elecom-factory-initramfs $(eval edimax_model=$(word 1,$(1))) @@ -50,6 +50,23 @@ define Build/cybertan-trx -rm $@-empty.bin endef +# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to +# sysupgrade, as otherwise it will implant the old configuration from +# OEM firmware when writing rootfs from factory.bin +define Build/engenius-tar-gz + -[ -f "$@" ] && \ + mkdir -p $@.tmp && \ + echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ + echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ + $(CP) $(KDIR)/loader-$(DEVICE_NAME).uImage \ + $@.tmp/openwrt-$(word 1,$(1))-uImage-lzma.bin && \ + $(CP) $@ $@.tmp/openwrt-$(word 1,$(1))-root.squashfs && \ + $(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \ + $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \ + -C $@.tmp . | gzip -9n > $@ && \ + rm -rf $@.tmp +endef + define Build/mkdapimg2 $(STAGING_DIR_HOST)/bin/mkdapimg2 \ -i $@ -o $@.new \ @@ -135,6 +152,7 @@ define Build/wrgg-pad-rootfs $(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 64 >>$@ endef + define Device/seama KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma KERNEL_INITRAMFS := $$(KERNEL) | seama @@ -298,17 +316,12 @@ endef TARGET_DEVICES += avm_fritzdvbc define Device/buffalo_bhr-4grv + $(Device/buffalo_common) SOC := ar7242 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := BHR-4GRV + BUFFALO_PRODUCT := BHR-4GRV DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32256k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc BHR-4GRV 1.99 | \ - buffalo-tag BHR-4GRV 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += wzr-hp-g450h endef TARGET_DEVICES += buffalo_bhr-4grv @@ -321,52 +334,48 @@ define Device/buffalo_bhr-4grv2 endef TARGET_DEVICES += buffalo_bhr-4grv2 -define Device/buffalo_wzr-hp-ag300h +define Device/buffalo_wzr_ar7161 + $(Device/buffalo_common) SOC := ar7161 - DEVICE_VENDOR := Buffalo - DEVICE_MODEL := WZR-HP-AG300H - IMAGE_SIZE := 32320k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-AG300H 1.99 | \ - buffalo-tag WZR-HP-AG300H 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header + BUFFALO_PRODUCT := WZR-HP-AG300H DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-leds-reset kmod-owl-loader + IMAGE_SIZE := 32320k SUPPORTED_DEVICES += wzr-hp-ag300h endef + +define Device/buffalo_wzr-600dhp + $(Device/buffalo_wzr_ar7161) + DEVICE_MODEL := WZR-600DHP +endef +TARGET_DEVICES += buffalo_wzr-600dhp + +define Device/buffalo_wzr-hp-ag300h + $(Device/buffalo_wzr_ar7161) + DEVICE_MODEL := WZR-HP-AG300H +endef TARGET_DEVICES += buffalo_wzr-hp-ag300h define Device/buffalo_wzr-hp-g302h-a1a0 + $(Device/buffalo_common) SOC := ar7242 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WZR-HP-G302H DEVICE_VARIANT := A1A0 + BUFFALO_PRODUCT := WZR-HP-G302H + BUFFALO_HWVER := 4 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32128k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G302H 1.99 | \ - buffalo-tag WZR-HP-G302H 4 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += wzr-hp-g300nh2 endef TARGET_DEVICES += buffalo_wzr-hp-g302h-a1a0 define Device/buffalo_wzr-hp-g450h + $(Device/buffalo_common) SOC := ar7242 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WZR-HP-G450H/WZR-450HP + BUFFALO_PRODUCT := WZR-HP-G450H DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport IMAGE_SIZE := 32256k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WZR-HP-G450H 1.99 | \ - buffalo-tag WZR-HP-G450H 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += wzr-hp-g450h endef TARGET_DEVICES += buffalo_wzr-hp-g450h @@ -791,6 +800,20 @@ define Device/embeddedwireless_dorin endef TARGET_DEVICES += embeddedwireless_dorin +define Device/engenius_loader_okli + DEVICE_VENDOR := EnGenius + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 + 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-squashfs-fakeroot-be | pad-to $$$$(BLOCKSIZE) | \ + append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + check-size | engenius-tar-gz $$$$(ENGENIUS_IMGNAME) +endef + define Device/engenius_ecb1750 SOC := qca9558 DEVICE_VENDOR := EnGenius @@ -805,6 +828,30 @@ define Device/engenius_ecb1750 endef TARGET_DEVICES += engenius_ecb1750 +define Device/engenius_enh202-v1 + $(Device/engenius_loader_okli) + SOC := ar7240 + DEVICE_MODEL := ENH202 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := rssileds + IMAGE_SIZE := 4864k + LOADER_FLASH_OFFS := 0x1b0000 + ENGENIUS_IMGNAME := senao-enh202 +endef +TARGET_DEVICES += engenius_enh202-v1 + +define Device/engenius_ens202ext-v1 + $(Device/engenius_loader_okli) + SOC := ar9341 + DEVICE_MODEL := ENS202EXT + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := rssileds + IMAGE_SIZE := 12032k + LOADER_FLASH_OFFS := 0x230000 + ENGENIUS_IMGNAME := senao-ens202ext +endef +TARGET_DEVICES += engenius_ens202ext-v1 + define Device/engenius_epg5000 SOC := qca9558 DEVICE_VENDOR := EnGenius @@ -1019,6 +1066,34 @@ define Device/librerouter_librerouter-v1 endef TARGET_DEVICES += librerouter_librerouter-v1 +define Device/meraki_mr16 + SOC := ar7161 + DEVICE_VENDOR := Meraki + DEVICE_MODEL := MR16 + IMAGE_SIZE := 15616k + DEVICE_PACKAGES := kmod-owl-loader + SUPPORTED_DEVICES += mr16 + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := Partitions differ from ar71xx version of MR16. Image format is incompatible. \ + To use sysupgrade, you must change /lib/update/common.sh::get_image to prepend 128K zeroes to this image, \ + and change the bootcmd in u-boot to "bootm 0xbf0a0000". After that, you can use "sysupgrade -F". \ + For more details, see the OpenWrt Wiki: https://openwrt.org/toh/meraki/mr16, \ + or the commit message of the MR16 ath79 port on git.openwrt.org. +endef +TARGET_DEVICES += meraki_mr16 + +define Device/mercury_mw4530r-v1 + $(Device/tplink-8mlzma) + SOC := ar9344 + DEVICE_VENDOR := Mercury + DEVICE_MODEL := MW4530R + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x45300001 + SUPPORTED_DEVICES += tl-wdr4300 +endef +TARGET_DEVICES += mercury_mw4530r-v1 + define Device/nec_wg1200cr SOC := qca9563 DEVICE_VENDOR := NEC diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 9f4f89bd9..83c34d718 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -1,16 +1,11 @@ include ./common-buffalo.mk define Device/buffalo_whr-g301n + $(Device/buffalo_common) SOC := ar7240 - DEVICE_VENDOR := Buffalo DEVICE_MODEL := WHR-G301N + BUFFALO_PRODUCT := WHR-G301N IMAGE_SIZE := 3712k - IMAGES += factory.bin tftp.bin - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \ - pad-rootfs | check-size - IMAGE/factory.bin := $$(IMAGE/default) | buffalo-enc WHR-G301N 1.99 | \ - buffalo-tag WHR-G301N 3 - IMAGE/tftp.bin := $$(IMAGE/default) | buffalo-tftp-header SUPPORTED_DEVICES += whr-g301n DEFAULT := n endef diff --git a/target/linux/ath79/nand/base-files/etc/init.d/bootcount b/target/linux/ath79/nand/base-files/etc/init.d/bootcount index c82386b55..b5f920421 100755 --- a/target/linux/ath79/nand/base-files/etc/init.d/bootcount +++ b/target/linux/ath79/nand/base-files/etc/init.d/bootcount @@ -1,6 +1,6 @@ #!/bin/sh /etc/rc.common -# SPDX-License-Identifier: GPL-2.0 +# SPDX-License-Identifier: GPL-2.0-only START=99 diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh b/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh index 86729f8f2..e2c41d91c 100644 --- a/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh +++ b/target/linux/ath79/nand/base-files/lib/upgrade/glinet.sh @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-2.0 +# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2019 Jeff Kletsky # diff --git a/target/linux/bcm27xx/patches-5.4/950-0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch b/target/linux/bcm27xx/patches-5.4/950-0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch index 8e0ccd4d4..e89250df0 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0031-amba_pl011-Don-t-use-DT-aliases-for-numbering.patch @@ -14,7 +14,7 @@ use the same logic. --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2576,7 +2576,12 @@ static int pl011_setup_port(struct devic +@@ -2575,7 +2575,12 @@ static int pl011_setup_port(struct devic if (IS_ERR(base)) return PTR_ERR(base); diff --git a/target/linux/bcm27xx/patches-5.4/950-0032-amba_pl011-Round-input-clock-up.patch b/target/linux/bcm27xx/patches-5.4/950-0032-amba_pl011-Round-input-clock-up.patch index 7d5eb19c2..fec36493b 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0032-amba_pl011-Round-input-clock-up.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0032-amba_pl011-Round-input-clock-up.patch @@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell /* Clear pending error and receive interrupts */ pl011_write(UART011_OEIS | UART011_BEIS | UART011_PEIS | -@@ -2322,7 +2339,7 @@ static int __init pl011_console_setup(st +@@ -2321,7 +2338,7 @@ static int pl011_console_setup(struct co plat->init(); } @@ -68,7 +68,7 @@ Signed-off-by: Phil Elwell if (uap->vendor->fixed_options) { baud = uap->fixed_baud; -@@ -2507,6 +2524,7 @@ static struct uart_driver amba_reg = { +@@ -2506,6 +2523,7 @@ static struct uart_driver amba_reg = { .cons = AMBA_CONSOLE, }; @@ -76,7 +76,7 @@ Signed-off-by: Phil Elwell static int pl011_probe_dt_alias(int index, struct device *dev) { struct device_node *np; -@@ -2538,6 +2556,7 @@ static int pl011_probe_dt_alias(int inde +@@ -2537,6 +2555,7 @@ static int pl011_probe_dt_alias(int inde return ret; } diff --git a/target/linux/bcm27xx/patches-5.4/950-0034-amba_pl011-Add-cts-event-workaround-DT-property.patch b/target/linux/bcm27xx/patches-5.4/950-0034-amba_pl011-Add-cts-event-workaround-DT-property.patch index 07989b5a1..4c4cbb13c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0034-amba_pl011-Add-cts-event-workaround-DT-property.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0034-amba_pl011-Add-cts-event-workaround-DT-property.patch @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell - reg --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2660,6 +2660,11 @@ static int pl011_probe(struct amba_devic +@@ -2662,6 +2662,11 @@ static int pl011_probe(struct amba_devic if (IS_ERR(uap->clk)) return PTR_ERR(uap->clk); diff --git a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch index fe4d1d9a0..5b7f773b0 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch @@ -1051,7 +1051,7 @@ Signed-off-by: Jonathan Bell USB_PORT_FEAT_C_OVER_CURRENT); --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -2000,6 +2000,85 @@ free_interfaces: +@@ -1993,6 +1993,85 @@ free_interfaces: if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); diff --git a/target/linux/bcm27xx/patches-5.4/950-0040-fbdev-add-FBIOCOPYAREA-ioctl.patch b/target/linux/bcm27xx/patches-5.4/950-0040-fbdev-add-FBIOCOPYAREA-ioctl.patch index 8fa4ddf5c..77eb123cf 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0040-fbdev-add-FBIOCOPYAREA-ioctl.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0040-fbdev-add-FBIOCOPYAREA-ioctl.patch @@ -234,7 +234,7 @@ Signed-off-by: Dave Stevenson static int bcm2708_fb_register(struct bcm2708_fb *fb) --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c -@@ -1076,6 +1076,30 @@ fb_blank(struct fb_info *info, int blank +@@ -1072,6 +1072,30 @@ fb_blank(struct fb_info *info, int blank } EXPORT_SYMBOL(fb_blank); @@ -265,7 +265,7 @@ Signed-off-by: Dave Stevenson static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { -@@ -1084,6 +1108,7 @@ static long do_fb_ioctl(struct fb_info * +@@ -1080,6 +1104,7 @@ static long do_fb_ioctl(struct fb_info * struct fb_fix_screeninfo fix; struct fb_cmap cmap_from; struct fb_cmap_user cmap; @@ -273,7 +273,7 @@ Signed-off-by: Dave Stevenson void __user *argp = (void __user *)arg; long ret = 0; -@@ -1159,6 +1184,15 @@ static long do_fb_ioctl(struct fb_info * +@@ -1155,6 +1180,15 @@ static long do_fb_ioctl(struct fb_info * unlock_fb_info(info); console_unlock(); break; @@ -289,7 +289,7 @@ Signed-off-by: Dave Stevenson default: lock_fb_info(info); fb = info->fbops; -@@ -1304,6 +1338,7 @@ static long fb_compat_ioctl(struct file +@@ -1300,6 +1334,7 @@ static long fb_compat_ioctl(struct file case FBIOPAN_DISPLAY: case FBIOGET_CON2FBMAP: case FBIOPUT_CON2FBMAP: diff --git a/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 0bb08a56f..5710a8834 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0222-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5334,6 +5431,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5335,6 +5432,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-5.4/950-0283-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.4/950-0283-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index f265beb34..d2e7c9944 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0283-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0283-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1237,6 +1240,9 @@ +@@ -1244,6 +1247,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 @@ -53,11 +53,11 @@ Signed-off-by: Jonathan Bell { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL }, -@@ -179,6 +180,7 @@ static const struct hid_device_id hid_qu +@@ -184,6 +185,7 @@ static const struct hid_device_id hid_qu { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT }, + { HID_USB_DEVICE(USB_VENDOR_ID_XENTA, USB_DEVICE_ID_AIRMOUSE_MX3), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, + { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET }, { 0 } - }; diff --git a/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch b/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch index 08115b256..18b626067 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0316-kbuild-Allow-.dtbo-overlays-to-be-built-piecemeal.patch @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell --- a/Makefile +++ b/Makefile -@@ -1258,6 +1258,9 @@ ifneq ($(dtstree),) +@@ -1264,6 +1264,9 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch b/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch index b8f974c73..0e35d756e 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0460-Kbuild-Allow-.dtbo-overlays-to-be-built-adjust.patch @@ -15,7 +15,7 @@ Signed-off-by: Nataliya Korovkina --- a/Makefile +++ b/Makefile -@@ -1258,7 +1258,7 @@ ifneq ($(dtstree),) +@@ -1264,7 +1264,7 @@ ifneq ($(dtstree),) %.dtb: include/config/kernel.release scripts_dtc $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ diff --git a/target/linux/bcm27xx/patches-5.4/950-0653-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch b/target/linux/bcm27xx/patches-5.4/950-0653-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch index c67037e74..c6dfba6e4 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0653-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0653-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch @@ -23,7 +23,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -3053,6 +3053,7 @@ static int __spi_validate_bits_per_word( +@@ -3058,6 +3058,7 @@ static int __spi_validate_bits_per_word( */ int spi_setup(struct spi_device *spi) { @@ -31,7 +31,7 @@ Signed-off-by: Phil Elwell unsigned bad_bits, ugly_bits; int status; -@@ -3070,6 +3071,14 @@ int spi_setup(struct spi_device *spi) +@@ -3075,6 +3076,14 @@ int spi_setup(struct spi_device *spi) (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) return -EINVAL; diff --git a/target/linux/bcm27xx/patches-5.4/950-0672-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch b/target/linux/bcm27xx/patches-5.4/950-0672-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch index 6183d8eb1..450e212ac 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0672-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0672-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch @@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -1787,15 +1787,6 @@ static int of_spi_parse_dt(struct spi_co +@@ -1792,15 +1792,6 @@ static int of_spi_parse_dt(struct spi_co } spi->chip_select = value; diff --git a/target/linux/bcm27xx/patches-5.4/950-0697-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch b/target/linux/bcm27xx/patches-5.4/950-0697-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch index 0225f7b95..eeab13995 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0697-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0697-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -3065,8 +3065,8 @@ int spi_setup(struct spi_device *spi) +@@ -3070,8 +3070,8 @@ int spi_setup(struct spi_device *spi) if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods && ctlr->cs_gpiods[spi->chip_select] && !(spi->mode & SPI_CS_HIGH)) { diff --git a/target/linux/bcm47xx/patches-5.4/159-cpu_fixes.patch b/target/linux/bcm47xx/patches-5.4/159-cpu_fixes.patch index 1c98d6b4e..59d7834de 100644 --- a/target/linux/bcm47xx/patches-5.4/159-cpu_fixes.patch +++ b/target/linux/bcm47xx/patches-5.4/159-cpu_fixes.patch @@ -388,7 +388,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -1775,6 +1787,17 @@ static void coherency_setup(void) +@@ -1779,6 +1791,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -406,7 +406,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1821,6 +1844,15 @@ void r4k_cache_init(void) +@@ -1825,6 +1848,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -422,7 +422,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1897,7 +1929,15 @@ void r4k_cache_init(void) +@@ -1901,7 +1933,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-lowi.dts b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-lowi.dts index b7203a4fc..44662a26d 100644 --- a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-lowi.dts +++ b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-lowi.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Sercomm H500-s lowi * diff --git a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts index 7a04dcfde..32d8fdbe7 100644 --- a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts +++ b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Sercomm H500-s vfes * diff --git a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s.dtsi b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s.dtsi index eb8a9f7ec..39b2e63eb 100644 --- a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s.dtsi +++ b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s.dtsi @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Sercomm H500-s * diff --git a/target/linux/bcm63xx/patches-5.4/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch b/target/linux/bcm63xx/patches-5.4/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch index fcb016ecf..9159b14d3 100644 --- a/target/linux/bcm63xx/patches-5.4/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch +++ b/target/linux/bcm63xx/patches-5.4/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch @@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c -@@ -665,6 +665,10 @@ int ehci_setup(struct usb_hcd *hcd) +@@ -666,6 +666,10 @@ int ehci_setup(struct usb_hcd *hcd) /* cache this readonly data; minimize chip reads */ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); diff --git a/target/linux/gemini/base-files/etc/board.d/02_network b/target/linux/gemini/base-files/etc/board.d/02_network new file mode 100755 index 000000000..f371956a6 --- /dev/null +++ b/target/linux/gemini/base-files/etc/board.d/02_network @@ -0,0 +1,27 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in +dlink,dir-685) + # These are all connected to eth0 thru RTL8366RB + ucidef_set_interface "eth" ifname "eth0" protocol "none" + ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan" + ;; +itian,sq201) + # These are all connected to eth1 thru VSC7395 + ucidef_set_interface "eth" ifname "eth1" protocol "none" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0" + ;; +storlink,gemini324) + # These are all connected to eth1 thru VSC7385 + ucidef_set_interface "eth" ifname "eth1" protocol "none" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth0" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch index 3c305b4b8..60defa39c 100644 --- a/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-5.4/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -487,7 +487,7 @@ KBUILD_LDFLAGS := +@@ -493,7 +493,7 @@ KBUILD_LDFLAGS := GCC_PLUGINS_CFLAGS := CLANG_FLAGS := @@ -18,4 +18,4 @@ Signed-off-by: Felix Fietkau +export ARCH SRCARCH SUBARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX - export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE + export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ diff --git a/target/linux/generic/backport-5.4/041-v5.5-arm64-Implement-optimised-checksum-routine.patch b/target/linux/generic/backport-5.4/041-v5.5-arm64-Implement-optimised-checksum-routine.patch new file mode 100644 index 000000000..00ec7d020 --- /dev/null +++ b/target/linux/generic/backport-5.4/041-v5.5-arm64-Implement-optimised-checksum-routine.patch @@ -0,0 +1,176 @@ +From: Robin Murphy +Date: Wed, 15 Jan 2020 16:42:39 +0000 +Subject: [PATCH] arm64: Implement optimised checksum routine + +Apparently there exist certain workloads which rely heavily on software +checksumming, for which the generic do_csum() implementation becomes a +significant bottleneck. Therefore let's give arm64 its own optimised +version - for ease of maintenance this foregoes assembly or intrisics, +and is thus not actually arm64-specific, but does rely heavily on C +idioms that translate well to the A64 ISA and the typical load/store +capabilities of most ARMv8 CPU cores. + +The resulting increase in checksum throughput scales nicely with buffer +size, tending towards 4x for a small in-order core (Cortex-A53), and up +to 6x or more for an aggressive big core (Ampere eMAG). + +Reported-by: Lingyan Huang +Tested-by: Lingyan Huang +Signed-off-by: Robin Murphy +Signed-off-by: Will Deacon +--- + create mode 100644 arch/arm64/lib/csum.c + +--- a/arch/arm64/include/asm/checksum.h ++++ b/arch/arm64/include/asm/checksum.h +@@ -36,6 +36,9 @@ static inline __sum16 ip_fast_csum(const + } + #define ip_fast_csum ip_fast_csum + ++extern unsigned int do_csum(const unsigned char *buff, int len); ++#define do_csum do_csum ++ + #include + + #endif /* __ASM_CHECKSUM_H */ +--- a/arch/arm64/lib/Makefile ++++ b/arch/arm64/lib/Makefile +@@ -1,9 +1,9 @@ + # SPDX-License-Identifier: GPL-2.0 + lib-y := clear_user.o delay.o copy_from_user.o \ + copy_to_user.o copy_in_user.o copy_page.o \ +- clear_page.o memchr.o memcpy.o memmove.o memset.o \ +- memcmp.o strcmp.o strncmp.o strlen.o strnlen.o \ +- strchr.o strrchr.o tishift.o ++ clear_page.o csum.o memchr.o memcpy.o memmove.o \ ++ memset.o memcmp.o strcmp.o strncmp.o strlen.o \ ++ strnlen.o strchr.o strrchr.o tishift.o + + ifeq ($(CONFIG_KERNEL_MODE_NEON), y) + obj-$(CONFIG_XOR_BLOCKS) += xor-neon.o +--- /dev/null ++++ b/arch/arm64/lib/csum.c +@@ -0,0 +1,123 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Copyright (C) 2019-2020 Arm Ltd. ++ ++#include ++#include ++#include ++ ++#include ++ ++/* Looks dumb, but generates nice-ish code */ ++static u64 accumulate(u64 sum, u64 data) ++{ ++ __uint128_t tmp = (__uint128_t)sum + data; ++ return tmp + (tmp >> 64); ++} ++ ++unsigned int do_csum(const unsigned char *buff, int len) ++{ ++ unsigned int offset, shift, sum; ++ const u64 *ptr; ++ u64 data, sum64 = 0; ++ ++ offset = (unsigned long)buff & 7; ++ /* ++ * This is to all intents and purposes safe, since rounding down cannot ++ * result in a different page or cache line being accessed, and @buff ++ * should absolutely not be pointing to anything read-sensitive. We do, ++ * however, have to be careful not to piss off KASAN, which means using ++ * unchecked reads to accommodate the head and tail, for which we'll ++ * compensate with an explicit check up-front. ++ */ ++ kasan_check_read(buff, len); ++ ptr = (u64 *)(buff - offset); ++ len = len + offset - 8; ++ ++ /* ++ * Head: zero out any excess leading bytes. Shifting back by the same ++ * amount should be at least as fast as any other way of handling the ++ * odd/even alignment, and means we can ignore it until the very end. ++ */ ++ shift = offset * 8; ++ data = READ_ONCE_NOCHECK(*ptr++); ++#ifdef __LITTLE_ENDIAN ++ data = (data >> shift) << shift; ++#else ++ data = (data << shift) >> shift; ++#endif ++ ++ /* ++ * Body: straightforward aligned loads from here on (the paired loads ++ * underlying the quadword type still only need dword alignment). The ++ * main loop strictly excludes the tail, so the second loop will always ++ * run at least once. ++ */ ++ while (unlikely(len > 64)) { ++ __uint128_t tmp1, tmp2, tmp3, tmp4; ++ ++ tmp1 = READ_ONCE_NOCHECK(*(__uint128_t *)ptr); ++ tmp2 = READ_ONCE_NOCHECK(*(__uint128_t *)(ptr + 2)); ++ tmp3 = READ_ONCE_NOCHECK(*(__uint128_t *)(ptr + 4)); ++ tmp4 = READ_ONCE_NOCHECK(*(__uint128_t *)(ptr + 6)); ++ ++ len -= 64; ++ ptr += 8; ++ ++ /* This is the "don't dump the carry flag into a GPR" idiom */ ++ tmp1 += (tmp1 >> 64) | (tmp1 << 64); ++ tmp2 += (tmp2 >> 64) | (tmp2 << 64); ++ tmp3 += (tmp3 >> 64) | (tmp3 << 64); ++ tmp4 += (tmp4 >> 64) | (tmp4 << 64); ++ tmp1 = ((tmp1 >> 64) << 64) | (tmp2 >> 64); ++ tmp1 += (tmp1 >> 64) | (tmp1 << 64); ++ tmp3 = ((tmp3 >> 64) << 64) | (tmp4 >> 64); ++ tmp3 += (tmp3 >> 64) | (tmp3 << 64); ++ tmp1 = ((tmp1 >> 64) << 64) | (tmp3 >> 64); ++ tmp1 += (tmp1 >> 64) | (tmp1 << 64); ++ tmp1 = ((tmp1 >> 64) << 64) | sum64; ++ tmp1 += (tmp1 >> 64) | (tmp1 << 64); ++ sum64 = tmp1 >> 64; ++ } ++ while (len > 8) { ++ __uint128_t tmp; ++ ++ sum64 = accumulate(sum64, data); ++ tmp = READ_ONCE_NOCHECK(*(__uint128_t *)ptr); ++ ++ len -= 16; ++ ptr += 2; ++ ++#ifdef __LITTLE_ENDIAN ++ data = tmp >> 64; ++ sum64 = accumulate(sum64, tmp); ++#else ++ data = tmp; ++ sum64 = accumulate(sum64, tmp >> 64); ++#endif ++ } ++ if (len > 0) { ++ sum64 = accumulate(sum64, data); ++ data = READ_ONCE_NOCHECK(*ptr); ++ len -= 8; ++ } ++ /* ++ * Tail: zero any over-read bytes similarly to the head, again ++ * preserving odd/even alignment. ++ */ ++ shift = len * -8; ++#ifdef __LITTLE_ENDIAN ++ data = (data << shift) >> shift; ++#else ++ data = (data >> shift) << shift; ++#endif ++ sum64 = accumulate(sum64, data); ++ ++ /* Finally, folding */ ++ sum64 += (sum64 >> 32) | (sum64 << 32); ++ sum = sum64 >> 32; ++ sum += (sum >> 16) | (sum << 16); ++ if (offset & 1) ++ return (u16)swab32(sum); ++ ++ return sum >> 16; ++} diff --git a/target/linux/generic/backport-5.4/042-v5.5-arm64-csum-Fix-pathological-zero-length-calls.patch b/target/linux/generic/backport-5.4/042-v5.5-arm64-csum-Fix-pathological-zero-length-calls.patch new file mode 100644 index 000000000..50b210e14 --- /dev/null +++ b/target/linux/generic/backport-5.4/042-v5.5-arm64-csum-Fix-pathological-zero-length-calls.patch @@ -0,0 +1,28 @@ +From: Robin Murphy +Date: Fri, 17 Jan 2020 15:48:39 +0000 +Subject: [PATCH] arm64: csum: Fix pathological zero-length calls + +In validating the checksumming results of the new routine, I sadly +neglected to test its not-checksumming results. Thus it slipped through +that the one case where @buff is already dword-aligned and @len = 0 +manages to defeat the tail-masking logic and behave as if @len = 8. +For a zero length it doesn't make much sense to deference @buff anyway, +so just add an early return (which has essentially zero impact on +performance). + +Signed-off-by: Robin Murphy +Signed-off-by: Will Deacon +--- + +--- a/arch/arm64/lib/csum.c ++++ b/arch/arm64/lib/csum.c +@@ -20,6 +20,9 @@ unsigned int do_csum(const unsigned char + const u64 *ptr; + u64 data, sum64 = 0; + ++ if (unlikely(len == 0)) ++ return 0; ++ + offset = (unsigned long)buff & 7; + /* + * This is to all intents and purposes safe, since rounding down cannot diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch new file mode 100644 index 000000000..f864a7899 --- /dev/null +++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch @@ -0,0 +1,78 @@ +From: Alexander Lobakin +Date: Fri, 15 Nov 2019 12:11:35 +0300 +Subject: [PATCH] net: core: allow fast GRO for skbs with Ethernet header in + head + +Commit 78d3fd0b7de8 ("gro: Only use skb_gro_header for completely +non-linear packets") back in May'09 (v2.6.31-rc1) has changed the +original condition '!skb_headlen(skb)' to +'skb->mac_header == skb->tail' in gro_reset_offset() saying: "Since +the drivers that need this optimisation all provide completely +non-linear packets" (note that this condition has become the current +'skb_mac_header(skb) == skb_tail_pointer(skb)' later with commmit +ced14f6804a9 ("net: Correct comparisons and calculations using +skb->tail and skb-transport_header") without any functional changes). + +For now, we have the following rough statistics for v5.4-rc7: +1) napi_gro_frags: 14 +2) napi_gro_receive with skb->head containing (most of) payload: 83 +3) napi_gro_receive with skb->head containing all the headers: 20 +4) napi_gro_receive with skb->head containing only Ethernet header: 2 + +With the current condition, fast GRO with the usage of +NAPI_GRO_CB(skb)->frag0 is available only in the [1] case. +Packets pushed by [2] and [3] go through the 'slow' path, but +it's not a problem for them as they already contain all the needed +headers in skb->head, so pskb_may_pull() only moves skb->data. + +The layout of skbs in the fourth [4] case at the moment of +dev_gro_receive() is identical to skbs that have come through [1], +as napi_frags_skb() pulls Ethernet header to skb->head. The only +difference is that the mentioned condition is always false for them, +because skb_put() and friends irreversibly alter the tail pointer. +They also go through the 'slow' path, but now every single +pskb_may_pull() in every single .gro_receive() will call the *really* +slow __pskb_pull_tail() to pull headers to head. This significantly +decreases the overall performance for no visible reasons. + +The only two users of method [4] is: +* drivers/staging/qlge +* drivers/net/wireless/iwlwifi (all three variants: dvm, mvm, mvm-mq) + +Note that in case with wireless drivers we can't use [1] +(napi_gro_frags()) at least for now and mac80211 stack always +performs pushes and pulls anyways, so performance hit is inavoidable. + +At the moment of v2.6.31 the mentioned change was necessary (that's +why I don't add the "Fixes:" tag), but it became obsolete since +skb_gro_mac_header() has gone in commit a50e233c50db ("net-gro: +restore frag0 optimization"), so we can simply revert the condition +in gro_reset_offset() to allow skbs from [4] go through the 'fast' +path just like in case [1]. + +This was tested on a 600 MHz MIPS CPU and a custom driver and this +patch gave boosts up to 40 Mbps to method [4] in both directions +comparing to net-next, which made overall performance relatively +close to [1] (without it, [4] is the slowest). + +v2: +- Add more references and explanations to commit message +- Fix some typos ibid +- No functional changes + +Signed-off-by: Alexander Lobakin +Signed-off-by: David S. Miller +--- + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -5403,8 +5403,7 @@ static void skb_gro_reset_offset(struct + NAPI_GRO_CB(skb)->frag0 = NULL; + NAPI_GRO_CB(skb)->frag0_len = 0; + +- if (skb_mac_header(skb) == skb_tail_pointer(skb) && +- pinfo->nr_frags && ++ if (!skb_headlen(skb) && pinfo->nr_frags && + !PageHighMem(skb_frag_page(frag0))) { + NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0); + NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, diff --git a/target/linux/generic/backport-5.4/716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch b/target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch similarity index 100% rename from target/linux/generic/backport-5.4/716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch rename to target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch diff --git a/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch b/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch index 6ee99b479..ecb70a990 100644 --- a/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch +++ b/target/linux/generic/backport-5.4/737-v5.5-net-phy-add-core-phylib-sfp-support.patch @@ -130,7 +130,7 @@ Signed-off-by: Russell King /* Some Ethernet drivers try to connect to a PHY device before * calling register_netdevice() -> netdev_register_kobject() and * does the dev->dev.kobj initialization. Here we only check for -@@ -2289,6 +2352,9 @@ static int phy_remove(struct device *dev +@@ -2290,6 +2353,9 @@ static int phy_remove(struct device *dev phydev->state = PHY_DOWN; mutex_unlock(&phydev->lock); diff --git a/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch b/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch index f03cd2a98..bb26986c7 100644 --- a/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch +++ b/target/linux/generic/backport-5.4/750-v5.5-net-phy-add-support-for-clause-37-auto-negotiation.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1681,6 +1681,40 @@ static int genphy_config_advert(struct p +@@ -1682,6 +1682,40 @@ static int genphy_config_advert(struct p } /** @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller * genphy_config_eee_advert - disable unwanted eee mode advertisement * @phydev: target phy_device struct * -@@ -1789,6 +1823,54 @@ int __genphy_config_aneg(struct phy_devi +@@ -1790,6 +1824,54 @@ int __genphy_config_aneg(struct phy_devi EXPORT_SYMBOL(__genphy_config_aneg); /** @@ -116,7 +116,7 @@ Signed-off-by: David S. Miller * genphy_aneg_done - return auto-negotiation status * @phydev: target phy_device struct * -@@ -1960,6 +2042,63 @@ int genphy_read_status(struct phy_device +@@ -1961,6 +2043,63 @@ int genphy_read_status(struct phy_device EXPORT_SYMBOL(genphy_read_status); /** diff --git a/target/linux/generic/backport-5.4/756-v5.8-net-dsa-rtl8366-Pass-GENMASK-signed-bits.patch b/target/linux/generic/backport-5.4/756-v5.8-net-dsa-rtl8366-Pass-GENMASK-signed-bits.patch new file mode 100644 index 000000000..4c5d559e1 --- /dev/null +++ b/target/linux/generic/backport-5.4/756-v5.8-net-dsa-rtl8366-Pass-GENMASK-signed-bits.patch @@ -0,0 +1,27 @@ +From 733993f502f254912b1415e13f73651d9f2e74ef Mon Sep 17 00:00:00 2001 +From: Andrew Lunn +Date: Sun, 5 Jul 2020 22:42:27 +0200 +Subject: [PATCH 1/5] net: dsa: rtl8366: Pass GENMASK() signed bits + +Oddly, GENMASK() requires signed bit numbers, so that it can compare +them for < 0. If passed an unsigned type, we get warnings about the +test never being true. + +Signed-off-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/dsa/rtl8366.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/dsa/rtl8366.c ++++ b/drivers/net/dsa/rtl8366.c +@@ -285,7 +285,7 @@ int rtl8366_init_vlan(struct realtek_smi + /* For the CPU port, make all ports members of this + * VLAN. + */ +- mask = GENMASK(smi->num_ports - 1, 0); ++ mask = GENMASK((int)smi->num_ports - 1, 0); + else + /* For all other ports, enable itself plus the + * CPU port. diff --git a/target/linux/generic/backport-5.4/757-v5.8-net-dsa-tag_rtl4_a-Implement-Realtek-4-byte-A-tag.patch b/target/linux/generic/backport-5.4/757-v5.8-net-dsa-tag_rtl4_a-Implement-Realtek-4-byte-A-tag.patch new file mode 100644 index 000000000..70d7000ba --- /dev/null +++ b/target/linux/generic/backport-5.4/757-v5.8-net-dsa-tag_rtl4_a-Implement-Realtek-4-byte-A-tag.patch @@ -0,0 +1,232 @@ +From 078ced30af696b52a450a016a16eb47499d68117 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Wed, 8 Jul 2020 14:25:36 +0200 +Subject: [PATCH 2/5] net: dsa: tag_rtl4_a: Implement Realtek 4 byte A tag + +This implements the known parts of the Realtek 4 byte +tag protocol version 0xA, as found in the RTL8366RB +DSA switch. + +It is designated as protocol version 0xA as a +different Realtek 4 byte tag format with protocol +version 0x9 is known to exist in the Realtek RTL8306 +chips. + +The tag and switch chip lacks public documentation, so +the tag format has been reverse-engineered from +packet dumps. As only ingress traffic has been available +for analysis an egress tag has not been possible to +develop (even using educated guesses about bit fields) +so this is as far as it gets. It is not known if the +switch even supports egress tagging. + +Excessive attempts to figure out the egress tag format +was made. When nothing else worked, I just tried all bit +combinations with 0xannp where a is protocol and p is +port. I looped through all values several times trying +to get a response from ping, without any positive +result. + +Using just these ingress tags however, the switch +functionality is vastly improved and the packets find +their way into the destination port without any +tricky VLAN configuration. On the D-Link DIR-685 the +LAN ports now come up and respond to ping without +any command line configuration so this is a real +improvement for users. + +Egress packets need to be restricted to the proper +target ports using VLAN, which the RTL8366RB DSA +switch driver already sets up. + +Cc: DENG Qingfang +Cc: Mauri Sandberg +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Linus Walleij +Signed-off-by: David S. Miller +--- + include/net/dsa.h | 2 + + net/dsa/Kconfig | 7 +++ + net/dsa/Makefile | 1 + + net/dsa/tag_rtl4_a.c | 130 +++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 140 insertions(+) + create mode 100644 net/dsa/tag_rtl4_a.c + +--- a/include/net/dsa.h ++++ b/include/net/dsa.h +@@ -42,6 +42,7 @@ struct phylink_link_state; + #define DSA_TAG_PROTO_8021Q_VALUE 12 + #define DSA_TAG_PROTO_SJA1105_VALUE 13 + #define DSA_TAG_PROTO_KSZ8795_VALUE 14 ++#define DSA_TAG_PROTO_RTL4_A_VALUE 17 + + enum dsa_tag_protocol { + DSA_TAG_PROTO_NONE = DSA_TAG_PROTO_NONE_VALUE, +@@ -59,6 +60,7 @@ enum dsa_tag_protocol { + DSA_TAG_PROTO_8021Q = DSA_TAG_PROTO_8021Q_VALUE, + DSA_TAG_PROTO_SJA1105 = DSA_TAG_PROTO_SJA1105_VALUE, + DSA_TAG_PROTO_KSZ8795 = DSA_TAG_PROTO_KSZ8795_VALUE, ++ DSA_TAG_PROTO_RTL4_A = DSA_TAG_PROTO_RTL4_A_VALUE, + }; + + struct packet_type; +--- a/net/dsa/Kconfig ++++ b/net/dsa/Kconfig +@@ -80,6 +80,13 @@ config NET_DSA_TAG_KSZ + Say Y if you want to enable support for tagging frames for the + Microchip 8795/9477/9893 families of switches. + ++config NET_DSA_TAG_RTL4_A ++ tristate "Tag driver for Realtek 4 byte protocol A tags" ++ help ++ Say Y or M if you want to enable support for tagging frames for the ++ Realtek switches with 4 byte protocol A tags, sich as found in ++ the Realtek RTL8366RB. ++ + config NET_DSA_TAG_QCA + tristate "Tag driver for Qualcomm Atheros QCA8K switches" + help +--- a/net/dsa/Makefile ++++ b/net/dsa/Makefile +@@ -10,6 +10,7 @@ obj-$(CONFIG_NET_DSA_TAG_DSA) += tag_dsa + obj-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o + obj-$(CONFIG_NET_DSA_TAG_GSWIP) += tag_gswip.o + obj-$(CONFIG_NET_DSA_TAG_KSZ) += tag_ksz.o ++obj-$(CONFIG_NET_DSA_TAG_RTL4_A) += tag_rtl4_a.o + obj-$(CONFIG_NET_DSA_TAG_LAN9303) += tag_lan9303.o + obj-$(CONFIG_NET_DSA_TAG_MTK) += tag_mtk.o + obj-$(CONFIG_NET_DSA_TAG_QCA) += tag_qca.o +--- /dev/null ++++ b/net/dsa/tag_rtl4_a.c +@@ -0,0 +1,130 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Handler for Realtek 4 byte DSA switch tags ++ * Currently only supports protocol "A" found in RTL8366RB ++ * Copyright (c) 2020 Linus Walleij ++ * ++ * This "proprietary tag" header looks like so: ++ * ++ * ------------------------------------------------- ++ * | MAC DA | MAC SA | 0x8899 | 2 bytes tag | Type | ++ * ------------------------------------------------- ++ * ++ * The 2 bytes tag form a 16 bit big endian word. The exact ++ * meaning has been guessed from packet dumps from ingress ++ * frames, as no working egress traffic has been available ++ * we do not know the format of the egress tags or if they ++ * are even supported. ++ */ ++ ++#include ++#include ++ ++#include "dsa_priv.h" ++ ++#define RTL4_A_HDR_LEN 4 ++#define RTL4_A_ETHERTYPE 0x8899 ++#define RTL4_A_PROTOCOL_SHIFT 12 ++/* ++ * 0x1 = Realtek Remote Control protocol (RRCP) ++ * 0x2/0x3 seems to be used for loopback testing ++ * 0x9 = RTL8306 DSA protocol ++ * 0xa = RTL8366RB DSA protocol ++ */ ++#define RTL4_A_PROTOCOL_RTL8366RB 0xa ++ ++static struct sk_buff *rtl4a_tag_xmit(struct sk_buff *skb, ++ struct net_device *dev) ++{ ++ /* ++ * Just let it pass thru, we don't know if it is possible ++ * to tag a frame with the 0x8899 ethertype and direct it ++ * to a specific port, all attempts at reverse-engineering have ++ * ended up with the frames getting dropped. ++ * ++ * The VLAN set-up needs to restrict the frames to the right port. ++ * ++ * If you have documentation on the tagging format for RTL8366RB ++ * (tag type A) then please contribute. ++ */ ++ return skb; ++} ++ ++static struct sk_buff *rtl4a_tag_rcv(struct sk_buff *skb, ++ struct net_device *dev, ++ struct packet_type *pt) ++{ ++ u16 protport; ++ __be16 *p; ++ u16 etype; ++ u8 *tag; ++ u8 prot; ++ u8 port; ++ ++ if (unlikely(!pskb_may_pull(skb, RTL4_A_HDR_LEN))) ++ return NULL; ++ ++ /* The RTL4 header has its own custom Ethertype 0x8899 and that ++ * starts right at the beginning of the packet, after the src ++ * ethernet addr. Apparantly skb->data always points 2 bytes in, ++ * behind the Ethertype. ++ */ ++ tag = skb->data - 2; ++ p = (__be16 *)tag; ++ etype = ntohs(*p); ++ if (etype != RTL4_A_ETHERTYPE) { ++ /* Not custom, just pass through */ ++ netdev_dbg(dev, "non-realtek ethertype 0x%04x\n", etype); ++ return skb; ++ } ++ p = (__be16 *)(tag + 2); ++ protport = ntohs(*p); ++ /* The 4 upper bits are the protocol */ ++ prot = (protport >> RTL4_A_PROTOCOL_SHIFT) & 0x0f; ++ if (prot != RTL4_A_PROTOCOL_RTL8366RB) { ++ netdev_err(dev, "unknown realtek protocol 0x%01x\n", prot); ++ return NULL; ++ } ++ port = protport & 0xff; ++ ++ skb->dev = dsa_master_find_slave(dev, 0, port); ++ if (!skb->dev) { ++ netdev_dbg(dev, "could not find slave for port %d\n", port); ++ return NULL; ++ } ++ ++ /* Remove RTL4 tag and recalculate checksum */ ++ skb_pull_rcsum(skb, RTL4_A_HDR_LEN); ++ ++ /* Move ethernet DA and SA in front of the data */ ++ memmove(skb->data - ETH_HLEN, ++ skb->data - ETH_HLEN - RTL4_A_HDR_LEN, ++ 2 * ETH_ALEN); ++ ++ skb->offload_fwd_mark = 1; ++ ++ return skb; ++} ++ ++static int rtl4a_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto, ++ int *offset) ++{ ++ *offset = RTL4_A_HDR_LEN; ++ /* Skip past the tag and fetch the encapsulated Ethertype */ ++ *proto = ((__be16 *)skb->data)[1]; ++ ++ return 0; ++} ++ ++static const struct dsa_device_ops rtl4a_netdev_ops = { ++ .name = "rtl4a", ++ .proto = DSA_TAG_PROTO_RTL4_A, ++ .xmit = rtl4a_tag_xmit, ++ .rcv = rtl4a_tag_rcv, ++ .flow_dissect = rtl4a_tag_flow_dissect, ++ .overhead = RTL4_A_HDR_LEN, ++}; ++module_dsa_tag_driver(rtl4a_netdev_ops); ++ ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_RTL4_A); diff --git a/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch b/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch new file mode 100644 index 000000000..b68c033bb --- /dev/null +++ b/target/linux/generic/backport-5.4/758-v5.8-net-dsa-rtl8366rb-Support-the-CPU-DSA-tag.patch @@ -0,0 +1,100 @@ +From c633ba43b7a9c2bfdb992ffd198d4c661520466f Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Wed, 8 Jul 2020 14:25:37 +0200 +Subject: [PATCH 3/5] net: dsa: rtl8366rb: Support the CPU DSA tag + +This activates the support to use the CPU tag to properly +direct ingress traffic to the right port. + +Bit 15 in register RTL8368RB_CPU_CTRL_REG can be set to +1 to disable the insertion of the CPU tag which is what +the code currently does. The bit 15 define calls this +setting RTL8368RB_CPU_INSTAG which is confusing since the +inverse meaning is implied: programmers may think that +setting this bit to 1 will *enable* inserting the tag +rather than disabling it, so rename this setting in +bit 15 to RTL8368RB_CPU_NO_TAG which is more to the +point. + +After this e.g. ping works out-of-the-box with the +RTL8366RB. + +Cc: DENG Qingfang +Cc: Mauri Sandberg +Reviewed-by: Andrew Lunn +Reviewed-by: Florian Fainelli +Signed-off-by: Linus Walleij +Signed-off-by: David S. Miller +--- + drivers/net/dsa/Kconfig | 1 + + drivers/net/dsa/rtl8366rb.c | 31 ++++++++----------------------- + 2 files changed, 9 insertions(+), 23 deletions(-) + +--- a/drivers/net/dsa/Kconfig ++++ b/drivers/net/dsa/Kconfig +@@ -66,6 +66,7 @@ config NET_DSA_QCA8K + config NET_DSA_REALTEK_SMI + tristate "Realtek SMI Ethernet switch family support" + depends on NET_DSA ++ select NET_DSA_TAG_RTL4_A + select FIXED_PHY + select IRQ_DOMAIN + select REALTEK_PHY +--- a/drivers/net/dsa/rtl8366rb.c ++++ b/drivers/net/dsa/rtl8366rb.c +@@ -109,8 +109,8 @@ + /* CPU port control reg */ + #define RTL8368RB_CPU_CTRL_REG 0x0061 + #define RTL8368RB_CPU_PORTS_MSK 0x00FF +-/* Enables inserting custom tag length/type 0x8899 */ +-#define RTL8368RB_CPU_INSTAG BIT(15) ++/* Disables inserting custom tag length/type 0x8899 */ ++#define RTL8368RB_CPU_NO_TAG BIT(15) + + #define RTL8366RB_SMAR0 0x0070 /* bits 0..15 */ + #define RTL8366RB_SMAR1 0x0071 /* bits 16..31 */ +@@ -844,16 +844,14 @@ static int rtl8366rb_setup(struct dsa_sw + if (ret) + return ret; + +- /* Enable CPU port and enable inserting CPU tag ++ /* Enable CPU port with custom DSA tag 8899. + * +- * Disabling RTL8368RB_CPU_INSTAG here will change the behaviour +- * of the switch totally and it will start talking Realtek RRCP +- * internally. It is probably possible to experiment with this, +- * but then the kernel needs to understand and handle RRCP first. ++ * If you set RTL8368RB_CPU_NO_TAG (bit 15) in this registers ++ * the custom tag is turned off. + */ + ret = regmap_update_bits(smi->map, RTL8368RB_CPU_CTRL_REG, + 0xFFFF, +- RTL8368RB_CPU_INSTAG | BIT(smi->cpu_port)); ++ BIT(smi->cpu_port)); + if (ret) + return ret; + +@@ -966,21 +964,8 @@ static int rtl8366rb_setup(struct dsa_sw + static enum dsa_tag_protocol rtl8366_get_tag_protocol(struct dsa_switch *ds, + int port) + { +- /* For now, the RTL switches are handled without any custom tags. +- * +- * It is possible to turn on "custom tags" by removing the +- * RTL8368RB_CPU_INSTAG flag when enabling the port but what it +- * does is unfamiliar to DSA: ethernet frames of type 8899, the Realtek +- * Remote Control Protocol (RRCP) start to appear on the CPU port of +- * the device. So this is not the ordinary few extra bytes in the +- * frame. Instead it appears that the switch starts to talk Realtek +- * RRCP internally which means a pretty complex RRCP implementation +- * decoding and responding the RRCP protocol is needed to exploit this. +- * +- * The OpenRRCP project (dormant since 2009) have reverse-egineered +- * parts of the protocol. +- */ +- return DSA_TAG_PROTO_NONE; ++ /* This switch uses the 4 byte protocol A Realtek DSA tag */ ++ return DSA_TAG_PROTO_RTL4_A; + } + + static void rtl8366rb_adjust_link(struct dsa_switch *ds, int port, diff --git a/target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch similarity index 67% rename from target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch rename to target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch index 78932933d..4df1fd267 100644 --- a/target/linux/mediatek/patches-5.4/1000-eth-gdm-config-backport.patch +++ b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch @@ -1,6 +1,16 @@ +From: MarkLee +Date: Wed, 13 Nov 2019 10:38:42 +0800 +Subject: [PATCH] net: ethernet: mediatek: Integrate GDM/PSE setup operations + +Integrate GDM/PSE setup operations into single function "mtk_gdm_config" + +Signed-off-by: MarkLee +Signed-off-by: David S. Miller +--- + --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2210,6 +2210,31 @@ static int mtk_start_dma(struct mtk_eth +@@ -2211,6 +2211,28 @@ static int mtk_start_dma(struct mtk_eth return 0; } @@ -8,9 +18,6 @@ +{ + int i; + -+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) -+ return; -+ + for (i = 0; i < MTK_MAC_COUNT; i++) { + u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i)); + @@ -32,25 +39,7 @@ static int mtk_open(struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -2230,6 +2255,8 @@ static int mtk_open(struct net_device *d - if (err) - return err; - -+ mtk_gdm_config(eth, MTK_GDMA_TO_PDMA); -+ - napi_enable(ð->tx_napi); - napi_enable(ð->rx_napi); - mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); -@@ -2285,6 +2312,8 @@ static int mtk_stop(struct net_device *d - if (!refcount_dec_and_test(ð->dma_refcnt)) - return 0; - -+ mtk_gdm_config(eth, MTK_GDMA_DROP_ALL); -+ - mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); - mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); - napi_disable(ð->tx_napi); -@@ -2411,8 +2440,6 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2406,8 +2428,6 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, 0, MTK_QDMA_DELAY_INT); mtk_tx_irq_disable(eth, ~0); mtk_rx_irq_disable(eth, ~0); @@ -59,7 +48,7 @@ /* FE int grouping */ mtk_w32(eth, MTK_TX_DONE_INT, MTK_PDMA_INT_GRP1); -@@ -2421,19 +2448,6 @@ static int mtk_hw_init(struct mtk_eth *e +@@ -2416,18 +2436,7 @@ static int mtk_hw_init(struct mtk_eth *e mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2); mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); @@ -75,18 +64,17 @@ - /* setup the mac dma */ - mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); - } -- ++ mtk_gdm_config(eth, MTK_GDMA_TO_PDMA); + return 0; - err_disable_pm: --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -84,6 +84,8 @@ +@@ -84,6 +84,7 @@ #define MTK_GDMA_ICS_EN BIT(22) #define MTK_GDMA_TCS_EN BIT(21) #define MTK_GDMA_UCS_EN BIT(20) +#define MTK_GDMA_TO_PDMA 0x0 -+#define MTK_GDMA_DROP_ALL 0x7777 /* Unicast Filter MAC Address Register - Low */ #define MTK_GDMA_MAC_ADRL(x) (0x508 + (x * 0x1000)) diff --git a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch new file mode 100644 index 000000000..cdcd6a1a3 --- /dev/null +++ b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch @@ -0,0 +1,45 @@ +From: MarkLee +Date: Wed, 13 Nov 2019 10:38:43 +0800 +Subject: [PATCH] net: ethernet: mediatek: Refine the timing of GDM/PSE setup + +Refine the timing of GDM/PSE setup, move it from mtk_hw_init +to mtk_open. This is recommended by the mt762x HW design to +do GDM/PSE setup only after PDMA has been started. + +We exclude mt7628 in mtk_gdm_config function since it is a old IP +and there is no GDM/PSE block on it. + +Signed-off-by: MarkLee +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -2215,6 +2215,9 @@ static void mtk_gdm_config(struct mtk_et + { + int i; + ++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) ++ return; ++ + for (i = 0; i < MTK_MAC_COUNT; i++) { + u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i)); + +@@ -2253,6 +2256,8 @@ static int mtk_open(struct net_device *d + if (err) + return err; + ++ mtk_gdm_config(eth, MTK_GDMA_TO_PDMA); ++ + napi_enable(ð->tx_napi); + napi_enable(ð->rx_napi); + mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); +@@ -2436,8 +2441,6 @@ static int mtk_hw_init(struct mtk_eth *e + mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2); + mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP); + +- mtk_gdm_config(eth, MTK_GDMA_TO_PDMA); +- + return 0; + + err_disable_pm: diff --git a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch new file mode 100644 index 000000000..b8c40ef66 --- /dev/null +++ b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch @@ -0,0 +1,33 @@ +From: MarkLee +Date: Wed, 13 Nov 2019 10:38:44 +0800 +Subject: [PATCH] net: ethernet: mediatek: Enable GDM GDMA_DROP_ALL mode + +Enable GDM GDMA_DROP_ALL mode to drop all packet during the +stop operation. This is recommended by the mt762x HW design +to drop all packet from GMAC before stopping PDMA. + +Signed-off-by: MarkLee +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -2310,6 +2310,8 @@ static int mtk_stop(struct net_device *d + if (!refcount_dec_and_test(ð->dma_refcnt)) + return 0; + ++ mtk_gdm_config(eth, MTK_GDMA_DROP_ALL); ++ + mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); + mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); + napi_disable(ð->tx_napi); +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -85,6 +85,7 @@ + #define MTK_GDMA_TCS_EN BIT(21) + #define MTK_GDMA_UCS_EN BIT(20) + #define MTK_GDMA_TO_PDMA 0x0 ++#define MTK_GDMA_DROP_ALL 0x7777 + + /* Unicast Filter MAC Address Register - Low */ + #define MTK_GDMA_MAC_ADRL(x) (0x508 + (x * 0x1000)) diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index d09dde24e..4b00fb4cb 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -1532,6 +1532,7 @@ CONFIG_EXTRA_TARGETS="" # CONFIG_FAILOVER is not set # CONFIG_FAIR_GROUP_SCHED is not set # CONFIG_FANOTIFY is not set +# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_FAT_DEFAULT_UTF8 is not set @@ -2120,6 +2121,7 @@ CONFIG_HW_RANDOM_TPM=y # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_SLAVE_EEPROM is not set # CONFIG_I2C_SMBUS is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_TAOS_EVM is not set @@ -2380,6 +2382,7 @@ CONFIG_IO_STRICT_DEVMEM=y # CONFIG_IP6_NF_TARGET_SYNPROXY is not set # CONFIG_IPACK_BUS is not set # CONFIG_IPC_NS is not set +# CONFIG_IPMB_DEVICE_INTERFACE is not set # CONFIG_IPMI_HANDLER is not set # CONFIG_IPV6 is not set # CONFIG_IPV6_FOU is not set @@ -3245,6 +3248,7 @@ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 CONFIG_MTD_SPLIT=y # CONFIG_MTD_SPLIT_BCM_WFI_FW is not set # CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set +# CONFIG_MTD_SPLIT_ELF_FW is not set # CONFIG_MTD_SPLIT_EVA_FW is not set # CONFIG_MTD_SPLIT_FIRMWARE is not set CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" @@ -3448,6 +3452,7 @@ CONFIG_NET_CORE=y # CONFIG_NET_DSA_TAG_LAN9303 is not set # CONFIG_NET_DSA_TAG_MTK is not set # CONFIG_NET_DSA_TAG_QCA is not set +# CONFIG_NET_DSA_TAG_RTL4_A is not set # CONFIG_NET_DSA_TAG_SJA1105 is not set # CONFIG_NET_DSA_TAG_TRAILER is not set # CONFIG_NET_DSA_VITESSE_VSC73XX is not set @@ -3653,6 +3658,7 @@ CONFIG_NFS_V3=y CONFIG_NF_CONNTRACK_PROCFS=y # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set # CONFIG_NF_CONNTRACK_SANE is not set +# CONFIG_NF_CONNTRACK_SECMARK is not set # CONFIG_NF_CONNTRACK_SIP is not set # CONFIG_NF_CONNTRACK_SNMP is not set # CONFIG_NF_CONNTRACK_TFTP is not set diff --git a/target/linux/generic/hack-5.4/230-openwrt_lzma_options.patch b/target/linux/generic/hack-5.4/230-openwrt_lzma_options.patch index d4de310a9..809ccbc1e 100644 --- a/target/linux/generic/hack-5.4/230-openwrt_lzma_options.patch +++ b/target/linux/generic/hack-5.4/230-openwrt_lzma_options.patch @@ -27,11 +27,11 @@ Signed-off-by: Imre Kaloz # --------------------------------------------------------------------------- quiet_cmd_lzma = LZMA $@ -- cmd_lzma = { cat $(real-prereqs) | lzma -9; $(size_append); } > $@ -+ cmd_lzma = { cat $(real-prereqs) | lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so; $(size_append); } > $@ +- cmd_lzma = { cat $(real-prereqs) | $(LZMA) -9; $(size_append); } > $@ ++ cmd_lzma = { cat $(real-prereqs) | $(LZMA) e -d20 -lc1 -lp2 -pb2 -eos -si -so; $(size_append); } > $@ quiet_cmd_lzo = LZO $@ - cmd_lzo = { cat $(real-prereqs) | lzop -9; $(size_append); } > $@ + cmd_lzo = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ --- a/usr/gen_initramfs_list.sh +++ b/usr/gen_initramfs_list.sh @@ -229,7 +229,7 @@ cpio_list= diff --git a/target/linux/generic/hack-5.4/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-5.4/301-mips_image_cmdline_hack.patch index 4af9e5a25..da0aa3425 100644 --- a/target/linux/generic/hack-5.4/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/hack-5.4/301-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1157,6 +1157,10 @@ config SYNC_R4K +@@ -1158,6 +1158,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/hack-5.4/550-loop-Report-EOPNOTSUPP-properly.patch b/target/linux/generic/hack-5.4/550-loop-Report-EOPNOTSUPP-properly.patch index 754c01be1..0e5447d45 100644 --- a/target/linux/generic/hack-5.4/550-loop-Report-EOPNOTSUPP-properly.patch +++ b/target/linux/generic/hack-5.4/550-loop-Report-EOPNOTSUPP-properly.patch @@ -27,7 +27,7 @@ Reviewed-by: Bart Van Assche goto end_io; } -@@ -1970,7 +1970,10 @@ static void loop_handle_cmd(struct loop_ +@@ -1973,7 +1973,10 @@ static void loop_handle_cmd(struct loop_ failed: /* complete non-aio request */ if (!cmd->use_aio || ret) { diff --git a/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch b/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch index a7761e2d4..f9480d59d 100644 --- a/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch +++ b/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch @@ -1,6 +1,6 @@ --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h -@@ -158,6 +158,8 @@ struct nf_flow_table_hw { +@@ -160,6 +160,8 @@ struct nf_flow_table_hw { int nf_flow_table_hw_register(const struct nf_flow_table_hw *offload); void nf_flow_table_hw_unregister(const struct nf_flow_table_hw *offload); diff --git a/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch index 3a9d64dd4..737392b1f 100644 --- a/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch +++ b/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch @@ -576,7 +576,7 @@ Signed-off-by: Felix Fietkau +#endif /* _XT_FLOWOFFLOAD_H */ --- a/include/net/netfilter/nf_flow_table.h +++ b/include/net/netfilter/nf_flow_table.h -@@ -128,6 +128,10 @@ static inline void flow_offload_dead(str +@@ -130,6 +130,10 @@ static inline void flow_offload_dead(str flow->flags |= FLOW_OFFLOAD_DYING; } diff --git a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch index 4201dfe7f..0e292f5b6 100644 --- a/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-5.4/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1911,6 +1911,9 @@ int genphy_update_link(struct phy_device +@@ -1912,6 +1912,9 @@ int genphy_update_link(struct phy_device if (bmcr & BMCR_ANRESTART) goto done; diff --git a/target/linux/generic/hack-5.4/902-debloat_proc.patch b/target/linux/generic/hack-5.4/902-debloat_proc.patch index 8813b38da..a2a7e1eef 100644 --- a/target/linux/generic/hack-5.4/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.4/902-debloat_proc.patch @@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau if (!pe) --- a/mm/vmalloc.c +++ b/mm/vmalloc.c -@@ -3562,6 +3562,8 @@ static const struct seq_operations vmall +@@ -3564,6 +3564,8 @@ static const struct seq_operations vmall static int __init proc_vmalloc_init(void) { @@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2847,11 +2847,13 @@ static const struct seq_operations fib_r +@@ -2848,11 +2848,13 @@ static const struct seq_operations fib_r int __net_init fib_proc_init(struct net *net) { @@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau fib_triestat_seq_show, NULL)) goto out2; -@@ -2862,17 +2864,21 @@ int __net_init fib_proc_init(struct net +@@ -2863,17 +2865,21 @@ int __net_init fib_proc_init(struct net return 0; out3: diff --git a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch index ab53b74a7..7c768c6a7 100644 --- a/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-5.4/904-debloat_dma_buf.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2679,6 +2679,7 @@ int wake_up_state(struct task_struct *p, +@@ -2756,6 +2756,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch b/target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch index 3fe1bb5d1..55a4538f6 100644 --- a/target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch +++ b/target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c -@@ -638,7 +638,7 @@ static int ehci_run (struct usb_hcd *hcd +@@ -639,7 +639,7 @@ static int ehci_run (struct usb_hcd *hcd "USB %x.%x started, EHCI %x.%02x%s\n", ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), temp >> 8, temp & 0xff, @@ -28,7 +28,7 @@ Signed-off-by: Florian Fainelli &ehci->regs->intr_enable); /* Turn On Interrupts */ --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c -@@ -641,7 +641,7 @@ ehci_hub_status_data (struct usb_hcd *hc +@@ -640,7 +640,7 @@ ehci_hub_status_data (struct usb_hcd *hc * always set, seem to clear PORT_OCC and PORT_CSC when writing to * PORT_POWER; that's surprising, but maybe within-spec. */ @@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli mask = PORT_CSC | PORT_PEC | PORT_OCC; else mask = PORT_CSC | PORT_PEC; -@@ -1011,7 +1011,7 @@ int ehci_hub_control( +@@ -1010,7 +1010,7 @@ int ehci_hub_control( if (temp & PORT_PEC) status |= USB_PORT_STAT_C_ENABLE << 16; diff --git a/target/linux/generic/pending-5.4/201-extra_optimization.patch b/target/linux/generic/pending-5.4/201-extra_optimization.patch index cbec8ef36..c60648799 100644 --- a/target/linux/generic/pending-5.4/201-extra_optimization.patch +++ b/target/linux/generic/pending-5.4/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -713,11 +713,11 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -719,11 +719,11 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE diff --git a/target/linux/generic/pending-5.4/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-5.4/300-mips_expose_boot_raw.patch index 50029a455..a4f003ec3 100644 --- a/target/linux/generic/pending-5.4/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/pending-5.4/300-mips_expose_boot_raw.patch @@ -9,7 +9,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1067,9 +1067,6 @@ config FW_ARC +@@ -1068,9 +1068,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -3041,6 +3038,18 @@ choice +@@ -3042,6 +3039,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch index b46c3f5ed..c48a144d3 100644 --- a/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch +++ b/target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau /* Our partition linked list */ static LIST_HEAD(mtd_partitions); static DEFINE_MUTEX(mtd_partitions_mutex); -@@ -206,6 +208,53 @@ static int part_erase(struct mtd_info *m +@@ -206,11 +208,77 @@ static int part_erase(struct mtd_info *m { struct mtd_part *part = mtd_to_part(mtd); int ret; @@ -73,10 +73,9 @@ Signed-off-by: Felix Fietkau instr->addr += part->offset; ret = part->parent->_erase(part->parent, instr); -@@ -213,6 +262,24 @@ static int part_erase(struct mtd_info *m + if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) instr->fail_addr -= part->offset; - instr->addr -= part->offset; - ++ + if (mtd->flags & MTD_ERASE_PARTIAL) { + if (partial_start) { + part->parent->_write(part->parent, @@ -95,10 +94,10 @@ Signed-off-by: Felix Fietkau + kfree(erase_buf); + } + - return ret; - } + instr->addr -= part->offset; -@@ -525,19 +592,22 @@ static struct mtd_part *allocate_partiti + return ret; +@@ -525,19 +593,22 @@ static struct mtd_part *allocate_partiti remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ diff --git a/target/linux/generic/pending-5.4/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-5.4/412-mtd-partial_eraseblock_unlock.patch index 348fb9a84..b23bc1b20 100644 --- a/target/linux/generic/pending-5.4/412-mtd-partial_eraseblock_unlock.patch +++ b/target/linux/generic/pending-5.4/412-mtd-partial_eraseblock_unlock.patch @@ -20,7 +20,7 @@ Signed-off-by: Tim Harvey --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -292,7 +292,16 @@ static int part_lock(struct mtd_info *mt +@@ -293,7 +293,16 @@ static int part_lock(struct mtd_info *mt static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) { struct mtd_part *part = mtd_to_part(mtd); diff --git a/target/linux/generic/pending-5.4/630-packet_socket_type.patch b/target/linux/generic/pending-5.4/630-packet_socket_type.patch index f082aa145..a137fb5a6 100644 --- a/target/linux/generic/pending-5.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-5.4/630-packet_socket_type.patch @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2184,12 +2186,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2185,12 +2187,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3284,6 +3286,7 @@ static int packet_create(struct net *net +@@ -3289,6 +3291,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3917,6 +3920,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3922,6 +3925,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3973,6 +3986,13 @@ static int packet_getsockopt(struct sock +@@ -3978,6 +3991,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index a005b25c7..3260e645f 100644 --- a/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-5.4/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5745,6 +5745,13 @@ static int nf_tables_flowtable_parse_hoo +@@ -5741,6 +5741,13 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) return err; @@ -520,7 +520,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL); if (!ops) return -ENOMEM; -@@ -5875,10 +5882,19 @@ static int nf_tables_newflowtable(struct +@@ -5871,10 +5878,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -6004,7 +6020,8 @@ static int nf_tables_fill_flowtable_info +@@ -6000,7 +6016,8 @@ static int nf_tables_fill_flowtable_info nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) || nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle), diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch new file mode 100644 index 000000000..392a37b34 --- /dev/null +++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch @@ -0,0 +1,78 @@ +From: Felix Fietkau +Date: Thu, 17 Sep 2020 18:41:23 +0200 +Subject: [PATCH] net: dsa: support hardware flow table offload + +Look up the master device and the port id + +Signed-off-by: Felix Fietkau +--- + +--- a/include/net/netfilter/nf_flow_table.h ++++ b/include/net/netfilter/nf_flow_table.h +@@ -90,6 +90,7 @@ struct flow_offload { + #define FLOW_OFFLOAD_PATH_ETHERNET BIT(0) + #define FLOW_OFFLOAD_PATH_VLAN BIT(1) + #define FLOW_OFFLOAD_PATH_PPPOE BIT(2) ++#define FLOW_OFFLOAD_PATH_DSA BIT(3) + + struct flow_offload_hw_path { + struct net_device *dev; +@@ -100,6 +101,7 @@ struct flow_offload_hw_path { + u16 vlan_proto; + u16 vlan_id; + u16 pppoe_sid; ++ u16 dsa_port; + }; + + #define NF_FLOW_TIMEOUT (30 * HZ) +--- a/net/dsa/slave.c ++++ b/net/dsa/slave.c +@@ -19,6 +19,10 @@ + #include + #include + #include ++#if IS_ENABLED(CONFIG_NF_FLOW_TABLE) ++#include ++#include ++#endif + + #include "dsa_priv.h" + +@@ -1221,6 +1225,27 @@ static struct devlink_port *dsa_slave_ge + return dp->ds->devlink ? &dp->devlink_port : NULL; + } + ++#if IS_ENABLED(CONFIG_NF_FLOW_TABLE) ++static int dsa_flow_offload_check(struct flow_offload_hw_path *path) ++{ ++ struct net_device *dev = path->dev; ++ struct dsa_port *dp; ++ ++ if (!(path->flags & FLOW_OFFLOAD_PATH_ETHERNET)) ++ return -EINVAL; ++ ++ dp = dsa_slave_to_port(dev); ++ path->dsa_port = dp->index; ++ path->dev = dsa_slave_to_master(dev); ++ path->flags |= FLOW_OFFLOAD_PATH_DSA; ++ ++ if (path->dev->netdev_ops->ndo_flow_offload_check) ++ return path->dev->netdev_ops->ndo_flow_offload_check(path); ++ ++ return 0; ++} ++#endif /* CONFIG_NF_FLOW_TABLE */ ++ + static const struct net_device_ops dsa_slave_netdev_ops = { + .ndo_open = dsa_slave_open, + .ndo_stop = dsa_slave_close, +@@ -1245,6 +1270,9 @@ static const struct net_device_ops dsa_s + .ndo_vlan_rx_add_vid = dsa_slave_vlan_rx_add_vid, + .ndo_vlan_rx_kill_vid = dsa_slave_vlan_rx_kill_vid, + .ndo_get_devlink_port = dsa_slave_get_devlink_port, ++#if IS_ENABLED(CONFIG_NF_FLOW_TABLE) ++ .ndo_flow_offload_check = dsa_flow_offload_check, ++#endif + }; + + static struct device_type dsa_type = { diff --git a/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 702199242..8bcca1c4d 100644 --- a/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -293,7 +293,7 @@ Signed-off-by: Steven Barth __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); -@@ -951,6 +1091,7 @@ static void init_tel_txopt(struct ipv6_t +@@ -959,6 +1099,7 @@ static void init_tel_txopt(struct ipv6_t opt->ops.opt_nflen = 8; } @@ -301,7 +301,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own * @t: the outgoing tunnel device -@@ -1303,6 +1444,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1311,6 +1452,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str { struct ip6_tnl *t = netdev_priv(dev); struct ipv6hdr *ipv6h; @@ -309,7 +309,7 @@ Signed-off-by: Steven Barth int encap_limit = -1; __u16 offset; struct flowi6 fl6; -@@ -1368,6 +1510,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1376,6 +1518,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); dsfield = INET_ECN_encapsulate(dsfield, ipv6_get_dsfield(ipv6h)); @@ -328,7 +328,7 @@ Signed-off-by: Steven Barth if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; -@@ -1497,6 +1651,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1505,6 +1659,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.link = p->link; t->parms.proto = p->proto; t->parms.fwmark = p->fwmark; @@ -343,7 +343,7 @@ Signed-off-by: Steven Barth dst_cache_reset(&t->dst_cache); ip6_tnl_link_config(t); return 0; -@@ -1535,6 +1697,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1543,6 +1705,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -351,7 +351,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1919,6 +2082,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1927,6 +2090,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -367,7 +367,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1956,6 +2128,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1964,6 +2136,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_FWMARK]) parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); @@ -414,7 +414,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2071,6 +2283,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2079,6 +2291,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -427,7 +427,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2100,6 +2318,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2108,6 +2326,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(0) + /* IFLA_IPTUN_FWMARK */ nla_total_size(4) + @@ -452,7 +452,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2107,6 +2343,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2115,6 +2351,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -462,7 +462,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2116,9 +2355,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2124,9 +2363,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || @@ -491,7 +491,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2158,6 +2415,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2166,6 +2423,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, diff --git a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 232aee963..3590557a3 100644 --- a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski static void rt_fibinfo_free(struct rtable __rcu **rtp) --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2595,6 +2595,7 @@ static const char *const rtn_type_names[ +@@ -2596,6 +2596,7 @@ static const char *const rtn_type_names[ [RTN_THROW] = "THROW", [RTN_NAT] = "NAT", [RTN_XRESOLVE] = "XRESOLVE", diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 5acadeceb..8ca7b0be3 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5469,6 +5469,9 @@ static enum gro_result dev_gro_receive(s +@@ -5468,6 +5468,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7262,6 +7265,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7263,6 +7266,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7312,6 +7357,7 @@ static int __netdev_upper_dev_link(struc +@@ -7313,6 +7358,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7405,6 +7451,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7406,6 +7452,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8135,6 +8182,7 @@ int dev_set_mac_address(struct net_devic +@@ -8136,6 +8183,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch index 254464580..dcb3d319d 100644 --- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch +++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch @@ -196,15 +196,15 @@ Signed-off-by: Felix Fietkau void netif_napi_add(struct net_device *dev, struct napi_struct *napi, int (*poll)(struct napi_struct *, int), int weight) { -@@ -6238,6 +6327,7 @@ void netif_napi_add(struct net_device *d +@@ -6237,6 +6326,7 @@ void netif_napi_add(struct net_device *d #ifdef CONFIG_NETPOLL napi->poll_owner = -1; #endif + INIT_WORK(&napi->work, napi_workfn); set_bit(NAPI_STATE_SCHED, &napi->state); - napi_hash_add(napi); - } -@@ -6276,6 +6366,7 @@ static void flush_gro_hash(struct napi_s + set_bit(NAPI_STATE_NPSVC, &napi->state); + list_add_rcu(&napi->dev_list, &dev->napi_list); +@@ -6277,6 +6367,7 @@ static void flush_gro_hash(struct napi_s void netif_napi_del(struct napi_struct *napi) { might_sleep(); @@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau if (napi_hash_del(napi)) synchronize_net(); list_del_init(&napi->dev_list); -@@ -6288,50 +6379,18 @@ EXPORT_SYMBOL(netif_napi_del); +@@ -6289,50 +6380,18 @@ EXPORT_SYMBOL(netif_napi_del); static int napi_poll(struct napi_struct *n, struct list_head *repoll) { @@ -267,7 +267,7 @@ Signed-off-by: Felix Fietkau /* Some drivers may have called napi_schedule * prior to exhausting their budget. -@@ -10264,6 +10323,10 @@ static int __init net_dev_init(void) +@@ -10265,6 +10324,10 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/ramips/patches-5.4/0400-net-ethernet-mediatek-use-napi_consume_skb.patch b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch similarity index 96% rename from target/linux/ramips/patches-5.4/0400-net-ethernet-mediatek-use-napi_consume_skb.patch rename to target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch index a31100642..9909c4c96 100644 --- a/target/linux/ramips/patches-5.4/0400-net-ethernet-mediatek-use-napi_consume_skb.patch +++ b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch @@ -1,6 +1,6 @@ From: Felix Fietkau Date: Mon, 8 Jun 2020 17:01:12 +0200 -Subject: [PATCH] net: ethernet: mediatek: use napi_consume_skb +Subject: [PATCH] net: ethernet: mtk_eth_soc: use napi_consume_skb Should improve performance, since it can use bulk free diff --git a/target/linux/ramips/patches-5.4/0401-net-ethernet-mediatek-significantly-reduce-mdio-bus-.patch b/target/linux/generic/pending-5.4/770-01-net-ethernet-mtk_eth_soc-significantly-reduce-mdio-b.patch similarity index 91% rename from target/linux/ramips/patches-5.4/0401-net-ethernet-mediatek-significantly-reduce-mdio-bus-.patch rename to target/linux/generic/pending-5.4/770-01-net-ethernet-mtk_eth_soc-significantly-reduce-mdio-b.patch index c2ba9964e..922c35a3e 100644 --- a/target/linux/ramips/patches-5.4/0401-net-ethernet-mediatek-significantly-reduce-mdio-bus-.patch +++ b/target/linux/generic/pending-5.4/770-01-net-ethernet-mtk_eth_soc-significantly-reduce-mdio-b.patch @@ -1,6 +1,6 @@ From: Felix Fietkau Date: Mon, 8 Jun 2020 17:02:39 +0200 -Subject: [PATCH] net: ethernet: mediatek: significantly reduce mdio bus +Subject: [PATCH] net: ethernet: mtk_eth_soc: significantly reduce mdio bus access latency usleep_range often ends up sleeping much longer than the 10-20us provided diff --git a/target/linux/mediatek/patches-5.4/0400-eth-fix-rx-vlan-hw-offload.patch b/target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch similarity index 64% rename from target/linux/mediatek/patches-5.4/0400-eth-fix-rx-vlan-hw-offload.patch rename to target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch index dd75edf11..e17877028 100644 --- a/target/linux/mediatek/patches-5.4/0400-eth-fix-rx-vlan-hw-offload.patch +++ b/target/linux/generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch @@ -1,6 +1,16 @@ +From: Felix Fietkau +Date: Wed, 26 Aug 2020 16:52:12 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: fix rx vlan offload + +The VLAN ID in the rx descriptor is only valid if the RX_DMA_VID bit is set +Fixes frames wrongly marked with VLAN tags + +Signed-off-by: Felix Fietkau +--- + --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1315,7 +1315,7 @@ static int mtk_poll_rx(struct napi_struc +@@ -1320,7 +1320,7 @@ static int mtk_poll_rx(struct napi_struc skb->protocol = eth_type_trans(skb, netdev); if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && @@ -11,7 +21,7 @@ skb_record_rx_queue(skb, 0); --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -293,6 +293,7 @@ +@@ -295,6 +295,7 @@ #define RX_DMA_LSO BIT(30) #define RX_DMA_PLEN0(_x) (((_x) & 0x3fff) << 16) #define RX_DMA_GET_PLEN0(_x) (((_x) >> 16) & 0x3fff) diff --git a/target/linux/mediatek/patches-5.4/0401-eth-fix-eth1-tx-timeout.patch b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch similarity index 58% rename from target/linux/mediatek/patches-5.4/0401-eth-fix-eth1-tx-timeout.patch rename to target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch index 407211830..fd28bb869 100644 --- a/target/linux/mediatek/patches-5.4/0401-eth-fix-eth1-tx-timeout.patch +++ b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch @@ -1,6 +1,18 @@ +From: Felix Fietkau +Date: Wed, 26 Aug 2020 16:55:54 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: fix unnecessary tx queue + stops + +When running short on descriptors, only stop the queue for the netdev that tx +was attempted for. By the time the something tries to send on the other netdev, +the ring might have some more room already + +Signed-off-by: Felix Fietkau +--- + --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1121,17 +1121,6 @@ static void mtk_wake_queue(struct mtk_et +@@ -1126,17 +1126,6 @@ static void mtk_wake_queue(struct mtk_et } } @@ -18,7 +30,7 @@ static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct mtk_mac *mac = netdev_priv(dev); -@@ -1152,7 +1141,7 @@ static int mtk_start_xmit(struct sk_buff +@@ -1157,7 +1146,7 @@ static int mtk_start_xmit(struct sk_buff tx_num = mtk_cal_txd_req(skb); if (unlikely(atomic_read(&ring->free_count) <= tx_num)) { @@ -27,7 +39,7 @@ netif_err(eth, tx_queued, dev, "Tx Ring full when queue awake!\n"); spin_unlock(ð->page_lock); -@@ -1178,7 +1167,7 @@ static int mtk_start_xmit(struct sk_buff +@@ -1183,7 +1172,7 @@ static int mtk_start_xmit(struct sk_buff goto drop; if (unlikely(atomic_read(&ring->free_count) <= ring->thresh)) diff --git a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch new file mode 100644 index 000000000..e135f27f9 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Date: Wed, 26 Aug 2020 16:58:55 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: use larger burst size for + qdma tx + +Improves tx performance + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -2187,7 +2187,7 @@ static int mtk_start_dma(struct mtk_eth + if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { + mtk_w32(eth, + MTK_TX_WB_DDONE | MTK_TX_DMA_EN | +- MTK_DMA_SIZE_16DWORDS | MTK_NDP_CO_PRO | ++ MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | + MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | + MTK_RX_BT_32DWORDS, + MTK_QDMA_GLO_CFG); +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -197,7 +197,7 @@ + #define MTK_RX_BT_32DWORDS (3 << 11) + #define MTK_NDP_CO_PRO BIT(10) + #define MTK_TX_WB_DDONE BIT(6) +-#define MTK_DMA_SIZE_16DWORDS (2 << 4) ++#define MTK_TX_BT_32DWORDS (3 << 4) + #define MTK_RX_DMA_BUSY BIT(3) + #define MTK_TX_DMA_BUSY BIT(1) + #define MTK_RX_DMA_EN BIT(2) diff --git a/target/linux/generic/pending-5.4/770-05-net-ethernet-mtk_eth_soc-increase-DMA-ring-sizes.patch b/target/linux/generic/pending-5.4/770-05-net-ethernet-mtk_eth_soc-increase-DMA-ring-sizes.patch new file mode 100644 index 000000000..f68cbc333 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-05-net-ethernet-mtk_eth_soc-increase-DMA-ring-sizes.patch @@ -0,0 +1,21 @@ +From: Felix Fietkau +Date: Wed, 26 Aug 2020 16:59:41 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: increase DMA ring sizes + +256 descriptors is not enough for multi-gigabit traffic under load on MT7622. +Bump it to 512 to improve performance + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -19,7 +19,7 @@ + #define MTK_QDMA_PAGE_SIZE 2048 + #define MTK_MAX_RX_LENGTH 1536 + #define MTK_TX_DMA_BUF_LEN 0x3fff +-#define MTK_DMA_SIZE 256 ++#define MTK_DMA_SIZE 512 + #define MTK_NAPI_WEIGHT 64 + #define MTK_MAC_COUNT 2 + #define MTK_RX_ETH_HLEN (VLAN_ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN) diff --git a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch new file mode 100644 index 000000000..8720ab503 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch @@ -0,0 +1,281 @@ +From: Felix Fietkau +Date: Wed, 26 Aug 2020 17:02:30 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: implement dynamic interrupt + moderation + +Reduces the number of interrupts under load + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/Kconfig ++++ b/drivers/net/ethernet/mediatek/Kconfig +@@ -10,6 +10,7 @@ if NET_VENDOR_MEDIATEK + config NET_MEDIATEK_SOC + tristate "MediaTek SoC Gigabit Ethernet support" + select PHYLINK ++ select DIMLIB + ---help--- + This driver supports the gigabit ethernet MACs in the + MediaTek SoC family. +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1228,12 +1228,13 @@ static void mtk_update_rx_cpu_idx(struct + static int mtk_poll_rx(struct napi_struct *napi, int budget, + struct mtk_eth *eth) + { ++ struct dim_sample dim_sample = {}; + struct mtk_rx_ring *ring; + int idx; + struct sk_buff *skb; + u8 *data, *new_data; + struct mtk_rx_dma *rxd, trxd; +- int done = 0; ++ int done = 0, bytes = 0; + + while (done < budget) { + struct net_device *netdev; +@@ -1307,6 +1308,7 @@ static int mtk_poll_rx(struct napi_struc + else + skb_checksum_none_assert(skb); + skb->protocol = eth_type_trans(skb, netdev); ++ bytes += pktlen; + + if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && + (trxd.rxd2 & RX_DMA_VTAG)) +@@ -1338,6 +1340,12 @@ rx_done: + mtk_update_rx_cpu_idx(eth); + } + ++ eth->rx_packets += done; ++ eth->rx_bytes += bytes; ++ dim_update_sample(eth->rx_events, eth->rx_packets, eth->rx_bytes, ++ &dim_sample); ++ net_dim(ð->rx_dim, dim_sample); ++ + return done; + } + +@@ -1430,6 +1438,7 @@ static int mtk_poll_tx_pdma(struct mtk_e + static int mtk_poll_tx(struct mtk_eth *eth, int budget) + { + struct mtk_tx_ring *ring = ð->tx_ring; ++ struct dim_sample dim_sample = {}; + unsigned int done[MTK_MAX_DEVS]; + unsigned int bytes[MTK_MAX_DEVS]; + int total = 0, i; +@@ -1447,8 +1456,14 @@ static int mtk_poll_tx(struct mtk_eth *e + continue; + netdev_completed_queue(eth->netdev[i], done[i], bytes[i]); + total += done[i]; ++ eth->tx_packets += done[i]; ++ eth->tx_bytes += bytes[i]; + } + ++ dim_update_sample(eth->tx_events, eth->tx_packets, eth->tx_bytes, ++ &dim_sample); ++ net_dim(ð->tx_dim, dim_sample); ++ + if (mtk_queue_stopped(eth) && + (atomic_read(&ring->free_count) > ring->thresh)) + mtk_wake_queue(eth); +@@ -2123,6 +2138,7 @@ static irqreturn_t mtk_handle_irq_rx(int + { + struct mtk_eth *eth = _eth; + ++ eth->rx_events++; + if (likely(napi_schedule_prep(ð->rx_napi))) { + __napi_schedule(ð->rx_napi); + mtk_rx_irq_disable(eth, MTK_RX_DONE_INT); +@@ -2135,6 +2151,7 @@ static irqreturn_t mtk_handle_irq_tx(int + { + struct mtk_eth *eth = _eth; + ++ eth->tx_events++; + if (likely(napi_schedule_prep(ð->tx_napi))) { + __napi_schedule(ð->tx_napi); + mtk_tx_irq_disable(eth, MTK_TX_DONE_INT); +@@ -2311,6 +2328,9 @@ static int mtk_stop(struct net_device *d + napi_disable(ð->tx_napi); + napi_disable(ð->rx_napi); + ++ cancel_work_sync(ð->rx_dim.work); ++ cancel_work_sync(ð->tx_dim.work); ++ + if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) + mtk_stop_dma(eth, MTK_QDMA_GLO_CFG); + mtk_stop_dma(eth, MTK_PDMA_GLO_CFG); +@@ -2360,6 +2380,64 @@ err_disable_clks: + return ret; + } + ++static void mtk_dim_rx(struct work_struct *work) ++{ ++ struct dim *dim = container_of(work, struct dim, work); ++ struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim); ++ struct dim_cq_moder cur_profile; ++ u32 val, cur; ++ ++ cur_profile = net_dim_get_rx_moderation(eth->rx_dim.mode, ++ dim->profile_ix); ++ spin_lock_bh(ð->dim_lock); ++ ++ val = mtk_r32(eth, MTK_PDMA_DELAY_INT); ++ val &= MTK_PDMA_DELAY_TX_MASK; ++ val |= MTK_PDMA_DELAY_RX_EN; ++ ++ cur = min_t(u32, DIV_ROUND_UP(cur_profile.usec, 20), MTK_PDMA_DELAY_PTIME_MASK); ++ val |= cur << MTK_PDMA_DELAY_RX_PTIME_SHIFT; ++ ++ cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK); ++ val |= cur << MTK_PDMA_DELAY_RX_PINT_SHIFT; ++ ++ mtk_w32(eth, val, MTK_PDMA_DELAY_INT); ++ mtk_w32(eth, val, MTK_QDMA_DELAY_INT); ++ ++ spin_unlock_bh(ð->dim_lock); ++ ++ dim->state = DIM_START_MEASURE; ++} ++ ++static void mtk_dim_tx(struct work_struct *work) ++{ ++ struct dim *dim = container_of(work, struct dim, work); ++ struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim); ++ struct dim_cq_moder cur_profile; ++ u32 val, cur; ++ ++ cur_profile = net_dim_get_tx_moderation(eth->tx_dim.mode, ++ dim->profile_ix); ++ spin_lock_bh(ð->dim_lock); ++ ++ val = mtk_r32(eth, MTK_PDMA_DELAY_INT); ++ val &= MTK_PDMA_DELAY_RX_MASK; ++ val |= MTK_PDMA_DELAY_TX_EN; ++ ++ cur = min_t(u32, DIV_ROUND_UP(cur_profile.usec, 20), MTK_PDMA_DELAY_PTIME_MASK); ++ val |= cur << MTK_PDMA_DELAY_TX_PTIME_SHIFT; ++ ++ cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK); ++ val |= cur << MTK_PDMA_DELAY_TX_PINT_SHIFT; ++ ++ mtk_w32(eth, val, MTK_PDMA_DELAY_INT); ++ mtk_w32(eth, val, MTK_QDMA_DELAY_INT); ++ ++ spin_unlock_bh(ð->dim_lock); ++ ++ dim->state = DIM_START_MEASURE; ++} ++ + static int mtk_hw_init(struct mtk_eth *eth) + { + int i, val, ret; +@@ -2381,9 +2459,6 @@ static int mtk_hw_init(struct mtk_eth *e + goto err_disable_pm; + } + +- /* enable interrupt delay for RX */ +- mtk_w32(eth, MTK_PDMA_DELAY_RX_DELAY, MTK_PDMA_DELAY_INT); +- + /* disable delay and normal interrupt */ + mtk_tx_irq_disable(eth, ~0); + mtk_rx_irq_disable(eth, ~0); +@@ -2422,11 +2497,10 @@ static int mtk_hw_init(struct mtk_eth *e + /* Enable RX VLan Offloading */ + mtk_w32(eth, 1, MTK_CDMP_EG_CTRL); + +- /* enable interrupt delay for RX */ +- mtk_w32(eth, MTK_PDMA_DELAY_RX_DELAY, MTK_PDMA_DELAY_INT); ++ mtk_dim_rx(ð->rx_dim.work); ++ mtk_dim_tx(ð->tx_dim.work); + + /* disable delay and normal interrupt */ +- mtk_w32(eth, 0, MTK_QDMA_DELAY_INT); + mtk_tx_irq_disable(eth, ~0); + mtk_rx_irq_disable(eth, ~0); + +@@ -2930,6 +3004,13 @@ static int mtk_probe(struct platform_dev + spin_lock_init(ð->page_lock); + spin_lock_init(ð->tx_irq_lock); + spin_lock_init(ð->rx_irq_lock); ++ spin_lock_init(ð->dim_lock); ++ ++ eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; ++ INIT_WORK(ð->rx_dim.work, mtk_dim_rx); ++ ++ eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE; ++ INIT_WORK(ð->tx_dim.work, mtk_dim_tx); + + if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { + eth->ethsys = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #define MTK_QDMA_PAGE_SIZE 2048 + #define MTK_MAX_RX_LENGTH 1536 +@@ -131,13 +132,18 @@ + + /* PDMA Delay Interrupt Register */ + #define MTK_PDMA_DELAY_INT 0xa0c ++#define MTK_PDMA_DELAY_RX_MASK GENMASK(15, 0) + #define MTK_PDMA_DELAY_RX_EN BIT(15) +-#define MTK_PDMA_DELAY_RX_PINT 4 + #define MTK_PDMA_DELAY_RX_PINT_SHIFT 8 +-#define MTK_PDMA_DELAY_RX_PTIME 4 +-#define MTK_PDMA_DELAY_RX_DELAY \ +- (MTK_PDMA_DELAY_RX_EN | MTK_PDMA_DELAY_RX_PTIME | \ +- (MTK_PDMA_DELAY_RX_PINT << MTK_PDMA_DELAY_RX_PINT_SHIFT)) ++#define MTK_PDMA_DELAY_RX_PTIME_SHIFT 0 ++ ++#define MTK_PDMA_DELAY_TX_MASK GENMASK(31, 16) ++#define MTK_PDMA_DELAY_TX_EN BIT(31) ++#define MTK_PDMA_DELAY_TX_PINT_SHIFT 24 ++#define MTK_PDMA_DELAY_TX_PTIME_SHIFT 16 ++ ++#define MTK_PDMA_DELAY_PINT_MASK 0x7f ++#define MTK_PDMA_DELAY_PTIME_MASK 0xff + + /* PDMA Interrupt Status Register */ + #define MTK_PDMA_INT_STATUS 0xa20 +@@ -219,6 +225,7 @@ + /* QDMA Interrupt Status Register */ + #define MTK_QDMA_INT_STATUS 0x1A18 + #define MTK_RX_DONE_DLY BIT(30) ++#define MTK_TX_DONE_DLY BIT(28) + #define MTK_RX_DONE_INT3 BIT(19) + #define MTK_RX_DONE_INT2 BIT(18) + #define MTK_RX_DONE_INT1 BIT(17) +@@ -228,8 +235,7 @@ + #define MTK_TX_DONE_INT1 BIT(1) + #define MTK_TX_DONE_INT0 BIT(0) + #define MTK_RX_DONE_INT MTK_RX_DONE_DLY +-#define MTK_TX_DONE_INT (MTK_TX_DONE_INT0 | MTK_TX_DONE_INT1 | \ +- MTK_TX_DONE_INT2 | MTK_TX_DONE_INT3) ++#define MTK_TX_DONE_INT MTK_TX_DONE_DLY + + /* QDMA Interrupt grouping registers */ + #define MTK_QDMA_INT_GRP1 0x1a20 +@@ -892,6 +898,18 @@ struct mtk_eth { + + const struct mtk_soc_data *soc; + ++ spinlock_t dim_lock; ++ ++ u32 rx_events; ++ u32 rx_packets; ++ u32 rx_bytes; ++ struct dim rx_dim; ++ ++ u32 tx_events; ++ u32 tx_packets; ++ u32 tx_bytes; ++ struct dim tx_dim; ++ + u32 tx_int_mask_reg; + u32 tx_int_status_reg; + u32 rx_dma_l4_valid; diff --git a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch new file mode 100644 index 000000000..a7231d826 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch @@ -0,0 +1,67 @@ +From: Felix Fietkau +Date: Thu, 27 Aug 2020 06:32:03 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: cache hardware pointer of last + freed tx descriptor + +The value is only updated by the CPU, so it is cheaper to access from the ring +data structure than from a hardware register + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1358,7 +1358,7 @@ static int mtk_poll_tx_qdma(struct mtk_e + struct mtk_tx_buf *tx_buf; + u32 cpu, dma; + +- cpu = mtk_r32(eth, MTK_QTX_CRX_PTR); ++ cpu = ring->last_free_ptr; + dma = mtk_r32(eth, MTK_QTX_DRX_PTR); + + desc = mtk_qdma_phys_to_virt(ring, cpu); +@@ -1392,6 +1392,7 @@ static int mtk_poll_tx_qdma(struct mtk_e + cpu = next_cpu; + } + ++ ring->last_free_ptr = cpu; + mtk_w32(eth, cpu, MTK_QTX_CRX_PTR); + + return budget; +@@ -1592,6 +1593,7 @@ static int mtk_tx_alloc(struct mtk_eth * + atomic_set(&ring->free_count, MTK_DMA_SIZE - 2); + ring->next_free = &ring->dma[0]; + ring->last_free = &ring->dma[MTK_DMA_SIZE - 1]; ++ ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz)); + ring->thresh = MAX_SKB_FRAGS; + + /* make sure that all changes to the dma ring are flushed before we +@@ -1605,9 +1607,7 @@ static int mtk_tx_alloc(struct mtk_eth * + mtk_w32(eth, + ring->phys + ((MTK_DMA_SIZE - 1) * sz), + MTK_QTX_CRX_PTR); +- mtk_w32(eth, +- ring->phys + ((MTK_DMA_SIZE - 1) * sz), +- MTK_QTX_DRX_PTR); ++ mtk_w32(eth, ring->last_free_ptr, MTK_QTX_DRX_PTR); + mtk_w32(eth, (QDMA_RES_THRES << 8) | QDMA_RES_THRES, + MTK_QTX_CFG(0)); + } else { +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -624,6 +624,7 @@ struct mtk_tx_buf { + * @phys: The physical addr of tx_buf + * @next_free: Pointer to the next free descriptor + * @last_free: Pointer to the last free descriptor ++ * @last_free_ptr: Hardware pointer value of the last free descriptor + * @thresh: The threshold of minimum amount of free descriptors + * @free_count: QDMA uses a linked list. Track how many free descriptors + * are present +@@ -634,6 +635,7 @@ struct mtk_tx_ring { + dma_addr_t phys; + struct mtk_tx_dma *next_free; + struct mtk_tx_dma *last_free; ++ u32 last_free_ptr; + u16 thresh; + atomic_t free_count; + int dma_size; diff --git a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch new file mode 100644 index 000000000..1b7a0a9ac --- /dev/null +++ b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch @@ -0,0 +1,44 @@ +From: Felix Fietkau +Date: Thu, 27 Aug 2020 09:24:25 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: only read the full rx + descriptor if DMA is done + +Uncached memory access is expensive, and there is no need to access all +descriptor words if we can't process them anyway + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -772,13 +772,18 @@ static inline int mtk_max_buf_size(int f + return buf_size; + } + +-static inline void mtk_rx_get_desc(struct mtk_rx_dma *rxd, ++static inline bool mtk_rx_get_desc(struct mtk_rx_dma *rxd, + struct mtk_rx_dma *dma_rxd) + { +- rxd->rxd1 = READ_ONCE(dma_rxd->rxd1); + rxd->rxd2 = READ_ONCE(dma_rxd->rxd2); ++ if (!(rxd->rxd2 & RX_DMA_DONE)) ++ return false; ++ ++ rxd->rxd1 = READ_ONCE(dma_rxd->rxd1); + rxd->rxd3 = READ_ONCE(dma_rxd->rxd3); + rxd->rxd4 = READ_ONCE(dma_rxd->rxd4); ++ ++ return true; + } + + /* the qdma core needs scratch memory to be setup */ +@@ -1250,8 +1255,7 @@ static int mtk_poll_rx(struct napi_struc + rxd = &ring->dma[idx]; + data = ring->data[idx]; + +- mtk_rx_get_desc(&trxd, rxd); +- if (!(trxd.rxd2 & RX_DMA_DONE)) ++ if (!mtk_rx_get_desc(&trxd, rxd)) + break; + + /* find out which mac the packet come from. values start at 1 */ diff --git a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch new file mode 100644 index 000000000..2e1d2bb79 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch @@ -0,0 +1,44 @@ +From: Felix Fietkau +Date: Thu, 27 Aug 2020 09:44:43 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: unmap rx data before calling + build_skb + +Since build_skb accesses the data area (for initializing shinfo), dma unmap +needs to happen before that call + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1293,17 +1293,18 @@ static int mtk_poll_rx(struct napi_struc + goto release_desc; + } + ++ dma_unmap_single(eth->dev, trxd.rxd1, ++ ring->buf_size, DMA_FROM_DEVICE); ++ + /* receive data */ + skb = build_skb(data, ring->frag_size); + if (unlikely(!skb)) { +- skb_free_frag(new_data); ++ skb_free_frag(data); + netdev->stats.rx_dropped++; +- goto release_desc; ++ goto skip_rx; + } + skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN); + +- dma_unmap_single(eth->dev, trxd.rxd1, +- ring->buf_size, DMA_FROM_DEVICE); + pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); + skb->dev = netdev; + skb_put(skb, pktlen); +@@ -1321,6 +1322,7 @@ static int mtk_poll_rx(struct napi_struc + skb_record_rx_queue(skb, 0); + napi_gro_receive(napi, skb); + ++skip_rx: + ring->data[idx] = new_data; + rxd->rxd1 = (unsigned int)dma_addr; + diff --git a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch new file mode 100644 index 000000000..e56799eb1 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch @@ -0,0 +1,35 @@ +From: Felix Fietkau +Date: Fri, 4 Sep 2020 18:14:05 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: avoid rearming interrupt if + napi_complete returns false + +Reduces unnecessary interrupts + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1515,8 +1515,8 @@ static int mtk_napi_tx(struct napi_struc + if (status & MTK_TX_DONE_INT) + return budget; + +- napi_complete(napi); +- mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); ++ if (napi_complete(napi)) ++ mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); + + return tx_done; + } +@@ -1549,8 +1549,9 @@ poll_again: + remain_budget -= rx_done; + goto poll_again; + } +- napi_complete(napi); +- mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); ++ ++ if (napi_complete(napi)) ++ mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); + + return rx_done + budget - remain_budget; + } diff --git a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch new file mode 100644 index 000000000..36a52bbc0 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch @@ -0,0 +1,75 @@ +From: Felix Fietkau +Date: Sun, 13 Sep 2020 08:17:02 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: fix parsing packets in GDM + +When using DSA, set the special tag in GDM ingress control to allow the MAC +to parse packets properly earlier. This affects rx DMA source port reporting. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include "mtk_eth_soc.h" + +@@ -1240,12 +1241,14 @@ static int mtk_poll_rx(struct napi_struc + u8 *data, *new_data; + struct mtk_rx_dma *rxd, trxd; + int done = 0, bytes = 0; ++ bool uses_dsa = eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]); + + while (done < budget) { + struct net_device *netdev; + unsigned int pktlen; + dma_addr_t dma_addr; + int mac; ++ u16 hash; + + ring = mtk_get_rx_ring(eth); + if (unlikely(!ring)) +@@ -1259,13 +1262,13 @@ static int mtk_poll_rx(struct napi_struc + break; + + /* find out which mac the packet come from. values start at 1 */ +- if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { ++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) + mac = 0; +- } else { +- mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) & +- RX_DMA_FPORT_MASK; +- mac--; +- } ++ else if (uses_dsa) ++ mac = !(trxd.rxd4 >> 22); ++ else ++ mac = ((trxd.rxd4 >> RX_DMA_FPORT_SHIFT) & ++ RX_DMA_FPORT_MASK) - 1; + + if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT || + !eth->netdev[mac])) +@@ -2247,6 +2250,9 @@ static void mtk_gdm_config(struct mtk_et + + val |= config; + ++ if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0])) ++ val |= MTK_GDMA_SPECIAL_TAG; ++ + mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); + } + /* Reset and enable PSE */ +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -82,6 +82,7 @@ + + /* GDM Exgress Control Register */ + #define MTK_GDMA_FWD_CFG(x) (0x500 + (x * 0x1000)) ++#define MTK_GDMA_SPECIAL_TAG BIT(24) + #define MTK_GDMA_ICS_EN BIT(22) + #define MTK_GDMA_TCS_EN BIT(21) + #define MTK_GDMA_UCS_EN BIT(20) diff --git a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch new file mode 100644 index 000000000..384af9d21 --- /dev/null +++ b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch @@ -0,0 +1,23 @@ +From: Felix Fietkau +Date: Sun, 13 Sep 2020 08:27:24 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: set PPE flow hash as skb hash + if present + +This improves GRO performance + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1318,6 +1318,10 @@ static int mtk_poll_rx(struct napi_struc + skb->protocol = eth_type_trans(skb, netdev); + bytes += pktlen; + ++ hash = trxd.rxd4 & GENMASK(13, 0); ++ if (hash != GENMASK(13, 0)) ++ skb_set_hash(skb, hash, PKT_HASH_TYPE_L4); ++ + if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && + (trxd.rxd2 & RX_DMA_VTAG)) + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), diff --git a/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch b/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch index 9e72313ec..bec9363fa 100644 --- a/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch +++ b/target/linux/generic/pending-5.4/820-libata-Assign-OF-node-to-the-SCSI-device.patch @@ -41,7 +41,7 @@ ChangeLog v1->v2: #include "libata.h" #include "libata-transport.h" -@@ -4573,6 +4574,34 @@ int ata_scsi_add_hosts(struct ata_host * +@@ -4579,6 +4580,34 @@ int ata_scsi_add_hosts(struct ata_host * return rc; } @@ -76,7 +76,7 @@ ChangeLog v1->v2: void ata_scsi_scan_host(struct ata_port *ap, int sync) { int tries = 5; -@@ -4598,6 +4627,7 @@ void ata_scsi_scan_host(struct ata_port +@@ -4604,6 +4633,7 @@ void ata_scsi_scan_host(struct ata_port NULL); if (!IS_ERR(sdev)) { dev->sdev = sdev; diff --git a/target/linux/generic/pending-5.4/834-ledtrig-libata.patch b/target/linux/generic/pending-5.4/834-ledtrig-libata.patch index 783f8ea84..e9fe40514 100644 --- a/target/linux/generic/pending-5.4/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-5.4/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -5115,6 +5128,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5114,6 +5127,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = qc->hw_tag = tag; -@@ -6049,6 +6065,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -6048,6 +6064,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -6084,6 +6103,12 @@ static void ata_host_release(struct kref +@@ -6083,6 +6102,12 @@ static void ata_host_release(struct kref kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6547,7 +6572,23 @@ int ata_host_register(struct ata_host *h +@@ -6546,7 +6571,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } @@ -134,7 +134,7 @@ Signed-off-by: Daniel Golle /* * Define if arch has non-standard setup. This is a _PCI_ standard -@@ -879,6 +882,12 @@ struct ata_port { +@@ -880,6 +883,12 @@ struct ata_port { #ifdef CONFIG_ATA_ACPI struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ #endif diff --git a/target/linux/imx6/base-files/etc/board.d/02_network b/target/linux/imx6/base-files/etc/board.d/02_network index bc0531352..60df86e18 100755 --- a/target/linux/imx6/base-files/etc/board.d/02_network +++ b/target/linux/imx6/base-files/etc/board.d/02_network @@ -10,22 +10,34 @@ board=$(board_name) board_config_update case "$board" in -cubox-i |\ -gw51xx |\ -gw52xx |\ -gw5904 |\ -gw5907 |\ -gw5910 |\ -gw5912 |\ -gw5913) +gw,imx6dl-gw51xx |\ +gw,imx6dl-gw52xx |\ +gw,imx6dl-gw5904 |\ +gw,imx6dl-gw5907 |\ +gw,imx6dl-gw5910 |\ +gw,imx6dl-gw5912 |\ +gw,imx6dl-gw5913 |\ +gw,imx6q-gw51xx |\ +gw,imx6q-gw52xx |\ +gw,imx6q-gw5904 |\ +gw,imx6q-gw5907 |\ +gw,imx6q-gw5910 |\ +gw,imx6q-gw5912 |\ +gw,imx6q-gw5913 |\ +solidrun,cubox-i/dl |\ +solidrun,cubox-i/q ) ucidef_set_interface_lan 'eth0' ;; -gw53xx |\ -gw54xx |\ -gw552x) +gw,imx6dl-gw53xx |\ +gw,imx6dl-gw54xx |\ +gw,imx6dl-gw552x |\ +gw,imx6q-gw53xx |\ +gw,imx6q-gw5400-a |\ +gw,imx6q-gw54xx |\ +gw,imx6q-gw552x ) ucidef_set_interfaces_lan_wan 'eth0' 'eth1' ;; -wandboard) +wand,imx6dl-wandboard ) ucidef_set_interface_wan 'eth0' ;; esac diff --git a/target/linux/imx6/base-files/lib/imx6.sh b/target/linux/imx6/base-files/lib/imx6.sh index a9fd0cad9..46d2eeb00 100644 --- a/target/linux/imx6/base-files/lib/imx6.sh +++ b/target/linux/imx6/base-files/lib/imx6.sh @@ -2,9 +2,6 @@ # Copyright (C) 2010-2013 OpenWrt.org # -IMX6_BOARD_NAME= -IMX6_MODEL= - rootpartuuid() { local cmdline=$(cat /proc/cmdline) local bootpart=${cmdline##*root=} @@ -31,103 +28,3 @@ apalis_mount_boot() { mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null } } - -imx6_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - "Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW51XX") - name="gw51xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW52XX") - name="gw52xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW53XX") - name="gw53xx" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\ - "Gateworks Ventana GW5400-A") - name="gw54xx" - ;; - - "Gateworks Ventana i.MX6 Dual/Quad GW551X" |\ - "Gateworks Ventana i.MX6 DualLite/Solo GW551X") - name="gw551x" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW552X" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW552X") - name="gw552x" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW553X" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW553X") - name="gw553x" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5904" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5904") - name="gw5904" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5907" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5907") - name="gw5907" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5910" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5910") - name="gw5910" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5912" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5912") - name="gw5912" - ;; - - "Gateworks Ventana i.MX6 DualLite/Solo GW5913" |\ - "Gateworks Ventana i.MX6 Dual/Quad GW5913") - name="gw5913" - ;; - - "SolidRun Cubox-i Solo/DualLite" |\ - "SolidRun Cubox-i Dual/Quad") - name="cubox-i" - ;; - - "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board" |\ - "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.1") - name="apalis,ixora" - ;; - - "Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board") - name="apalis,eval" - ;; - - "Wandboard i.MX6 Dual Lite Board") - name="wandboard" - ;; - - *) - name="generic" - ;; - esac - - [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name" - [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$IMX6_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/imx6/base-files/lib/preinit/01_sysinfo b/target/linux/imx6/base-files/lib/preinit/01_sysinfo deleted file mode 100644 index 73f9e596b..000000000 --- a/target/linux/imx6/base-files/lib/preinit/01_sysinfo +++ /dev/null @@ -1,7 +0,0 @@ -do_sysinfo_imx6() { - . /lib/imx6.sh - - imx6_board_detect -} - -boot_hook_add preinit_main do_sysinfo_imx6 diff --git a/target/linux/imx6/base-files/lib/preinit/79_move_config b/target/linux/imx6/base-files/lib/preinit/79_move_config index 7e3029204..baa7ffe44 100644 --- a/target/linux/imx6/base-files/lib/preinit/79_move_config +++ b/target/linux/imx6/base-files/lib/preinit/79_move_config @@ -6,7 +6,9 @@ move_config() { local board=$(board_name) case "$board" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) if [ -b $(bootpart_from_uuid) ]; then apalis_mount_boot [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" / diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh b/target/linux/imx6/base-files/lib/upgrade/platform.sh index a090cc080..79f2a5078 100755 --- a/target/linux/imx6/base-files/lib/upgrade/platform.sh +++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh @@ -8,7 +8,9 @@ RAMFS_COPY_BIN='blkid jffs2reset' enable_image_metadata_check() { case "$(board_name)" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) REQUIRE_IMAGE_METADATA=1 ;; esac @@ -34,13 +36,39 @@ platform_check_image() { local board=$(board_name) case "$board" in - apalis*) - return 0 - ;; - *gw5*) + gw,imx6dl-gw51xx |\ + gw,imx6dl-gw52xx |\ + gw,imx6dl-gw53xx |\ + gw,imx6dl-gw54xx |\ + gw,imx6dl-gw551x |\ + gw,imx6dl-gw552x |\ + gw,imx6dl-gw553x |\ + gw,imx6dl-gw5904 |\ + gw,imx6dl-gw5907 |\ + gw,imx6dl-gw5910 |\ + gw,imx6dl-gw5912 |\ + gw,imx6dl-gw5913 |\ + gw,imx6q-gw51xx |\ + gw,imx6q-gw52xx |\ + gw,imx6q-gw53xx |\ + gw,imx6q-gw5400-a |\ + gw,imx6q-gw54xx |\ + gw,imx6q-gw551x |\ + gw,imx6q-gw552x |\ + gw,imx6q-gw553x |\ + gw,imx6q-gw5904 |\ + gw,imx6q-gw5907 |\ + gw,imx6q-gw5910 |\ + gw,imx6q-gw5912 |\ + gw,imx6q-gw5913 ) nand_do_platform_check $board $1 return $?; ;; + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) + return 0 + ;; esac echo "Sysupgrade is not yet supported on $board." @@ -51,12 +79,38 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in - apalis*) - apalis_do_upgrade "$1" - ;; - *gw5*) + gw,imx6dl-gw51xx |\ + gw,imx6dl-gw52xx |\ + gw,imx6dl-gw53xx |\ + gw,imx6dl-gw54xx |\ + gw,imx6dl-gw551x |\ + gw,imx6dl-gw552x |\ + gw,imx6dl-gw553x |\ + gw,imx6dl-gw5904 |\ + gw,imx6dl-gw5907 |\ + gw,imx6dl-gw5910 |\ + gw,imx6dl-gw5912 |\ + gw,imx6dl-gw5913 |\ + gw,imx6q-gw51xx |\ + gw,imx6q-gw52xx |\ + gw,imx6q-gw53xx |\ + gw,imx6q-gw5400-a |\ + gw,imx6q-gw54xx |\ + gw,imx6q-gw551x |\ + gw,imx6q-gw552x |\ + gw,imx6q-gw553x |\ + gw,imx6q-gw5904 |\ + gw,imx6q-gw5907 |\ + gw,imx6q-gw5910 |\ + gw,imx6q-gw5912 |\ + gw,imx6q-gw5913 ) nand_do_upgrade "$1" ;; + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) + apalis_do_upgrade "$1" + ;; esac } @@ -64,7 +118,9 @@ platform_copy_config() { local board=$(board_name) case "$board" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) apalis_copy_config ;; esac @@ -74,7 +130,9 @@ platform_pre_upgrade() { local board=$(board_name) case "$board" in - apalis*) + toradex,apalis_imx6q-eval |\ + toradex,apalis_imx6q-ixora |\ + toradex,apalis_imx6q-ixora-v1.1 ) [ -z "$UPGRADE_BACKUP" ] && { jffs2reset -y umount /overlay diff --git a/target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch b/target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch index cf5c44e68..e56ab6d0f 100644 --- a/target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch +++ b/target/linux/ipq40xx/patches-5.4/400-mmc-sdhci-sdhci-msm-use-sdhci_set_clock-instead-of-s.patch @@ -14,7 +14,7 @@ Signed-off-by: Robert Marko --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c -@@ -1730,7 +1730,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat +@@ -1746,7 +1746,7 @@ MODULE_DEVICE_TABLE(of, sdhci_msm_dt_mat static const struct sdhci_ops sdhci_msm_ops = { .reset = sdhci_reset, diff --git a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch index 17b1294fd..c37777c48 100644 --- a/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch +++ b/target/linux/ipq40xx/patches-5.4/705-net-add-qualcomm-ar40xx-phy.patch @@ -26,7 +26,7 @@ obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o --- /dev/null +++ b/drivers/net/phy/ar40xx.c -@@ -0,0 +1,2118 @@ +@@ -0,0 +1,2151 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * @@ -799,6 +799,37 @@ + return 0; +} + ++static int ++ar40xx_sw_get_port_stats(struct switch_dev *dev, int port, ++ struct switch_port_stats *stats) ++{ ++ struct ar40xx_priv *priv = swdev_to_ar40xx(dev); ++ u32 num_mibs = ARRAY_SIZE(ar40xx_mibs); ++ u64 *mib_stats; ++ int ret = 0; ++ static int last_port = AR40XX_NUM_PORTS - 1; ++ ++ mutex_lock(&priv->mib_lock); ++ ++ /* Avoid unnecessary capture */ ++ if (last_port >= port) { ++ ret = ar40xx_mib_capture(priv); ++ if (ret) ++ goto unlock; ++ } ++ last_port = port; ++ ++ ar40xx_mib_fetch_port_stat(priv, port, false); ++ ++ mib_stats = &priv->mib_stats[port * num_mibs]; ++ /* 15: TXBYTE, 31: RXGOODBYTE */ ++ stats->tx_bytes = mib_stats[15]; ++ stats->rx_bytes = mib_stats[31]; ++unlock: ++ mutex_unlock(&priv->mib_lock); ++ return ret; ++} ++ +static const struct switch_attr ar40xx_sw_attr_globals[] = { + { + .type = SWITCH_TYPE_INT, @@ -1177,6 +1208,7 @@ + /* disable phy internal loopback */ + mdiobus_write(bus, 0x1f, 0x10, 0x6860); + mdiobus_write(bus, 0x1f, 0x0, 0x9040); ++ ar40xx_phy_mmd_write(priv, 0x1f, 7, 0x8076, 0x0670); /* 1000_LED_n */ + + for (phy = 0; phy < AR40XX_NUM_PORTS - 1; phy++) { + /* disable mac loop back */ @@ -1809,6 +1841,7 @@ + .apply_config = ar40xx_sw_hw_apply, + .reset_switch = ar40xx_sw_reset_switch, + .get_port_link = ar40xx_sw_get_port_link, ++ .get_port_stats = ar40xx_sw_get_port_stats, +}; + +/* Start of phy driver support */ diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4 index 263d153dd..568c5df39 100644 --- a/target/linux/ipq806x/config-5.4 +++ b/target/linux/ipq806x/config-5.4 @@ -68,6 +68,7 @@ CONFIG_ARM_QCOM_CPUIDLE=y CONFIG_ARM_THUMB=y CONFIG_ARM_UNWIND=y CONFIG_ARM_VIRT_EXT=y +CONFIG_AT803X_PHY=y CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_MQ_PCI=y diff --git a/target/linux/ipq806x/patches-5.4/093-1-v5.8-ipq806x-PCI-qcom-Add-missing-ipq806x-clocks-in-PCIe-driver.patch b/target/linux/ipq806x/patches-5.4/093-1-v5.8-ipq806x-PCI-qcom-Add-missing-ipq806x-clocks-in-PCIe-driver.patch deleted file mode 100644 index 6098cb8fe..000000000 --- a/target/linux/ipq806x/patches-5.4/093-1-v5.8-ipq806x-PCI-qcom-Add-missing-ipq806x-clocks-in-PCIe-driver.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 8b6f0330b5f9a7543356bfa9e76d580f03aa2c1e Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -Date: Mon, 15 Jun 2020 23:05:57 +0200 -Subject: PCI: qcom: Add missing ipq806x clocks in PCIe driver - -Aux and Ref clk are missing in PCIe qcom driver. Add support for this -optional clks for ipq8064/apq8064 SoC. - -Link: https://lore.kernel.org/r/20200615210608.21469-2-ansuelsmth@gmail.com -Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") -Signed-off-by: Sham Muthayyan -Signed-off-by: Ansuel Smith -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Rob Herring -Acked-by: Stanimir Varbanov ---- - drivers/pci/controller/dwc/pcie-qcom.c | 38 +++++++++++++++++++++++++++++----- - 1 file changed, 33 insertions(+), 5 deletions(-) - ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -103,6 +103,8 @@ struct qcom_pcie_resources_2_1_0 { - struct clk *iface_clk; - struct clk *core_clk; - struct clk *phy_clk; -+ struct clk *aux_clk; -+ struct clk *ref_clk; - struct reset_control *pci_reset; - struct reset_control *axi_reset; - struct reset_control *ahb_reset; -@@ -253,6 +255,14 @@ static int qcom_pcie_get_resources_2_1_0 - if (IS_ERR(res->phy_clk)) - return PTR_ERR(res->phy_clk); - -+ res->aux_clk = devm_clk_get_optional(dev, "aux"); -+ if (IS_ERR(res->aux_clk)) -+ return PTR_ERR(res->aux_clk); -+ -+ res->ref_clk = devm_clk_get_optional(dev, "ref"); -+ if (IS_ERR(res->ref_clk)) -+ return PTR_ERR(res->ref_clk); -+ - res->pci_reset = devm_reset_control_get_exclusive(dev, "pci"); - if (IS_ERR(res->pci_reset)) - return PTR_ERR(res->pci_reset); -@@ -285,6 +295,8 @@ static void qcom_pcie_deinit_2_1_0(struc - clk_disable_unprepare(res->iface_clk); - clk_disable_unprepare(res->core_clk); - clk_disable_unprepare(res->phy_clk); -+ clk_disable_unprepare(res->aux_clk); -+ clk_disable_unprepare(res->ref_clk); - regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); - } - -@@ -315,16 +327,28 @@ static int qcom_pcie_init_2_1_0(struct q - goto err_assert_ahb; - } - -+ ret = clk_prepare_enable(res->core_clk); -+ if (ret) { -+ dev_err(dev, "cannot prepare/enable core clock\n"); -+ goto err_clk_core; -+ } -+ - ret = clk_prepare_enable(res->phy_clk); - if (ret) { - dev_err(dev, "cannot prepare/enable phy clock\n"); - goto err_clk_phy; - } - -- ret = clk_prepare_enable(res->core_clk); -+ ret = clk_prepare_enable(res->aux_clk); - if (ret) { -- dev_err(dev, "cannot prepare/enable core clock\n"); -- goto err_clk_core; -+ dev_err(dev, "cannot prepare/enable aux clock\n"); -+ goto err_clk_aux; -+ } -+ -+ ret = clk_prepare_enable(res->ref_clk); -+ if (ret) { -+ dev_err(dev, "cannot prepare/enable ref clock\n"); -+ goto err_clk_ref; - } - - ret = reset_control_deassert(res->ahb_reset); -@@ -400,10 +424,14 @@ static int qcom_pcie_init_2_1_0(struct q - return 0; - - err_deassert_ahb: -- clk_disable_unprepare(res->core_clk); --err_clk_core: -+ clk_disable_unprepare(res->ref_clk); -+err_clk_ref: -+ clk_disable_unprepare(res->aux_clk); -+err_clk_aux: - clk_disable_unprepare(res->phy_clk); - err_clk_phy: -+ clk_disable_unprepare(res->core_clk); -+err_clk_core: - clk_disable_unprepare(res->iface_clk); - err_assert_ahb: - regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); diff --git a/target/linux/ipq806x/patches-5.4/093-2-v5.8-ipq806x-PCI-qcom-Change-duplicate-PCI-reset-to-phy-reset.patch b/target/linux/ipq806x/patches-5.4/093-2-v5.8-ipq806x-PCI-qcom-Change-duplicate-PCI-reset-to-phy-reset.patch deleted file mode 100644 index 960041971..000000000 --- a/target/linux/ipq806x/patches-5.4/093-2-v5.8-ipq806x-PCI-qcom-Change-duplicate-PCI-reset-to-phy-reset.patch +++ /dev/null @@ -1,72 +0,0 @@ -From dd58318c019f10bc94db36df66af6c55d4c0cbba Mon Sep 17 00:00:00 2001 -From: Abhishek Sahu -Date: Mon, 15 Jun 2020 23:05:59 +0200 -Subject: PCI: qcom: Change duplicate PCI reset to phy reset - -The deinit issues reset_control_assert for PCI twice and does not contain -phy reset. - -Link: https://lore.kernel.org/r/20200615210608.21469-4-ansuelsmth@gmail.com -Signed-off-by: Abhishek Sahu -Signed-off-by: Ansuel Smith -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Rob Herring -Acked-by: Stanimir Varbanov ---- - drivers/pci/controller/dwc/pcie-qcom.c | 18 ++++++++---------- - 1 file changed, 8 insertions(+), 10 deletions(-) - ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -287,14 +287,14 @@ static void qcom_pcie_deinit_2_1_0(struc - { - struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; - -+ clk_disable_unprepare(res->phy_clk); - reset_control_assert(res->pci_reset); - reset_control_assert(res->axi_reset); - reset_control_assert(res->ahb_reset); - reset_control_assert(res->por_reset); -- reset_control_assert(res->pci_reset); -+ reset_control_assert(res->phy_reset); - clk_disable_unprepare(res->iface_clk); - clk_disable_unprepare(res->core_clk); -- clk_disable_unprepare(res->phy_clk); - clk_disable_unprepare(res->aux_clk); - clk_disable_unprepare(res->ref_clk); - regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); -@@ -333,12 +333,6 @@ static int qcom_pcie_init_2_1_0(struct q - goto err_clk_core; - } - -- ret = clk_prepare_enable(res->phy_clk); -- if (ret) { -- dev_err(dev, "cannot prepare/enable phy clock\n"); -- goto err_clk_phy; -- } -- - ret = clk_prepare_enable(res->aux_clk); - if (ret) { - dev_err(dev, "cannot prepare/enable aux clock\n"); -@@ -411,6 +405,12 @@ static int qcom_pcie_init_2_1_0(struct q - return ret; - } - -+ ret = clk_prepare_enable(res->phy_clk); -+ if (ret) { -+ dev_err(dev, "cannot prepare/enable phy clock\n"); -+ goto err_deassert_ahb; -+ } -+ - /* wait for clock acquisition */ - usleep_range(1000, 1500); - -@@ -428,8 +428,6 @@ err_deassert_ahb: - err_clk_ref: - clk_disable_unprepare(res->aux_clk); - err_clk_aux: -- clk_disable_unprepare(res->phy_clk); --err_clk_phy: - clk_disable_unprepare(res->core_clk); - err_clk_core: - clk_disable_unprepare(res->iface_clk); diff --git a/target/linux/ipq806x/patches-5.4/093-3-v5.8-ipq806x-PCI-qcom-Add-missing-reset-for-ipq806x.patch b/target/linux/ipq806x/patches-5.4/093-3-v5.8-ipq806x-PCI-qcom-Add-missing-reset-for-ipq806x.patch deleted file mode 100644 index fe31e55de..000000000 --- a/target/linux/ipq806x/patches-5.4/093-3-v5.8-ipq806x-PCI-qcom-Add-missing-reset-for-ipq806x.patch +++ /dev/null @@ -1,62 +0,0 @@ -From ee367e2cdd2202b5714982739e684543cd2cee0e Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -Date: Mon, 15 Jun 2020 23:06:00 +0200 -Subject: PCI: qcom: Add missing reset for ipq806x - -Add missing ext reset used by ipq8064 SoC in PCIe qcom driver. - -Link: https://lore.kernel.org/r/20200615210608.21469-5-ansuelsmth@gmail.com -Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") -Signed-off-by: Sham Muthayyan -Signed-off-by: Ansuel Smith -Signed-off-by: Lorenzo Pieralisi -Reviewed-by: Rob Herring -Reviewed-by: Philipp Zabel -Acked-by: Stanimir Varbanov -Cc: stable@vger.kernel.org # v4.5+ ---- - drivers/pci/controller/dwc/pcie-qcom.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/drivers/pci/controller/dwc/pcie-qcom.c -+++ b/drivers/pci/controller/dwc/pcie-qcom.c -@@ -110,6 +110,7 @@ struct qcom_pcie_resources_2_1_0 { - struct reset_control *ahb_reset; - struct reset_control *por_reset; - struct reset_control *phy_reset; -+ struct reset_control *ext_reset; - struct regulator_bulk_data supplies[QCOM_PCIE_2_1_0_MAX_SUPPLY]; - }; - -@@ -279,6 +280,10 @@ static int qcom_pcie_get_resources_2_1_0 - if (IS_ERR(res->por_reset)) - return PTR_ERR(res->por_reset); - -+ res->ext_reset = devm_reset_control_get_optional_exclusive(dev, "ext"); -+ if (IS_ERR(res->ext_reset)) -+ return PTR_ERR(res->ext_reset); -+ - res->phy_reset = devm_reset_control_get_exclusive(dev, "phy"); - return PTR_ERR_OR_ZERO(res->phy_reset); - } -@@ -292,6 +297,7 @@ static void qcom_pcie_deinit_2_1_0(struc - reset_control_assert(res->axi_reset); - reset_control_assert(res->ahb_reset); - reset_control_assert(res->por_reset); -+ reset_control_assert(res->ext_reset); - reset_control_assert(res->phy_reset); - clk_disable_unprepare(res->iface_clk); - clk_disable_unprepare(res->core_clk); -@@ -351,6 +357,12 @@ static int qcom_pcie_init_2_1_0(struct q - goto err_deassert_ahb; - } - -+ ret = reset_control_deassert(res->ext_reset); -+ if (ret) { -+ dev_err(dev, "cannot deassert ext reset\n"); -+ goto err_deassert_ahb; -+ } -+ - /* enable PCIe clocks and resets */ - val = readl(pcie->parf + PCIE20_PARF_PHY_CTRL); - val &= ~BIT(0); diff --git a/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch b/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch new file mode 100644 index 000000000..f75f99490 --- /dev/null +++ b/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi +@@ -865,6 +865,41 @@ + reg = <0x12100000 0x10000>; + }; + ++ gsbi1: gsbi@12440000 { ++ compatible = "qcom,gsbi-v1.0.0"; ++ cell-index = <1>; ++ reg = <0x12440000 0x100>; ++ clocks = <&gcc GSBI1_H_CLK>; ++ clock-names = "iface"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ranges; ++ status = "disabled"; ++ ++ syscon-tcsr = <&tcsr>; ++ ++ gsbi1_serial: serial@12450000 { ++ compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; ++ reg = <0x12450000 0x100>, ++ <0x12400000 0x03>; ++ interrupts = ; ++ clocks = <&gcc GSBI1_UART_CLK>, <&gcc GSBI1_H_CLK>; ++ clock-names = "core", "iface"; ++ status = "disabled"; ++ }; ++ ++ gsbi1_i2c: i2c@12460000 { ++ compatible = "qcom,i2c-qup-v1.1.1"; ++ reg = <0x12460000 0x1000>; ++ interrupts = ; ++ clocks = <&gcc GSBI1_QUP_CLK>, <&gcc GSBI1_H_CLK>; ++ clock-names = "core", "iface"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; ++ }; ++ + gsbi2: gsbi@12480000 { + compatible = "qcom,gsbi-v1.0.0"; + cell-index = <2>; diff --git a/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch b/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch new file mode 100644 index 000000000..3cc032fdd --- /dev/null +++ b/target/linux/ipq806x/patches-5.4/997-device_tree_cmdline.patch @@ -0,0 +1,12 @@ +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -1059,6 +1059,9 @@ int __init early_init_dt_scan_chosen(uns + p = of_get_flat_dt_prop(node, "bootargs", &l); + if (p != NULL && l > 0) + strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); ++ p = of_get_flat_dt_prop(node, "bootargs-append", &l); ++ if (p != NULL && l > 0) ++ strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE)); + + /* + * CONFIG_CMDLINE is meant to be a default in case nothing else diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version deleted file mode 100644 index d7f8488e8..000000000 --- a/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2020 OpenWrt.org -# - -. /lib/functions.sh - -case "$(board_name)" in - linksys,e4200-v2|\ - linksys,ea3500|\ - linksys,ea4500) - uci set system.@system[0].compat_version="1.1" - uci commit system - ;; -esac - -exit 0 diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts index 851f31671..b41243d8d 100644 --- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500 * diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-nsa310s.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-nsa310s.dts index fe892ffdc..a2a718077 100644 --- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-nsa310s.dts +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-nsa310s.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /dts-v1/; #include "kirkwood.dtsi" diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 89042d172..0816add47 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -12,8 +12,7 @@ KERNEL_LOADADDR:=0x8000 define Device/dsa-migration DEVICE_COMPAT_VERSION := 1.1 - DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA \ - (early adopters with DSA already set up may just force-flash keeping existing config) + DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA endef define Device/Default diff --git a/target/linux/lantiq/ase/base-files/etc/board.d/02_network b/target/linux/lantiq/ase/base-files/etc/board.d/02_network index 0bda3e476..deddba240 100755 --- a/target/linux/lantiq/ase/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/ase/base-files/etc/board.d/02_network @@ -37,7 +37,7 @@ lantiq_setup_macs() case "$board" in allnet,all0333cj) - lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ;; esac diff --git a/target/linux/lantiq/ase/config-5.4 b/target/linux/lantiq/ase/config-5.4 index 455cd54d1..070b4543e 100644 --- a/target/linux/lantiq/ase/config-5.4 +++ b/target/linux/lantiq/ase/config-5.4 @@ -14,8 +14,6 @@ CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_LANTIQ_ETOP=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_NLS=y -# CONFIG_PSB6970_PHY is not set -# CONFIG_RTL8366_SMI is not set CONFIG_SGL_ALLOC=y CONFIG_SOC_AMAZON_SE=y # CONFIG_SOC_XWAY is not set diff --git a/target/linux/lantiq/config-5.4 b/target/linux/lantiq/config-5.4 index 6f3b193cc..a1c259b00 100644 --- a/target/linux/lantiq/config-5.4 +++ b/target/linux/lantiq/config-5.4 @@ -194,13 +194,10 @@ CONFIG_PINCTRL_LANTIQ=y CONFIG_PINCTRL_XWAY=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_SYSCON=y -CONFIG_PSB6970_PHY=y CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RESET_LANTIQ=y -CONFIG_RTL8366RB_PHY=y -CONFIG_RTL8366_SMI=y # CONFIG_SERIAL_8250 is not set CONFIG_SERIAL_LANTIQ=y # CONFIG_SOC_AMAZON_SE is not set diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts index c5dd1600f..8bb3e3cbd 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts @@ -96,7 +96,7 @@ }; partition@3ff200 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x3ff200 0xc00>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts index 044ae2b41..9c1ebf42f 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts @@ -148,7 +148,7 @@ read-only; }; partition@64000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x64000 0x004000>; }; ath9k_cal: partition@68000 { diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts index 5419215dc..98ce11c25 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts @@ -162,7 +162,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi index a3dbbbdfa..64fae44e7 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi @@ -158,7 +158,7 @@ partition@10000 { reg = <0x10000 0x10000>; - label = "uboot-env"; + label = "u-boot-env"; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts index 9b640e032..95df8ed04 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts @@ -148,7 +148,7 @@ }; partition@20000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x20000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts index 267788319..81ce53993 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts @@ -144,7 +144,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts index 19a44d5f6..89a7adcd6 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts @@ -178,7 +178,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi index dcae06d89..39e02d072 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi @@ -145,7 +145,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; /* 64 KB */ read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts index 8e5301ddc..42eb12c80 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts @@ -155,7 +155,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts index b59477cb1..02ec8705a 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts @@ -167,7 +167,7 @@ }; partition@20000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x20000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts index cceb42164..b1c1b8be8 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts @@ -116,7 +116,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts index eecff4bb0..096180ac9 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts @@ -185,7 +185,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts index 9e4216033..854648ddc 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts @@ -123,7 +123,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts index 063be778d..b48559d3c 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts @@ -140,7 +140,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts index b5e884557..3f4112318 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts @@ -172,7 +172,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts index 34b541af9..79019b635 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts @@ -167,7 +167,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts index d673c9b20..c07497615 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts @@ -109,7 +109,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts index 5db5f314d..a3cb13201 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts @@ -179,7 +179,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts index ec90a2bef..60fd8bb91 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts @@ -192,7 +192,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x30000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts index 67b0f9631..f40d27841 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts @@ -62,7 +62,7 @@ }; partition@20000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x20000 0x20000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts index 40886feec..9f2d8ec33 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts @@ -154,7 +154,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x10000>; /* 64KB */ }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts index 1afc74900..cba2d7eb8 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts @@ -49,7 +49,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; /* 64 KB */ }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts index 0072f7e2b..4a023d1e3 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts @@ -77,7 +77,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x30000 0x10000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts index 2107da543..d2f5c8c16 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts @@ -27,7 +27,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x40000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts index 56d0fe0bc..5e4084f24 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts @@ -28,7 +28,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x40000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi index b35f70b64..f741ea2b7 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi @@ -24,7 +24,7 @@ partition@40000 { reg = <0x40000 0x80000>; - label = "uboot_env"; + label = "u-boot-env"; }; partition@c0000 { diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts index 3d10f582b..b9be5d55d 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts @@ -136,7 +136,7 @@ }; partition@30000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x30000 0x10000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts index d6c521cfe..8a4a694c4 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts @@ -203,7 +203,7 @@ }; partition@60000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x60000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts index e074147d6..ba1a01e36 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts @@ -136,7 +136,7 @@ }; partition@7f0000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x7f0000 0x10000>; }; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts index 613ff3782..bbe3b0ed4 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts @@ -17,7 +17,7 @@ }; partition@60000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x60000 0x20000>; /* 128 KiB */ read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts index 2121fbf41..e9606e19a 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts @@ -16,7 +16,7 @@ read-only; }; partition@60000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x60000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts index f6a2d9f6a..a506b7dd1 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts @@ -242,7 +242,7 @@ read-only; }; partition@a0000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0xa0000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts index 4631ad4ff..61be0ca2e 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts @@ -281,7 +281,7 @@ partition@ff0000 { reg = <0xff0000 0x2000>; - label = "ubootconfig"; + label = "u-boot-env"; }; partition@ff3000 { diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts index 585521459..7a7ab1cd4 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts @@ -33,7 +33,7 @@ }; partition@100000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x100000 0x40000>; /* 256 KB */ }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts index c204c5e09..004ce6f00 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts @@ -24,7 +24,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts index cdba656e4..d6dd5edfe 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts @@ -160,7 +160,7 @@ partition@7f0000 { reg = <0x7f0000 0x2000>; - label = "ubootconfig"; + label = "u-boot-env"; read-only; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts index 4d7aac325..fc19468f7 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts @@ -43,7 +43,7 @@ reg = <0x00000 0x40000>; }; partition@40000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; }; partition@60000 { diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts index 7da153380..46a813785 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts @@ -35,7 +35,7 @@ read-only; }; partition@50000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x50000 0x10000>; }; partition@60000 { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts index c5dd1600f..8bb3e3cbd 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts @@ -96,7 +96,7 @@ }; partition@3ff200 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x3ff200 0xc00>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts index 044ae2b41..9c1ebf42f 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts @@ -148,7 +148,7 @@ read-only; }; partition@64000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x64000 0x004000>; }; ath9k_cal: partition@68000 { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts index 5419215dc..98ce11c25 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts @@ -162,7 +162,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi index a3dbbbdfa..64fae44e7 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_netgear_dgn3500.dtsi @@ -158,7 +158,7 @@ partition@10000 { reg = <0x10000 0x10000>; - label = "uboot-env"; + label = "u-boot-env"; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts index 9b640e032..95df8ed04 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts @@ -148,7 +148,7 @@ }; partition@20000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x20000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts index 267788319..81ce53993 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts @@ -144,7 +144,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts index 19a44d5f6..89a7adcd6 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts @@ -178,7 +178,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi index 3ed49e4a6..48fe88fea 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi @@ -145,7 +145,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; /* 64 KB */ read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts index 8e5301ddc..42eb12c80 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts @@ -155,7 +155,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts index b59477cb1..02ec8705a 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts @@ -167,7 +167,7 @@ }; partition@20000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x20000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts index fb240b2ed..ac0af44a9 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts @@ -116,7 +116,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts index eecff4bb0..096180ac9 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts @@ -185,7 +185,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts index 9e4216033..854648ddc 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts @@ -123,7 +123,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts index 063be778d..b48559d3c 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts @@ -140,7 +140,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts index 5afc15703..e0e47681b 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts @@ -172,7 +172,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts index 34b541af9..79019b635 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts @@ -167,7 +167,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts index 437fecec9..fd92ed49c 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts @@ -109,7 +109,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts index 5db5f314d..a3cb13201 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts @@ -179,7 +179,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts index ec90a2bef..60fd8bb91 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts @@ -192,7 +192,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x30000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts index 67b0f9631..f40d27841 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts @@ -62,7 +62,7 @@ }; partition@20000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x20000 0x20000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts index 40886feec..9f2d8ec33 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts @@ -154,7 +154,7 @@ }; partition@40000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x10000>; /* 64KB */ }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts index 1afc74900..cba2d7eb8 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_lantiq_easy50712.dts @@ -49,7 +49,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; /* 64 KB */ }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts index 0072f7e2b..4a023d1e3 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts @@ -77,7 +77,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x30000 0x10000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts index 13f9f82b1..06f5110bc 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nand.dts @@ -26,7 +26,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x40000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts index 56d0fe0bc..5e4084f24 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_lantiq_easy98000-nor.dts @@ -28,7 +28,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x40000 0x40000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi index 688b7da44..2ed15a8dd 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/falcon_sflash-16m.dtsi @@ -23,7 +23,7 @@ partition@40000 { reg = <0x40000 0x80000>; - label = "uboot_env"; + label = "u-boot-env"; }; partition@c0000 { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts index 3d10f582b..b9be5d55d 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts @@ -136,7 +136,7 @@ }; partition@30000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x30000 0x10000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts index 793818471..d9cdf2234 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts @@ -203,7 +203,7 @@ }; partition@60000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x60000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts index e074147d6..ba1a01e36 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts @@ -136,7 +136,7 @@ }; partition@7f0000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x7f0000 0x10000>; }; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts index 613ff3782..bbe3b0ed4 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22-nor.dts @@ -17,7 +17,7 @@ }; partition@60000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x60000 0x20000>; /* 128 KiB */ read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts index 2121fbf41..e9606e19a 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519-nor.dts @@ -16,7 +16,7 @@ read-only; }; partition@60000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x60000 0x10000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7412.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7412.dts index fe02d53c8..85fb3368c 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7412.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7412.dts @@ -32,13 +32,13 @@ keys { compatible = "gpio-keys-polled"; poll-interval = <100>; - + wps { label = "wps"; gpios = <&gpio 1 GPIO_ACTIVE_LOW>; linux,code = ; }; - + dect { label = "dect"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; @@ -54,27 +54,27 @@ gpios = <&gpio 6 GPIO_ACTIVE_LOW>; default-state = "keep"; }; - + power_red: power_red { label = "fritz7412:red:power"; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; }; - + fon { label = "fritz7412:green:fon"; gpios = <&gpio 34 GPIO_ACTIVE_LOW>; }; - + dect { label = "fritz7412:green:dect"; gpios = <&gpio 15 GPIO_ACTIVE_LOW>; }; - + wifi: wifi { label = "fritz7412:green:wifi"; gpios = <&gpio 0 GPIO_ACTIVE_LOW>; }; - + info: info { label = "fritz7412:green:info"; gpios = <&gpio 35 GPIO_ACTIVE_LOW>; @@ -205,7 +205,7 @@ #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-mdio"; - + phy11: ethernet-phy@11 { reg = <0x11>; compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts index f6a2d9f6a..a506b7dd1 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts @@ -242,7 +242,7 @@ read-only; }; partition@a0000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0xa0000 0x20000>; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts index 7709a86e5..410992d51 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts @@ -281,7 +281,7 @@ partition@ff0000 { reg = <0xff0000 0x2000>; - label = "ubootconfig"; + label = "u-boot-env"; }; partition@ff3000 { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts index 585521459..7a7ab1cd4 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts @@ -33,7 +33,7 @@ }; partition@100000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x100000 0x40000>; /* 256 KB */ }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts index c204c5e09..004ce6f00 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nor.dts @@ -24,7 +24,7 @@ }; partition@10000 { - label = "uboot_env"; + label = "u-boot-env"; reg = <0x10000 0x10000>; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts index cdba656e4..d6dd5edfe 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_netgear_dm200.dts @@ -160,7 +160,7 @@ partition@7f0000 { reg = <0x7f0000 0x2000>; - label = "ubootconfig"; + label = "u-boot-env"; read-only; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dts index 98f228257..512db47e7 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dts @@ -88,5 +88,5 @@ label = "vr200:blue:wps"; gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; - }; + }; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200v.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200v.dts index 2e25a72a8..d042714a5 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200v.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200v.dts @@ -88,7 +88,7 @@ label = "vr200v:blue:phone"; gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; - }; + }; }; &vmmc { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts index 4d7aac325..fc19468f7 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts @@ -43,7 +43,7 @@ reg = <0x00000 0x40000>; }; partition@40000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x40000 0x20000>; }; partition@60000 { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts index 7da153380..46a813785 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f3.dts @@ -35,7 +35,7 @@ read-only; }; partition@50000 { - label = "uboot-env"; + label = "u-boot-env"; reg = <0x50000 0x10000>; }; partition@60000 { diff --git a/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch index fa0f136cb..822d90524 100644 --- a/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-5.4/0152-lantiq-VPE.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2376,6 +2376,12 @@ config MIPS_VPE_LOADER +@@ -2377,6 +2377,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network index 533128825..07bcdf9f8 100755 --- a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network @@ -101,8 +101,8 @@ lantiq_setup_macs() case "$board" in alphanetworks,asl56026) - lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) - wan_mac=$(mtd_get_mac_ascii uboot_env wanmac) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanmac) ;; arcadyan,arv7519rw22) wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0x16)" 1) @@ -112,7 +112,7 @@ lantiq_setup_macs() lantiq,easy80920-nor|\ zyxel,p-2812hnu-f1|\ zyxel,p-2812hnu-f3) - lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ;; arcadyan,vgv7510kw22-brn|\ @@ -145,7 +145,7 @@ lantiq_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) ;; buffalo,wbmr-300hpd) - lan_mac=$(mtd_get_mac_ascii ubootconfig ethaddr) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac="$lan_mac" ;; netgear,dm200) diff --git a/target/linux/lantiq/xway/base-files/etc/board.d/02_network b/target/linux/lantiq/xway/base-files/etc/board.d/02_network index 54ace3989..9813b62c1 100755 --- a/target/linux/lantiq/xway/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/xway/base-files/etc/board.d/02_network @@ -90,7 +90,7 @@ lantiq_setup_macs() bt,homehub-v3a|\ netgear,dgn3500|\ netgear,dgn3500b) - lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ;; arcadyan,arv7506pw11) diff --git a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 1f12da855..9aea4eed6 100644 --- a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -39,11 +39,11 @@ case "$FIRMWARE" in ;; bt,homehub-v3a) caldata_extract_swap "art-copy" 0x0 0x1000 - ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot_env ethaddr) +2) 0x10c + ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) 0x10c ;; netgear,dgn3500|netgear,dgn3500b) caldata_extract "calibration" 0xf000 0x1000 - ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 0x20c + ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) 0x20c ;; avm,fritz7312|avm,fritz7320) caldata_extract "urlader" 0x985 0x1000 diff --git a/target/linux/layerscape/patches-5.4/701-net-0408-sdk_fman-fix-CONFIG_COMPAT-leak-during-headers-insta.patch b/target/linux/layerscape/patches-5.4/701-net-0408-sdk_fman-fix-CONFIG_COMPAT-leak-during-headers-insta.patch new file mode 100644 index 000000000..bff431c52 --- /dev/null +++ b/target/linux/layerscape/patches-5.4/701-net-0408-sdk_fman-fix-CONFIG_COMPAT-leak-during-headers-insta.patch @@ -0,0 +1,516 @@ +From 7837219f354524f6c2c9332a6a5aa616c28f53a9 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 20 Aug 2020 18:38:49 +0800 +Subject: [PATCH] sdk_fman: fix CONFIG_COMPAT leak during headers installing + +This patch is to fix CONFIG_COMPAT leak during headers installing +by replacing CONFIG_COMPAT kernel option with FM_COMPAT instead. + +Signed-off-by: Yangbo Lu +--- + .../net/ethernet/freescale/sdk_fman/ncsw_config.mk | 5 ++ + include/uapi/linux/fmd/Peripherals/fm_ioctls.h | 16 ++--- + include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h | 72 +++++++++++----------- + .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h | 14 ++--- + .../uapi/linux/fmd/Peripherals/fm_test_ioctls.h | 4 +- + 5 files changed, 58 insertions(+), 53 deletions(-) + +--- a/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk ++++ b/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk +@@ -44,6 +44,11 @@ ifdef CONFIG_FMAN_ARM + ccflags-y += -I$(FMAN)/inc/integrations/LS1043 + endif + ++# FM_COMPAT is used in kernel headers in case of kernel option leaking ++ifeq ("$(CONFIG_COMPAT)", "y") ++ccflags-y += -DFM_COMPAT ++endif ++ + ccflags-y += -I$(FMAN)/src/inc + ccflags-y += -I$(FMAN)/src/inc/system + ccflags-y += -I$(FMAN)/src/inc/wrapper +--- a/include/uapi/linux/fmd/Peripherals/fm_ioctls.h ++++ b/include/uapi/linux/fmd/Peripherals/fm_ioctls.h +@@ -434,7 +434,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Retval Handle to FM VSP object, or NULL for Failure. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_CONFIG_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_compat_fm_vsp_params_t) + #endif + #define FM_IOC_VSP_CONFIG _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(8), ioc_fm_vsp_params_t) +@@ -448,7 +448,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Return E_OK on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_INIT_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_compat_fm_obj_t) + #endif + #define FM_IOC_VSP_INIT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(9), ioc_fm_obj_t) +@@ -464,7 +464,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Return E_OK on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_FREE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_compat_fm_obj_t) + #endif + #define FM_IOC_VSP_FREE _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(10), ioc_fm_obj_t) +@@ -482,7 +482,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Cautions Allowed only following FM_VSP_Config() and before FM_VSP_Init(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_CONFIG_POOL_DEPLETION_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(11), ioc_compat_fm_buf_pool_depletion_params_t) + #endif + #define FM_IOC_VSP_CONFIG_POOL_DEPLETION _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(11), ioc_fm_buf_pool_depletion_params_t) +@@ -512,7 +512,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Cautions Allowed only following FM_VSP_Config() and before FM_VSP_Init(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), ioc_compat_fm_buffer_prefix_content_params_t) + #endif + #define FM_IOC_VSP_CONFIG_BUFFER_PREFIX_CONTENT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(12), ioc_fm_buffer_prefix_content_params_t) +@@ -530,7 +530,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Cautions Allowed only following FM_VSP_Config() and before FM_VSP_Init(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_CONFIG_NO_SG_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(13), ioc_compat_fm_vsp_config_no_sg_params_t) + #endif + #define FM_IOC_VSP_CONFIG_NO_SG _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(13), ioc_fm_vsp_config_no_sg_params_t) +@@ -554,7 +554,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Cautions Allowed only following FM_VSP_Init(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_VSP_GET_BUFFER_PRS_RESULT_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(14), ioc_compat_fm_vsp_prs_result_params_t) + #endif + #define FM_IOC_VSP_GET_BUFFER_PRS_RESULT _IOWR(FM_IOC_TYPE_BASE, FM_IOC_NUM(14), ioc_fm_vsp_prs_result_params_t) +@@ -612,7 +612,7 @@ typedef struct ioc_fm_ctrl_mon_counters_ + + @Cautions Allowed only following FM_Init(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_IOC_CTRL_MON_GET_COUNTERS_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(17), ioc_compat_fm_ctrl_mon_counters_params_t) + #endif + #define FM_IOC_CTRL_MON_GET_COUNTERS _IOW(FM_IOC_TYPE_BASE, FM_IOC_NUM(17), ioc_fm_ctrl_mon_counters_params_t) +--- a/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h ++++ b/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h +@@ -312,7 +312,7 @@ typedef struct ioc_fm_pcd_kg_dflt_value_ + + @Cautions Allowed only when PCD is disabled. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_PRS_LOAD_SW_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(3), ioc_compat_fm_pcd_prs_sw_params_t) + #endif + #define FM_PCD_IOC_PRS_LOAD_SW _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(3), ioc_fm_pcd_prs_sw_params_t) +@@ -385,7 +385,7 @@ typedef struct ioc_fm_pcd_kg_dflt_value_ + + @Cautions Allowed only following FM_PCD_Init() & FM_PCD_KgSchemeSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_KG_SCHEME_GET_CNTR_COMPAT _IOR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(4), ioc_compat_fm_pcd_kg_scheme_spc_t) + #endif + #define FM_PCD_IOC_KG_SCHEME_GET_CNTR _IOR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(4), ioc_fm_pcd_kg_scheme_spc_t) +@@ -2413,7 +2413,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only following FM_PCD_MatchTableSet(). + *//***************************************************************************/ + +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_GET_KEY_STAT_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(12), ioc_compat_fm_pcd_cc_tbl_get_stats_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_GET_KEY_STAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(12), ioc_fm_pcd_cc_tbl_get_stats_t) +@@ -2439,7 +2439,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only following FM_PCD_MatchTableSet(). + *//***************************************************************************/ + +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(13), ioc_compat_fm_pcd_cc_tbl_get_stats_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(13), ioc_fm_pcd_cc_tbl_get_stats_t) +@@ -2463,7 +2463,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only following FM_PCD_HashTableSet(). + *//***************************************************************************/ + +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(14), ioc_compat_fm_pcd_cc_tbl_get_stats_t) + #endif + #define FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(14), ioc_fm_pcd_cc_tbl_get_stats_t) +@@ -2511,7 +2511,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(20), ioc_compat_fm_pcd_net_env_params_t) + #endif + #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(20), ioc_fm_pcd_net_env_params_t) +@@ -2525,7 +2525,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(21), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_NET_ENV_CHARACTERISTICS_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(21), ioc_fm_obj_t) +@@ -2544,7 +2544,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_KG_SCHEME_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(24), ioc_compat_fm_pcd_kg_scheme_params_t) + #endif + #define FM_PCD_IOC_KG_SCHEME_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(24), ioc_fm_pcd_kg_scheme_params_t) +@@ -2558,7 +2558,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_KG_SCHEME_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(25), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_KG_SCHEME_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(25), ioc_fm_obj_t) +@@ -2575,7 +2575,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_CC_ROOT_BUILD_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(26), compat_uptr_t) + #endif + #define FM_PCD_IOC_CC_ROOT_BUILD _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(26), void *) /* workaround ...*/ +@@ -2587,7 +2587,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Param[in] ioc_fm_obj_t - The id of a CC tree. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_CC_ROOT_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(27), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_CC_ROOT_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(27), ioc_fm_obj_t) +@@ -2604,7 +2604,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(28), compat_uptr_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(28), void *) /* workaround ...*/ +@@ -2618,7 +2618,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(29), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(29), ioc_fm_obj_t) +@@ -2634,7 +2634,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_CcRootBuild(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_CC_ROOT_MODIFY_NEXT_ENGINE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(30), ioc_compat_fm_pcd_cc_tree_modify_next_engine_params_t) + #endif + #define FM_PCD_IOC_CC_ROOT_MODIFY_NEXT_ENGINE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(30), ioc_fm_pcd_cc_tree_modify_next_engine_params_t) +@@ -2650,7 +2650,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_MatchTableSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_NEXT_ENGINE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(31), ioc_compat_fm_pcd_cc_node_modify_next_engine_params_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_NEXT_ENGINE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(31), ioc_fm_pcd_cc_node_modify_next_engine_params_t) +@@ -2666,7 +2666,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_MatchTableSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_MISS_NEXT_ENGINE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(32), ioc_compat_fm_pcd_cc_node_modify_next_engine_params_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_MISS_NEXT_ENGINE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(32), ioc_fm_pcd_cc_node_modify_next_engine_params_t) +@@ -2684,7 +2684,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only after FM_PCD_MatchTableSet() has been called for this + node and for all of the nodes that lead to it. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_REMOVE_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(33), ioc_compat_fm_pcd_cc_node_remove_key_params_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_REMOVE_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(33), ioc_fm_pcd_cc_node_remove_key_params_t) +@@ -2705,7 +2705,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only after FM_PCD_MatchTableSet() has been called for this + node and for all of the nodes that lead to it. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_ADD_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(34), ioc_compat_fm_pcd_cc_node_modify_key_and_next_engine_params_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_ADD_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(34), ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t) +@@ -2722,7 +2722,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only following FM_PCD_MatchTableSet() not only of the relevnt node but also + the node that points to this node + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_AND_NEXT_ENGINE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(35), ioc_compat_fm_pcd_cc_node_modify_key_and_next_engine_params_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_AND_NEXT_ENGINE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(35), ioc_fm_pcd_cc_node_modify_key_and_next_engine_params_t) +@@ -2739,7 +2739,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + @Cautions Allowed only after FM_PCD_MatchTableSet() has been called for this + node and for all of the nodes that lead to it. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(36), ioc_compat_fm_pcd_cc_node_modify_key_params_t) + #endif + #define FM_PCD_IOC_MATCH_TABLE_MODIFY_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(36), ioc_fm_pcd_cc_node_modify_key_params_t) +@@ -2766,7 +2766,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_HASH_TABLE_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_compat_fm_pcd_hash_table_params_t) + #endif + #define FM_PCD_IOC_HASH_TABLE_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_fm_pcd_hash_table_params_t) +@@ -2784,7 +2784,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_HashTableSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_HASH_TABLE_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_HASH_TABLE_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(37), ioc_fm_obj_t) +@@ -2803,7 +2803,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_HashTableSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_HASH_TABLE_ADD_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(39), ioc_compat_fm_pcd_hash_table_add_key_params_t) + #endif + #define FM_PCD_IOC_HASH_TABLE_ADD_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(39), ioc_fm_pcd_hash_table_add_key_params_t) +@@ -2820,7 +2820,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_HashTableSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_HASH_TABLE_REMOVE_KEY_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(40), ioc_compat_fm_pcd_hash_table_remove_key_params_t) + #endif + #define FM_PCD_IOC_HASH_TABLE_REMOVE_KEY _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(40), ioc_fm_pcd_hash_table_remove_key_params_t) +@@ -2836,7 +2836,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_PLCR_PROFILE_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_compat_fm_pcd_plcr_profile_params_t) + #endif + #define FM_PCD_IOC_PLCR_PROFILE_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_fm_pcd_plcr_profile_params_t) +@@ -2851,7 +2851,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_PLCR_PROFILE_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_PLCR_PROFILE_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(41), ioc_fm_obj_t) +@@ -2867,7 +2867,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return A handle to the initialized object on success; NULL code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MANIP_NODE_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(43), ioc_compat_fm_pcd_manip_params_t) + #endif + #define FM_PCD_IOC_MANIP_NODE_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(43), ioc_fm_pcd_manip_params_t) +@@ -2887,7 +2887,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_ManipNodeSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MANIP_NODE_REPLACE_COMPAT FM_PCD_IOC_MANIP_NODE_SET_COMPAT + #endif + #define FM_PCD_IOC_MANIP_NODE_REPLACE FM_PCD_IOC_MANIP_NODE_SET +@@ -2903,7 +2903,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_ManipNodeSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MANIP_NODE_DELETE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(44), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_MANIP_NODE_DELETE _IOW(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(44), ioc_fm_obj_t) +@@ -2920,7 +2920,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_ManipNodeSet(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_MANIP_GET_STATS_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(50), ioc_compat_fm_pcd_manip_get_stats_t) + #endif + #define FM_PCD_IOC_MANIP_GET_STATS _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(50), ioc_fm_pcd_manip_get_stats_t) +@@ -2953,7 +2953,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_Init(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_FRM_REPLIC_GROUP_SET_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(46), ioc_compat_fm_pcd_frm_replic_group_params_t) + #endif + #define FM_PCD_IOC_FRM_REPLIC_GROUP_SET _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(46), ioc_fm_pcd_frm_replic_group_params_t) +@@ -2969,7 +2969,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_FrmReplicSetGroup(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_FRM_REPLIC_GROUP_DELETE_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(47), ioc_compat_fm_obj_t) + #endif + #define FM_PCD_IOC_FRM_REPLIC_GROUP_DELETE _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(47), ioc_fm_obj_t) +@@ -2987,7 +2987,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_FrmReplicSetGroup() of this group. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_FRM_REPLIC_MEMBER_ADD_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(48), ioc_compat_fm_pcd_frm_replic_member_params_t) + #endif + #define FM_PCD_IOC_FRM_REPLIC_MEMBER_ADD _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(48), ioc_fm_pcd_frm_replic_member_params_t) +@@ -3004,7 +3004,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Cautions Allowed only following FM_PCD_FrmReplicSetGroup() of this group. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_FRM_REPLIC_MEMBER_REMOVE_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(49), ioc_compat_fm_pcd_frm_replic_member_t) + #endif + #define FM_PCD_IOC_FRM_REPLIC_MEMBER_REMOVE _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(49), ioc_fm_pcd_frm_replic_member_t) +@@ -3021,7 +3021,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + + @Return 0 on success; Error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_STATISTICS_SET_NODE_COMPAT _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(45), void *) + #endif + #define FM_PCD_IOC_STATISTICS_SET_NODE _IOWR(FM_IOC_TYPE_BASE, FM_PCD_IOC_NUM(45), void *) +@@ -3029,7 +3029,7 @@ typedef struct ioc_fm_pcd_cc_tbl_get_sta + #endif /* FM_CAPWAP_SUPPORT */ + + #ifdef NCSW_BACKWARD_COMPATIBLE_API +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PCD_IOC_SET_NET_ENV_CHARACTERISTICS_COMPAT \ + FM_PCD_IOC_NET_ENV_CHARACTERISTICS_SET_COMPAT + #define FM_PCD_IOC_DELETE_NET_ENV_CHARACTERISTICS_COMPAT \ +--- a/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h ++++ b/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h +@@ -589,7 +589,7 @@ typedef struct ioc_fm_port_pcd_fqids_par + + @Return 0 on success; error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_SET_PCD_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(20), ioc_compat_fm_port_pcd_params_t) + #endif + #define FM_PORT_IOC_SET_PCD _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(20), ioc_fm_port_pcd_params_t) +@@ -674,7 +674,7 @@ typedef struct ioc_fm_port_pcd_fqids_par + + @Return 0 on success; error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_PCD_KG_MODIFY_INITIAL_SCHEME_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(26), ioc_compat_fm_pcd_kg_scheme_select_t) + #endif + #define FM_PORT_IOC_PCD_KG_MODIFY_INITIAL_SCHEME _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(26), ioc_fm_pcd_kg_scheme_select_t) +@@ -691,7 +691,7 @@ typedef struct ioc_fm_port_pcd_fqids_par + + @Return 0 on success; error code otherwise. + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_PCD_PLCR_MODIFY_INITIAL_PROFILE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(27), ioc_compat_fm_obj_t) + #endif + #define FM_PORT_IOC_PCD_PLCR_MODIFY_INITIAL_PROFILE _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(27), ioc_fm_obj_t) +@@ -708,7 +708,7 @@ typedef struct ioc_fm_port_pcd_fqids_par + + @Cautions Allowed only following FM_PORT_SetPCD() and FM_PORT_DetachPCD() + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_PCD_CC_MODIFY_TREE_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(28), ioc_compat_fm_obj_t) + #endif + #define FM_PORT_IOC_PCD_CC_MODIFY_TREE _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(28), ioc_fm_obj_t) +@@ -726,7 +726,7 @@ typedef struct ioc_fm_port_pcd_fqids_par + + @Cautions Allowed only following FM_PORT_SetPCD(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_PCD_KG_BIND_SCHEMES_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(30), ioc_compat_fm_pcd_port_schemes_params_t) + #endif + #define FM_PORT_IOC_PCD_KG_BIND_SCHEMES _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(30), ioc_fm_pcd_port_schemes_params_t) +@@ -744,7 +744,7 @@ typedef struct ioc_fm_port_pcd_fqids_par + + @Cautions Allowed only following FM_PORT_SetPCD(). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_PCD_KG_UNBIND_SCHEMES_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(31), ioc_compat_fm_pcd_port_schemes_params_t) + #endif + #define FM_PORT_IOC_PCD_KG_UNBIND_SCHEMES _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(31), ioc_fm_pcd_port_schemes_params_t) +@@ -917,7 +917,7 @@ typedef struct ioc_fm_port_vsp_alloc_par + @Cautions Allowed only following FM_PORT_Init(), and before FM_PORT_SetPCD() + and also before FM_PORT_Enable() (i.e. the port should be disabled). + *//***************************************************************************/ +-#if defined(CONFIG_COMPAT) ++#if defined(FM_COMPAT) + #define FM_PORT_IOC_VSP_ALLOC_COMPAT _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), ioc_compat_fm_port_vsp_alloc_params_t) + #endif + #define FM_PORT_IOC_VSP_ALLOC _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(38), ioc_fm_port_vsp_alloc_params_t) +--- a/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h ++++ b/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h +@@ -90,7 +90,7 @@ typedef struct ioc_fmt_buff_context_t { + uint8_t fm_time_stamp[FM_TIME_STAMP_MAX]; + } ioc_fmt_buff_context_t; + +-#if defined(__KERNEL__) && defined(CONFIG_COMPAT) ++#if defined(__KERNEL__) && defined(FM_COMPAT) + typedef struct ioc_fmt_compat_buff_context_t { + compat_uptr_t p_user_priv; + uint8_t fm_prs_res[FM_PRS_MAX]; +@@ -109,7 +109,7 @@ typedef struct ioc_fmt_buff_desc_t { + ioc_fmt_buff_context_t buff_context; + } ioc_fmt_buff_desc_t; + +-#if defined(__KERNEL__) && defined(CONFIG_COMPAT) ++#if defined(__KERNEL__) && defined(FM_COMPAT) + typedef struct ioc_fmt_compat_buff_desc_t { + uint32_t qid; + compat_uptr_t p_data; diff --git a/target/linux/layerscape/patches-5.4/811-kvm-0002-arm-arm64-KVM-allow-specifying-s2-prot-bits-when-map.patch b/target/linux/layerscape/patches-5.4/811-kvm-0002-arm-arm64-KVM-allow-specifying-s2-prot-bits-when-map.patch index 309782b46..bdc872539 100644 --- a/target/linux/layerscape/patches-5.4/811-kvm-0002-arm-arm64-KVM-allow-specifying-s2-prot-bits-when-map.patch +++ b/target/linux/layerscape/patches-5.4/811-kvm-0002-arm-arm64-KVM-allow-specifying-s2-prot-bits-when-map.patch @@ -64,7 +64,7 @@ Signed-off-by: Laurentiu Tudor if (writable) pte = kvm_s2pte_mkwrite(pte); -@@ -2356,7 +2358,7 @@ int kvm_arch_prepare_memory_region(struc +@@ -2361,7 +2363,7 @@ int kvm_arch_prepare_memory_region(struc ret = kvm_phys_addr_ioremap(kvm, gpa, pa, vm_end - vm_start, diff --git a/target/linux/layerscape/patches-5.4/811-kvm-0003-arm-arm64-KVM-drop-qman-mmio-cacheable-mapping-hack.patch b/target/linux/layerscape/patches-5.4/811-kvm-0003-arm-arm64-KVM-drop-qman-mmio-cacheable-mapping-hack.patch index 47ec98ec2..1b36b61e6 100644 --- a/target/linux/layerscape/patches-5.4/811-kvm-0003-arm-arm64-KVM-drop-qman-mmio-cacheable-mapping-hack.patch +++ b/target/linux/layerscape/patches-5.4/811-kvm-0003-arm-arm64-KVM-drop-qman-mmio-cacheable-mapping-hack.patch @@ -105,7 +105,7 @@ Signed-off-by: Diana Craciun if (kvm_is_device_pfn(pfn)) { mem_type = PAGE_S2_DEVICE; flags |= KVM_S2PTE_FLAG_IS_IOMAP; -@@ -2346,6 +2390,9 @@ int kvm_arch_prepare_memory_region(struc +@@ -2351,6 +2395,9 @@ int kvm_arch_prepare_memory_region(struc gpa_t gpa = mem->guest_phys_addr + (vm_start - mem->userspace_addr); phys_addr_t pa; @@ -115,7 +115,7 @@ Signed-off-by: Diana Craciun pa = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT; pa += vm_start - vma->vm_start; -@@ -2356,9 +2403,13 @@ int kvm_arch_prepare_memory_region(struc +@@ -2361,9 +2408,13 @@ int kvm_arch_prepare_memory_region(struc goto out; } diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch index 492ae99d0..085de51c1 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0001-mmc-sdhci-of-esdhc-poll-ESDHC_FLUSH_ASYNC_FIFO-bit-u.patch @@ -14,7 +14,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -591,6 +591,32 @@ static void esdhc_clock_enable(struct sd +@@ -592,6 +592,32 @@ static void esdhc_clock_enable(struct sd } } @@ -47,7 +47,7 @@ Signed-off-by: Yangbo Lu static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); -@@ -683,9 +709,7 @@ static void esdhc_of_set_clock(struct sd +@@ -684,9 +710,7 @@ static void esdhc_of_set_clock(struct sd sdhci_writel(host, temp | ESDHC_HS400_WNDW_ADJUST, ESDHC_TBCTL); esdhc_clock_enable(host, false); @@ -58,7 +58,7 @@ Signed-off-by: Yangbo Lu } /* Wait max 20 ms */ -@@ -887,10 +911,7 @@ static void esdhc_tuning_block_enable(st +@@ -888,10 +912,7 @@ static void esdhc_tuning_block_enable(st u32 val; esdhc_clock_enable(host, false); diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch index a80d5c91a..df1956886 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0002-LF-605-mmc-sdhci-of-esdhc-convert-to-use-esdhc_tunin.patch @@ -15,7 +15,7 @@ Acked-by: Adrian Hunter --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -923,20 +923,11 @@ static void esdhc_tuning_block_enable(st +@@ -924,20 +924,11 @@ static void esdhc_tuning_block_enable(st esdhc_clock_enable(host, true); } @@ -37,7 +37,7 @@ Acked-by: Adrian Hunter /* Write TBCTL[11:8]=4'h8 */ val = sdhci_readl(host, ESDHC_TBCTL); val &= ~(0xf << 8); -@@ -955,6 +946,25 @@ static void esdhc_prepare_sw_tuning(stru +@@ -956,6 +947,25 @@ static void esdhc_prepare_sw_tuning(stru val = sdhci_readl(host, ESDHC_TBSTAT); val = sdhci_readl(host, ESDHC_TBSTAT); @@ -63,7 +63,7 @@ Acked-by: Adrian Hunter /* Reset data lines by setting ESDHCCTL[RSTD] */ sdhci_reset(host, SDHCI_RESET_DATA); /* Write 32'hFFFF_FFFF to IRQSTAT register */ -@@ -965,10 +975,8 @@ static void esdhc_prepare_sw_tuning(stru +@@ -966,10 +976,8 @@ static void esdhc_prepare_sw_tuning(stru * then program TBPTR[TB_WNDW_END_PTR] = 4 * div_ratio * and program TBPTR[TB_WNDW_START_PTR] = 8 * div_ratio. */ diff --git a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch index fcdeb15d8..1d2e9386c 100644 --- a/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch +++ b/target/linux/layerscape/patches-5.4/816-sdhc-0003-LF-605-mmc-sdhci-of-esdhc-update-tuning-erratum-A-00.patch @@ -20,7 +20,7 @@ Acked-by: Adrian Hunter --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c -@@ -889,20 +889,20 @@ static int esdhc_signal_voltage_switch(s +@@ -890,20 +890,20 @@ static int esdhc_signal_voltage_switch(s } static struct soc_device_attribute soc_tuning_erratum_type1[] = { @@ -51,7 +51,7 @@ Acked-by: Adrian Hunter { }, }; -@@ -970,13 +970,13 @@ static void esdhc_prepare_sw_tuning(stru +@@ -971,13 +971,13 @@ static void esdhc_prepare_sw_tuning(stru /* Write 32'hFFFF_FFFF to IRQSTAT register */ sdhci_writel(host, 0xFFFFFFFF, SDHCI_INT_STATUS); @@ -68,7 +68,7 @@ Acked-by: Adrian Hunter *window_start = 8 * esdhc->div_ratio; *window_end = 4 * esdhc->div_ratio; } else { -@@ -1049,6 +1049,19 @@ static int esdhc_execute_tuning(struct m +@@ -1050,6 +1050,19 @@ static int esdhc_execute_tuning(struct m if (ret) break; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch index c4dc00a91..1d1e63a07 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch @@ -54,7 +54,7 @@ Signed-off-by: Peter Chen * All 3.1 IP version constants are greater than the 3.0 IP --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -3427,6 +3427,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3495,6 +3495,10 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; dwc->gadget.lpm_capable = true; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0013-MLK-9785-1-usb-host-ehci-hcd-enable-park-mode.patch b/target/linux/layerscape/patches-5.4/820-usb-0013-MLK-9785-1-usb-host-ehci-hcd-enable-park-mode.patch index b07c68031..f7da7b23d 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0013-MLK-9785-1-usb-host-ehci-hcd-enable-park-mode.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0013-MLK-9785-1-usb-host-ehci-hcd-enable-park-mode.patch @@ -27,7 +27,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c -@@ -80,7 +80,7 @@ module_param (log2_irq_thresh, int, S_IR +@@ -81,7 +81,7 @@ module_param (log2_irq_thresh, int, S_IR MODULE_PARM_DESC (log2_irq_thresh, "log2 IRQ latency, 1-64 microframes"); /* initial park setting: slower than hw default */ diff --git a/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch b/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch index 2ea9390cf..fea7921b1 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0014-MLK-17380-3-usb-move-EH-SINGLE_STEP_SET_FEATURE-impl.patch @@ -163,7 +163,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c -@@ -1232,6 +1232,10 @@ static const struct hc_driver ehci_hc_dr +@@ -1233,6 +1233,10 @@ static const struct hc_driver ehci_hc_dr * device support */ .free_dev = ehci_remove_device, @@ -176,7 +176,7 @@ Signed-off-by: Peter Chen void ehci_init_driver(struct hc_driver *drv, --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c -@@ -725,145 +725,6 @@ ehci_hub_descriptor ( +@@ -724,145 +724,6 @@ ehci_hub_descriptor ( } /*-------------------------------------------------------------------------*/ diff --git a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch index 635850ec7..0ecfb978e 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch @@ -24,7 +24,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c -@@ -1419,6 +1419,15 @@ int xhci_hub_control(struct usb_hcd *hcd +@@ -1420,6 +1420,15 @@ int xhci_hub_control(struct usb_hcd *hcd /* 4.19.6 Port Test Modes (USB2 Test Mode) */ if (hcd->speed != HCD_USB2) goto error; @@ -174,7 +174,7 @@ Signed-off-by: Peter Chen * bursts that are required to move all packets in this TD. Only SuperSpeed --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5361,6 +5361,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5362,6 +5362,7 @@ static const struct hc_driver xhci_hc_dr .disable_usb3_lpm_timeout = xhci_disable_usb3_lpm_timeout, .find_raw_port_number = xhci_find_raw_port_number, .clear_tt_buffer_complete = xhci_clear_tt_buffer_complete, diff --git a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch index 57818b113..314005868 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch @@ -24,7 +24,7 @@ Signed-off-by: Peter Chen --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -5378,6 +5378,8 @@ void xhci_init_driver(struct hc_driver * +@@ -5379,6 +5379,8 @@ void xhci_init_driver(struct hc_driver * drv->reset = over->reset; if (over->start) drv->start = over->start; diff --git a/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch b/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch index 9cbf4ee13..b31c69579 100644 --- a/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch +++ b/target/linux/layerscape/patches-5.4/820-usb-0021-MLK-22099-usb-host-xhci-do-warm-reset-for-link-state.patch @@ -16,7 +16,7 @@ Signed-off-by: Li Jun --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c -@@ -1732,7 +1732,8 @@ static bool xhci_port_missing_cas_quirk( +@@ -1733,7 +1733,8 @@ static bool xhci_port_missing_cas_quirk( return false; if (((portsc & PORT_PLS_MASK) != XDEV_POLLING) && diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps b/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps deleted file mode 100755 index 15e9ef32a..000000000 --- a/target/linux/mediatek/base-files/etc/uci-defaults/99-net-ps +++ /dev/null @@ -1,5 +0,0 @@ -uci -q get network.globals.packet_steering >/dev/null || { - uci set network.globals='globals' - uci set network.globals.packet_steering=1 - uci commit network -} diff --git a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-lynx-rfb.dts b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-lynx-rfb.dts index 8ea7b163d..15b667d83 100644 --- a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-lynx-rfb.dts +++ b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-lynx-rfb.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019 MediaTek Inc. * Author: Ryder Lee diff --git a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts index 8ea7b163d..15b667d83 100644 --- a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts +++ b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629-rfb.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019 MediaTek Inc. * Author: Ryder Lee diff --git a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629.dtsi b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629.dtsi index 53f47796b..68af4897b 100644 --- a/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629.dtsi +++ b/target/linux/mediatek/files-4.19/arch/arm/boot/dts/mt7629.dtsi @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019 MediaTek Inc. * diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts index 557745ed9..f1cbd94b4 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0 OR MIT) +// SPDX-License-Identifier: (GPL-2.0-only OR MIT) /* * Copyright (c) 2018 MediaTek Inc. * Author: Ryder Lee diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts index 3945f26e1..6e94e49bc 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts @@ -3,7 +3,7 @@ * Author: Ming Huang * Sean Wang * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ /dts-v1/; diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-lynx-rfb1.dts b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-lynx-rfb1.dts index 895491098..52db11823 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-lynx-rfb1.dts +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-lynx-rfb1.dts @@ -3,7 +3,7 @@ * Author: Ming Huang * Sean Wang * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ /dts-v1/; diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts index 04829f639..1002ad2b7 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts @@ -3,7 +3,7 @@ * Author: Ming Huang * Sean Wang * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ /dts-v1/; diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi index a5c0a5d54..934b4d938 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi @@ -3,7 +3,7 @@ * Author: Ming Huang * Sean Wang * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ #include diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.c index 014b83be9..6a94d0d2f 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.h index ef2d68417..40243d4e5 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7530.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.c index 5b9f35916..7ebf09c10 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Zhanguo Ju diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.h index e4ef81e94..52c8a49fd 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt7531.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x.h index 317b31ddc..837a41564 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_common.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_common.c index 18f925956..4015ddf12 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_common.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_common.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_mdio.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_mdio.c index 8a9a45c0b..a3f0c5d3f 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_mdio.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_mdio.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.c index 78aecd34e..54916243e 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Sirui Zhao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.h index 3c0627380..85dc9e791 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_nl.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Sirui Zhao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_regs.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_regs.h index 0c91b8e0e..3f23ae200 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_regs.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_regs.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c index b601b90fb..342ad576b 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h index b877d8957..f000364ee 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.c b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.c index f3c8c38f3..4d88eee8d 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.c +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.h b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.h index 66c9cf984..c726b8eac 100644 --- a/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.h +++ b/target/linux/mediatek/files-4.19/drivers/net/phy/mtk/mt753x/mt753x_vlan.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts index 163886760..2235306b2 100644 --- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64-rootdisk.dts @@ -2,7 +2,7 @@ * Copyright (c) 2018 MediaTek Inc. * Author: Ryder Lee * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ /dts-v1/; diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts index 4199ee9aa..a7b32a9f8 100644 --- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-elecom-wrc-2533gent.dts @@ -3,7 +3,7 @@ * Author: Ming Huang * Sean Wang * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ /dts-v1/; diff --git a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts index f64a88237..2589a349a 100644 --- a/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts +++ b/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts @@ -2,7 +2,7 @@ * Copyright (c) 2018 MediaTek Inc. * Author: Ryder Lee * - * SPDX-License-Identifier: (GPL-2.0 OR MIT) + * SPDX-License-Identifier: (GPL-2.0-only OR MIT) */ /dts-v1/; diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.c index 014b83be9..6a94d0d2f 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.h index ef2d68417..40243d4e5 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7530.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.c index 5b9f35916..7ebf09c10 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Zhanguo Ju diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.h index e4ef81e94..52c8a49fd 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt7531.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x.h index 317b31ddc..837a41564 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_common.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_common.c index 18f925956..4015ddf12 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_common.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_common.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_mdio.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_mdio.c index 8a9a45c0b..a3f0c5d3f 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_mdio.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_mdio.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.c index 40faa0190..ccde2c920 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Sirui Zhao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.h index 3c0627380..85dc9e791 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_nl.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Sirui Zhao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_regs.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_regs.h index 0c91b8e0e..3f23ae200 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_regs.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_regs.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c index b601b90fb..342ad576b 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h index b877d8957..f000364ee 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_swconfig.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. * Author: Weijie Gao diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.c b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.c index f3c8c38f3..4d88eee8d 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.c +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.h b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.h index 66c9cf984..c726b8eac 100644 --- a/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.h +++ b/target/linux/mediatek/files-5.4/drivers/net/phy/mtk/mt753x/mt753x_vlan.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018 MediaTek Inc. */ diff --git a/target/linux/mediatek/image/gen_mtk_mmc_img.sh b/target/linux/mediatek/image/gen_mtk_mmc_img.sh index ea8a9c63a..2dacb9019 100644 --- a/target/linux/mediatek/image/gen_mtk_mmc_img.sh +++ b/target/linux/mediatek/image/gen_mtk_mmc_img.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright © 2019 Alexey Loukianov # Copyright © 2020 David Woodhouse diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index dee340acc..0851184dc 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -28,7 +28,7 @@ define Device/elecom_wrc-2533gent DEVICE_DTS := mt7622-elecom-wrc-2533gent DEVICE_DTS_DIR := $(DTS_DIR)/mediatek DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-mt7615e \ - kmod-mt7615-firmware mt7622bt-firmware swconfig + kmod-mt7615-firmware kmod-btmtkuart swconfig endef TARGET_DEVICES += elecom_wrc-2533gent diff --git a/target/linux/mediatek/modules.mk b/target/linux/mediatek/modules.mk index eb81afe23..9c6fb515f 100644 --- a/target/linux/mediatek/modules.mk +++ b/target/linux/mediatek/modules.mk @@ -15,6 +15,18 @@ endef $(eval $(call KernelPackage,ata-ahci-mtk)) +define KernelPackage/btmtkuart + SUBMENU:=Other modules + TITLE:=MediaTek HCI UART driver + DEPENDS:=@TARGET_mediatek_mt7622 +kmod-bluetooth +mt7622bt-firmware + KCONFIG:=CONFIG_BT_MTKUART + FILES:= \ + $(LINUX_DIR)/drivers/bluetooth/btmtkuart.ko + AUTOLOAD:=$(call AutoProbe,btmtkuart) +endef + +$(eval $(call KernelPackage,btmtkuart)) + define KernelPackage/sdhci-mtk SUBMENU:=Other modules TITLE:=Mediatek SDHCI driver diff --git a/target/linux/mediatek/mt7622/config-5.4 b/target/linux/mediatek/mt7622/config-5.4 index a66488467..7f547c3d4 100755 --- a/target/linux/mediatek/mt7622/config-5.4 +++ b/target/linux/mediatek/mt7622/config-5.4 @@ -82,26 +82,24 @@ CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARM64=y CONFIG_ARM64_4K_PAGES=y -CONFIG_ARM64_CNP=y +# CONFIG_ARM64_CNP is not set CONFIG_ARM64_CONT_SHIFT=4 -CONFIG_ARM64_ERRATUM_1165522=y -CONFIG_ARM64_ERRATUM_1286807=y -CONFIG_ARM64_ERRATUM_1418040=y -CONFIG_ARM64_HW_AFDBM=y +# CONFIG_ARM64_ERRATUM_1165522 is not set +# CONFIG_ARM64_ERRATUM_1286807 is not set +# CONFIG_ARM64_ERRATUM_1418040 is not set +CONFIG_ARM64_ERRATUM_843419=y +CONFIG_ARM64_ERRATUM_845719=y +CONFIG_ARM64_MODULE_PLTS=y CONFIG_ARM64_PAGE_SHIFT=12 -CONFIG_ARM64_PAN=y CONFIG_ARM64_PA_BITS=48 CONFIG_ARM64_PA_BITS_48=y -CONFIG_ARM64_PTR_AUTH=y +# CONFIG_ARM64_PTR_AUTH is not set CONFIG_ARM64_SSBD=y -CONFIG_ARM64_SVE=y +# CONFIG_ARM64_SVE is not set # CONFIG_ARM64_SW_TTBR0_PAN is not set CONFIG_ARM64_TAGGED_ADDR_ABI=y -CONFIG_ARM64_UAO=y CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y -CONFIG_ARM64_VHE=y -CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y # CONFIG_ARMV8_DEPRECATED is not set CONFIG_ARM_AMBA=y CONFIG_ARM_ARCH_TIMER=y @@ -123,22 +121,7 @@ CONFIG_BLK_SCSI_REQUEST=y CONFIG_BLOCK_COMPAT=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_BT=y -CONFIG_BT_BCM=y -CONFIG_BT_BREDR=y -CONFIG_BT_DEBUGFS=y -CONFIG_BT_HCIUART=y -CONFIG_BT_HCIUART_BCM=y -# CONFIG_BT_HCIUART_INTEL is not set -# CONFIG_BT_HCIUART_NOKIA is not set -CONFIG_BT_HCIUART_QCA=y -CONFIG_BT_HCIUART_SERDEV=y -CONFIG_BT_HCIVHCI=y -CONFIG_BT_HS=y -CONFIG_BT_LE=y -CONFIG_BT_MTKUART=y -CONFIG_BT_QCA=y -CONFIG_CAVIUM_TX2_ERRATUM_219=y +# CONFIG_CAVIUM_TX2_ERRATUM_219 is not set CONFIG_CC_HAS_KASAN_GENERIC=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y @@ -228,6 +211,7 @@ CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_MISC=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y +CONFIG_DIMLIB=y CONFIG_DMADEVICES=y CONFIG_DMATEST=y CONFIG_DMA_DIRECT_REMAP=y @@ -249,7 +233,7 @@ CONFIG_FONT_8x16=y CONFIG_FONT_AUTOSELECT=y CONFIG_FONT_SUPPORT=y CONFIG_FRAME_POINTER=y -CONFIG_FUJITSU_ERRATUM_010001=y +# CONFIG_FUJITSU_ERRATUM_010001 is not set CONFIG_FW_LOADER_PAGED_BUF=y CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ARCH_TOPOLOGY=y @@ -283,7 +267,8 @@ CONFIG_GLOB=y CONFIG_GPIOLIB=y CONFIG_GRO_CELLS=y CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDEN_BRANCH_PREDICTOR=y +# CONFIG_HARDEN_BRANCH_PREDICTOR is not set +# CONFIG_HARDEN_EL2_VECTORS is not set CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -331,6 +316,7 @@ CONFIG_HAVE_GENERIC_VDSO=y CONFIG_HAVE_HW_BREAKPOINT=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_PATA_PLATFORM=y CONFIG_HAVE_PCI=y @@ -345,7 +331,6 @@ CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_UID16=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HOLES_IN_ZONE=y -# CONFIG_HW_NAT is not set CONFIG_HZ=250 CONFIG_HZ_250=y CONFIG_ICPLUS_PHY=y @@ -391,7 +376,6 @@ CONFIG_MAGIC_SYSRQ=y CONFIG_MDIO_BUS=y CONFIG_MDIO_DEVICE=y CONFIG_MEDIATEK_MT6577_AUXADC=y -# CONFIG_MEDIATEK_NETSYS_V2 is not set CONFIG_MEDIATEK_WATCHDOG=y CONFIG_MEDIA_SUPPORT=y CONFIG_MEMFD_CREATE=y @@ -436,6 +420,7 @@ CONFIG_NET_DSA=y CONFIG_NET_DSA_MT7530=y CONFIG_NET_DSA_TAG_MTK=y CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_MEDIATEK_OFFLOAD=y CONFIG_NET_MEDIATEK_SOC=y CONFIG_NET_SWITCHDEV=y CONFIG_NET_VENDOR_MEDIATEK=y @@ -459,8 +444,17 @@ CONFIG_OLD_SIGSUSPEND3=y CONFIG_PADATA=y CONFIG_PARTITION_PERCPU=y CONFIG_PCI=y +CONFIG_PCIEAER=y +CONFIG_PCIEASPM=y +# CONFIG_PCIEASPM_DEBUG is not set +# CONFIG_PCIEASPM_DEFAULT is not set +CONFIG_PCIEASPM_PERFORMANCE=y +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +CONFIG_PCIEPORTBUS=y # CONFIG_PCIE_AL is not set CONFIG_PCIE_MEDIATEK=y +CONFIG_PCIE_PME=y CONFIG_PCI_DEBUG=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y @@ -484,6 +478,7 @@ CONFIG_PINCTRL_MT7622=y CONFIG_PINCTRL_MT8516=y CONFIG_PINCTRL_MTK=y CONFIG_PINCTRL_MTK_MOORE=y +CONFIG_PLUGIN_HOSTCC="g++" CONFIG_PM=y CONFIG_PM_CLK=y CONFIG_PM_GENERIC_DOMAINS=y @@ -520,7 +515,6 @@ CONFIG_RTC_DRV_MT7622=y CONFIG_RTC_I2C_AND_SPI=y CONFIG_RTL8367S_GSW=y CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_SCHED_MC=y CONFIG_SCSI=y # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set CONFIG_SERIAL_8250_FSL=y diff --git a/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch b/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch index ada4ad699..966916ef2 100644 --- a/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch +++ b/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch @@ -20,7 +20,7 @@ Signed-off-by: Mark Brown --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -1797,13 +1797,8 @@ static int of_spi_parse_dt(struct spi_co +@@ -1802,13 +1802,8 @@ static int of_spi_parse_dt(struct spi_co spi->mode |= SPI_CS_HIGH; /* Device speed */ diff --git a/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch b/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch index b545ea809..bf16062cb 100644 --- a/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch +++ b/target/linux/mediatek/patches-5.4/0310-dts-add-wmac-support-for-mt7622-rfb1.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -712,6 +712,17 @@ +@@ -714,6 +714,17 @@ status = "disabled"; }; diff --git a/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch b/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch new file mode 100644 index 000000000..5bc0fd0b7 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0503-crypto-fix-eip97-cache-incoherent.patch @@ -0,0 +1,26 @@ +--- a/drivers/crypto/inside-secure/safexcel.h ++++ b/drivers/crypto/inside-secure/safexcel.h +@@ -722,6 +722,9 @@ enum safexcel_eip_version { + /* Priority we use for advertising our algorithms */ + #define SAFEXCEL_CRA_PRIORITY 300 + ++/* System cache line size */ ++#define SYSTEM_CACHELINE_SIZE 64 ++ + /* SM3 digest result for zero length message */ + #define EIP197_SM3_ZEROM_HASH "\x1A\xB2\x1D\x83\x55\xCF\xA1\x7F" \ + "\x8E\x61\x19\x48\x31\xE8\x1A\x8F" \ +--- a/drivers/crypto/inside-secure/safexcel_hash.c ++++ b/drivers/crypto/inside-secure/safexcel_hash.c +@@ -57,9 +57,9 @@ struct safexcel_ahash_req { + u8 block_sz; /* block size, only set once */ + u8 digest_sz; /* output digest size, only set once */ + __le32 state[SHA3_512_BLOCK_SIZE / +- sizeof(__le32)] __aligned(sizeof(__le32)); ++ sizeof(__le32)] __aligned(SYSTEM_CACHELINE_SIZE); + +- u64 len; ++ u64 len __aligned(SYSTEM_CACHELINE_SIZE); + u64 processed; + + u8 cache[HASH_CACHE_SIZE] __aligned(sizeof(u32)); diff --git a/target/linux/mediatek/patches-5.4/0600-1-6-net-dsa-mt7530-Refine-message-in-Kconfig.patch b/target/linux/mediatek/patches-5.4/0600-1-6-net-dsa-mt7530-Refine-message-in-Kconfig.patch deleted file mode 100644 index 5288751e5..000000000 --- a/target/linux/mediatek/patches-5.4/0600-1-6-net-dsa-mt7530-Refine-message-in-Kconfig.patch +++ /dev/null @@ -1,98 +0,0 @@ -From patchwork Tue Dec 10 08:14:37 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Landen Chao -X-Patchwork-Id: 1206962 -X-Patchwork-Delegate: davem@davemloft.net -Return-Path: -X-Original-To: patchwork-incoming-netdev@ozlabs.org -Delivered-To: patchwork-incoming-netdev@ozlabs.org -Authentication-Results: ozlabs.org; spf=none (no SPF record) - smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; - helo=vger.kernel.org; - envelope-from=netdev-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.b="pTp2PPKi"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 47XCY42hJqz9sRf - for ; - Tue, 10 Dec 2019 19:15:20 +1100 (AEDT) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727061AbfLJIO5 (ORCPT - ); - Tue, 10 Dec 2019 03:14:57 -0500 -Received: from mailgw02.mediatek.com ([210.61.82.184]:45567 "EHLO - mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by - vger.kernel.org with ESMTP id S1726932AbfLJIO4 (ORCPT - ); Tue, 10 Dec 2019 03:14:56 -0500 -X-UUID: f5656f2ff80846ebb40e3da87d60fb90-20191210 -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=mediatek.com; s=dk; - h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; - bh=THbuVAlbiUyMgTyO0rwrKX/mskzsxNwDv9gxXp2O2c8=; - b=pTp2PPKiPwR8QPOOf5yohf9lFERpEDlo/g/t2ChREfzFb9c+wylx++/div4hAB337+Ja2KIzbSu4URgdj5XHXUly8yuxrD8OBvV+ox0jlNLiRIN2dkCgL4fyzPr7ZPSk9lObJW05Yx2LY6Jy6eJZZXSShLlqLd0lDKwy6FT+hSI=; -X-UUID: f5656f2ff80846ebb40e3da87d60fb90-20191210 -Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by - mailgw02.mediatek.com (envelope-from ) - (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) - with ESMTP id 565263134; Tue, 10 Dec 2019 16:14:47 +0800 -Received: from mtkcas08.mediatek.inc (172.21.101.126) by - mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server - (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 16:14:38 +0800 -Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc - (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via - Frontend Transport; Tue, 10 Dec 2019 16:14:26 +0800 -From: Landen Chao -To: , , - , , - , -CC: , , - , - , , - , , - , Landen Chao -Subject: [PATCH net-next 1/6] net: dsa: mt7530: Refine message in Kconfig -Date: Tue, 10 Dec 2019 16:14:37 +0800 -Message-ID: <6ecf6cbf38223f35854bc361c2eefa1d85c724d2.1575914275.git.landen.chao@mediatek.com> -X-Mailer: git-send-email 2.18.0 -In-Reply-To: -References: -MIME-Version: 1.0 -X-MTK: N -Sender: netdev-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: netdev@vger.kernel.org - -Refine message in Kconfig with fixing typo and an explicit MT7621 support. - -Signed-off-by: Landen Chao -Signed-off-by: Sean Wang -Reviewed-by: Florian Fainelli ---- - drivers/net/dsa/Kconfig | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/net/dsa/Kconfig -+++ b/drivers/net/dsa/Kconfig -@@ -33,12 +33,12 @@ config NET_DSA_LANTIQ_GSWIP - the xrx200 / VR9 SoC. - - config NET_DSA_MT7530 -- tristate "Mediatek MT7530 Ethernet switch support" -+ tristate "MediaTek MT7530 and MT7621 Ethernet switch support" - depends on NET_DSA - select NET_DSA_TAG_MTK - ---help--- -- This enables support for the Mediatek MT7530 Ethernet switch -- chip. -+ This enables support for the MediaTek MT7530 and MT7621 Ethernet -+ switch chip. - - config NET_DSA_MV88E6060 - tristate "Marvell 88E6060 ethernet switch chip support" diff --git a/target/linux/mediatek/patches-5.4/0600-2-6-net-dsa-mt7530-Extend-device-data-ready-for-adding-a-new-hardware.patch b/target/linux/mediatek/patches-5.4/0600-2-6-net-dsa-mt7530-Extend-device-data-ready-for-adding-a-new-hardware.patch deleted file mode 100644 index c4b117dcb..000000000 --- a/target/linux/mediatek/patches-5.4/0600-2-6-net-dsa-mt7530-Extend-device-data-ready-for-adding-a-new-hardware.patch +++ /dev/null @@ -1,441 +0,0 @@ -From patchwork Tue Dec 10 08:14:38 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Landen Chao -X-Patchwork-Id: 1206963 -X-Patchwork-Delegate: davem@davemloft.net -Return-Path: -X-Original-To: patchwork-incoming-netdev@ozlabs.org -Delivered-To: patchwork-incoming-netdev@ozlabs.org -Authentication-Results: ozlabs.org; spf=none (no SPF record) - smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; - helo=vger.kernel.org; - envelope-from=netdev-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.b="UJ5NATux"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 47XCY92tBkz9sR7 - for ; - Tue, 10 Dec 2019 19:15:25 +1100 (AEDT) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727003AbfLJIO4 (ORCPT - ); - Tue, 10 Dec 2019 03:14:56 -0500 -Received: from mailgw02.mediatek.com ([210.61.82.184]:45567 "EHLO - mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by - vger.kernel.org with ESMTP id S1726071AbfLJIOy (ORCPT - ); Tue, 10 Dec 2019 03:14:54 -0500 -X-UUID: a18674d7b33c423e9e67b7440f4771cf-20191210 -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=mediatek.com; s=dk; - h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; - bh=c2C/fEHYw/8uqadmiP2m2xa2hsUpAd52urXVJTPlYck=; - b=UJ5NATuxMtqHln5i6BTpWiLnxGKgWvp4DpRsKVO2xdnz2cJaT4XL8F/T5fK3CTF4nAai0EKPAcqp+rr8eCLq7uURJv5e5h+ZIzKLSAB4zgnchXesQLo0uFS8vs5w2yp49j6bez1z3v/uN+1+Lpq0uYid9awCqzvbnovrooEysu4=; -X-UUID: a18674d7b33c423e9e67b7440f4771cf-20191210 -Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by - mailgw02.mediatek.com (envelope-from ) - (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) - with ESMTP id 1965641267; Tue, 10 Dec 2019 16:14:46 +0800 -Received: from mtkcas08.mediatek.inc (172.21.101.126) by - mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server - (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 16:14:31 +0800 -Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc - (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via - Frontend Transport; Tue, 10 Dec 2019 16:14:26 +0800 -From: Landen Chao -To: , , - , , - , -CC: , , - , - , , - , , - , Landen Chao -Subject: [PATCH net-next 2/6] net: dsa: mt7530: Extend device data ready for - adding a new hardware -Date: Tue, 10 Dec 2019 16:14:38 +0800 -Message-ID: <2d546d6bb15ff8b4b75af2220e20db4e634f4145.1575914275.git.landen.chao@mediatek.com> -X-Mailer: git-send-email 2.18.0 -In-Reply-To: -References: -MIME-Version: 1.0 -X-MTK: N -Sender: netdev-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: netdev@vger.kernel.org - -Add a structure holding required operations for each device such as device -initialization, PHY port read or write, a checker whether PHY interface is -supported on a certain port, MAC port setup for either bus pad or a -specific PHY interface. - -The patch is done for ready adding a new hardware MT7531. - -Signed-off-by: Landen Chao -Signed-off-by: Sean Wang ---- - drivers/net/dsa/mt7530.c | 231 +++++++++++++++++++++++++++++---------- - drivers/net/dsa/mt7530.h | 29 ++++- - 2 files changed, 203 insertions(+), 57 deletions(-) - ---- a/drivers/net/dsa/mt7530.c -+++ b/drivers/net/dsa/mt7530.c -@@ -373,7 +373,7 @@ mt7530_fdb_write(struct mt7530_priv *pri - } - - static int --mt7530_pad_clk_setup(struct dsa_switch *ds, int mode) -+mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t mode) - { - struct mt7530_priv *priv = ds->priv; - u32 ncpo1, ssc_delta, trgint, i, xtal; -@@ -1355,13 +1355,111 @@ mt7530_setup(struct dsa_switch *ds) - return 0; - } - --static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port, -+static bool mt7530_phy_supported(struct dsa_switch *ds, int port, -+ const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ switch (port) { -+ case 0: /* Internal phy */ -+ case 1: -+ case 2: -+ case 3: -+ case 4: -+ if (state->interface != PHY_INTERFACE_MODE_GMII) -+ goto unsupported; -+ break; -+ case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ -+ if (!phy_interface_mode_is_rgmii(state->interface) && -+ state->interface != PHY_INTERFACE_MODE_MII && -+ state->interface != PHY_INTERFACE_MODE_GMII) -+ goto unsupported; -+ break; -+ case 6: /* 1st cpu port */ -+ if (state->interface != PHY_INTERFACE_MODE_RGMII && -+ state->interface != PHY_INTERFACE_MODE_TRGMII) -+ goto unsupported; -+ break; -+ default: -+ dev_err(priv->dev, "%s: unsupported port: %i\n", __func__, -+ port); -+ goto unsupported; -+ } -+ -+ return true; -+ -+unsupported: -+ return false; -+} -+ -+static bool mt753x_phy_supported(struct dsa_switch *ds, int port, -+ const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ return priv->info->phy_supported(ds, port, state); -+} -+ -+static int -+mt7530_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ /* Setup TX circuit incluing relevant PAD and driving */ -+ mt7530_pad_clk_setup(ds, state->interface); -+ -+ if (priv->id == ID_MT7530) { -+ /* Setup RX circuit, relevant PAD and driving on the -+ * host which must be placed after the setup on the -+ * device side is all finished. -+ */ -+ mt7623_pad_clk_setup(ds); -+ } -+ -+ return 0; -+} -+ -+static int -+mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ return priv->info->pad_setup(ds, state); -+} -+ -+static int -+mt7530_mac_setup(struct dsa_switch *ds, int port, unsigned int mode, -+ const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ /* Only need to setup port5. */ -+ if (port != 5) -+ return 0; -+ -+ mt7530_setup_port5(priv->ds, state->interface); -+ -+ return 0; -+} -+ -+static int mt753x_mac_setup(struct dsa_switch *ds, int port, unsigned int mode, -+ const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ return priv->info->mac_setup(ds, port, mode, state); -+} -+ -+static void mt753x_phylink_mac_config(struct dsa_switch *ds, int port, - unsigned int mode, - const struct phylink_link_state *state) - { - struct mt7530_priv *priv = ds->priv; - u32 mcr_cur, mcr_new; - -+ if (!mt753x_phy_supported(ds, port, state)) -+ return; -+ - switch (port) { - case 0: /* Internal phy */ - case 1: -@@ -1374,24 +1472,15 @@ static void mt7530_phylink_mac_config(st - case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ - if (priv->p5_interface == state->interface) - break; -- if (!phy_interface_mode_is_rgmii(state->interface) && -- state->interface != PHY_INTERFACE_MODE_MII && -- state->interface != PHY_INTERFACE_MODE_GMII) -- return; -- -- mt7530_setup_port5(ds, state->interface); -+ if (mt753x_mac_setup(ds, port, mode, state) < 0) -+ goto unsupported; - break; - case 6: /* 1st cpu port */ - if (priv->p6_interface == state->interface) - break; -- -- if (state->interface != PHY_INTERFACE_MODE_RGMII && -- state->interface != PHY_INTERFACE_MODE_TRGMII) -- return; -- -- /* Setup TX circuit incluing relevant PAD and driving */ -- mt7530_pad_clk_setup(ds, state->interface); -- -+ mt753x_pad_setup(ds, state); -+ if (mt753x_mac_setup(ds, port, mode, state) < 0) -+ goto unsupported; - priv->p6_interface = state->interface; - break; - default: -@@ -1459,38 +1548,14 @@ static void mt7530_phylink_mac_link_up(s - mt7530_port_set_status(priv, port, 1); - } - --static void mt7530_phylink_validate(struct dsa_switch *ds, int port, -+static void mt753x_phylink_validate(struct dsa_switch *ds, int port, - unsigned long *supported, - struct phylink_link_state *state) - { - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; - -- switch (port) { -- case 0: /* Internal phy */ -- case 1: -- case 2: -- case 3: -- case 4: -- if (state->interface != PHY_INTERFACE_MODE_NA && -- state->interface != PHY_INTERFACE_MODE_GMII) -- goto unsupported; -- break; -- case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ -- if (state->interface != PHY_INTERFACE_MODE_NA && -- !phy_interface_mode_is_rgmii(state->interface) && -- state->interface != PHY_INTERFACE_MODE_MII && -- state->interface != PHY_INTERFACE_MODE_GMII) -- goto unsupported; -- break; -- case 6: /* 1st cpu port */ -- if (state->interface != PHY_INTERFACE_MODE_NA && -- state->interface != PHY_INTERFACE_MODE_RGMII && -- state->interface != PHY_INTERFACE_MODE_TRGMII) -- goto unsupported; -- break; -- default: -- dev_err(ds->dev, "%s: unsupported port: %i\n", __func__, port); --unsupported: -+ if (state->interface != PHY_INTERFACE_MODE_NA && -+ !mt753x_phy_supported(ds, port, state)) { - linkmode_zero(supported); - return; - } -@@ -1609,12 +1674,36 @@ static int mt7530_set_mac_eee(struct dsa - return 0; - } - -+static int -+mt753x_setup(struct dsa_switch *ds) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ return priv->info->setup(ds); -+} -+ -+static int -+mt753x_phy_read(struct dsa_switch *ds, int port, int regnum) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ return priv->info->phy_read(ds, port, regnum); -+} -+ -+static int -+mt753x_phy_write(struct dsa_switch *ds, int port, int regnum, u16 val) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ return priv->info->phy_write(ds, port, regnum, val); -+} -+ - static const struct dsa_switch_ops mt7530_switch_ops = { - .get_tag_protocol = mtk_get_tag_protocol, -- .setup = mt7530_setup, -+ .setup = mt753x_setup, - .get_strings = mt7530_get_strings, -- .phy_read = mt7530_phy_read, -- .phy_write = mt7530_phy_write, -+ .phy_read = mt753x_phy_read, -+ .phy_write = mt753x_phy_write, - .get_ethtool_stats = mt7530_get_ethtool_stats, - .get_sset_count = mt7530_get_sset_count, - .port_enable = mt7530_port_enable, -@@ -1631,18 +1720,39 @@ static const struct dsa_switch_ops mt753 - .port_vlan_del = mt7530_port_vlan_del, - .port_mirror_add = mt7530_port_mirror_add, - .port_mirror_del = mt7530_port_mirror_del, -- .phylink_validate = mt7530_phylink_validate, -+ .phylink_validate = mt753x_phylink_validate, - .phylink_mac_link_state = mt7530_phylink_mac_link_state, -- .phylink_mac_config = mt7530_phylink_mac_config, -+ .phylink_mac_config = mt753x_phylink_mac_config, - .phylink_mac_link_down = mt7530_phylink_mac_link_down, - .phylink_mac_link_up = mt7530_phylink_mac_link_up, - .get_mac_eee = mt7530_get_mac_eee, - .set_mac_eee = mt7530_set_mac_eee, - }; - --static const struct of_device_id mt7530_of_match[] = { -- { .compatible = "mediatek,mt7621", .data = (void *)ID_MT7621, }, -- { .compatible = "mediatek,mt7530", .data = (void *)ID_MT7530, }, -+static const struct mt753x_info mt753x_table[] = { -+ [ID_MT7621] = { -+ .id = ID_MT7621, -+ .setup = mt7530_setup, -+ .phy_read = mt7530_phy_read, -+ .phy_write = mt7530_phy_write, -+ .phy_supported = mt7530_phy_supported, -+ .pad_setup = mt7530_pad_setup, -+ .mac_setup = mt7530_mac_setup, -+ }, -+ [ID_MT7530] = { -+ .id = ID_MT7530, -+ .setup = mt7530_setup, -+ .phy_read = mt7530_phy_read, -+ .phy_write = mt7530_phy_write, -+ .phy_supported = mt7530_phy_supported, -+ .pad_setup = mt7530_pad_setup, -+ .mac_setup = mt7530_mac_setup, -+ }, -+}; -+ -+ static const struct of_device_id mt7530_of_match[] = { -+ { .compatible = "mediatek,mt7621", .data = &mt753x_table[ID_MT7621], }, -+ { .compatible = "mediatek,mt7530", .data = &mt753x_table[ID_MT7530], }, - { /* sentinel */ }, - }; - MODULE_DEVICE_TABLE(of, mt7530_of_match); -@@ -1680,8 +1790,19 @@ mt7530_probe(struct mdio_device *mdiodev - /* Get the hardware identifier from the devicetree node. - * We will need it for some of the clock and regulator setup. - */ -- priv->id = (unsigned int)(unsigned long) -- of_device_get_match_data(&mdiodev->dev); -+ priv->info = of_device_get_match_data(&mdiodev->dev); -+ if (!priv->info) -+ return -EINVAL; -+ -+ /* Sanity check if these required device operstaions are filled -+ * properly. -+ */ -+ if (!priv->info->setup || !priv->info->phy_read || -+ !priv->info->phy_write || !priv->info->phy_supported || -+ !priv->info->pad_setup || !priv->info->mac_setup) -+ return -EINVAL; -+ -+ priv->id = priv->info->id; - - if (priv->id == ID_MT7530) { - priv->core_pwr = devm_regulator_get(&mdiodev->dev, "core"); ---- a/drivers/net/dsa/mt7530.h -+++ b/drivers/net/dsa/mt7530.h -@@ -11,7 +11,7 @@ - #define MT7530_NUM_FDB_RECORDS 2048 - #define MT7530_ALL_MEMBERS 0xff - --enum { -+enum mt753x_id { - ID_MT7530 = 0, - ID_MT7621 = 1, - }; -@@ -447,6 +447,32 @@ static const char *p5_intf_modes(unsigne - } - } - -+/* struct mt753x_info - This is the main data structure for holding the specific -+ * part for each supported device -+ * @setup: Holding the handler to a device initialization -+ * @phy_read: Holding the way reading PHY port -+ * @phy_write: Holding the way writing PHY port -+ * @phy_supported: Check if the PHY type is being supported on a certain -+ * port -+ * @pad_setup: Holding the way setting up the bus pad for a certain MAC -+ * port -+ * @mac_setup: Holding the way setting up the PHY attribute for a -+ * certain MAC port -+ */ -+struct mt753x_info { -+ enum mt753x_id id; -+ -+ int (*setup)(struct dsa_switch *ds); -+ int (*phy_read)(struct dsa_switch *ds, int port, int regnum); -+ int (*phy_write)(struct dsa_switch *ds, int port, int regnum, u16 val); -+ bool (*phy_supported)(struct dsa_switch *ds, int port, -+ const struct phylink_link_state *state); -+ int (*pad_setup)(struct dsa_switch *ds, -+ const struct phylink_link_state *state); -+ int (*mac_setup)(struct dsa_switch *ds, int port, unsigned int mode, -+ const struct phylink_link_state *state); -+}; -+ - /* struct mt7530_priv - This is the main data structure for holding the state - * of the driver - * @dev: The device pointer -@@ -472,6 +498,7 @@ struct mt7530_priv { - struct regulator *core_pwr; - struct regulator *io_pwr; - struct gpio_desc *reset; -+ const struct mt753x_info *info; - unsigned int id; - bool mcm; - phy_interface_t p6_interface; diff --git a/target/linux/mediatek/patches-5.4/0600-3-6-dt-bindings-net-dsa-add-new-MT7531-binding-to-support-MT7531.patch b/target/linux/mediatek/patches-5.4/0600-3-6-dt-bindings-net-dsa-add-new-MT7531-binding-to-support-MT7531.patch deleted file mode 100644 index b28f23f57..000000000 --- a/target/linux/mediatek/patches-5.4/0600-3-6-dt-bindings-net-dsa-add-new-MT7531-binding-to-support-MT7531.patch +++ /dev/null @@ -1,179 +0,0 @@ -From patchwork Tue Dec 10 08:14:39 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Landen Chao -X-Patchwork-Id: 1206955 -X-Patchwork-Delegate: davem@davemloft.net -Return-Path: -X-Original-To: patchwork-incoming-netdev@ozlabs.org -Delivered-To: patchwork-incoming-netdev@ozlabs.org -Authentication-Results: ozlabs.org; spf=none (no SPF record) - smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; - helo=vger.kernel.org; - envelope-from=netdev-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.b="SuczJHZp"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 47XCXj3BBNz9sPh - for ; - Tue, 10 Dec 2019 19:15:01 +1100 (AEDT) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727133AbfLJIPA (ORCPT - ); - Tue, 10 Dec 2019 03:15:00 -0500 -Received: from mailgw02.mediatek.com ([210.61.82.184]:45567 "EHLO - mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by - vger.kernel.org with ESMTP id S1727022AbfLJIO7 (ORCPT - ); Tue, 10 Dec 2019 03:14:59 -0500 -X-UUID: a1d9a42928d44d63b201d5ad84c05baa-20191210 -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=mediatek.com; s=dk; - h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; - bh=KJqQ2m7z9H4vre+SZyxgKEGRWb9Edp5pJlYnepJNMyM=; - b=SuczJHZpeY7vF8UsCGorYUAcT2lEUX2E0ciiyQBS1rDLPzTYnufK8OXyAw5Uq8U1m72TGWYCaq1o0VWtI1meJpEmCL2TVK/d+Y+IaacHlO716BmX77+0MU0crczE8zx1Nz2pNh+GicsB6AoC9qbBU+p5egbKDMBhpRaGQNAeBww=; -X-UUID: a1d9a42928d44d63b201d5ad84c05baa-20191210 -Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by - mailgw02.mediatek.com (envelope-from ) - (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) - with ESMTP id 297826603; Tue, 10 Dec 2019 16:14:47 +0800 -Received: from mtkcas08.mediatek.inc (172.21.101.126) by - mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server - (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 16:14:38 +0800 -Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc - (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via - Frontend Transport; Tue, 10 Dec 2019 16:14:26 +0800 -From: Landen Chao -To: , , - , , - , -CC: , , - , - , , - , , - , Landen Chao -Subject: [PATCH net-next 3/6] dt-bindings: net: dsa: add new MT7531 binding - to support MT7531 -Date: Tue, 10 Dec 2019 16:14:39 +0800 -Message-ID: <1c382fd916b66bfe3ce8ef18c12f954dbcbddbbc.1575914275.git.landen.chao@mediatek.com> -X-Mailer: git-send-email 2.18.0 -In-Reply-To: -References: -MIME-Version: 1.0 -X-MTK: N -Sender: netdev-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: netdev@vger.kernel.org - -Add devicetree binding to support the compatible mt7531 switch as used -in the MediaTek MT7531 switch. - -Signed-off-by: Sean Wang -Signed-off-by: Landen Chao ---- - .../devicetree/bindings/net/dsa/mt7530.txt | 77 ++++++++++++++++++- - 1 file changed, 74 insertions(+), 3 deletions(-) - ---- a/Documentation/devicetree/bindings/net/dsa/mt7530.txt -+++ b/Documentation/devicetree/bindings/net/dsa/mt7530.txt -@@ -5,6 +5,7 @@ Required properties: - - - compatible: may be compatible = "mediatek,mt7530" - or compatible = "mediatek,mt7621" -+ or compatible = "mediatek,mt7531" - - #address-cells: Must be 1. - - #size-cells: Must be 0. - - mediatek,mcm: Boolean; if defined, indicates that either MT7530 is the part -@@ -32,10 +33,13 @@ Required properties for the child nodes - - - reg: Port address described must be 6 for CPU port and from 0 to 5 for - user ports. --- phy-mode: String, must be either "trgmii" or "rgmii" for port labeled -- "cpu". -+- phy-mode: String, the follow value would be acceptable for port labeled "cpu" -+ If compatible mediatek,mt7530 or mediatek,mt7621 is set, -+ must be either "trgmii" or "rgmii" -+ If compatible mediatek,mt7531 is set, -+ must be either "sgmii", "1000base-x" or "2500base-x" - --Port 5 of the switch is muxed between: -+Port 5 of mt7530 and mt7621 switch is muxed between: - 1. GMAC5: GMAC5 can interface with another external MAC or PHY. - 2. PHY of port 0 or port 4: PHY interfaces with an external MAC like 2nd GMAC - of the SOC. Used in many setups where port 0/4 becomes the WAN port. -@@ -308,3 +312,70 @@ Example 3: MT7621: Port 5 is connected t - }; - }; - }; -+ -+Example 4: -+ -+ð { -+ gmac0: mac@0 { -+ compatible = "mediatek,eth-mac"; -+ reg = <0>; -+ phy-mode = "2500base-x"; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ pause; -+ }; -+ }; -+ -+ &mdio0 { -+ switch@0 { -+ compatible = "mediatek,mt7531"; -+ reg = <0>; -+ reset-gpios = <&pio 54 0>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ -+ port@0 { -+ reg = <0>; -+ label = "lan0"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan1"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan2"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "lan3"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "wan"; -+ }; -+ -+ port@6 { -+ reg = <6>; -+ label = "cpu"; -+ ethernet = <&gmac0>; -+ phy-mode = "2500base-x"; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ pause; -+ }; -+ }; -+ }; -+ }; -+ }; diff --git a/target/linux/mediatek/patches-5.4/0600-4-6-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch b/target/linux/mediatek/patches-5.4/0600-4-6-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch deleted file mode 100644 index 299ac24c7..000000000 --- a/target/linux/mediatek/patches-5.4/0600-4-6-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch +++ /dev/null @@ -1,1096 +0,0 @@ -From patchwork Tue Dec 10 08:14:40 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Landen Chao -X-Patchwork-Id: 1206959 -X-Patchwork-Delegate: davem@davemloft.net -Return-Path: -X-Original-To: patchwork-incoming-netdev@ozlabs.org -Delivered-To: patchwork-incoming-netdev@ozlabs.org -Authentication-Results: ozlabs.org; spf=none (no SPF record) - smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; - helo=vger.kernel.org; - envelope-from=netdev-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.b="A6fsNqWU"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 47XCXz2fDsz9sPh - for ; - Tue, 10 Dec 2019 19:15:15 +1100 (AEDT) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727198AbfLJIPC (ORCPT - ); - Tue, 10 Dec 2019 03:15:02 -0500 -Received: from mailgw02.mediatek.com ([210.61.82.184]:39119 "EHLO - mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by - vger.kernel.org with ESMTP id S1726750AbfLJIPC (ORCPT - ); Tue, 10 Dec 2019 03:15:02 -0500 -X-UUID: 38155314c18e497aacbec5bc0f664b9a-20191210 -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=mediatek.com; s=dk; - h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; - bh=sEkoMPWKI3m+K/8A3kC0uuYTNxZZaGCvfLKvnEmwQQ4=; - b=A6fsNqWUmjxIiZPLPb43Hs36qwwvYXMLQ/LlU24IcsfBro20uMkDbzGq522r69u0071Qgekwc/zs4yujo0pz40jCfnAo38JIDP73w4ZyVGuOENM5gdE+qNNUednOVSi052hcMRhS7zpVD0Rfl7vKKOU42F7Tl+cadVzjUl0ow/s=; -X-UUID: 38155314c18e497aacbec5bc0f664b9a-20191210 -Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by - mailgw02.mediatek.com (envelope-from ) - (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) - with ESMTP id 452927388; Tue, 10 Dec 2019 16:14:46 +0800 -Received: from mtkcas08.mediatek.inc (172.21.101.126) by - mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server - (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 16:14:31 +0800 -Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc - (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via - Frontend Transport; Tue, 10 Dec 2019 16:14:26 +0800 -From: Landen Chao -To: , , - , , - , -CC: , , - , - , , - , , - , Landen Chao -Subject: [PATCH net-next 4/6] net: dsa: mt7530: Add the support of MT7531 - switch -Date: Tue, 10 Dec 2019 16:14:40 +0800 -Message-ID: <6d608dd024edc90b09ba4fe35417b693847f973c.1575914275.git.landen.chao@mediatek.com> -X-Mailer: git-send-email 2.18.0 -In-Reply-To: -References: -MIME-Version: 1.0 -X-MTK: N -Sender: netdev-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: netdev@vger.kernel.org - -Add new support for MT7531: - -MT7531 is the next generation of MT7530. It is also a 7-ports switch with -5 giga embedded phys, 2 cpu ports, and the same MAC logic of MT7530. Cpu -port 6 only supports HSGMII interface. Cpu port 5 supports either RGMII -or HSGMII in different HW sku. Due to HSGMII interface support, pll, and -pad setting are different from MT7530. This patch adds different initial -setting of MT7531. - -Signed-off-by: Landen Chao -Signed-off-by: Sean Wang ---- - drivers/net/dsa/Kconfig | 6 +- - drivers/net/dsa/mt7530.c | 643 ++++++++++++++++++++++++++++++++++++++- - drivers/net/dsa/mt7530.h | 144 +++++++++ - 3 files changed, 784 insertions(+), 9 deletions(-) - ---- a/drivers/net/dsa/Kconfig -+++ b/drivers/net/dsa/Kconfig -@@ -33,12 +33,12 @@ config NET_DSA_LANTIQ_GSWIP - the xrx200 / VR9 SoC. - - config NET_DSA_MT7530 -- tristate "MediaTek MT7530 and MT7621 Ethernet switch support" -+ tristate "MediaTek MT753x and MT7621 Ethernet switch support" - depends on NET_DSA - select NET_DSA_TAG_MTK - ---help--- -- This enables support for the MediaTek MT7530 and MT7621 Ethernet -- switch chip. -+ This enables support for the MediaTek MT7530, MT7531 and MT7621 -+ Ethernet switch chip. - - config NET_DSA_MV88E6060 - tristate "Marvell 88E6060 ethernet switch chip support" ---- a/drivers/net/dsa/mt7530.c -+++ b/drivers/net/dsa/mt7530.c -@@ -234,6 +234,12 @@ mt7530_write(struct mt7530_priv *priv, u - } - - static u32 -+_mt7530_unlocked_read(struct mt7530_dummy_poll *p) -+{ -+ return mt7530_mii_read(p->priv, p->reg); -+} -+ -+static u32 - _mt7530_read(struct mt7530_dummy_poll *p) - { - struct mii_bus *bus = p->priv->bus; -@@ -287,6 +293,102 @@ mt7530_clear(struct mt7530_priv *priv, u - } - - static int -+mt7531_ind_mmd_phy_read(struct mt7530_priv *priv, int port, int devad, -+ int regnum) -+{ -+ struct mii_bus *bus = priv->bus; -+ struct mt7530_dummy_poll p; -+ u32 reg, val; -+ int ret; -+ -+ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); -+ -+ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ reg = MDIO_CL45_ADDR | MDIO_PHY_ADDR(port) | MDIO_DEV_ADDR(devad) | -+ regnum; -+ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | PHY_ACS_ST); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ reg = MDIO_CL45_READ | MDIO_PHY_ADDR(port) | MDIO_DEV_ADDR(devad); -+ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | PHY_ACS_ST); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ ret = val & MDIO_RW_DATA_MASK; -+out: -+ mutex_unlock(&bus->mdio_lock); -+ -+ return ret; -+} -+ -+static int -+mt7531_ind_mmd_phy_write(struct mt7530_priv *priv, int port, int devad, -+ int regnum, u32 data) -+{ -+ struct mii_bus *bus = priv->bus; -+ struct mt7530_dummy_poll p; -+ u32 val, reg; -+ int ret; -+ -+ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); -+ -+ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ reg = MDIO_CL45_ADDR | MDIO_PHY_ADDR(port) | MDIO_DEV_ADDR(devad) | -+ regnum; -+ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | PHY_ACS_ST); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ reg = MDIO_CL45_WRITE | MDIO_PHY_ADDR(port) | MDIO_DEV_ADDR(devad) | -+ data; -+ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | PHY_ACS_ST); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+out: -+ mutex_unlock(&bus->mdio_lock); -+ -+ return ret; -+} -+ -+static int - mt7530_fdb_cmd(struct mt7530_priv *priv, enum mt7530_fdb_cmd cmd, u32 *rsp) - { - u32 val; -@@ -516,6 +618,83 @@ static int mt7530_phy_write(struct dsa_s - return mdiobus_write_nested(priv->bus, port, regnum, val); - } - -+static int -+mt7531_ind_phy_read(struct dsa_switch *ds, int port, int regnum) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ struct mii_bus *bus = priv->bus; -+ struct mt7530_dummy_poll p; -+ int ret; -+ u32 val; -+ -+ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); -+ -+ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ val = MDIO_CL22_READ | MDIO_PHY_ADDR(port) | MDIO_REG_ADDR(regnum); -+ -+ mt7530_mii_write(priv, MT7531_PHY_IAC, val | PHY_ACS_ST); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, -+ !(val & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ ret = val & MDIO_RW_DATA_MASK; -+out: -+ mutex_unlock(&bus->mdio_lock); -+ -+ return ret; -+} -+ -+static int -+mt7531_ind_phy_write(struct dsa_switch *ds, int port, int regnum, -+ u16 data) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ struct mii_bus *bus = priv->bus; -+ struct mt7530_dummy_poll p; -+ int ret; -+ u32 reg; -+ -+ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); -+ -+ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg, -+ !(reg & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+ reg = MDIO_CL22_WRITE | MDIO_PHY_ADDR(port) | MDIO_REG_ADDR(regnum) | -+ data; -+ -+ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | PHY_ACS_ST); -+ -+ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg, -+ !(reg & PHY_ACS_ST), 20, 100000); -+ if (ret < 0) { -+ dev_err(priv->dev, "poll timeout\n"); -+ goto out; -+ } -+ -+out: -+ mutex_unlock(&bus->mdio_lock); -+ -+ return ret; -+} -+ - static void - mt7530_get_strings(struct dsa_switch *ds, int port, u32 stringset, - uint8_t *data) -@@ -1355,6 +1534,86 @@ mt7530_setup(struct dsa_switch *ds) - return 0; - } - -+static int mt7531_setup(struct dsa_switch *ds) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ struct mt7530_dummy_poll p; -+ u32 val, id; -+ int ret, i; -+ -+ /* Reset whole chip through gpio pin or memory-mapped registers for -+ * different type of hardware -+ */ -+ if (priv->mcm) { -+ reset_control_assert(priv->rstc); -+ usleep_range(1000, 1100); -+ reset_control_deassert(priv->rstc); -+ } else { -+ gpiod_set_value_cansleep(priv->reset, 0); -+ usleep_range(1000, 1100); -+ gpiod_set_value_cansleep(priv->reset, 1); -+ } -+ -+ /* Waiting for MT7530 got to stable */ -+ INIT_MT7530_DUMMY_POLL(&p, priv, MT7530_HWTRAP); -+ ret = readx_poll_timeout(_mt7530_read, &p, val, val != 0, -+ 20, 1000000); -+ if (ret < 0) { -+ dev_err(priv->dev, "reset timeout\n"); -+ return ret; -+ } -+ -+ id = mt7530_read(priv, MT7531_CREV); -+ id >>= CHIP_NAME_SHIFT; -+ -+ if (id != MT7531_ID) { -+ dev_err(priv->dev, "chip %x can't be supported\n", id); -+ return -ENODEV; -+ } -+ -+ /* Reset the switch through internal reset */ -+ mt7530_write(priv, MT7530_SYS_CTRL, -+ SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | -+ SYS_CTRL_REG_RST); -+ -+ priv->p6_interface = PHY_INTERFACE_MODE_NA; -+ -+ /* Enable PHY power, since phy_device has not yet been created -+ * provided for phy_[read,write]_mmd_indirect is called, we provide -+ * our own mt7531_ind_mmd_phy_[read,write] to complete this -+ * function. -+ */ -+ val = mt7531_ind_mmd_phy_read(priv, 0, PHY_DEV1F, -+ MT7531_PHY_DEV1F_REG_403); -+ val |= MT7531_PHY_EN_BYPASS_MODE; -+ val &= ~MT7531_PHY_POWER_OFF; -+ mt7531_ind_mmd_phy_write(priv, 0, PHY_DEV1F, -+ MT7531_PHY_DEV1F_REG_403, val); -+ -+ /* Enable and reset MIB counters */ -+ mt7530_mib_reset(ds); -+ -+ mt7530_clear(priv, MT7530_MFC, UNU_FFP_MASK); -+ -+ for (i = 0; i < MT7530_NUM_PORTS; i++) { -+ /* Disable forwarding by default on all ports */ -+ mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK, -+ PCR_MATRIX_CLR); -+ -+ if (dsa_is_cpu_port(ds, i)) -+ mt7530_cpu_port_enable(priv, i); -+ else -+ mt7530_port_disable(ds, i); -+ } -+ -+ /* Flush the FDB table */ -+ ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL); -+ if (ret < 0) -+ return ret; -+ -+ return 0; -+} -+ - static bool mt7530_phy_supported(struct dsa_switch *ds, int port, - const struct phylink_link_state *state) - { -@@ -1392,6 +1651,49 @@ unsupported: - return false; - } - -+static bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv) -+{ -+ u32 val; -+ -+ val = mt7530_read(priv, MT7531_TOP_SIG_SR); -+ return ((val & PAD_DUAL_SGMII_EN) != 0); -+} -+ -+static bool mt7531_phy_supported(struct dsa_switch *ds, int port, -+ const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ switch (port) { -+ case 0: /* Internal phy */ -+ case 1: -+ case 2: -+ case 3: -+ case 4: -+ if (state->interface != PHY_INTERFACE_MODE_GMII) -+ goto unsupported; -+ break; -+ case 5: /* 2nd cpu port supports either rgmii or sgmii/8023z */ -+ if (!mt7531_dual_sgmii_supported(priv)) -+ return phy_interface_mode_is_rgmii(state->interface); -+ /* fall through */ -+ case 6: /* 1st cpu port supports sgmii/8023z only */ -+ if (state->interface != PHY_INTERFACE_MODE_SGMII && -+ !phy_interface_mode_is_8023z(state->interface)) -+ goto unsupported; -+ break; -+ default: -+ dev_err(priv->dev, "%s: unsupported port: %i\n", __func__, -+ port); -+ goto unsupported; -+ } -+ -+ return true; -+ -+unsupported: -+ return false; -+} -+ - static bool mt753x_phy_supported(struct dsa_switch *ds, int port, - const struct phylink_link_state *state) - { -@@ -1413,7 +1715,144 @@ mt7530_pad_setup(struct dsa_switch *ds, - * host which must be placed after the setup on the - * device side is all finished. - */ -- mt7623_pad_clk_setup(ds); -+ //mt7623_pad_clk_setup(ds); -+ } -+ -+ return 0; -+} -+ -+static int -+mt7531_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ u32 xtal, val; -+ -+ if (mt7531_dual_sgmii_supported(priv)) -+ return 0; -+ -+ xtal = mt7530_read(priv, MT7531_HWTRAP) & HWTRAP_XTAL_FSEL_MASK; -+ -+ switch (xtal) { -+ case HWTRAP_XTAL_FSEL_25MHZ: -+ /* Step 1 : Disable MT7531 COREPLL */ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val &= ~EN_COREPLL; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ -+ /* Step 2: switch to XTAL output */ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val |= SW_CLKSW; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_EN; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ /* Step 3: disable PLLGP and enable program PLLGP */ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val |= SW_PLLGP; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ -+ /* Step 4: program COREPLL output frequency to 500MHz */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_POSDIV_M; -+ val |= 2 << RG_COREPLL_POSDIV_S; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ usleep_range(25, 35); -+ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_SDM_PCW_M; -+ val |= 0x140000 << RG_COREPLL_SDM_PCW_S; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ /* Set feedback divide ratio update signal to high */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val |= RG_COREPLL_SDM_PCW_CHG; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ /* Wait for at least 16 XTAL clocks */ -+ usleep_range(10, 20); -+ -+ /* Step 5: set feedback divide ratio update signal to low */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_SDM_PCW_CHG; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ /* Enable 325M clock for SGMII */ -+ mt7530_write(priv, MT7531_ANA_PLLGP_CR5, 0xad0000); -+ -+ /* Enable 250SSC clock for RGMII */ -+ mt7530_write(priv, MT7531_ANA_PLLGP_CR2, 0x4f40000); -+ -+ /* Step 6: Enable MT7531 PLL */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val |= RG_COREPLL_EN; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val |= EN_COREPLL; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ usleep_range(25, 35); -+ break; -+ case HWTRAP_XTAL_FSEL_40MHZ: -+ /* Step 1 : Disable MT7531 COREPLL */ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val &= ~EN_COREPLL; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ -+ /* Step 2: switch to XTAL output */ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val |= SW_CLKSW; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_EN; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ /* Step 3: disable PLLGP and enable program PLLGP */ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val |= SW_PLLGP; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ -+ /* Step 4: program COREPLL output frequency to 500MHz */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_POSDIV_M; -+ val |= 2 << RG_COREPLL_POSDIV_S; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ usleep_range(25, 35); -+ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_SDM_PCW_M; -+ val |= 0x190000 << RG_COREPLL_SDM_PCW_S; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ /* Set feedback divide ratio update signal to high */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val |= RG_COREPLL_SDM_PCW_CHG; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ /* Wait for at least 16 XTAL clocks */ -+ usleep_range(10, 20); -+ -+ /* Step 5: set feedback divide ratio update signal to low */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val &= ~RG_COREPLL_SDM_PCW_CHG; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ /* Enable 325M clock for SGMII */ -+ mt7530_write(priv, MT7531_ANA_PLLGP_CR5, 0xad0000); -+ -+ /* Enable 250SSC clock for RGMII */ -+ mt7530_write(priv, MT7531_ANA_PLLGP_CR2, 0x4f40000); -+ -+ /* Step 6: Enable MT7531 PLL */ -+ val = mt7530_read(priv, MT7531_PLLGP_CR0); -+ val |= RG_COREPLL_EN; -+ mt7530_write(priv, MT7531_PLLGP_CR0, val); -+ -+ val = mt7530_read(priv, MT7531_PLLGP_EN); -+ val |= EN_COREPLL; -+ mt7530_write(priv, MT7531_PLLGP_EN, val); -+ usleep_range(25, 35); -+ break; - } - - return 0; -@@ -1442,6 +1881,149 @@ mt7530_mac_setup(struct dsa_switch *ds, - return 0; - } - -+static int mt7531_rgmii_setup(struct mt7530_priv *priv, u32 port) -+{ -+ u32 val; -+ -+ if (port != 5) { -+ dev_err(priv->dev, "RGMII mode is not available for port %d\n", -+ port); -+ return -EINVAL; -+ } -+ -+ val = mt7530_read(priv, MT7531_CLKGEN_CTRL); -+ val |= GP_CLK_EN; -+ val &= ~GP_MODE_MASK; -+ val |= GP_MODE(MT7531_GP_MODE_RGMII); -+ val |= TXCLK_NO_REVERSE; -+ val |= RXCLK_NO_DELAY; -+ val &= ~CLK_SKEW_IN_MASK; -+ val |= CLK_SKEW_IN(MT7531_CLK_SKEW_NO_CHG); -+ val &= ~CLK_SKEW_OUT_MASK; -+ val |= CLK_SKEW_OUT(MT7531_CLK_SKEW_NO_CHG); -+ mt7530_write(priv, MT7531_CLKGEN_CTRL, val); -+ -+ return 0; -+} -+ -+static int mt7531_sgmii_setup_mode_force(struct mt7530_priv *priv, u32 port, -+ const struct phylink_link_state *state) -+{ -+ u32 val; -+ -+ if (port != 5 && port != 6) -+ return -EINVAL; -+ -+ val = mt7530_read(priv, MT7531_QPHY_PWR_STATE_CTRL(port)); -+ val |= MT7531_SGMII_PHYA_PWD; -+ mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), val); -+ -+ val = mt7530_read(priv, MT7531_PHYA_CTRL_SIGNAL3(port)); -+ val &= ~MT7531_RG_TPHY_SPEED_MASK; -+ if (state->interface == PHY_INTERFACE_MODE_2500BASEX) -+ val |= MT7531_RG_TPHY_SPEED_3_125G; -+ mt7530_write(priv, MT7531_PHYA_CTRL_SIGNAL3(port), val); -+ -+ val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); -+ val &= ~MT7531_SGMII_AN_ENABLE; -+ mt7530_write(priv, MT7531_PCS_CONTROL_1(port), val); -+ -+ val = mt7530_read(priv, MT7531_SGMII_MODE(port)); -+ val &= ~MT7531_SGMII_IF_MODE_MASK; -+ -+ switch (state->speed) { -+ case SPEED_10: -+ val |= MT7531_SGMII_FORCE_SPEED_10; -+ break; -+ case SPEED_100: -+ val |= MT7531_SGMII_FORCE_SPEED_100; -+ break; -+ case SPEED_2500: -+ case SPEED_1000: -+ val |= MT7531_SGMII_FORCE_SPEED_1000; -+ break; -+ }; -+ -+ val &= ~MT7531_SGMII_FORCE_DUPLEX; -+ /* For sgmii force mode, 0 is full duplex and 1 is half duplex */ -+ if (state->duplex == DUPLEX_HALF) -+ val |= MT7531_SGMII_FORCE_DUPLEX; -+ -+ mt7530_write(priv, MT7531_SGMII_MODE(port), val); -+ -+ val = mt7530_read(priv, MT7531_QPHY_PWR_STATE_CTRL(port)); -+ val &= ~MT7531_SGMII_PHYA_PWD; -+ mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), val); -+ -+ return 0; -+} -+ -+static int mt7531_sgmii_setup_mode_an(struct mt7530_priv *priv, int port, -+ const struct phylink_link_state *state) -+{ -+ u32 val; -+ -+ if (port != 5 && port != 6) -+ return -EINVAL; -+ -+ val = mt7530_read(priv, MT7531_QPHY_PWR_STATE_CTRL(port)); -+ val |= MT7531_SGMII_PHYA_PWD; -+ mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), val); -+ -+ switch (state->speed) { -+ case SPEED_10: -+ case SPEED_100: -+ case SPEED_1000: -+ val = mt7530_read(priv, MT7531_PHYA_CTRL_SIGNAL3(port)); -+ val &= ~MT7531_RG_TPHY_SPEED_MASK; -+ mt7530_write(priv, MT7531_PHYA_CTRL_SIGNAL3(port), val); -+ break; -+ default: -+ dev_info(priv->dev, "invalid SGMII speed idx %d for port %d\n", -+ state->speed, port); -+ -+ return -EINVAL; -+ } -+ -+ val = mt7530_read(priv, MT7531_SGMII_MODE(port)); -+ val |= MT7531_SGMII_REMOTE_FAULT_DIS; -+ mt7530_write(priv, MT7531_SGMII_MODE(port), val); -+ -+ val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); -+ val |= MT7531_SGMII_AN_RESTART; -+ mt7530_write(priv, MT7531_PCS_CONTROL_1(port), val); -+ -+ val = mt7530_read(priv, MT7531_QPHY_PWR_STATE_CTRL(port)); -+ val &= ~MT7531_SGMII_PHYA_PWD; -+ mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), val); -+ -+ return 0; -+} -+ -+static int -+mt7531_mac_setup(struct dsa_switch *ds, int port, unsigned int mode, -+ const struct phylink_link_state *state) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ if (port < 5 || port >= MT7530_NUM_PORTS) { -+ dev_err(priv->dev, "port %d is not a MAC port\n", port); -+ return -EINVAL; -+ } -+ -+ switch (state->interface) { -+ case PHY_INTERFACE_MODE_RGMII: -+ return mt7531_rgmii_setup(priv, port); -+ case PHY_INTERFACE_MODE_1000BASEX: -+ case PHY_INTERFACE_MODE_2500BASEX: -+ return mt7531_sgmii_setup_mode_force(priv, port, state); -+ case PHY_INTERFACE_MODE_SGMII: -+ return mt7531_sgmii_setup_mode_an(priv, port, state); -+ default: -+ return -EINVAL; -+ } -+} -+ - static int mt753x_mac_setup(struct dsa_switch *ds, int port, unsigned int mode, - const struct phylink_link_state *state) - { -@@ -1473,22 +2055,23 @@ static void mt753x_phylink_mac_config(st - if (priv->p5_interface == state->interface) - break; - if (mt753x_mac_setup(ds, port, mode, state) < 0) -- goto unsupported; -+ break; -+ priv->p5_interface = state->interface; - break; - case 6: /* 1st cpu port */ - if (priv->p6_interface == state->interface) - break; - mt753x_pad_setup(ds, state); - if (mt753x_mac_setup(ds, port, mode, state) < 0) -- goto unsupported; -+ break; - priv->p6_interface = state->interface; - break; - default: -- dev_err(ds->dev, "%s: unsupported port: %i\n", __func__, port); - return; - } - -- if (phylink_autoneg_inband(mode)) { -+ if (phylink_autoneg_inband(mode) && -+ state->interface != PHY_INTERFACE_MODE_SGMII) { - dev_err(ds->dev, "%s: in-band negotiation unsupported\n", - __func__); - return; -@@ -1499,13 +2082,15 @@ static void mt753x_phylink_mac_config(st - mcr_new &= ~(PMCR_FORCE_SPEED_1000 | PMCR_FORCE_SPEED_100 | - PMCR_FORCE_FDX | PMCR_TX_FC_EN | PMCR_RX_FC_EN); - mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | -- PMCR_BACKPR_EN | PMCR_FORCE_MODE; -+ PMCR_BACKPR_EN | PMCR_FORCE_MODE_ID(priv->id) | -+ PMCR_FORCE_LNK; - - /* Are we connected to external phy */ - if (port == 5 && dsa_is_user_port(ds, 5)) - mcr_new |= PMCR_EXT_PHY; - - switch (state->speed) { -+ case SPEED_2500: - case SPEED_1000: - mcr_new |= PMCR_FORCE_SPEED_1000; - if (priv->eee_enable & BIT(port)) -@@ -1529,6 +2114,27 @@ static void mt753x_phylink_mac_config(st - mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); - } - -+void mt7531_sgmii_restart_an(struct dsa_switch *ds, int port) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ u32 val; -+ -+ val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); -+ val |= MT7531_SGMII_AN_RESTART; -+ mt7530_write(priv, MT7531_PCS_CONTROL_1(port), val); -+} -+ -+static void -+mt753x_phylink_mac_an_restart(struct dsa_switch *ds, int port) -+{ -+ struct mt7530_priv *priv = ds->priv; -+ -+ if (!priv->info->port_an_restart) -+ return; -+ -+ priv->info->port_an_restart(ds, port); -+} -+ - static void mt7530_phylink_mac_link_down(struct dsa_switch *ds, int port, - unsigned int mode, - phy_interface_t interface) -@@ -1563,9 +2169,20 @@ static void mt753x_phylink_validate(stru - phylink_set_port_modes(mask); - phylink_set(mask, Autoneg); - -- if (state->interface == PHY_INTERFACE_MODE_TRGMII) { -+ switch (state->interface) { -+ case PHY_INTERFACE_MODE_TRGMII: - phylink_set(mask, 1000baseT_Full); -- } else { -+ break; -+ case PHY_INTERFACE_MODE_1000BASEX: -+ case PHY_INTERFACE_MODE_2500BASEX: -+ phylink_set(mask, 1000baseX_Full); -+ phylink_set(mask, 2500baseX_Full); -+ break; -+ case PHY_INTERFACE_MODE_SGMII: -+ phylink_set(mask, 1000baseT_Full); -+ phylink_set(mask, 1000baseX_Full); -+ /* fall through */ -+ default: - phylink_set(mask, 10baseT_Half); - phylink_set(mask, 10baseT_Full); - phylink_set(mask, 100baseT_Half); -@@ -1577,6 +2194,7 @@ static void mt753x_phylink_validate(stru - if (port == 5) - phylink_set(mask, 1000baseX_Full); - } -+ break; - } - - phylink_set(mask, Pause); -@@ -1721,8 +2339,9 @@ static const struct dsa_switch_ops mt753 - .port_mirror_add = mt7530_port_mirror_add, - .port_mirror_del = mt7530_port_mirror_del, - .phylink_validate = mt753x_phylink_validate, -- .phylink_mac_link_state = mt7530_phylink_mac_link_state, -+ .phylink_mac_link_state = mt7530_phylink_mac_link_state, - .phylink_mac_config = mt753x_phylink_mac_config, -+ .phylink_mac_an_restart = mt753x_phylink_mac_an_restart, - .phylink_mac_link_down = mt7530_phylink_mac_link_down, - .phylink_mac_link_up = mt7530_phylink_mac_link_up, - .get_mac_eee = mt7530_get_mac_eee, -@@ -1748,11 +2367,22 @@ static const struct mt753x_info mt753x_t - .pad_setup = mt7530_pad_setup, - .mac_setup = mt7530_mac_setup, - }, -+ [ID_MT7531] = { -+ .id = ID_MT7531, -+ .setup = mt7531_setup, -+ .phy_read = mt7531_ind_phy_read, -+ .phy_write = mt7531_ind_phy_write, -+ .phy_supported = mt7531_phy_supported, -+ .pad_setup = mt7531_pad_setup, -+ .mac_setup = mt7531_mac_setup, -+ .port_an_restart = mt7531_sgmii_restart_an, -+ }, - }; - - static const struct of_device_id mt7530_of_match[] = { - { .compatible = "mediatek,mt7621", .data = &mt753x_table[ID_MT7621], }, - { .compatible = "mediatek,mt7530", .data = &mt753x_table[ID_MT7530], }, -+ { .compatible = "mediatek,mt7531", .data = &mt753x_table[ID_MT7531], }, - { /* sentinel */ }, - }; - MODULE_DEVICE_TABLE(of, mt7530_of_match); ---- a/drivers/net/dsa/mt7530.h -+++ b/drivers/net/dsa/mt7530.h -@@ -14,6 +14,7 @@ - enum mt753x_id { - ID_MT7530 = 0, - ID_MT7621 = 1, -+ ID_MT7531 = 2, - }; - - #define NUM_TRGMII_CTRL 5 -@@ -222,6 +223,19 @@ enum mt7530_vlan_port_attr { - #define PMCR_FORCE_LNK BIT(0) - #define PMCR_SPEED_MASK (PMCR_FORCE_SPEED_100 | \ - PMCR_FORCE_SPEED_1000) -+#define MT7531_FORCE_LNK BIT(31) -+#define MT7531_FORCE_SPD BIT(30) -+#define MT7531_FORCE_DPX BIT(29) -+#define MT7531_FORCE_RX_FC BIT(28) -+#define MT7531_FORCE_TX_FC BIT(27) -+#define MT7531_FORCE_MODE (MT7531_FORCE_LNK | \ -+ MT7531_FORCE_SPD | \ -+ MT7531_FORCE_DPX | \ -+ MT7531_FORCE_RX_FC | \ -+ MT7531_FORCE_TX_FC) -+#define PMCR_FORCE_MODE_ID(id) (((id) == ID_MT7531) ? \ -+ MT7531_FORCE_MODE : \ -+ PMCR_FORCE_MODE) - - #define MT7530_PMSR_P(x) (0x3008 + (x) * 0x100) - #define PMSR_EEE1G BIT(7) -@@ -258,12 +272,111 @@ enum mt7530_vlan_port_attr { - CCR_RX_OCT_CNT_BAD | \ - CCR_TX_OCT_CNT_GOOD | \ - CCR_TX_OCT_CNT_BAD) -+ -+/* SGMII registers */ -+#define MT7531_SGMII_REG_BASE 0x5000 -+#define MT7531_SGMII_REG(p, r) (MT7531_SGMII_REG_BASE + \ -+ ((p) - 5) * 0x1000 + (r)) -+ -+/* SGMII PCS_CONTROL_1 */ -+#define MT7531_PCS_CONTROL_1(p) MT7531_SGMII_REG(p, 0x00) -+#define MT7531_SGMII_LINK_STATUS BIT(18) -+#define MT7531_SGMII_AN_ENABLE BIT(12) -+#define MT7531_SGMII_AN_RESTART BIT(9) -+ -+/* Fields of SGMII_MODE */ -+#define MT7531_SGMII_MODE(p) MT7531_SGMII_REG(p, 0x20) -+#define MT7531_SGMII_REMOTE_FAULT_DIS BIT(8) -+#define MT7531_SGMII_FORCE_DUPLEX BIT(4) -+#define MT7531_SGMII_IF_MODE_MASK GENMASK(5, 1) -+#define MT7531_SGMII_FORCE_SPEED_10 0x0 -+#define MT7531_SGMII_FORCE_SPEED_100 BIT(2) -+#define MT7531_SGMII_FORCE_SPEED_1000 BIT(3) -+ -+/* Fields of QPHY_PWR_STATE_CTRL */ -+#define MT7531_QPHY_PWR_STATE_CTRL(p) MT7531_SGMII_REG(p, 0xe8) -+#define MT7531_SGMII_PHYA_PWD BIT(4) -+ -+/* Values of SGMII SPEED */ -+#define MT7531_PHYA_CTRL_SIGNAL3(p) MT7531_SGMII_REG(p, 0x128) -+#define MT7531_RG_TPHY_SPEED_MASK (BIT(2) | BIT(3)) -+#define MT7531_RG_TPHY_SPEED_1_25G 0x0 -+#define MT7531_RG_TPHY_SPEED_3_125G BIT(2) -+ - /* Register for system reset */ - #define MT7530_SYS_CTRL 0x7000 - #define SYS_CTRL_PHY_RST BIT(2) - #define SYS_CTRL_SW_RST BIT(1) - #define SYS_CTRL_REG_RST BIT(0) - -+/* Register for PHY Indirect Access Control */ -+#define MT7531_PHY_IAC 0x701C -+#define PHY_ACS_ST BIT(31) -+#define MDIO_REG_ADDR_MASK (0x1f << 25) -+#define MDIO_PHY_ADDR_MASK (0x1f << 20) -+#define MDIO_CMD_MASK (0x3 << 18) -+#define MDIO_ST_MASK (0x3 << 16) -+#define MDIO_RW_DATA_MASK (0xffff) -+#define MDIO_REG_ADDR(x) (((x) & 0x1f) << 25) -+#define MDIO_DEV_ADDR(x) (((x) & 0x1f) << 25) -+#define MDIO_PHY_ADDR(x) (((x) & 0x1f) << 20) -+#define MDIO_CMD(x) (((x) & 0x3) << 18) -+#define MDIO_ST(x) (((x) & 0x3) << 16) -+ -+enum mt7531_phy_iac_cmd { -+ MT7531_MDIO_ADDR = 0, -+ MT7531_MDIO_WRITE = 1, -+ MT7531_MDIO_READ = 2, -+ MT7531_MDIO_READ_CL45 = 3, -+}; -+ -+/* MDIO_ST: MDIO start field */ -+enum mt7531_mdio_st { -+ MT7531_MDIO_ST_CL45 = 0, -+ MT7531_MDIO_ST_CL22 = 1, -+}; -+ -+#define MDIO_CL22_READ (MDIO_ST(MT7531_MDIO_ST_CL22) | \ -+ MDIO_CMD(MT7531_MDIO_READ)) -+#define MDIO_CL22_WRITE (MDIO_ST(MT7531_MDIO_ST_CL22) | \ -+ MDIO_CMD(MT7531_MDIO_WRITE)) -+#define MDIO_CL45_ADDR (MDIO_ST(MT7531_MDIO_ST_CL45) | \ -+ MDIO_CMD(MT7531_MDIO_ADDR)) -+#define MDIO_CL45_READ (MDIO_ST(MT7531_MDIO_ST_CL45) | \ -+ MDIO_CMD(MT7531_MDIO_READ)) -+#define MDIO_CL45_WRITE (MDIO_ST(MT7531_MDIO_ST_CL45) | \ -+ MDIO_CMD(MT7531_MDIO_WRITE)) -+ -+#define MT7531_CLKGEN_CTRL 0x7500 -+#define CLK_SKEW_OUT(x) (((x) & 0x3) << 8) -+#define CLK_SKEW_OUT_MASK (0x3 << 8) -+#define CLK_SKEW_IN(x) (((x) & 0x3) << 6) -+#define CLK_SKEW_IN_MASK (0x3 << 6) -+#define RXCLK_NO_DELAY BIT(5) -+#define TXCLK_NO_REVERSE BIT(4) -+#define GP_MODE(x) (((x) & 0x3) << 1) -+#define GP_MODE_MASK (0x3 << 1) -+#define GP_CLK_EN BIT(0) -+ -+#define PHY_DEV1F 0x1f -+#define MT7531_PHY_DEV1F_REG_403 0x403 -+ -+#define MT7531_PHY_EN_BYPASS_MODE BIT(4) -+#define MT7531_PHY_POWER_OFF BIT(5) -+ -+enum mt7531_gp_mode { -+ MT7531_GP_MODE_RGMII = 0, -+ MT7531_GP_MODE_MII = 1, -+ MT7531_GP_MODE_REV_MII = 2 -+}; -+ -+enum mt7531_clk_skew { -+ MT7531_CLK_SKEW_NO_CHG = 0, -+ MT7531_CLK_SKEW_DLY_100PPS = 1, -+ MT7531_CLK_SKEW_DLY_200PPS = 2, -+ MT7531_CLK_SKEW_REVERSE = 3, -+}; -+ - /* Register for hw trap status */ - #define MT7530_HWTRAP 0x7800 - #define HWTRAP_XTAL_MASK (BIT(10) | BIT(9)) -@@ -271,6 +384,11 @@ enum mt7530_vlan_port_attr { - #define HWTRAP_XTAL_40MHZ (BIT(10)) - #define HWTRAP_XTAL_20MHZ (BIT(9)) - -+#define MT7531_HWTRAP 0x7800 -+#define HWTRAP_XTAL_FSEL_MASK BIT(7) -+#define HWTRAP_XTAL_FSEL_25MHZ BIT(7) -+#define HWTRAP_XTAL_FSEL_40MHZ 0 -+ - /* Register for hw trap modification */ - #define MT7530_MHWTRAP 0x7804 - #define MHWTRAP_PHY0_SEL BIT(20) -@@ -285,14 +403,34 @@ enum mt7530_vlan_port_attr { - #define MT7530_TOP_SIG_CTRL 0x7808 - #define TOP_SIG_CTRL_NORMAL (BIT(17) | BIT(16)) - -+#define MT7531_TOP_SIG_SR 0x780c -+#define PAD_DUAL_SGMII_EN BIT(1) -+ - #define MT7530_IO_DRV_CR 0x7810 - #define P5_IO_CLK_DRV(x) ((x) & 0x3) - #define P5_IO_DATA_DRV(x) (((x) & 0x3) << 4) - -+#define MT7531_PLLGP_EN 0x7820 -+#define EN_COREPLL BIT(2) -+#define SW_CLKSW BIT(1) -+#define SW_PLLGP BIT(0) -+ -+#define MT7531_PLLGP_CR0 0x78a8 -+#define RG_COREPLL_EN BIT(22) -+#define RG_COREPLL_POSDIV_S 23 -+#define RG_COREPLL_POSDIV_M 0x3800000 -+#define RG_COREPLL_SDM_PCW_S 1 -+#define RG_COREPLL_SDM_PCW_M 0x3ffffe -+#define RG_COREPLL_SDM_PCW_CHG BIT(0) -+ - #define MT7530_P6ECR 0x7830 - #define P6_INTF_MODE_MASK 0x3 - #define P6_INTF_MODE(x) ((x) & 0x3) - -+/* RGMII and SGMII PLL clock */ -+#define MT7531_ANA_PLLGP_CR2 0x78b0 -+#define MT7531_ANA_PLLGP_CR5 0x78bc -+ - /* Registers for TRGMII on the both side */ - #define MT7530_TRGMII_RCK_CTRL 0x7a00 - #define RX_RST BIT(31) -@@ -335,6 +473,9 @@ enum mt7530_vlan_port_attr { - #define CHIP_NAME_SHIFT 16 - #define MT7530_ID 0x7530 - -+#define MT7531_CREV 0x781C -+#define MT7531_ID 0x7531 -+ - /* Registers for core PLL access through mmd indirect */ - #define CORE_PLL_GROUP2 0x401 - #define RG_SYSPLL_EN_NORMAL BIT(15) -@@ -458,6 +599,8 @@ static const char *p5_intf_modes(unsigne - * port - * @mac_setup: Holding the way setting up the PHY attribute for a - * certain MAC port -+ * @port_an_restart Holding the way restarting 802.3z BaseX autonegotiation -+ * for a certain MAC port - */ - struct mt753x_info { - enum mt753x_id id; -@@ -471,6 +614,7 @@ struct mt753x_info { - const struct phylink_link_state *state); - int (*mac_setup)(struct dsa_switch *ds, int port, unsigned int mode, - const struct phylink_link_state *state); -+ void (*port_an_restart)(struct dsa_switch *ds, int port); - }; - - /* struct mt7530_priv - This is the main data structure for holding the state diff --git a/target/linux/mediatek/patches-5.4/0600-6-6-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch b/target/linux/mediatek/patches-5.4/0600-6-6-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch deleted file mode 100644 index 8919ad27e..000000000 --- a/target/linux/mediatek/patches-5.4/0600-6-6-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch +++ /dev/null @@ -1,138 +0,0 @@ -From patchwork Tue Dec 10 08:14:42 2019 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Landen Chao -X-Patchwork-Id: 1206964 -X-Patchwork-Delegate: davem@davemloft.net -Return-Path: -X-Original-To: patchwork-incoming-netdev@ozlabs.org -Delivered-To: patchwork-incoming-netdev@ozlabs.org -Authentication-Results: ozlabs.org; spf=none (no SPF record) - smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; - helo=vger.kernel.org; - envelope-from=netdev-owner@vger.kernel.org; - receiver=) -Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) - header.from=mediatek.com -Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; - unprotected) header.d=mediatek.com header.i=@mediatek.com - header.b="eagJVm76"; dkim-atps=neutral -Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) - by ozlabs.org (Postfix) with ESMTP id 47XCYF2fNjz9sR7 - for ; - Tue, 10 Dec 2019 19:15:29 +1100 (AEDT) -Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand - id S1727295AbfLJIP0 (ORCPT - ); - Tue, 10 Dec 2019 03:15:26 -0500 -Received: from mailgw01.mediatek.com ([210.61.82.183]:21469 "EHLO - mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by - vger.kernel.org with ESMTP id S1726062AbfLJIO4 (ORCPT - ); Tue, 10 Dec 2019 03:14:56 -0500 -X-UUID: f9b456136baf42daba0957485d388010-20191210 -DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; - d=mediatek.com; s=dk; - h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; - bh=BT+q/z4xoeKXCk+y25bvARvW/z0vRa1uB7kHqAjvpaw=; - b=eagJVm76XNgnVVvxDHR4QtcIyynPPYY4k7twyvlRAQeSnsJbABh1afLK+LlxnJ0TM069F+hNNzWXq7ZGru/I+gYhmqZcYCt/SkEYgxdTb0VNE+DIW0hmNAOoJ0i23gobJ3xa7JVRfIfeZcbjwRJSuqwzLBRZBLIFzqSs71VZx1Y=; -X-UUID: f9b456136baf42daba0957485d388010-20191210 -Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by - mailgw01.mediatek.com (envelope-from ) - (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) - with ESMTP id 1831961689; Tue, 10 Dec 2019 16:14:48 +0800 -Received: from mtkcas08.mediatek.inc (172.21.101.126) by - mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server - (TLS) id 15.0.1395.4; Tue, 10 Dec 2019 16:14:32 +0800 -Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc - (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via - Frontend Transport; Tue, 10 Dec 2019 16:14:27 +0800 -From: Landen Chao -To: , , - , , - , -CC: , , - , - , , - , , - , Landen Chao -Subject: [PATCH net-next 6/6] arm64: dts: mt7622: add mt7531 dsa to - bananapi-bpi-r64 board -Date: Tue, 10 Dec 2019 16:14:42 +0800 -Message-ID: <62eef5503c117f48d4b41e94fd28d75e123590b4.1575914275.git.landen.chao@mediatek.com> -X-Mailer: git-send-email 2.18.0 -In-Reply-To: -References: -MIME-Version: 1.0 -X-MTK: N -Sender: netdev-owner@vger.kernel.org -Precedence: bulk -List-ID: -X-Mailing-List: netdev@vger.kernel.org - -Add mt7531 dsa to bananapi-bpi-r64 board for 5 giga Ethernet ports support. - -Signed-off-by: Landen Chao ---- - .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 50 +++++++++++++++++++ - 1 file changed, 50 insertions(+) - ---- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts -+++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts -@@ -150,6 +150,56 @@ - mdio: mdio-bus { - #address-cells = <1>; - #size-cells = <0>; -+ -+ switch@0 { -+ compatible = "mediatek,mt7531"; -+ reg = <0>; -+ reset-gpios = <&pio 54 0>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ label = "wan"; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan0"; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan1"; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "lan2"; -+ }; -+ -+ port@4 { -+ reg = <4>; -+ label = "lan3"; -+ }; -+ -+ port@6 { -+ reg = <6>; -+ label = "cpu"; -+ ethernet = <&gmac0>; -+ phy-mode = "2500base-x"; -+ -+ fixed-link { -+ speed = <2500>; -+ full-duplex; -+ pause; -+ }; -+ }; -+ }; -+ }; -+ - }; - }; - diff --git a/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch new file mode 100644 index 000000000..0eac2ed66 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch @@ -0,0 +1,246 @@ +From: Russell King +Date: Wed, 26 Feb 2020 10:23:41 +0000 +Subject: [PATCH] net: phylink: propagate resolved link config via + mac_link_up() + +Propagate the resolved link parameters via the mac_link_up() call for +MACs that do not automatically track their PCS state. We propagate the +link parameters via function arguments so that inappropriate members +of struct phylink_link_state can't be accessed, and creating a new +structure just for this adds needless complexity to the API. + +Tested-by: Andre Przywara +Tested-by: Alexandre Belloni +Tested-by: Vladimir Oltean +Signed-off-by: Russell King +Signed-off-by: David S. Miller +--- + +--- a/Documentation/networking/sfp-phylink.rst ++++ b/Documentation/networking/sfp-phylink.rst +@@ -74,10 +74,13 @@ phylib to the sfp/phylink support. Plea + this documentation. + + 1. Optionally split the network driver's phylib update function into +- three parts dealing with link-down, link-up and reconfiguring the +- MAC settings. This can be done as a separate preparation commit. ++ two parts dealing with link-down and link-up. This can be done as ++ a separate preparation commit. + +- An example of this preparation can be found in git commit fc548b991fb0. ++ An older example of this preparation can be found in git commit ++ fc548b991fb0, although this was splitting into three parts; the ++ link-up part now includes configuring the MAC for the link settings. ++ Please see :c:func:`mac_link_up` for more information on this. + + 2. Replace:: + +@@ -207,6 +210,14 @@ this documentation. + using. This is particularly important for in-band negotiation + methods such as 1000base-X and SGMII. + ++ The :c:func:`mac_link_up` method is used to inform the MAC that the ++ link has come up. The call includes the negotiation mode and interface ++ for reference only. The finalised link parameters are also supplied ++ (speed, duplex and flow control/pause enablement settings) which ++ should be used to configure the MAC when the MAC and PCS are not ++ tightly integrated, or when the settings are not coming from in-band ++ negotiation. ++ + The :c:func:`mac_config` method is used to update the MAC with the + requested state, and must avoid unnecessarily taking the link down + when making changes to the MAC configuration. This means the +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -3653,9 +3653,11 @@ static void mvneta_mac_link_down(struct + mvneta_set_eee(pp, false); + } + +-static void mvneta_mac_link_up(struct phylink_config *config, unsigned int mode, +- phy_interface_t interface, +- struct phy_device *phy) ++static void mvneta_mac_link_up(struct phylink_config *config, ++ struct phy_device *phy, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct net_device *ndev = to_net_dev(config->dev); + struct mvneta_port *pp = netdev_priv(ndev); +--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c ++++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +@@ -58,8 +58,11 @@ static struct { + */ + static void mvpp2_mac_config(struct phylink_config *config, unsigned int mode, + const struct phylink_link_state *state); +-static void mvpp2_mac_link_up(struct phylink_config *config, unsigned int mode, +- phy_interface_t interface, struct phy_device *phy); ++static void mvpp2_mac_link_up(struct phylink_config *config, ++ struct phy_device *phy, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause); + + /* Queue modes */ + #define MVPP2_QDIST_SINGLE_MODE 0 +@@ -3467,8 +3470,9 @@ static void mvpp2_start_dev(struct mvpp2 + .interface = port->phy_interface, + }; + mvpp2_mac_config(&port->phylink_config, MLO_AN_INBAND, &state); +- mvpp2_mac_link_up(&port->phylink_config, MLO_AN_INBAND, +- port->phy_interface, NULL); ++ mvpp2_mac_link_up(&port->phylink_config, NULL, ++ MLO_AN_INBAND, port->phy_interface, ++ SPEED_UNKNOWN, DUPLEX_UNKNOWN, false, false); + } + + netif_tx_start_all_queues(port->dev); +@@ -5124,8 +5128,11 @@ static void mvpp2_mac_config(struct phyl + mvpp2_port_enable(port); + } + +-static void mvpp2_mac_link_up(struct phylink_config *config, unsigned int mode, +- phy_interface_t interface, struct phy_device *phy) ++static void mvpp2_mac_link_up(struct phylink_config *config, ++ struct phy_device *phy, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct net_device *dev = to_net_dev(config->dev); + struct mvpp2_port *port = netdev_priv(dev); +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -446,9 +446,10 @@ static void mtk_mac_link_down(struct phy + mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id)); + } + +-static void mtk_mac_link_up(struct phylink_config *config, unsigned int mode, +- phy_interface_t interface, +- struct phy_device *phy) ++static void mtk_mac_link_up(struct phylink_config *config, ++ struct phy_device *phy, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex, bool tx_pause, bool rx_pause) + { + struct mtk_mac *mac = container_of(config, struct mtk_mac, + phylink_config); +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -951,8 +951,10 @@ static void stmmac_mac_link_down(struct + } + + static void stmmac_mac_link_up(struct phylink_config *config, ++ struct phy_device *phy, + unsigned int mode, phy_interface_t interface, +- struct phy_device *phy) ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -1488,9 +1488,10 @@ static void axienet_mac_link_down(struct + } + + static void axienet_mac_link_up(struct phylink_config *config, +- unsigned int mode, +- phy_interface_t interface, +- struct phy_device *phy) ++ struct phy_device *phy, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + /* nothing meaningful to do */ + } +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -447,8 +447,11 @@ static void phylink_mac_link_up(struct p + struct net_device *ndev = pl->netdev; + + pl->cur_interface = link_state.interface; +- pl->ops->mac_link_up(pl->config, pl->cur_link_an_mode, +- pl->cur_interface, pl->phydev); ++ pl->ops->mac_link_up(pl->config, pl->phydev, ++ pl->cur_link_an_mode, pl->cur_interface, ++ link_state.speed, link_state.duplex, ++ !!(link_state.pause & MLO_PAUSE_TX), ++ !!(link_state.pause & MLO_PAUSE_RX)); + + if (ndev) + netif_carrier_on(ndev); +--- a/include/linux/phylink.h ++++ b/include/linux/phylink.h +@@ -91,9 +91,10 @@ struct phylink_mac_ops { + void (*mac_an_restart)(struct phylink_config *config); + void (*mac_link_down)(struct phylink_config *config, unsigned int mode, + phy_interface_t interface); +- void (*mac_link_up)(struct phylink_config *config, unsigned int mode, +- phy_interface_t interface, +- struct phy_device *phy); ++ void (*mac_link_up)(struct phylink_config *config, ++ struct phy_device *phy, unsigned int mode, ++ phy_interface_t interface, int speed, int duplex, ++ bool tx_pause, bool rx_pause); + }; + + #if 0 /* For kernel-doc purposes only. */ +@@ -217,19 +218,34 @@ void mac_link_down(struct phylink_config + /** + * mac_link_up() - allow the link to come up + * @config: a pointer to a &struct phylink_config. ++ * @phy: any attached phy + * @mode: link autonegotiation mode + * @interface: link &typedef phy_interface_t mode +- * @phy: any attached phy ++ * @speed: link speed ++ * @duplex: link duplex ++ * @tx_pause: link transmit pause enablement status ++ * @rx_pause: link receive pause enablement status ++ * ++ * Configure the MAC for an established link. ++ * ++ * @speed, @duplex, @tx_pause and @rx_pause indicate the finalised link ++ * settings, and should be used to configure the MAC block appropriately ++ * where these settings are not automatically conveyed from the PCS block, ++ * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode)) ++ * is disabled. ++ * ++ * Note that when 802.3z in-band negotiation is in use, it is possible ++ * that the user wishes to override the pause settings, and this should ++ * be allowed when considering the implementation of this method. + * +- * If @mode is not an in-band negotiation mode (as defined by +- * phylink_autoneg_inband()), allow the link to come up. If @phy +- * is non-%NULL, configure Energy Efficient Ethernet by calling ++ * If in-band negotiation mode is disabled, allow the link to come up. If ++ * @phy is non-%NULL, configure Energy Efficient Ethernet by calling + * phy_init_eee() and perform appropriate MAC configuration for EEE. + * Interface type selection must be done in mac_config(). + */ +-void mac_link_up(struct phylink_config *config, unsigned int mode, +- phy_interface_t interface, +- struct phy_device *phy); ++void mac_link_up(struct phylink_config *config, struct phy_device *phy, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex, bool tx_pause, bool rx_pause); + #endif + + struct phylink *phylink_create(struct phylink_config *, struct fwnode_handle *, +--- a/net/dsa/port.c ++++ b/net/dsa/port.c +@@ -529,9 +529,11 @@ void dsa_port_phylink_mac_link_down(stru + EXPORT_SYMBOL_GPL(dsa_port_phylink_mac_link_down); + + void dsa_port_phylink_mac_link_up(struct phylink_config *config, ++ struct phy_device *phydev, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev) ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct dsa_port *dp = container_of(config, struct dsa_port, pl_config); + struct dsa_switch *ds = dp->ds; diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch new file mode 100644 index 000000000..f74bc30d9 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch @@ -0,0 +1,143 @@ +From: Russell King +Date: Wed, 26 Feb 2020 10:23:46 +0000 +Subject: [PATCH] net: dsa: propagate resolved link config via mac_link_up() + +Propagate the resolved link configuration down via DSA's +phylink_mac_link_up() operation to allow split PCS/MAC to work. + +Tested-by: Vladimir Oltean +Signed-off-by: Russell King +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/dsa/b53/b53_common.c ++++ b/drivers/net/dsa/b53/b53_common.c +@@ -1276,7 +1276,9 @@ EXPORT_SYMBOL(b53_phylink_mac_link_down) + void b53_phylink_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev) ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct b53_device *dev = ds->priv; + +--- a/drivers/net/dsa/b53/b53_priv.h ++++ b/drivers/net/dsa/b53/b53_priv.h +@@ -337,7 +337,9 @@ void b53_phylink_mac_link_down(struct ds + void b53_phylink_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev); ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause); + int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering); + int b53_vlan_prepare(struct dsa_switch *ds, int port, + const struct switchdev_obj_port_vlan *vlan); +--- a/drivers/net/dsa/bcm_sf2.c ++++ b/drivers/net/dsa/bcm_sf2.c +@@ -635,7 +635,9 @@ static void bcm_sf2_sw_mac_link_down(str + static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev) ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); + struct ethtool_eee *p = &priv->dev->ports[port].eee; +--- a/drivers/net/dsa/lantiq_gswip.c ++++ b/drivers/net/dsa/lantiq_gswip.c +@@ -1517,7 +1517,9 @@ static void gswip_phylink_mac_link_down( + static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev) ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct gswip_priv *priv = ds->priv; + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -1452,7 +1452,9 @@ static void mt7530_phylink_mac_link_down + static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev) ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + struct mt7530_priv *priv = ds->priv; + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -652,7 +652,9 @@ static void mv88e6xxx_mac_link_down(stru + + static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, phy_interface_t interface, +- struct phy_device *phydev) ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + if (mode == MLO_AN_FIXED) + mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP); +--- a/drivers/net/dsa/sja1105/sja1105_main.c ++++ b/drivers/net/dsa/sja1105/sja1105_main.c +@@ -830,7 +830,9 @@ static void sja1105_mac_link_down(struct + static void sja1105_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev) ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause) + { + sja1105_inhibit_tx(ds->priv, BIT(port), false); + } +--- a/include/net/dsa.h ++++ b/include/net/dsa.h +@@ -401,7 +401,9 @@ struct dsa_switch_ops { + void (*phylink_mac_link_up)(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev); ++ struct phy_device *phydev, ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause); + void (*phylink_fixed_state)(struct dsa_switch *ds, int port, + struct phylink_link_state *state); + /* +--- a/net/dsa/port.c ++++ b/net/dsa/port.c +@@ -544,7 +544,8 @@ void dsa_port_phylink_mac_link_up(struct + return; + } + +- ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev); ++ ds->ops->phylink_mac_link_up(ds, dp->index, mode, interface, phydev, ++ speed, duplex, tx_pause, rx_pause); + } + EXPORT_SYMBOL_GPL(dsa_port_phylink_mac_link_up); + +--- a/net/dsa/dsa_priv.h ++++ b/net/dsa/dsa_priv.h +@@ -180,9 +180,11 @@ void dsa_port_phylink_mac_link_down(stru + unsigned int mode, + phy_interface_t interface); + void dsa_port_phylink_mac_link_up(struct phylink_config *config, ++ struct phy_device *phydev, + unsigned int mode, + phy_interface_t interface, +- struct phy_device *phydev); ++ int speed, int duplex, ++ bool tx_pause, bool rx_pause); + extern const struct phylink_mac_ops dsa_port_phylink_mac_ops; + + /* slave.c */ diff --git a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch new file mode 100644 index 000000000..ae153847d --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch @@ -0,0 +1,145 @@ +From: =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= +Date: Fri, 27 Mar 2020 15:44:12 +0100 +Subject: [PATCH] net: dsa: mt7530: use resolved link config in mac_link_up() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Convert the mt7530 switch driver to use the finalised link +parameters in mac_link_up() rather than the parameters in mac_config(). + +Signed-off-by: RenĂ© van Dorst +Tested-by: Sean Wang +Signed-off-by: David S. Miller +--- + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -490,17 +490,6 @@ mt7530_mib_reset(struct dsa_switch *ds) + mt7530_write(priv, MT7530_MIB_CCR, CCR_MIB_ACTIVATE); + } + +-static void +-mt7530_port_set_status(struct mt7530_priv *priv, int port, int enable) +-{ +- u32 mask = PMCR_TX_EN | PMCR_RX_EN | PMCR_FORCE_LNK; +- +- if (enable) +- mt7530_set(priv, MT7530_PMCR_P(port), mask); +- else +- mt7530_clear(priv, MT7530_PMCR_P(port), mask); +-} +- + static int mt7530_phy_read(struct dsa_switch *ds, int port, int regnum) + { + struct mt7530_priv *priv = ds->priv; +@@ -674,7 +663,7 @@ mt7530_port_enable(struct dsa_switch *ds + priv->ports[port].enable = true; + mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, + priv->ports[port].pm); +- mt7530_port_set_status(priv, port, 0); ++ mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); + + mutex_unlock(&priv->reg_mutex); + +@@ -697,7 +686,7 @@ mt7530_port_disable(struct dsa_switch *d + priv->ports[port].enable = false; + mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK, + PCR_MATRIX_CLR); +- mt7530_port_set_status(priv, port, 0); ++ mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); + + mutex_unlock(&priv->reg_mutex); + } +@@ -1407,8 +1396,7 @@ static void mt7530_phylink_mac_config(st + + mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); + mcr_new = mcr_cur; +- mcr_new &= ~(PMCR_FORCE_SPEED_1000 | PMCR_FORCE_SPEED_100 | +- PMCR_FORCE_FDX | PMCR_TX_FC_EN | PMCR_RX_FC_EN); ++ mcr_new &= ~PMCR_LINK_SETTINGS_MASK; + mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | + PMCR_BACKPR_EN | PMCR_FORCE_MODE; + +@@ -1416,26 +1404,6 @@ static void mt7530_phylink_mac_config(st + if (port == 5 && dsa_is_user_port(ds, 5)) + mcr_new |= PMCR_EXT_PHY; + +- switch (state->speed) { +- case SPEED_1000: +- mcr_new |= PMCR_FORCE_SPEED_1000; +- if (priv->eee_enable & BIT(port)) +- mcr_new |= PMCR_FORCE_EEE1G; +- break; +- case SPEED_100: +- mcr_new |= PMCR_FORCE_SPEED_100; +- if (priv->eee_enable & BIT(port)) +- mcr_new |= PMCR_FORCE_EEE100; +- break; +- } +- if (state->duplex == DUPLEX_FULL) { +- mcr_new |= PMCR_FORCE_FDX; +- if (state->pause & MLO_PAUSE_TX) +- mcr_new |= PMCR_TX_FC_EN; +- if (state->pause & MLO_PAUSE_RX) +- mcr_new |= PMCR_RX_FC_EN; +- } +- + if (mcr_new != mcr_cur) + mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); + } +@@ -1446,7 +1414,7 @@ static void mt7530_phylink_mac_link_down + { + struct mt7530_priv *priv = ds->priv; + +- mt7530_port_set_status(priv, port, 0); ++ mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); + } + + static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, +@@ -1457,8 +1425,31 @@ static void mt7530_phylink_mac_link_up(s + bool tx_pause, bool rx_pause) + { + struct mt7530_priv *priv = ds->priv; ++ u32 mcr; ++ ++ mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK; ++ ++ switch (speed) { ++ case SPEED_1000: ++ mcr |= PMCR_FORCE_SPEED_1000; ++ if (priv->eee_enable & BIT(port)) ++ mcr_new |= PMCR_FORCE_EEE1G; ++ break; ++ case SPEED_100: ++ mcr |= PMCR_FORCE_SPEED_100; ++ if (priv->eee_enable & BIT(port)) ++ mcr_new |= PMCR_FORCE_EEE100; ++ break; ++ } ++ if (duplex == DUPLEX_FULL) { ++ mcr |= PMCR_FORCE_FDX; ++ if (tx_pause) ++ mcr |= PMCR_TX_FC_EN; ++ if (rx_pause) ++ mcr |= PMCR_RX_FC_EN; ++ } + +- mt7530_port_set_status(priv, port, 1); ++ mt7530_set(priv, MT7530_PMCR_P(port), mcr); + } + + static void mt7530_phylink_validate(struct dsa_switch *ds, int port, +--- a/drivers/net/dsa/mt7530.h ++++ b/drivers/net/dsa/mt7530.h +@@ -222,6 +222,10 @@ enum mt7530_vlan_port_attr { + #define PMCR_FORCE_LNK BIT(0) + #define PMCR_SPEED_MASK (PMCR_FORCE_SPEED_100 | \ + PMCR_FORCE_SPEED_1000) ++#define PMCR_LINK_SETTINGS_MASK (PMCR_TX_EN | PMCR_FORCE_SPEED_1000 | \ ++ PMCR_RX_EN | PMCR_FORCE_SPEED_100 | \ ++ PMCR_TX_FC_EN | PMCR_RX_FC_EN | \ ++ PMCR_FORCE_FDX | PMCR_FORCE_LNK) + + #define MT7530_PMSR_P(x) (0x3008 + (x) * 0x100) + #define PMSR_EEE1G BIT(7) diff --git a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch new file mode 100644 index 000000000..b86c5b828 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch @@ -0,0 +1,458 @@ +From: Landen Chao +Date: Fri, 4 Sep 2020 22:21:57 +0800 +Subject: [PATCH] net: dsa: mt7530: Extend device data ready for adding a + new hardware + +Add a structure holding required operations for each device such as device +initialization, PHY port read or write, a checker whether PHY interface is +supported on a certain port, MAC port setup for either bus pad or a +specific PHY interface. + +The patch is done for ready adding a new hardware MT7531, and keep the +same setup logic of existing hardware. + +Signed-off-by: Landen Chao +Signed-off-by: Sean Wang +--- + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -372,8 +372,9 @@ mt7530_fdb_write(struct mt7530_priv *pri + mt7530_write(priv, MT7530_ATA1 + (i * 4), reg[i]); + } + ++/* Setup TX circuit including relevant PAD and driving */ + static int +-mt7530_pad_clk_setup(struct dsa_switch *ds, int mode) ++mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) + { + struct mt7530_priv *priv = ds->priv; + u32 ncpo1, ssc_delta, trgint, i, xtal; +@@ -387,7 +388,7 @@ mt7530_pad_clk_setup(struct dsa_switch * + return -EINVAL; + } + +- switch (mode) { ++ switch (interface) { + case PHY_INTERFACE_MODE_RGMII: + trgint = 0; + /* PLL frequency: 125MHz */ +@@ -409,7 +410,8 @@ mt7530_pad_clk_setup(struct dsa_switch * + } + break; + default: +- dev_err(priv->dev, "xMII mode %d not supported\n", mode); ++ dev_err(priv->dev, "xMII interface %d not supported\n", ++ interface); + return -EINVAL; + } + +@@ -1344,12 +1346,11 @@ mt7530_setup(struct dsa_switch *ds) + return 0; + } + +-static void mt7530_phylink_mac_config(struct dsa_switch *ds, int port, +- unsigned int mode, +- const struct phylink_link_state *state) ++static bool ++mt7530_phy_mode_supported(struct dsa_switch *ds, int port, ++ const struct phylink_link_state *state) + { + struct mt7530_priv *priv = ds->priv; +- u32 mcr_cur, mcr_new; + + switch (port) { + case 0: /* Internal phy */ +@@ -1358,33 +1359,114 @@ static void mt7530_phylink_mac_config(st + case 3: + case 4: + if (state->interface != PHY_INTERFACE_MODE_GMII) +- return; ++ goto unsupported; + break; + case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ +- if (priv->p5_interface == state->interface) +- break; + if (!phy_interface_mode_is_rgmii(state->interface) && + state->interface != PHY_INTERFACE_MODE_MII && + state->interface != PHY_INTERFACE_MODE_GMII) +- return; ++ goto unsupported; ++ break; ++ case 6: /* 1st cpu port */ ++ if (state->interface != PHY_INTERFACE_MODE_RGMII && ++ state->interface != PHY_INTERFACE_MODE_TRGMII) ++ goto unsupported; ++ break; ++ default: ++ dev_err(priv->dev, "%s: unsupported port: %i\n", __func__, ++ port); ++ goto unsupported; ++ } ++ ++ return true; ++ ++unsupported: ++ return false; ++} ++ ++static bool ++mt753x_phy_mode_supported(struct dsa_switch *ds, int port, ++ const struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->phy_mode_supported(ds, port, state); ++} ++ ++static int ++mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->pad_setup(ds, state->interface); ++} ++ ++static int ++mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ++ phy_interface_t interface) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ /* Only need to setup port5. */ ++ if (port != 5) ++ return 0; ++ ++ mt7530_setup_port5(priv->ds, interface); ++ ++ return 0; ++} ++ ++static int ++mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ++ const struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->mac_port_config(ds, port, mode, state->interface); ++} ++ ++static void ++mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ++ const struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ u32 mcr_cur, mcr_new; ++ ++ if (!mt753x_phy_mode_supported(ds, port, state)) ++ goto unsupported; ++ ++ switch (port) { ++ case 0: /* Internal phy */ ++ case 1: ++ case 2: ++ case 3: ++ case 4: ++ if (state->interface != PHY_INTERFACE_MODE_GMII) ++ goto unsupported; ++ break; ++ case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ ++ if (priv->p5_interface == state->interface) ++ break; ++ ++ if (mt753x_mac_config(ds, port, mode, state) < 0) ++ goto unsupported; + +- mt7530_setup_port5(ds, state->interface); + break; + case 6: /* 1st cpu port */ + if (priv->p6_interface == state->interface) + break; + +- if (state->interface != PHY_INTERFACE_MODE_RGMII && +- state->interface != PHY_INTERFACE_MODE_TRGMII) +- return; ++ mt753x_pad_setup(ds, state); + +- /* Setup TX circuit incluing relevant PAD and driving */ +- mt7530_pad_clk_setup(ds, state->interface); ++ if (mt753x_mac_config(ds, port, mode, state) < 0) ++ goto unsupported; + + priv->p6_interface = state->interface; + break; + default: +- dev_err(ds->dev, "%s: unsupported port: %i\n", __func__, port); ++unsupported: ++ dev_err(ds->dev, "%s: unsupported %s port: %i\n", ++ __func__, phy_modes(state->interface), port); + return; + } + +@@ -1452,61 +1534,44 @@ static void mt7530_phylink_mac_link_up(s + mt7530_set(priv, MT7530_PMCR_P(port), mcr); + } + +-static void mt7530_phylink_validate(struct dsa_switch *ds, int port, +- unsigned long *supported, +- struct phylink_link_state *state) ++static void ++mt7530_mac_port_validate(struct dsa_switch *ds, int port, ++ unsigned long *supported) + { ++ if (port == 5) ++ phylink_set(supported, 1000baseX_Full); ++} ++ ++static void ++mt753x_phylink_validate(struct dsa_switch *ds, int port, ++ unsigned long *supported, ++ struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; + __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; + +- switch (port) { +- case 0: /* Internal phy */ +- case 1: +- case 2: +- case 3: +- case 4: +- if (state->interface != PHY_INTERFACE_MODE_NA && +- state->interface != PHY_INTERFACE_MODE_GMII) +- goto unsupported; +- break; +- case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */ +- if (state->interface != PHY_INTERFACE_MODE_NA && +- !phy_interface_mode_is_rgmii(state->interface) && +- state->interface != PHY_INTERFACE_MODE_MII && +- state->interface != PHY_INTERFACE_MODE_GMII) +- goto unsupported; +- break; +- case 6: /* 1st cpu port */ +- if (state->interface != PHY_INTERFACE_MODE_NA && +- state->interface != PHY_INTERFACE_MODE_RGMII && +- state->interface != PHY_INTERFACE_MODE_TRGMII) +- goto unsupported; +- break; +- default: +- dev_err(ds->dev, "%s: unsupported port: %i\n", __func__, port); +-unsupported: ++ if (state->interface != PHY_INTERFACE_MODE_NA && ++ !mt753x_phy_mode_supported(ds, port, state)) { + linkmode_zero(supported); + return; + } + + phylink_set_port_modes(mask); +- phylink_set(mask, Autoneg); + +- if (state->interface == PHY_INTERFACE_MODE_TRGMII) { +- phylink_set(mask, 1000baseT_Full); +- } else { ++ if (state->interface != PHY_INTERFACE_MODE_TRGMII) { + phylink_set(mask, 10baseT_Half); + phylink_set(mask, 10baseT_Full); + phylink_set(mask, 100baseT_Half); + phylink_set(mask, 100baseT_Full); +- +- if (state->interface != PHY_INTERFACE_MODE_MII) { +- /* This switch only supports 1G full-duplex. */ +- phylink_set(mask, 1000baseT_Full); +- if (port == 5) +- phylink_set(mask, 1000baseX_Full); +- } ++ phylink_set(mask, Autoneg); + } + ++ /* This switch only supports 1G full-duplex. */ ++ if (state->interface != PHY_INTERFACE_MODE_MII) ++ phylink_set(mask, 1000baseT_Full); ++ ++ priv->info->mac_port_validate(ds, port, mask); ++ + phylink_set(mask, Pause); + phylink_set(mask, Asym_Pause); + +@@ -1602,12 +1667,45 @@ static int mt7530_set_mac_eee(struct dsa + return 0; + } + ++static int ++mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port, ++ struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->mac_port_get_state(ds, port, state); ++} ++ ++static int ++mt753x_setup(struct dsa_switch *ds) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->sw_setup(ds); ++} ++ ++static int ++mt753x_phy_read(struct dsa_switch *ds, int port, int regnum) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->phy_read(ds, port, regnum); ++} ++ ++static int ++mt753x_phy_write(struct dsa_switch *ds, int port, int regnum, u16 val) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ return priv->info->phy_write(ds, port, regnum, val); ++} ++ + static const struct dsa_switch_ops mt7530_switch_ops = { + .get_tag_protocol = mtk_get_tag_protocol, +- .setup = mt7530_setup, ++ .setup = mt753x_setup, + .get_strings = mt7530_get_strings, +- .phy_read = mt7530_phy_read, +- .phy_write = mt7530_phy_write, ++ .phy_read = mt753x_phy_read, ++ .phy_write = mt753x_phy_write, + .get_ethtool_stats = mt7530_get_ethtool_stats, + .get_sset_count = mt7530_get_sset_count, + .port_enable = mt7530_port_enable, +@@ -1624,18 +1722,43 @@ static const struct dsa_switch_ops mt753 + .port_vlan_del = mt7530_port_vlan_del, + .port_mirror_add = mt7530_port_mirror_add, + .port_mirror_del = mt7530_port_mirror_del, +- .phylink_validate = mt7530_phylink_validate, +- .phylink_mac_link_state = mt7530_phylink_mac_link_state, +- .phylink_mac_config = mt7530_phylink_mac_config, ++ .phylink_validate = mt753x_phylink_validate, ++ .phylink_mac_link_state = mt753x_phylink_mac_link_state, ++ .phylink_mac_config = mt753x_phylink_mac_config, + .phylink_mac_link_down = mt7530_phylink_mac_link_down, + .phylink_mac_link_up = mt7530_phylink_mac_link_up, + .get_mac_eee = mt7530_get_mac_eee, + .set_mac_eee = mt7530_set_mac_eee, + }; + ++static const struct mt753x_info mt753x_table[] = { ++ [ID_MT7621] = { ++ .id = ID_MT7621, ++ .sw_setup = mt7530_setup, ++ .phy_read = mt7530_phy_read, ++ .phy_write = mt7530_phy_write, ++ .pad_setup = mt7530_pad_clk_setup, ++ .phy_mode_supported = mt7530_phy_mode_supported, ++ .mac_port_validate = mt7530_mac_port_validate, ++ .mac_port_get_state = mt7530_phylink_mac_link_state, ++ .mac_port_config = mt7530_mac_config, ++ }, ++ [ID_MT7530] = { ++ .id = ID_MT7530, ++ .sw_setup = mt7530_setup, ++ .phy_read = mt7530_phy_read, ++ .phy_write = mt7530_phy_write, ++ .pad_setup = mt7530_pad_clk_setup, ++ .phy_mode_supported = mt7530_phy_mode_supported, ++ .mac_port_validate = mt7530_mac_port_validate, ++ .mac_port_get_state = mt7530_phylink_mac_link_state, ++ .mac_port_config = mt7530_mac_config, ++ }, ++}; ++ + static const struct of_device_id mt7530_of_match[] = { +- { .compatible = "mediatek,mt7621", .data = (void *)ID_MT7621, }, +- { .compatible = "mediatek,mt7530", .data = (void *)ID_MT7530, }, ++ { .compatible = "mediatek,mt7621", .data = &mt753x_table[ID_MT7621], }, ++ { .compatible = "mediatek,mt7530", .data = &mt753x_table[ID_MT7530], }, + { /* sentinel */ }, + }; + MODULE_DEVICE_TABLE(of, mt7530_of_match); +@@ -1673,8 +1796,21 @@ mt7530_probe(struct mdio_device *mdiodev + /* Get the hardware identifier from the devicetree node. + * We will need it for some of the clock and regulator setup. + */ +- priv->id = (unsigned int)(unsigned long) +- of_device_get_match_data(&mdiodev->dev); ++ priv->info = of_device_get_match_data(&mdiodev->dev); ++ if (!priv->info) ++ return -EINVAL; ++ ++ /* Sanity check if these required device operations are filled ++ * properly. ++ */ ++ if (!priv->info->sw_setup || !priv->info->pad_setup || ++ !priv->info->phy_read || !priv->info->phy_write || ++ !priv->info->phy_mode_supported || ++ !priv->info->mac_port_validate || ++ !priv->info->mac_port_get_state || !priv->info->mac_port_config) ++ return -EINVAL; ++ ++ priv->id = priv->info->id; + + if (priv->id == ID_MT7530) { + priv->core_pwr = devm_regulator_get(&mdiodev->dev, "core"); +--- a/drivers/net/dsa/mt7530.h ++++ b/drivers/net/dsa/mt7530.h +@@ -11,7 +11,7 @@ + #define MT7530_NUM_FDB_RECORDS 2048 + #define MT7530_ALL_MEMBERS 0xff + +-enum { ++enum mt753x_id { + ID_MT7530 = 0, + ID_MT7621 = 1, + }; +@@ -451,6 +451,40 @@ static const char *p5_intf_modes(unsigne + } + } + ++/* struct mt753x_info - This is the main data structure for holding the specific ++ * part for each supported device ++ * @sw_setup: Holding the handler to a device initialization ++ * @phy_read: Holding the way reading PHY port ++ * @phy_write: Holding the way writing PHY port ++ * @pad_setup: Holding the way setting up the bus pad for a certain ++ * MAC port ++ * @phy_mode_supported: Check if the PHY type is being supported on a certain ++ * port ++ * @mac_port_validate: Holding the way to set addition validate type for a ++ * certan MAC port ++ * @mac_port_get_state: Holding the way getting the MAC/PCS state for a certain ++ * MAC port ++ * @mac_port_config: Holding the way setting up the PHY attribute to a ++ * certain MAC port ++ */ ++struct mt753x_info { ++ enum mt753x_id id; ++ ++ int (*sw_setup)(struct dsa_switch *ds); ++ int (*phy_read)(struct dsa_switch *ds, int port, int regnum); ++ int (*phy_write)(struct dsa_switch *ds, int port, int regnum, u16 val); ++ int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface); ++ bool (*phy_mode_supported)(struct dsa_switch *ds, int port, ++ const struct phylink_link_state *state); ++ void (*mac_port_validate)(struct dsa_switch *ds, int port, ++ unsigned long *supported); ++ int (*mac_port_get_state)(struct dsa_switch *ds, int port, ++ struct phylink_link_state *state); ++ int (*mac_port_config)(struct dsa_switch *ds, int port, ++ unsigned int mode, ++ phy_interface_t interface); ++}; ++ + /* struct mt7530_priv - This is the main data structure for holding the state + * of the driver + * @dev: The device pointer +@@ -476,6 +510,7 @@ struct mt7530_priv { + struct regulator *core_pwr; + struct regulator *io_pwr; + struct gpio_desc *reset; ++ const struct mt753x_info *info; + unsigned int id; + bool mcm; + phy_interface_t p6_interface; diff --git a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch new file mode 100644 index 000000000..1e6126eb7 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch @@ -0,0 +1,1510 @@ +From: Landen Chao +Date: Fri, 4 Sep 2020 22:21:59 +0800 +Subject: [PATCH] net: dsa: mt7530: Add the support of MT7531 switch + +Add new support for MT7531: + +MT7531 is the next generation of MT7530. It is also a 7-ports switch with +5 giga embedded phys, 2 cpu ports, and the same MAC logic of MT7530. Cpu +port 6 only supports SGMII interface. Cpu port 5 supports either RGMII +or SGMII in different HW sku, but cannot be muxed to PHY of port 0/4 like +mt7530. Due to SGMII interface support, pll, and pad setting are different +from MT7530. This patch adds different initial setting, and SGMII phylink +handlers of MT7531. + +MT7531 SGMII interface can be configured in following mode: +- 'SGMII AN mode' with in-band negotiation capability + which is compatible with PHY_INTERFACE_MODE_SGMII. +- 'SGMII force mode' without in-band negotiation + which is compatible with 10B/8B encoding of + PHY_INTERFACE_MODE_1000BASEX with fixed full-duplex and fixed pause. +- 2.5 times faster clocked 'SGMII force mode' without in-band negotiation + which is compatible with 10B/8B encoding of + PHY_INTERFACE_MODE_2500BASEX with fixed full-duplex and fixed pause. + +Signed-off-by: Landen Chao +Signed-off-by: Sean Wang +--- + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -234,6 +234,12 @@ mt7530_write(struct mt7530_priv *priv, u + } + + static u32 ++_mt7530_unlocked_read(struct mt7530_dummy_poll *p) ++{ ++ return mt7530_mii_read(p->priv, p->reg); ++} ++ ++static u32 + _mt7530_read(struct mt7530_dummy_poll *p) + { + struct mii_bus *bus = p->priv->bus; +@@ -483,6 +489,108 @@ mt7530_pad_clk_setup(struct dsa_switch * + return 0; + } + ++static bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv) ++{ ++ u32 val; ++ ++ val = mt7530_read(priv, MT7531_TOP_SIG_SR); ++ ++ return (val & PAD_DUAL_SGMII_EN) != 0; ++} ++ ++static int ++mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ u32 val; ++ u32 top_sig; ++ u32 hwstrap; ++ u32 xtal; ++ ++ if (mt7531_dual_sgmii_supported(priv)) ++ return 0; ++ ++ val = mt7530_read(priv, MT7531_CREV); ++ top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR); ++ hwstrap = mt7530_read(priv, MT7531_HWTRAP); ++ if ((val & CHIP_REV_M) > 0) ++ xtal = (top_sig & PAD_MCM_SMI_EN) ? HWTRAP_XTAL_FSEL_40MHZ : ++ HWTRAP_XTAL_FSEL_25MHZ; ++ else ++ xtal = hwstrap & HWTRAP_XTAL_FSEL_MASK; ++ ++ /* Step 1 : Disable MT7531 COREPLL */ ++ val = mt7530_read(priv, MT7531_PLLGP_EN); ++ val &= ~EN_COREPLL; ++ mt7530_write(priv, MT7531_PLLGP_EN, val); ++ ++ /* Step 2: switch to XTAL output */ ++ val = mt7530_read(priv, MT7531_PLLGP_EN); ++ val |= SW_CLKSW; ++ mt7530_write(priv, MT7531_PLLGP_EN, val); ++ ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val &= ~RG_COREPLL_EN; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ ++ /* Step 3: disable PLLGP and enable program PLLGP */ ++ val = mt7530_read(priv, MT7531_PLLGP_EN); ++ val |= SW_PLLGP; ++ mt7530_write(priv, MT7531_PLLGP_EN, val); ++ ++ /* Step 4: program COREPLL output frequency to 500MHz */ ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val &= ~RG_COREPLL_POSDIV_M; ++ val |= 2 << RG_COREPLL_POSDIV_S; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ usleep_range(25, 35); ++ ++ switch (xtal) { ++ case HWTRAP_XTAL_FSEL_25MHZ: ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val &= ~RG_COREPLL_SDM_PCW_M; ++ val |= 0x140000 << RG_COREPLL_SDM_PCW_S; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ break; ++ case HWTRAP_XTAL_FSEL_40MHZ: ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val &= ~RG_COREPLL_SDM_PCW_M; ++ val |= 0x190000 << RG_COREPLL_SDM_PCW_S; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ break; ++ }; ++ ++ /* Set feedback divide ratio update signal to high */ ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val |= RG_COREPLL_SDM_PCW_CHG; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ /* Wait for at least 16 XTAL clocks */ ++ usleep_range(10, 20); ++ ++ /* Step 5: set feedback divide ratio update signal to low */ ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val &= ~RG_COREPLL_SDM_PCW_CHG; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ ++ /* Enable 325M clock for SGMII */ ++ mt7530_write(priv, MT7531_ANA_PLLGP_CR5, 0xad0000); ++ ++ /* Enable 250SSC clock for RGMII */ ++ mt7530_write(priv, MT7531_ANA_PLLGP_CR2, 0x4f40000); ++ ++ /* Step 6: Enable MT7531 PLL */ ++ val = mt7530_read(priv, MT7531_PLLGP_CR0); ++ val |= RG_COREPLL_EN; ++ mt7530_write(priv, MT7531_PLLGP_CR0, val); ++ ++ val = mt7530_read(priv, MT7531_PLLGP_EN); ++ val |= EN_COREPLL; ++ mt7530_write(priv, MT7531_PLLGP_EN, val); ++ usleep_range(25, 35); ++ ++ return 0; ++} ++ + static void + mt7530_mib_reset(struct dsa_switch *ds) + { +@@ -507,6 +615,217 @@ static int mt7530_phy_write(struct dsa_s + return mdiobus_write_nested(priv->bus, port, regnum, val); + } + ++static int ++mt7531_ind_c45_phy_read(struct mt7530_priv *priv, int port, int devad, ++ int regnum) ++{ ++ struct mii_bus *bus = priv->bus; ++ struct mt7530_dummy_poll p; ++ u32 reg, val; ++ int ret; ++ ++ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); ++ ++ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ reg = MT7531_MDIO_CL45_ADDR | MT7531_MDIO_PHY_ADDR(port) | ++ MT7531_MDIO_DEV_ADDR(devad) | regnum; ++ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | MT7531_PHY_ACS_ST); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ reg = MT7531_MDIO_CL45_READ | MT7531_MDIO_PHY_ADDR(port) | ++ MT7531_MDIO_DEV_ADDR(devad); ++ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | MT7531_PHY_ACS_ST); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ ret = val & MT7531_MDIO_RW_DATA_MASK; ++out: ++ mutex_unlock(&bus->mdio_lock); ++ ++ return ret; ++} ++ ++static int ++mt7531_ind_c45_phy_write(struct mt7530_priv *priv, int port, int devad, ++ int regnum, u32 data) ++{ ++ struct mii_bus *bus = priv->bus; ++ struct mt7530_dummy_poll p; ++ u32 val, reg; ++ int ret; ++ ++ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); ++ ++ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ reg = MT7531_MDIO_CL45_ADDR | MT7531_MDIO_PHY_ADDR(port) | ++ MT7531_MDIO_DEV_ADDR(devad) | regnum; ++ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | MT7531_PHY_ACS_ST); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ reg = MT7531_MDIO_CL45_WRITE | MT7531_MDIO_PHY_ADDR(port) | ++ MT7531_MDIO_DEV_ADDR(devad) | data; ++ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | MT7531_PHY_ACS_ST); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++out: ++ mutex_unlock(&bus->mdio_lock); ++ ++ return ret; ++} ++ ++static int ++mt7531_ind_c22_phy_read(struct mt7530_priv *priv, int port, int regnum) ++{ ++ struct mii_bus *bus = priv->bus; ++ struct mt7530_dummy_poll p; ++ int ret; ++ u32 val; ++ ++ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); ++ ++ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ val = MT7531_MDIO_CL22_READ | MT7531_MDIO_PHY_ADDR(port) | ++ MT7531_MDIO_REG_ADDR(regnum); ++ ++ mt7530_mii_write(priv, MT7531_PHY_IAC, val | MT7531_PHY_ACS_ST); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val, ++ !(val & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ ret = val & MT7531_MDIO_RW_DATA_MASK; ++out: ++ mutex_unlock(&bus->mdio_lock); ++ ++ return ret; ++} ++ ++static int ++mt7531_ind_c22_phy_write(struct mt7530_priv *priv, int port, int regnum, ++ u16 data) ++{ ++ struct mii_bus *bus = priv->bus; ++ struct mt7530_dummy_poll p; ++ int ret; ++ u32 reg; ++ ++ INIT_MT7530_DUMMY_POLL(&p, priv, MT7531_PHY_IAC); ++ ++ mutex_lock_nested(&bus->mdio_lock, MDIO_MUTEX_NESTED); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg, ++ !(reg & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++ reg = MT7531_MDIO_CL22_WRITE | MT7531_MDIO_PHY_ADDR(port) | ++ MT7531_MDIO_REG_ADDR(regnum) | data; ++ ++ mt7530_mii_write(priv, MT7531_PHY_IAC, reg | MT7531_PHY_ACS_ST); ++ ++ ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg, ++ !(reg & MT7531_PHY_ACS_ST), 20, 100000); ++ if (ret < 0) { ++ dev_err(priv->dev, "poll timeout\n"); ++ goto out; ++ } ++ ++out: ++ mutex_unlock(&bus->mdio_lock); ++ ++ return ret; ++} ++ ++static int ++mt7531_ind_phy_read(struct dsa_switch *ds, int port, int regnum) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ int devad; ++ int ret; ++ ++ if (regnum & MII_ADDR_C45) { ++ devad = (regnum >> MII_DEVADDR_C45_SHIFT) & 0x1f; ++ ret = mt7531_ind_c45_phy_read(priv, port, devad, ++ regnum & MII_REGADDR_C45_MASK); ++ } else { ++ ret = mt7531_ind_c22_phy_read(priv, port, regnum); ++ } ++ ++ return ret; ++} ++ ++static int ++mt7531_ind_phy_write(struct dsa_switch *ds, int port, int regnum, ++ u16 data) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ int devad; ++ int ret; ++ ++ if (regnum & MII_ADDR_C45) { ++ devad = (regnum >> MII_DEVADDR_C45_SHIFT) & 0x1f; ++ ret = mt7531_ind_c45_phy_write(priv, port, devad, ++ regnum & MII_REGADDR_C45_MASK, ++ data); ++ } else { ++ ret = mt7531_ind_c22_phy_write(priv, port, regnum, data); ++ } ++ ++ return ret; ++} ++ + static void + mt7530_get_strings(struct dsa_switch *ds, int port, u32 stringset, + uint8_t *data) +@@ -623,9 +942,14 @@ unlock_exit: + } + + static int +-mt7530_cpu_port_enable(struct mt7530_priv *priv, +- int port) ++mt753x_cpu_port_enable(struct dsa_switch *ds, int port) + { ++ struct mt7530_priv *priv = ds->priv; ++ ++ /* Setup max capability of CPU port at first */ ++ if (priv->info->cpu_port_config) ++ priv->info->cpu_port_config(ds, port); ++ + /* Enable Mediatek header mode on the cpu port */ + mt7530_write(priv, MT7530_PVC_P(port), + PORT_SPEC_TAG); +@@ -638,7 +962,7 @@ mt7530_cpu_port_enable(struct mt7530_pri + mt7530_rmw(priv, MT7530_MFC, CPU_MASK, CPU_EN | CPU_PORT(port)); + + /* CPU port gets connected to all user ports of +- * the switch ++ * the switch. + */ + mt7530_write(priv, MT7530_PCR_P(port), + PCR_MATRIX(dsa_user_ports(priv->ds))); +@@ -1132,27 +1456,42 @@ mt7530_port_vlan_del(struct dsa_switch * + return 0; + } + +-static int mt7530_port_mirror_add(struct dsa_switch *ds, int port, ++static int mt753x_mirror_port_get(unsigned int id, u32 val) ++{ ++ return (id == ID_MT7531) ? MT7531_MIRROR_PORT_GET(val) : ++ MIRROR_PORT(val); ++} ++ ++static int mt753x_mirror_port_set(unsigned int id, u32 val) ++{ ++ return (id == ID_MT7531) ? MT7531_MIRROR_PORT_SET(val) : ++ MIRROR_PORT(val); ++} ++ ++static int mt753x_port_mirror_add(struct dsa_switch *ds, int port, + struct dsa_mall_mirror_tc_entry *mirror, + bool ingress) + { + struct mt7530_priv *priv = ds->priv; ++ int monitor_port; + u32 val; + + /* Check for existent entry */ + if ((ingress ? priv->mirror_rx : priv->mirror_tx) & BIT(port)) + return -EEXIST; + +- val = mt7530_read(priv, MT7530_MFC); ++ val = mt7530_read(priv, MT753X_MIRROR_REG(priv->id)); + + /* MT7530 only supports one monitor port */ +- if (val & MIRROR_EN && MIRROR_PORT(val) != mirror->to_local_port) ++ monitor_port = mt753x_mirror_port_get(priv->id, val); ++ if (val & MT753X_MIRROR_EN(priv->id) && ++ monitor_port != mirror->to_local_port) + return -EEXIST; + +- val |= MIRROR_EN; +- val &= ~MIRROR_MASK; +- val |= mirror->to_local_port; +- mt7530_write(priv, MT7530_MFC, val); ++ val |= MT753X_MIRROR_EN(priv->id); ++ val &= ~MT753X_MIRROR_MASK(priv->id); ++ val |= mt753x_mirror_port_set(priv->id, mirror->to_local_port); ++ mt7530_write(priv, MT753X_MIRROR_REG(priv->id), val); + + val = mt7530_read(priv, MT7530_PCR_P(port)); + if (ingress) { +@@ -1167,7 +1506,7 @@ static int mt7530_port_mirror_add(struct + return 0; + } + +-static void mt7530_port_mirror_del(struct dsa_switch *ds, int port, ++static void mt753x_port_mirror_del(struct dsa_switch *ds, int port, + struct dsa_mall_mirror_tc_entry *mirror) + { + struct mt7530_priv *priv = ds->priv; +@@ -1184,9 +1523,9 @@ static void mt7530_port_mirror_del(struc + mt7530_write(priv, MT7530_PCR_P(port), val); + + if (!priv->mirror_rx && !priv->mirror_tx) { +- val = mt7530_read(priv, MT7530_MFC); +- val &= ~MIRROR_EN; +- mt7530_write(priv, MT7530_MFC, val); ++ val = mt7530_read(priv, MT753X_MIRROR_REG(priv->id)); ++ val &= ~MT753X_MIRROR_EN(priv->id); ++ mt7530_write(priv, MT753X_MIRROR_REG(priv->id), val); + } + } + +@@ -1292,7 +1631,7 @@ mt7530_setup(struct dsa_switch *ds) + PCR_MATRIX_CLR); + + if (dsa_is_cpu_port(ds, i)) +- mt7530_cpu_port_enable(priv, i); ++ mt753x_cpu_port_enable(ds, i); + else + mt7530_port_disable(ds, i); + +@@ -1346,6 +1685,118 @@ mt7530_setup(struct dsa_switch *ds) + return 0; + } + ++static int ++mt7531_setup(struct dsa_switch *ds) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ struct mt7530_dummy_poll p; ++ u32 val, id; ++ int ret, i; ++ ++ /* Reset whole chip through gpio pin or memory-mapped registers for ++ * different type of hardware ++ */ ++ if (priv->mcm) { ++ reset_control_assert(priv->rstc); ++ usleep_range(1000, 1100); ++ reset_control_deassert(priv->rstc); ++ } else { ++ gpiod_set_value_cansleep(priv->reset, 0); ++ usleep_range(1000, 1100); ++ gpiod_set_value_cansleep(priv->reset, 1); ++ } ++ ++ /* Waiting for MT7530 got to stable */ ++ INIT_MT7530_DUMMY_POLL(&p, priv, MT7530_HWTRAP); ++ ret = readx_poll_timeout(_mt7530_read, &p, val, val != 0, ++ 20, 1000000); ++ if (ret < 0) { ++ dev_err(priv->dev, "reset timeout\n"); ++ return ret; ++ } ++ ++ id = mt7530_read(priv, MT7531_CREV); ++ id >>= CHIP_NAME_SHIFT; ++ ++ if (id != MT7531_ID) { ++ dev_err(priv->dev, "chip %x can't be supported\n", id); ++ return -ENODEV; ++ } ++ ++ /* Reset the switch through internal reset */ ++ mt7530_write(priv, MT7530_SYS_CTRL, ++ SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | ++ SYS_CTRL_REG_RST); ++ ++ if (mt7531_dual_sgmii_supported(priv)) { ++ priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII; ++ ++ /* Let ds->slave_mii_bus be able to access external phy. */ ++ mt7530_rmw(priv, MT7531_GPIO_MODE1, MT7531_GPIO11_RG_RXD2_MASK, ++ MT7531_EXT_P_MDC_11); ++ mt7530_rmw(priv, MT7531_GPIO_MODE1, MT7531_GPIO12_RG_RXD3_MASK, ++ MT7531_EXT_P_MDIO_12); ++ } else { ++ priv->p5_intf_sel = P5_INTF_SEL_GMAC5; ++ } ++ dev_dbg(ds->dev, "P5 support %s interface\n", ++ p5_intf_modes(priv->p5_intf_sel)); ++ ++ mt7530_rmw(priv, MT7531_GPIO_MODE0, MT7531_GPIO0_MASK, ++ MT7531_GPIO0_INTERRUPT); ++ ++ /* Let phylink decide the interface later. */ ++ priv->p5_interface = PHY_INTERFACE_MODE_NA; ++ priv->p6_interface = PHY_INTERFACE_MODE_NA; ++ ++ /* Enable PHY core PLL, since phy_device has not yet been created ++ * provided for phy_[read,write]_mmd_indirect is called, we provide ++ * our own mt7531_ind_mmd_phy_[read,write] to complete this ++ * function. ++ */ ++ val = mt7531_ind_c45_phy_read(priv, MT753X_CTRL_PHY_ADDR, ++ MDIO_MMD_VEND2, CORE_PLL_GROUP4); ++ val |= MT7531_PHY_PLL_BYPASS_MODE; ++ val &= ~MT7531_PHY_PLL_OFF; ++ mt7531_ind_c45_phy_write(priv, MT753X_CTRL_PHY_ADDR, MDIO_MMD_VEND2, ++ CORE_PLL_GROUP4, val); ++ ++ /* BPDU to CPU port */ ++ mt7530_rmw(priv, MT7531_CFC, MT7531_CPU_PMAP_MASK, ++ BIT(MT7530_CPU_PORT)); ++ mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK, ++ MT753X_BPDU_CPU_ONLY); ++ ++ /* Enable and reset MIB counters */ ++ mt7530_mib_reset(ds); ++ ++ for (i = 0; i < MT7530_NUM_PORTS; i++) { ++ /* Disable forwarding by default on all ports */ ++ mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK, ++ PCR_MATRIX_CLR); ++ ++ mt7530_set(priv, MT7531_DBG_CNT(i), MT7531_DIS_CLR); ++ ++ if (dsa_is_cpu_port(ds, i)) ++ mt753x_cpu_port_enable(ds, i); ++ else ++ mt7530_port_disable(ds, i); ++ ++ /* Enable consistent egress tag */ ++ mt7530_rmw(priv, MT7530_PVC_P(i), PVC_EG_TAG_MASK, ++ PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT)); ++ } ++ ++ ds->configure_vlan_while_not_filtering = true; ++ ++ /* Flush the FDB table */ ++ ret = mt7530_fdb_cmd(priv, MT7530_FDB_FLUSH, NULL); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ + static bool + mt7530_phy_mode_supported(struct dsa_switch *ds, int port, + const struct phylink_link_state *state) +@@ -1384,6 +1835,47 @@ unsupported: + return false; + } + ++static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port) ++{ ++ return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII); ++} ++ ++static bool ++mt7531_phy_supported(struct dsa_switch *ds, int port, ++ const struct phylink_link_state *state) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ switch (port) { ++ case 0: /* Internal phy */ ++ case 1: ++ case 2: ++ case 3: ++ case 4: ++ if (state->interface != PHY_INTERFACE_MODE_GMII) ++ goto unsupported; ++ break; ++ case 5: /* 2nd cpu port supports either rgmii or sgmii/8023z */ ++ if (mt7531_is_rgmii_port(priv, port)) ++ return phy_interface_mode_is_rgmii(state->interface); ++ fallthrough; ++ case 6: /* 1st cpu port supports sgmii/8023z only */ ++ if (state->interface != PHY_INTERFACE_MODE_SGMII && ++ !phy_interface_mode_is_8023z(state->interface)) ++ goto unsupported; ++ break; ++ default: ++ dev_err(priv->dev, "%s: unsupported port: %i\n", __func__, ++ port); ++ goto unsupported; ++ } ++ ++ return true; ++ ++unsupported: ++ return false; ++} ++ + static bool + mt753x_phy_mode_supported(struct dsa_switch *ds, int port, + const struct phylink_link_state *state) +@@ -1416,6 +1908,227 @@ mt7530_mac_config(struct dsa_switch *ds, + return 0; + } + ++static int mt7531_rgmii_setup(struct mt7530_priv *priv, u32 port, ++ phy_interface_t interface, ++ struct phy_device *phydev) ++{ ++ u32 val; ++ ++ if (!mt7531_is_rgmii_port(priv, port)) { ++ dev_err(priv->dev, "RGMII mode is not available for port %d\n", ++ port); ++ return -EINVAL; ++ } ++ ++ val = mt7530_read(priv, MT7531_CLKGEN_CTRL); ++ val |= GP_CLK_EN; ++ val &= ~GP_MODE_MASK; ++ val |= GP_MODE(MT7531_GP_MODE_RGMII); ++ val &= ~CLK_SKEW_IN_MASK; ++ val |= CLK_SKEW_IN(MT7531_CLK_SKEW_NO_CHG); ++ val &= ~CLK_SKEW_OUT_MASK; ++ val |= CLK_SKEW_OUT(MT7531_CLK_SKEW_NO_CHG); ++ val |= TXCLK_NO_REVERSE | RXCLK_NO_DELAY; ++ ++ /* Do not adjust rgmii delay when vendor phy driver presents. */ ++ if (!phydev || phy_driver_is_genphy(phydev)) { ++ val &= ~(TXCLK_NO_REVERSE | RXCLK_NO_DELAY); ++ switch (interface) { ++ case PHY_INTERFACE_MODE_RGMII: ++ val |= TXCLK_NO_REVERSE; ++ val |= RXCLK_NO_DELAY; ++ break; ++ case PHY_INTERFACE_MODE_RGMII_RXID: ++ val |= TXCLK_NO_REVERSE; ++ break; ++ case PHY_INTERFACE_MODE_RGMII_TXID: ++ val |= RXCLK_NO_DELAY; ++ break; ++ case PHY_INTERFACE_MODE_RGMII_ID: ++ break; ++ default: ++ return -EINVAL; ++ } ++ } ++ mt7530_write(priv, MT7531_CLKGEN_CTRL, val); ++ ++ return 0; ++} ++ ++static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port, ++ unsigned long *supported) ++{ ++ /* Port5 supports ethier RGMII or SGMII. ++ * Port6 supports SGMII only. ++ */ ++ switch (port) { ++ case 5: ++ if (mt7531_is_rgmii_port(priv, port)) ++ break; ++ fallthrough; ++ case 6: ++ phylink_set(supported, 1000baseX_Full); ++ phylink_set(supported, 2500baseX_Full); ++ phylink_set(supported, 2500baseT_Full); ++ } ++} ++ ++static void ++mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ unsigned int val; ++ ++ /* For adjusting speed and duplex of SGMII force mode. */ ++ if (interface != PHY_INTERFACE_MODE_SGMII || ++ phylink_autoneg_inband(mode)) ++ return; ++ ++ /* SGMII force mode setting */ ++ val = mt7530_read(priv, MT7531_SGMII_MODE(port)); ++ val &= ~MT7531_SGMII_IF_MODE_MASK; ++ ++ switch (speed) { ++ case SPEED_10: ++ val |= MT7531_SGMII_FORCE_SPEED_10; ++ break; ++ case SPEED_100: ++ val |= MT7531_SGMII_FORCE_SPEED_100; ++ break; ++ case SPEED_1000: ++ val |= MT7531_SGMII_FORCE_SPEED_1000; ++ break; ++ } ++ ++ /* MT7531 SGMII 1G force mode can only work in full duplex mode, ++ * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not. ++ */ ++ if ((speed == SPEED_10 || speed == SPEED_100) && ++ duplex != DUPLEX_FULL) ++ val |= MT7531_SGMII_FORCE_HALF_DUPLEX; ++ ++ mt7530_write(priv, MT7531_SGMII_MODE(port), val); ++} ++ ++static bool mt753x_is_mac_port(u32 port) ++{ ++ return (port == 5 || port == 6); ++} ++ ++static int mt7531_sgmii_setup_mode_force(struct mt7530_priv *priv, u32 port, ++ phy_interface_t interface) ++{ ++ u32 val; ++ ++ if (!mt753x_is_mac_port(port)) ++ return -EINVAL; ++ ++ mt7530_set(priv, MT7531_QPHY_PWR_STATE_CTRL(port), ++ MT7531_SGMII_PHYA_PWD); ++ ++ val = mt7530_read(priv, MT7531_PHYA_CTRL_SIGNAL3(port)); ++ val &= ~MT7531_RG_TPHY_SPEED_MASK; ++ /* Setup 2.5 times faster clock for 2.5Gbps data speeds with 10B/8B ++ * encoding. ++ */ ++ val |= (interface == PHY_INTERFACE_MODE_2500BASEX) ? ++ MT7531_RG_TPHY_SPEED_3_125G : MT7531_RG_TPHY_SPEED_1_25G; ++ mt7530_write(priv, MT7531_PHYA_CTRL_SIGNAL3(port), val); ++ ++ mt7530_clear(priv, MT7531_PCS_CONTROL_1(port), MT7531_SGMII_AN_ENABLE); ++ ++ /* MT7531 SGMII 1G and 2.5G force mode can only work in full duplex ++ * mode, no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not. ++ */ ++ mt7530_rmw(priv, MT7531_SGMII_MODE(port), ++ MT7531_SGMII_IF_MODE_MASK | MT7531_SGMII_REMOTE_FAULT_DIS, ++ MT7531_SGMII_FORCE_SPEED_1000); ++ ++ mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), 0); ++ ++ return 0; ++} ++ ++static int mt7531_sgmii_setup_mode_an(struct mt7530_priv *priv, int port, ++ phy_interface_t interface) ++{ ++ if (!mt753x_is_mac_port(port)) ++ return -EINVAL; ++ ++ mt7530_set(priv, MT7531_QPHY_PWR_STATE_CTRL(port), ++ MT7531_SGMII_PHYA_PWD); ++ ++ mt7530_rmw(priv, MT7531_PHYA_CTRL_SIGNAL3(port), ++ MT7531_RG_TPHY_SPEED_MASK, MT7531_RG_TPHY_SPEED_1_25G); ++ ++ mt7530_set(priv, MT7531_SGMII_MODE(port), ++ MT7531_SGMII_REMOTE_FAULT_DIS | ++ MT7531_SGMII_SPEED_DUPLEX_AN); ++ ++ mt7530_rmw(priv, MT7531_PCS_SPEED_ABILITY(port), ++ MT7531_SGMII_TX_CONFIG_MASK, 1); ++ ++ mt7530_set(priv, MT7531_PCS_CONTROL_1(port), MT7531_SGMII_AN_ENABLE); ++ ++ mt7530_set(priv, MT7531_PCS_CONTROL_1(port), MT7531_SGMII_AN_RESTART); ++ ++ mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), 0); ++ ++ return 0; ++} ++ ++static void mt7531_sgmii_restart_an(struct dsa_switch *ds, int port) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ u32 val; ++ ++ /* Only restart AN when AN is enabled */ ++ val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); ++ if (val & MT7531_SGMII_AN_ENABLE) { ++ val |= MT7531_SGMII_AN_RESTART; ++ mt7530_write(priv, MT7531_PCS_CONTROL_1(port), val); ++ } ++} ++ ++static int ++mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode, ++ phy_interface_t interface) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ struct phy_device *phydev; ++ const struct dsa_port *dp; ++ ++ if (!mt753x_is_mac_port(port)) { ++ dev_err(priv->dev, "port %d is not a MAC port\n", port); ++ return -EINVAL; ++ } ++ ++ switch (interface) { ++ case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII_ID: ++ case PHY_INTERFACE_MODE_RGMII_RXID: ++ case PHY_INTERFACE_MODE_RGMII_TXID: ++ dp = dsa_to_port(ds, port); ++ phydev = dp->slave->phydev; ++ return mt7531_rgmii_setup(priv, port, interface, phydev); ++ case PHY_INTERFACE_MODE_SGMII: ++ return mt7531_sgmii_setup_mode_an(priv, port, interface); ++ case PHY_INTERFACE_MODE_NA: ++ case PHY_INTERFACE_MODE_1000BASEX: ++ case PHY_INTERFACE_MODE_2500BASEX: ++ if (phylink_autoneg_inband(mode)) ++ return -EINVAL; ++ ++ return mt7531_sgmii_setup_mode_force(priv, port, interface); ++ default: ++ return -EINVAL; ++ } ++ ++ return -EINVAL; ++} ++ + static int + mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode, + const struct phylink_link_state *state) +@@ -1451,6 +2164,8 @@ mt753x_phylink_mac_config(struct dsa_swi + if (mt753x_mac_config(ds, port, mode, state) < 0) + goto unsupported; + ++ if (priv->p5_intf_sel != P5_DISABLED) ++ priv->p5_interface = state->interface; + break; + case 6: /* 1st cpu port */ + if (priv->p6_interface == state->interface) +@@ -1470,7 +2185,8 @@ unsupported: + return; + } + +- if (phylink_autoneg_inband(mode)) { ++ if (phylink_autoneg_inband(mode) && ++ state->interface != PHY_INTERFACE_MODE_SGMII) { + dev_err(ds->dev, "%s: in-band negotiation unsupported\n", + __func__); + return; +@@ -1480,7 +2196,7 @@ unsupported: + mcr_new = mcr_cur; + mcr_new &= ~PMCR_LINK_SETTINGS_MASK; + mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN | +- PMCR_BACKPR_EN | PMCR_FORCE_MODE; ++ PMCR_BACKPR_EN | PMCR_FORCE_MODE_ID(priv->id); + + /* Are we connected to external phy */ + if (port == 5 && dsa_is_user_port(ds, 5)) +@@ -1490,7 +2206,18 @@ unsupported: + mt7530_write(priv, MT7530_PMCR_P(port), mcr_new); + } + +-static void mt7530_phylink_mac_link_down(struct dsa_switch *ds, int port, ++static void ++mt753x_phylink_mac_an_restart(struct dsa_switch *ds, int port) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ if (!priv->info->mac_pcs_an_restart) ++ return; ++ ++ priv->info->mac_pcs_an_restart(ds, port); ++} ++ ++static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface) + { +@@ -1499,7 +2226,19 @@ static void mt7530_phylink_mac_link_down + mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK); + } + +-static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port, ++static void mt753x_mac_pcs_link_up(struct dsa_switch *ds, int port, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ if (!priv->info->mac_pcs_link_up) ++ return; ++ ++ priv->info->mac_pcs_link_up(ds, port, mode, interface, speed, duplex); ++} ++ ++static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface, + struct phy_device *phydev, +@@ -1509,18 +2248,29 @@ static void mt7530_phylink_mac_link_up(s + struct mt7530_priv *priv = ds->priv; + u32 mcr; + ++ mt753x_mac_pcs_link_up(ds, port, mode, interface, speed, duplex); ++ + mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK; + ++ /* MT753x MAC works in 1G full duplex mode for all up-clocked ++ * variants. ++ */ ++ if (interface == PHY_INTERFACE_MODE_TRGMII || ++ (phy_interface_mode_is_8023z(interface))) { ++ speed = SPEED_1000; ++ duplex = DUPLEX_FULL; ++ } ++ + switch (speed) { + case SPEED_1000: + mcr |= PMCR_FORCE_SPEED_1000; + if (priv->eee_enable & BIT(port)) +- mcr_new |= PMCR_FORCE_EEE1G; ++ mcr |= PMCR_FORCE_EEE1G; + break; + case SPEED_100: + mcr |= PMCR_FORCE_SPEED_100; + if (priv->eee_enable & BIT(port)) +- mcr_new |= PMCR_FORCE_EEE100; ++ mcr |= PMCR_FORCE_EEE100; + break; + } + if (duplex == DUPLEX_FULL) { +@@ -1534,6 +2284,45 @@ static void mt7530_phylink_mac_link_up(s + mt7530_set(priv, MT7530_PMCR_P(port), mcr); + } + ++static int ++mt7531_cpu_port_config(struct dsa_switch *ds, int port) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ phy_interface_t interface; ++ int speed; ++ ++ switch (port) { ++ case 5: ++ if (mt7531_is_rgmii_port(priv, port)) ++ interface = PHY_INTERFACE_MODE_RGMII; ++ else ++ interface = PHY_INTERFACE_MODE_2500BASEX; ++ ++ priv->p5_interface = interface; ++ break; ++ case 6: ++ interface = PHY_INTERFACE_MODE_2500BASEX; ++ ++ mt7531_pad_setup(ds, interface); ++ ++ priv->p6_interface = interface; ++ break; ++ }; ++ ++ if (interface == PHY_INTERFACE_MODE_2500BASEX) ++ speed = SPEED_2500; ++ else ++ speed = SPEED_1000; ++ ++ mt7531_mac_config(ds, port, MLO_AN_FIXED, interface); ++ mt7530_write(priv, MT7530_PMCR_P(port), ++ PMCR_CPU_PORT_SETTING(priv->id)); ++ mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL, ++ speed, DUPLEX_FULL, true, true); ++ ++ return 0; ++} ++ + static void + mt7530_mac_port_validate(struct dsa_switch *ds, int port, + unsigned long *supported) +@@ -1542,6 +2331,14 @@ mt7530_mac_port_validate(struct dsa_swit + phylink_set(supported, 1000baseX_Full); + } + ++static void mt7531_mac_port_validate(struct dsa_switch *ds, int port, ++ unsigned long *supported) ++{ ++ struct mt7530_priv *priv = ds->priv; ++ ++ mt7531_sgmii_validate(priv, port, supported); ++} ++ + static void + mt753x_phylink_validate(struct dsa_switch *ds, int port, + unsigned long *supported, +@@ -1558,7 +2355,8 @@ mt753x_phylink_validate(struct dsa_switc + + phylink_set_port_modes(mask); + +- if (state->interface != PHY_INTERFACE_MODE_TRGMII) { ++ if (state->interface != PHY_INTERFACE_MODE_TRGMII || ++ !phy_interface_mode_is_8023z(state->interface)) { + phylink_set(mask, 10baseT_Half); + phylink_set(mask, 10baseT_Full); + phylink_set(mask, 100baseT_Half); +@@ -1577,6 +2375,11 @@ mt753x_phylink_validate(struct dsa_switc + + linkmode_and(supported, supported, mask); + linkmode_and(state->advertising, state->advertising, mask); ++ ++ /* We can only operate at 2500BaseX or 1000BaseX. If requested ++ * to advertise both, only report advertising at 2500BaseX. ++ */ ++ phylink_helper_basex_speed(state); + } + + static int +@@ -1667,6 +2470,63 @@ static int mt7530_set_mac_eee(struct dsa + return 0; + } + ++#ifdef notyet ++static int ++mt7531_sgmii_pcs_get_state_an(struct mt7530_priv *priv, int port, ++ struct phylink_link_state *state) ++{ ++ u32 status, val; ++ u16 config_reg; ++ ++ status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); ++ state->link = !!(status & MT7531_SGMII_LINK_STATUS); ++ if (state->interface == PHY_INTERFACE_MODE_SGMII && ++ (status & MT7531_SGMII_AN_ENABLE)) { ++ val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port)); ++ config_reg = val >> 16; ++ ++ switch (config_reg & LPA_SGMII_SPD_MASK) { ++ case LPA_SGMII_1000: ++ state->speed = SPEED_1000; ++ break; ++ case LPA_SGMII_100: ++ state->speed = SPEED_100; ++ break; ++ case LPA_SGMII_10: ++ state->speed = SPEED_10; ++ break; ++ default: ++ dev_err(priv->dev, "invalid sgmii PHY speed\n"); ++ state->link = false; ++ return -EINVAL; ++ } ++ ++ if (config_reg & LPA_SGMII_FULL_DUPLEX) ++ state->duplex = DUPLEX_FULL; ++ else ++ state->duplex = DUPLEX_HALF; ++ } ++ ++ return 0; ++} ++#endif ++ ++static int ++mt7531_phylink_mac_link_state(struct dsa_switch *ds, int port, ++ struct phylink_link_state *state) ++{ ++#ifdef notyet ++ struct mt7530_priv *priv = ds->priv; ++ ++ if (state->interface == PHY_INTERFACE_MODE_SGMII) ++ return mt7531_sgmii_pcs_get_state_an(priv, port, state); ++#else ++ return mt7530_phylink_mac_link_state(ds, port, state); ++#endif ++ ++ return -EOPNOTSUPP; ++} ++ + static int + mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port, + struct phylink_link_state *state) +@@ -1720,13 +2580,14 @@ static const struct dsa_switch_ops mt753 + .port_vlan_prepare = mt7530_port_vlan_prepare, + .port_vlan_add = mt7530_port_vlan_add, + .port_vlan_del = mt7530_port_vlan_del, +- .port_mirror_add = mt7530_port_mirror_add, +- .port_mirror_del = mt7530_port_mirror_del, ++ .port_mirror_add = mt753x_port_mirror_add, ++ .port_mirror_del = mt753x_port_mirror_del, + .phylink_validate = mt753x_phylink_validate, + .phylink_mac_link_state = mt753x_phylink_mac_link_state, + .phylink_mac_config = mt753x_phylink_mac_config, +- .phylink_mac_link_down = mt7530_phylink_mac_link_down, +- .phylink_mac_link_up = mt7530_phylink_mac_link_up, ++ .phylink_mac_an_restart = mt753x_phylink_mac_an_restart, ++ .phylink_mac_link_down = mt753x_phylink_mac_link_down, ++ .phylink_mac_link_up = mt753x_phylink_mac_link_up, + .get_mac_eee = mt7530_get_mac_eee, + .set_mac_eee = mt7530_set_mac_eee, + }; +@@ -1754,11 +2615,26 @@ static const struct mt753x_info mt753x_t + .mac_port_get_state = mt7530_phylink_mac_link_state, + .mac_port_config = mt7530_mac_config, + }, ++ [ID_MT7531] = { ++ .id = ID_MT7531, ++ .sw_setup = mt7531_setup, ++ .phy_read = mt7531_ind_phy_read, ++ .phy_write = mt7531_ind_phy_write, ++ .pad_setup = mt7531_pad_setup, ++ .cpu_port_config = mt7531_cpu_port_config, ++ .phy_mode_supported = mt7531_phy_supported, ++ .mac_port_validate = mt7531_mac_port_validate, ++ .mac_port_get_state = mt7531_phylink_mac_link_state, ++ .mac_port_config = mt7531_mac_config, ++ .mac_pcs_an_restart = mt7531_sgmii_restart_an, ++ .mac_pcs_link_up = mt7531_sgmii_link_up_force, ++ }, + }; + + static const struct of_device_id mt7530_of_match[] = { + { .compatible = "mediatek,mt7621", .data = &mt753x_table[ID_MT7621], }, + { .compatible = "mediatek,mt7530", .data = &mt753x_table[ID_MT7530], }, ++ { .compatible = "mediatek,mt7531", .data = &mt753x_table[ID_MT7531], }, + { /* sentinel */ }, + }; + MODULE_DEVICE_TABLE(of, mt7530_of_match); +--- a/drivers/net/dsa/mt7530.h ++++ b/drivers/net/dsa/mt7530.h +@@ -14,6 +14,7 @@ + enum mt753x_id { + ID_MT7530 = 0, + ID_MT7621 = 1, ++ ID_MT7531 = 2, + }; + + #define NUM_TRGMII_CTRL 5 +@@ -41,6 +42,33 @@ enum mt753x_id { + #define MIRROR_PORT(x) ((x) & 0x7) + #define MIRROR_MASK 0x7 + ++/* Registers for CPU forward control */ ++#define MT7531_CFC 0x4 ++#define MT7531_MIRROR_EN BIT(19) ++#define MT7531_MIRROR_MASK (MIRROR_MASK << 16) ++#define MT7531_MIRROR_PORT_GET(x) (((x) >> 16) & MIRROR_MASK) ++#define MT7531_MIRROR_PORT_SET(x) (((x) & MIRROR_MASK) << 16) ++#define MT7531_CPU_PMAP_MASK GENMASK(7, 0) ++ ++#define MT753X_MIRROR_REG(id) (((id) == ID_MT7531) ? \ ++ MT7531_CFC : MT7530_MFC) ++#define MT753X_MIRROR_EN(id) (((id) == ID_MT7531) ? \ ++ MT7531_MIRROR_EN : MIRROR_EN) ++#define MT753X_MIRROR_MASK(id) (((id) == ID_MT7531) ? \ ++ MT7531_MIRROR_MASK : MIRROR_MASK) ++ ++/* Registers for BPDU and PAE frame control*/ ++#define MT753X_BPC 0x24 ++#define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0) ++ ++enum mt753x_bpdu_port_fw { ++ MT753X_BPDU_FOLLOW_MFC, ++ MT753X_BPDU_CPU_EXCLUDE = 4, ++ MT753X_BPDU_CPU_INCLUDE = 5, ++ MT753X_BPDU_CPU_ONLY = 6, ++ MT753X_BPDU_DROP = 7, ++}; ++ + /* Registers for address table access */ + #define MT7530_ATA1 0x74 + #define STATIC_EMP 0 +@@ -222,10 +250,30 @@ enum mt7530_vlan_port_attr { + #define PMCR_FORCE_LNK BIT(0) + #define PMCR_SPEED_MASK (PMCR_FORCE_SPEED_100 | \ + PMCR_FORCE_SPEED_1000) ++#define MT7531_FORCE_LNK BIT(31) ++#define MT7531_FORCE_SPD BIT(30) ++#define MT7531_FORCE_DPX BIT(29) ++#define MT7531_FORCE_RX_FC BIT(28) ++#define MT7531_FORCE_TX_FC BIT(27) ++#define MT7531_FORCE_MODE (MT7531_FORCE_LNK | \ ++ MT7531_FORCE_SPD | \ ++ MT7531_FORCE_DPX | \ ++ MT7531_FORCE_RX_FC | \ ++ MT7531_FORCE_TX_FC) ++#define PMCR_FORCE_MODE_ID(id) (((id) == ID_MT7531) ? \ ++ MT7531_FORCE_MODE : \ ++ PMCR_FORCE_MODE) + #define PMCR_LINK_SETTINGS_MASK (PMCR_TX_EN | PMCR_FORCE_SPEED_1000 | \ + PMCR_RX_EN | PMCR_FORCE_SPEED_100 | \ + PMCR_TX_FC_EN | PMCR_RX_FC_EN | \ + PMCR_FORCE_FDX | PMCR_FORCE_LNK) ++#define PMCR_CPU_PORT_SETTING(id) (PMCR_FORCE_MODE_ID((id)) | \ ++ PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | \ ++ PMCR_BACKOFF_EN | PMCR_BACKPR_EN | \ ++ PMCR_TX_EN | PMCR_RX_EN | \ ++ PMCR_TX_FC_EN | PMCR_RX_FC_EN | \ ++ PMCR_FORCE_SPEED_1000 | \ ++ PMCR_FORCE_FDX | PMCR_FORCE_LNK) + + #define MT7530_PMSR_P(x) (0x3008 + (x) * 0x100) + #define PMSR_EEE1G BIT(7) +@@ -245,6 +293,10 @@ enum mt7530_vlan_port_attr { + #define LPI_THRESH(x) ((x & 0xFFF) << 4) + #define LPI_MODE_EN BIT(0) + ++/* Register for port debug count */ ++#define MT7531_DBG_CNT(x) (0x3018 + (x) * 0x100) ++#define MT7531_DIS_CLR BIT(31) ++ + /* Register for MIB */ + #define MT7530_PORT_MIB_COUNTER(x) (0x4000 + (x) * 0x100) + #define MT7530_MIB_CCR 0x4fe0 +@@ -262,12 +314,118 @@ enum mt7530_vlan_port_attr { + CCR_RX_OCT_CNT_BAD | \ + CCR_TX_OCT_CNT_GOOD | \ + CCR_TX_OCT_CNT_BAD) ++ ++/* MT7531 SGMII register group */ ++#define MT7531_SGMII_REG_BASE 0x5000 ++#define MT7531_SGMII_REG(p, r) (MT7531_SGMII_REG_BASE + \ ++ ((p) - 5) * 0x1000 + (r)) ++ ++/* Register forSGMII PCS_CONTROL_1 */ ++#define MT7531_PCS_CONTROL_1(p) MT7531_SGMII_REG(p, 0x00) ++#define MT7531_SGMII_LINK_STATUS BIT(18) ++#define MT7531_SGMII_AN_ENABLE BIT(12) ++#define MT7531_SGMII_AN_RESTART BIT(9) ++ ++/* Register for SGMII PCS_SPPED_ABILITY */ ++#define MT7531_PCS_SPEED_ABILITY(p) MT7531_SGMII_REG(p, 0x08) ++#define MT7531_SGMII_TX_CONFIG_MASK GENMASK(15, 0) ++#define MT7531_SGMII_TX_CONFIG BIT(0) ++ ++/* Register for SGMII_MODE */ ++#define MT7531_SGMII_MODE(p) MT7531_SGMII_REG(p, 0x20) ++#define MT7531_SGMII_REMOTE_FAULT_DIS BIT(8) ++#define MT7531_SGMII_IF_MODE_MASK GENMASK(5, 1) ++#define MT7531_SGMII_FORCE_DUPLEX BIT(4) ++#define MT7531_SGMII_FORCE_SPEED_MASK GENMASK(3, 2) ++#define MT7531_SGMII_FORCE_SPEED_1000 BIT(3) ++#define MT7531_SGMII_FORCE_SPEED_100 BIT(2) ++#define MT7531_SGMII_FORCE_SPEED_10 0 ++#define MT7531_SGMII_SPEED_DUPLEX_AN BIT(1) ++ ++enum mt7531_sgmii_force_duplex { ++ MT7531_SGMII_FORCE_FULL_DUPLEX = 0, ++ MT7531_SGMII_FORCE_HALF_DUPLEX = 0x10, ++}; ++ ++/* Fields of QPHY_PWR_STATE_CTRL */ ++#define MT7531_QPHY_PWR_STATE_CTRL(p) MT7531_SGMII_REG(p, 0xe8) ++#define MT7531_SGMII_PHYA_PWD BIT(4) ++ ++/* Values of SGMII SPEED */ ++#define MT7531_PHYA_CTRL_SIGNAL3(p) MT7531_SGMII_REG(p, 0x128) ++#define MT7531_RG_TPHY_SPEED_MASK (BIT(2) | BIT(3)) ++#define MT7531_RG_TPHY_SPEED_1_25G 0x0 ++#define MT7531_RG_TPHY_SPEED_3_125G BIT(2) ++ + /* Register for system reset */ + #define MT7530_SYS_CTRL 0x7000 + #define SYS_CTRL_PHY_RST BIT(2) + #define SYS_CTRL_SW_RST BIT(1) + #define SYS_CTRL_REG_RST BIT(0) + ++/* Register for PHY Indirect Access Control */ ++#define MT7531_PHY_IAC 0x701C ++#define MT7531_PHY_ACS_ST BIT(31) ++#define MT7531_MDIO_REG_ADDR_MASK (0x1f << 25) ++#define MT7531_MDIO_PHY_ADDR_MASK (0x1f << 20) ++#define MT7531_MDIO_CMD_MASK (0x3 << 18) ++#define MT7531_MDIO_ST_MASK (0x3 << 16) ++#define MT7531_MDIO_RW_DATA_MASK (0xffff) ++#define MT7531_MDIO_REG_ADDR(x) (((x) & 0x1f) << 25) ++#define MT7531_MDIO_DEV_ADDR(x) (((x) & 0x1f) << 25) ++#define MT7531_MDIO_PHY_ADDR(x) (((x) & 0x1f) << 20) ++#define MT7531_MDIO_CMD(x) (((x) & 0x3) << 18) ++#define MT7531_MDIO_ST(x) (((x) & 0x3) << 16) ++ ++enum mt7531_phy_iac_cmd { ++ MT7531_MDIO_ADDR = 0, ++ MT7531_MDIO_WRITE = 1, ++ MT7531_MDIO_READ = 2, ++ MT7531_MDIO_READ_CL45 = 3, ++}; ++ ++/* MDIO_ST: MDIO start field */ ++enum mt7531_mdio_st { ++ MT7531_MDIO_ST_CL45 = 0, ++ MT7531_MDIO_ST_CL22 = 1, ++}; ++ ++#define MT7531_MDIO_CL22_READ (MT7531_MDIO_ST(MT7531_MDIO_ST_CL22) | \ ++ MT7531_MDIO_CMD(MT7531_MDIO_READ)) ++#define MT7531_MDIO_CL22_WRITE (MT7531_MDIO_ST(MT7531_MDIO_ST_CL22) | \ ++ MT7531_MDIO_CMD(MT7531_MDIO_WRITE)) ++#define MT7531_MDIO_CL45_ADDR (MT7531_MDIO_ST(MT7531_MDIO_ST_CL45) | \ ++ MT7531_MDIO_CMD(MT7531_MDIO_ADDR)) ++#define MT7531_MDIO_CL45_READ (MT7531_MDIO_ST(MT7531_MDIO_ST_CL45) | \ ++ MT7531_MDIO_CMD(MT7531_MDIO_READ)) ++#define MT7531_MDIO_CL45_WRITE (MT7531_MDIO_ST(MT7531_MDIO_ST_CL45) | \ ++ MT7531_MDIO_CMD(MT7531_MDIO_WRITE)) ++ ++/* Register for RGMII clock phase */ ++#define MT7531_CLKGEN_CTRL 0x7500 ++#define CLK_SKEW_OUT(x) (((x) & 0x3) << 8) ++#define CLK_SKEW_OUT_MASK GENMASK(9, 8) ++#define CLK_SKEW_IN(x) (((x) & 0x3) << 6) ++#define CLK_SKEW_IN_MASK GENMASK(7, 6) ++#define RXCLK_NO_DELAY BIT(5) ++#define TXCLK_NO_REVERSE BIT(4) ++#define GP_MODE(x) (((x) & 0x3) << 1) ++#define GP_MODE_MASK GENMASK(2, 1) ++#define GP_CLK_EN BIT(0) ++ ++enum mt7531_gp_mode { ++ MT7531_GP_MODE_RGMII = 0, ++ MT7531_GP_MODE_MII = 1, ++ MT7531_GP_MODE_REV_MII = 2 ++}; ++ ++enum mt7531_clk_skew { ++ MT7531_CLK_SKEW_NO_CHG = 0, ++ MT7531_CLK_SKEW_DLY_100PPS = 1, ++ MT7531_CLK_SKEW_DLY_200PPS = 2, ++ MT7531_CLK_SKEW_REVERSE = 3, ++}; ++ + /* Register for hw trap status */ + #define MT7530_HWTRAP 0x7800 + #define HWTRAP_XTAL_MASK (BIT(10) | BIT(9)) +@@ -275,6 +433,16 @@ enum mt7530_vlan_port_attr { + #define HWTRAP_XTAL_40MHZ (BIT(10)) + #define HWTRAP_XTAL_20MHZ (BIT(9)) + ++#define MT7531_HWTRAP 0x7800 ++#define HWTRAP_XTAL_FSEL_MASK BIT(7) ++#define HWTRAP_XTAL_FSEL_25MHZ BIT(7) ++#define HWTRAP_XTAL_FSEL_40MHZ 0 ++/* Unique fields of (M)HWSTRAP for MT7531 */ ++#define XTAL_FSEL_S 7 ++#define XTAL_FSEL_M BIT(7) ++#define PHY_EN BIT(6) ++#define CHG_STRAP BIT(8) ++ + /* Register for hw trap modification */ + #define MT7530_MHWTRAP 0x7804 + #define MHWTRAP_PHY0_SEL BIT(20) +@@ -289,14 +457,37 @@ enum mt7530_vlan_port_attr { + #define MT7530_TOP_SIG_CTRL 0x7808 + #define TOP_SIG_CTRL_NORMAL (BIT(17) | BIT(16)) + ++#define MT7531_TOP_SIG_SR 0x780c ++#define PAD_DUAL_SGMII_EN BIT(1) ++#define PAD_MCM_SMI_EN BIT(0) ++ + #define MT7530_IO_DRV_CR 0x7810 + #define P5_IO_CLK_DRV(x) ((x) & 0x3) + #define P5_IO_DATA_DRV(x) (((x) & 0x3) << 4) + ++#define MT7531_CHIP_REV 0x781C ++ ++#define MT7531_PLLGP_EN 0x7820 ++#define EN_COREPLL BIT(2) ++#define SW_CLKSW BIT(1) ++#define SW_PLLGP BIT(0) ++ + #define MT7530_P6ECR 0x7830 + #define P6_INTF_MODE_MASK 0x3 + #define P6_INTF_MODE(x) ((x) & 0x3) + ++#define MT7531_PLLGP_CR0 0x78a8 ++#define RG_COREPLL_EN BIT(22) ++#define RG_COREPLL_POSDIV_S 23 ++#define RG_COREPLL_POSDIV_M 0x3800000 ++#define RG_COREPLL_SDM_PCW_S 1 ++#define RG_COREPLL_SDM_PCW_M 0x3ffffe ++#define RG_COREPLL_SDM_PCW_CHG BIT(0) ++ ++/* Registers for RGMII and SGMII PLL clock */ ++#define MT7531_ANA_PLLGP_CR2 0x78b0 ++#define MT7531_ANA_PLLGP_CR5 0x78bc ++ + /* Registers for TRGMII on the both side */ + #define MT7530_TRGMII_RCK_CTRL 0x7a00 + #define RX_RST BIT(31) +@@ -335,10 +526,25 @@ enum mt7530_vlan_port_attr { + #define MT7530_P5RGMIITXCR 0x7b04 + #define CSR_RGMII_TXC_CFG(x) ((x) & 0x1f) + ++/* Registers for GPIO mode */ ++#define MT7531_GPIO_MODE0 0x7c0c ++#define MT7531_GPIO0_MASK GENMASK(3, 0) ++#define MT7531_GPIO0_INTERRUPT 1 ++ ++#define MT7531_GPIO_MODE1 0x7c10 ++#define MT7531_GPIO11_RG_RXD2_MASK GENMASK(15, 12) ++#define MT7531_EXT_P_MDC_11 (2 << 12) ++#define MT7531_GPIO12_RG_RXD3_MASK GENMASK(19, 16) ++#define MT7531_EXT_P_MDIO_12 (2 << 16) ++ + #define MT7530_CREV 0x7ffc + #define CHIP_NAME_SHIFT 16 + #define MT7530_ID 0x7530 + ++#define MT7531_CREV 0x781C ++#define CHIP_REV_M 0x0f ++#define MT7531_ID 0x7531 ++ + /* Registers for core PLL access through mmd indirect */ + #define CORE_PLL_GROUP2 0x401 + #define RG_SYSPLL_EN_NORMAL BIT(15) +@@ -355,6 +561,10 @@ enum mt7530_vlan_port_attr { + #define RG_SYSPLL_DDSFBK_EN BIT(12) + #define RG_SYSPLL_BIAS_EN BIT(11) + #define RG_SYSPLL_BIAS_LPF_EN BIT(10) ++#define MT7531_PHY_PLL_OFF BIT(5) ++#define MT7531_PHY_PLL_BYPASS_MODE BIT(4) ++ ++#define MT753X_CTRL_PHY_ADDR 0 + + #define CORE_PLL_GROUP5 0x404 + #define RG_LCDDS_PCW_NCPO1(x) ((x) & 0xffff) +@@ -433,6 +643,7 @@ enum p5_interface_select { + P5_INTF_SEL_PHY_P0, + P5_INTF_SEL_PHY_P4, + P5_INTF_SEL_GMAC5, ++ P5_INTF_SEL_GMAC5_SGMII, + }; + + static const char *p5_intf_modes(unsigned int p5_interface) +@@ -446,6 +657,8 @@ static const char *p5_intf_modes(unsigne + return "PHY P4"; + case P5_INTF_SEL_GMAC5: + return "GMAC5"; ++ case P5_INTF_SEL_GMAC5_SGMII: ++ return "GMAC5_SGMII"; + default: + return "unknown"; + } +@@ -466,6 +679,10 @@ static const char *p5_intf_modes(unsigne + * MAC port + * @mac_port_config: Holding the way setting up the PHY attribute to a + * certain MAC port ++ * @mac_pcs_an_restart Holding the way restarting PCS autonegotiation for a ++ * certain MAC port ++ * @mac_pcs_link_up: Holding the way setting up the PHY attribute to the pcs ++ * of the certain MAC port + */ + struct mt753x_info { + enum mt753x_id id; +@@ -474,6 +691,7 @@ struct mt753x_info { + int (*phy_read)(struct dsa_switch *ds, int port, int regnum); + int (*phy_write)(struct dsa_switch *ds, int port, int regnum, u16 val); + int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface); ++ int (*cpu_port_config)(struct dsa_switch *ds, int port); + bool (*phy_mode_supported)(struct dsa_switch *ds, int port, + const struct phylink_link_state *state); + void (*mac_port_validate)(struct dsa_switch *ds, int port, +@@ -483,6 +701,10 @@ struct mt753x_info { + int (*mac_port_config)(struct dsa_switch *ds, int port, + unsigned int mode, + phy_interface_t interface); ++ void (*mac_pcs_an_restart)(struct dsa_switch *ds, int port); ++ void (*mac_pcs_link_up)(struct dsa_switch *ds, int port, ++ unsigned int mode, phy_interface_t interface, ++ int speed, int duplex); + }; + + /* struct mt7530_priv - This is the main data structure for holding the state diff --git a/target/linux/mediatek/patches-5.4/0605-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch b/target/linux/mediatek/patches-5.4/0605-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch new file mode 100644 index 000000000..8c3fe5208 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0605-arm64-dts-mt7622-add-mt7531-dsa-to-bananapi-bpi-r64-board.patch @@ -0,0 +1,71 @@ +From: Landen Chao +Subject: [PATCH net-next 6/6] arm64: dts: mt7622: add mt7531 dsa to + bananapi-bpi-r64 board +Date: Tue, 10 Dec 2019 16:14:42 +0800 + +Add mt7531 dsa to bananapi-bpi-r64 board for 5 giga Ethernet ports support. + +Signed-off-by: Landen Chao +--- + .../dts/mediatek/mt7622-bananapi-bpi-r64.dts | 50 +++++++++++++++++++ + 1 file changed, 50 insertions(+) + +--- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +@@ -150,6 +150,56 @@ + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; ++ ++ switch@0 { ++ compatible = "mediatek,mt7531"; ++ reg = <0>; ++ reset-gpios = <&pio 54 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "wan"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan0"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan1"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan3"; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ ethernet = <&gmac0>; ++ phy-mode = "2500base-x"; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ pause; ++ }; ++ }; ++ }; ++ }; ++ + }; + }; + diff --git a/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch b/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch new file mode 100644 index 000000000..94d5bbfb0 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/0700-arm-dts-mt7623-add-missing-pause-for-switchport.patch @@ -0,0 +1,23 @@ +From: Frank Wunderlich +Date: Mon, 7 Sep 2020 09:05:17 +0200 + +port6 of mt7530 switch (= cpu port 0) on bananapi-r2 misses pause option +which causes rx drops on running iperf. + +Cc: stable@vger.kernel.org +Fixes: f4ff257cd160 ("arm: dts: mt7623: add support for Bananapi R2 (BPI-R2) board") +Signed-off-by: Frank Wunderlich +--- + arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts ++++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +@@ -193,6 +193,7 @@ + fixed-link { + speed = <1000>; + full-duplex; ++ pause; + }; + }; + }; diff --git a/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch index 473fb688e..104334dc0 100644 --- a/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-5.4/0900-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2561,6 +2561,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2564,6 +2564,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch b/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch index bc0f7b1a6..3283746e3 100644 --- a/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch +++ b/target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch @@ -281,7 +281,7 @@ Signed-off-by: chuanjia.liu &pio { --- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi -@@ -790,45 +790,41 @@ +@@ -792,45 +792,41 @@ #reset-cells = <1>; }; @@ -344,7 +344,7 @@ Signed-off-by: chuanjia.liu interrupt-map-mask = <0 0 0 7>; interrupt-map = <0 0 0 1 &pcie_intc0 0>, <0 0 0 2 &pcie_intc0 1>, -@@ -840,15 +836,39 @@ +@@ -842,15 +838,39 @@ #interrupt-cells = <1>; }; }; diff --git a/target/linux/mediatek/patches-5.4/0999-hnat.patch b/target/linux/mediatek/patches-5.4/0999-hnat.patch index 26e4a0a54..f86c882eb 100644 --- a/target/linux/mediatek/patches-5.4/0999-hnat.patch +++ b/target/linux/mediatek/patches-5.4/0999-hnat.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/mediatek/Kconfig +++ b/drivers/net/ethernet/mediatek/Kconfig -@@ -14,4 +14,8 @@ config NET_MEDIATEK_SOC +@@ -15,4 +15,8 @@ config NET_MEDIATEK_SOC This driver supports the gigabit ethernet MACs in the MediaTek SoC family. @@ -144,10 +144,10 @@ #include +#include +#include + #include #include "mtk_eth_soc.h" - -@@ -1307,8 +1309,16 @@ static int mtk_poll_rx(struct napi_struc +@@ -1327,8 +1329,16 @@ static int mtk_poll_rx(struct napi_struc (trxd.rxd2 & RX_DMA_VTAG)) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), RX_DMA_VID(trxd.rxd3)); @@ -164,9 +164,9 @@ + } +#endif + skip_rx: ring->data[idx] = new_data; - rxd->rxd1 = (unsigned int)dma_addr; -@@ -2225,6 +2235,9 @@ static int mtk_open(struct net_device *d +@@ -2292,6 +2302,9 @@ static int mtk_open(struct net_device *d mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); refcount_set(ð->dma_refcnt, 1); @@ -176,7 +176,7 @@ } else refcount_inc(ð->dma_refcnt); -@@ -2283,6 +2296,9 @@ static int mtk_stop(struct net_device *d +@@ -2355,6 +2368,9 @@ static int mtk_stop(struct net_device *d mtk_dma_free(eth); @@ -186,7 +186,7 @@ return 0; } -@@ -2742,6 +2758,27 @@ static int mtk_set_rxnfc(struct net_devi +@@ -2853,6 +2869,27 @@ static int mtk_set_rxnfc(struct net_devi return ret; } @@ -214,7 +214,7 @@ static const struct ethtool_ops mtk_ethtool_ops = { .get_link_ksettings = mtk_get_link_ksettings, .set_link_ksettings = mtk_set_link_ksettings, -@@ -2773,6 +2810,9 @@ static const struct net_device_ops mtk_n +@@ -2884,6 +2921,9 @@ static const struct net_device_ops mtk_n #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = mtk_poll_controller, #endif @@ -224,7 +224,7 @@ }; static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) -@@ -3108,6 +3148,7 @@ static const struct mtk_soc_data mt7622_ +@@ -3226,6 +3266,7 @@ static const struct mtk_soc_data mt7622_ .hw_features = MTK_HW_FEATURES, .required_clks = MT7622_CLKS_BITMAP, .required_pctl = false, @@ -234,7 +234,7 @@ static const struct mtk_soc_data mt7623_data = { --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h -@@ -779,6 +779,13 @@ enum mkt_eth_capabilities { +@@ -790,6 +790,13 @@ enum mkt_eth_capabilities { MTK_MUX_U3_GMAC2_TO_QPHY | \ MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA) @@ -248,7 +248,7 @@ /* struct mtk_eth_data - This is the structure holding all differences * among various plaforms * @ana_rgc3: The offset for register ANA_RGC3 related to -@@ -796,6 +803,7 @@ struct mtk_soc_data { +@@ -807,6 +814,7 @@ struct mtk_soc_data { u32 required_clks; bool required_pctl; netdev_features_t hw_features; @@ -256,7 +256,7 @@ }; /* currently no SoC has more than 2 macs */ -@@ -821,6 +829,23 @@ struct mtk_sgmii { +@@ -832,6 +840,23 @@ struct mtk_sgmii { u32 ana_rgc3; }; @@ -280,7 +280,7 @@ /* struct mtk_eth - This is the main datasructure for holding the state * of the driver * @dev: The device pointer -@@ -894,6 +919,16 @@ struct mtk_eth { +@@ -917,6 +942,16 @@ struct mtk_eth { u32 tx_int_status_reg; u32 rx_dma_l4_valid; int ip_align; @@ -297,7 +297,7 @@ }; /* struct mtk_mac - the structure that holds the info about the MACs of the -@@ -926,6 +961,7 @@ void mtk_stats_update_mac(struct mtk_mac +@@ -949,6 +984,7 @@ void mtk_stats_update_mac(struct mtk_mac void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg); u32 mtk_r32(struct mtk_eth *eth, unsigned reg); @@ -305,7 +305,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *np, u32 ana_rgc3); -@@ -938,4 +974,13 @@ int mtk_gmac_sgmii_path_setup(struct mtk +@@ -961,4 +997,13 @@ int mtk_gmac_sgmii_path_setup(struct mtk int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id); int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id); @@ -321,7 +321,7 @@ #endif /* MTK_ETH_H */ --- /dev/null +++ b/drivers/net/ethernet/mediatek/mtk_offload.c -@@ -0,0 +1,593 @@ +@@ -0,0 +1,609 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License @@ -430,6 +430,22 @@ + } + } + ++ if (dest->flags & FLOW_OFFLOAD_PATH_DSA) { ++ entry->bfib1.vlan_layer = 1; ++ ++ entry->ipv4_hnapt.bfib1.vpm = 0; ++ entry->ipv4_hnapt.etype = BIT(dest->dsa_port); ++ ++ if (dest->flags & FLOW_OFFLOAD_PATH_VLAN) { ++ if (dest->vlan_proto != htons(ETH_P_8021Q)) ++ return -EINVAL; ++ ++ entry->ipv4_hnapt.etype |= BIT(8); ++ } else { ++ entry->ipv4_hnapt.vlan1 = 0; ++ } ++ } ++ + return 0; +} + diff --git a/target/linux/mediatek/patches-5.4/1001-eth-mtk-disable-TBDDONE-support.patch b/target/linux/mediatek/patches-5.4/1001-eth-mtk-disable-TBDDONE-support.patch deleted file mode 100644 index a1ddc3d5d..000000000 --- a/target/linux/mediatek/patches-5.4/1001-eth-mtk-disable-TBDDONE-support.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -1364,10 +1364,11 @@ static int mtk_poll_tx_qdma(struct mtk_e - u32 next_cpu = desc->txd2; - int mac = 0; - -- desc = mtk_qdma_phys_to_virt(ring, desc->txd2); - if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0) - break; - -+ desc = mtk_qdma_phys_to_virt(ring, desc->txd2); -+ - tx_buf = mtk_desc_to_tx_buf(ring, desc); - if (tx_buf->flags & MTK_TX_FLAGS_FPORT1) - mac = 1; -@@ -2191,7 +2192,7 @@ static int mtk_start_dma(struct mtk_eth - - if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { - mtk_w32(eth, -- MTK_TX_WB_DDONE | MTK_TX_DMA_EN | -+ MTK_TX_DMA_EN | - MTK_DMA_SIZE_16DWORDS | MTK_NDP_CO_PRO | - MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | - MTK_RX_BT_32DWORDS, diff --git a/target/linux/mediatek/patches-5.4/1003-dts-mt7622-rfb-change-to-ax-mtd-layout.patch b/target/linux/mediatek/patches-5.4/1003-dts-mt7622-rfb-change-to-ax-mtd-layout.patch new file mode 100644 index 000000000..817948986 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/1003-dts-mt7622-rfb-change-to-ax-mtd-layout.patch @@ -0,0 +1,23 @@ +--- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts ++++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +@@ -591,17 +591,17 @@ + + factory: partition@1c0000 { + label = "Factory"; +- reg = <0x1c0000 0x0040000>; ++ reg = <0x1c0000 0x0100000>; + }; + + partition@200000 { + label = "firmware"; +- reg = <0x200000 0x2000000>; ++ reg = <0x2c0000 0x2000000>; + }; + + partition@2200000 { + label = "User_data"; +- reg = <0x2200000 0x4000000>; ++ reg = <0x22c0000 0x4000000>; + }; + }; + }; diff --git a/target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch b/target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch new file mode 100644 index 000000000..d3ef78dc7 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/1010-pcie-mediatek-fix-clearing-interrupt-status.patch @@ -0,0 +1,24 @@ +From: Felix Fietkau +Date: Fri, 4 Sep 2020 18:33:27 +0200 +Subject: [PATCH] pcie-mediatek: fix clearing interrupt status + +Clearing the status needs to happen after running the handler, otherwise +we will get an extra spurious interrupt after the cause has been cleared + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/pci/controller/pcie-mediatek.c ++++ b/drivers/pci/controller/pcie-mediatek.c +@@ -616,10 +616,10 @@ static void mtk_pcie_intr_handler(struct + if (status & INTX_MASK) { + for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) { + /* Clear the INTx */ +- writel(1 << bit, port->base + PCIE_INT_STATUS); + virq = irq_find_mapping(port->irq_domain, + bit - INTX_SHIFT); + generic_handle_irq(virq); ++ writel(1 << bit, port->base + PCIE_INT_STATUS); + } + } + diff --git a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch new file mode 100644 index 000000000..ed9aecdf7 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch @@ -0,0 +1,83 @@ +From: Felix Fietkau +Date: Fri, 4 Sep 2020 18:36:06 +0200 +Subject: [PATCH] net: ethernet: mtk_eth_soc: add support for coherent DMA + +It improves performance by eliminating the need for a cache flush on rx and tx + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi +@@ -357,7 +357,7 @@ + }; + + cci_control2: slave-if@5000 { +- compatible = "arm,cci-400-ctrl-if"; ++ compatible = "arm,cci-400-ctrl-if", "syscon"; + interface-type = "ace"; + reg = <0x5000 0x1000>; + }; +@@ -967,6 +967,8 @@ + power-domains = <&scpsys MT7622_POWER_DOMAIN_ETHSYS>; + mediatek,ethsys = <ðsys>; + mediatek,sgmiisys = <&sgmiisys>; ++ mediatek,cci-control = <&cci_control2>; ++ dma-coherent; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -2486,6 +2487,12 @@ static int mtk_hw_init(struct mtk_eth *e + if (ret) + goto err_disable_pm; + ++ if (of_dma_is_coherent(eth->dev->of_node)) { ++ u32 mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA; ++ ++ regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, mask, mask); ++ } ++ + if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { + ret = device_reset(eth->dev); + if (ret) { +@@ -3088,6 +3095,16 @@ static int mtk_probe(struct platform_dev + } + } + ++ if (of_dma_is_coherent(pdev->dev.of_node)) { ++ struct regmap *cci; ++ ++ cci = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, ++ "mediatek,cci-control"); ++ /* enable CPU/bus coherency */ ++ if (!IS_ERR(cci)) ++ regmap_write(cci, 0, 3); ++ } ++ + if (MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII)) { + eth->sgmii = devm_kzalloc(eth->dev, sizeof(*eth->sgmii), + GFP_KERNEL); +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -426,6 +426,11 @@ + #define RSTCTRL_FE BIT(6) + #define RSTCTRL_PPE BIT(31) + ++/* ethernet dma channel agent map */ ++#define ETHSYS_DMA_AG_MAP 0x408 ++#define ETHSYS_DMA_AG_MAP_PDMA BIT(0) ++#define ETHSYS_DMA_AG_MAP_QDMA BIT(1) ++ + /* SGMII subsystem config registers */ + /* Register to auto-negotiation restart */ + #define SGMSYS_PCS_CONTROL_1 0x0 diff --git a/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch b/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch new file mode 100644 index 000000000..c24126284 --- /dev/null +++ b/target/linux/mediatek/patches-5.4/1012-pci-pcie-mediatek-add-support-for-coherent-DMA.patch @@ -0,0 +1,108 @@ +From: Felix Fietkau +Date: Fri, 4 Sep 2020 18:42:42 +0200 +Subject: [PATCH] pci: pcie-mediatek: add support for coherent DMA + +It improves performance by eliminating the need for a cache flush for DMA on +attached devices + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi +@@ -803,6 +803,8 @@ + reg = <0 0x1a143000 0 0x1000>; + reg-names = "port0"; + mediatek,pcie-cfg = <&pciecfg>; ++ mediatek,hifsys = <&hifsys>; ++ mediatek,cci-control = <&cci_control2>; + #address-cells = <3>; + #size-cells = <2>; + interrupts = ; +@@ -820,6 +822,7 @@ + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>; + status = "disabled"; ++ dma-coherent; + + slot0: pcie@0,0 { + reg = <0x0000 0 0 0 0>; +@@ -846,6 +849,8 @@ + reg = <0 0x1a145000 0 0x1000>; + reg-names = "port1"; + mediatek,pcie-cfg = <&pciecfg>; ++ mediatek,hifsys = <&hifsys>; ++ mediatek,cci-control = <&cci_control2>; + #address-cells = <3>; + #size-cells = <2>; + interrupts = ; +@@ -864,6 +869,7 @@ + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>; + status = "disabled"; ++ dma-coherent; + + slot1: pcie@1,0 { + reg = <0x0800 0 0 0 0>; +@@ -923,6 +929,11 @@ + }; + }; + ++ hifsys: syscon@1af00000 { ++ compatible = "mediatek,mt7622-hifsys", "syscon"; ++ reg = <0 0x1af00000 0 0x70>; ++ }; ++ + ethsys: syscon@1b000000 { + compatible = "mediatek,mt7622-ethsys", + "syscon"; +--- a/drivers/pci/controller/pcie-mediatek.c ++++ b/drivers/pci/controller/pcie-mediatek.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -139,6 +140,11 @@ + #define PCIE_LINK_STATUS_V2 0x804 + #define PCIE_PORT_LINKUP_V2 BIT(10) + ++/* DMA channel mapping */ ++#define HIFSYS_DMA_AG_MAP 0x008 ++#define HIFSYS_DMA_AG_MAP_PCIE0 BIT(0) ++#define HIFSYS_DMA_AG_MAP_PCIE1 BIT(1) ++ + struct mtk_pcie_port; + + /** +@@ -1068,6 +1074,27 @@ static int mtk_pcie_setup(struct mtk_pci + } + } + ++ if (of_dma_is_coherent(node)) { ++ struct regmap *con; ++ u32 mask; ++ ++ con = syscon_regmap_lookup_by_phandle(node, ++ "mediatek,cci-control"); ++ /* enable CPU/bus coherency */ ++ if (!IS_ERR(con)) ++ regmap_write(con, 0, 3); ++ ++ con = syscon_regmap_lookup_by_phandle(node, ++ "mediatek,hifsys"); ++ if (IS_ERR(con)) { ++ dev_err(dev, "missing hifsys node\n"); ++ return PTR_ERR(con); ++ } ++ ++ mask = HIFSYS_DMA_AG_MAP_PCIE0 | HIFSYS_DMA_AG_MAP_PCIE1; ++ regmap_update_bits(con, HIFSYS_DMA_AG_MAP, mask, mask); ++ } ++ + for_each_available_child_of_node(node, child) { + int slot; + diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c index 9f17f20ff..7eec2cf15 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +// SPDX-License-Identifier: GPL-2.0-or-later /* * OCEDO Panda Board Setup diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/red15w_rev1.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/red15w_rev1.c index 6669d5a57..1b2be853a 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/red15w_rev1.c +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/red15w_rev1.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Sophos RED 15w Rev.1 Board Setup diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/ws-ap3710i.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/ws-ap3710i.c index a2900868b..f23902de3 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/ws-ap3710i.c +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/ws-ap3710i.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Enterasys WS-AP3710i Board Setup diff --git a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version deleted file mode 100644 index 5965fdc2f..000000000 --- a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright (C) 2020 OpenWrt.org -# - -. /lib/functions.sh - -case "$(board_name)" in - linksys,wrt1200ac|\ - linksys,wrt1900ac-v1|\ - linksys,wrt1900ac-v2|\ - linksys,wrt1900acs|\ - linksys,wrt3200acm|\ - linksys,wrt32x|\ - solidrun,clearfog-base-a1|\ - solidrun,clearfog-pro-a1) - uci set system.@system[0].compat_version="1.1" - uci commit system - ;; -esac - -exit 0 diff --git a/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts b/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts index 5b722b4f8..5649c4cba 100644 --- a/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts +++ b/target/linux/mvebu/files-4.19/arch/arm64/boot/dts/marvell/armada-3720-uDPU.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device tree for the uDPU board. * Based on Marvell Armada 3720 development board (DB-88F3720-DDR3) diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts index ea392f9e4..458988619 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls421de.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Buffalo LinkStation LS421DE * @@ -209,12 +209,6 @@ gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; }; }; - - /* FIXME: this driver needs to be aware of the LED2 eth phy use, - which must be set to off state before shutting down the machine */ - restart_poweroff { - compatible = "restart-poweroff"; - }; }; ð1 { @@ -243,13 +237,6 @@ ethphy0: ethernet-phy@0 { /* Marvell 88E1518 */ reg = <0>; - /* - * LED2 is used to inform, at restart time, if the power - * switch was slided to the "off" position. - * Page 0x3, Register 0x10, bits 8-11: - * 0x800: LED2 off, power off the machine - * 0x900: LED2 on, boot the machine - */ marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED function */ <0x3 0x11 0x1 0x4401>, /* LED polarity */ <0x3 0x12 0x1 0x4905>; /* LED timer */ diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts index ef90a1bd3..e3bed4d44 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Globalscale Marvell ESPRESSOBin Board with eMMC * Copyright (C) 2018 Marvell diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts index 2b565ca8d..e1e007143 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Globalscale Marvell ESPRESSOBin Board V7 with eMMC * Copyright (C) 2018 Marvell diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts index 8a408c3c4..40f18409b 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /* * Device Tree file for Globalscale Marvell ESPRESSOBin Board V7 * Copyright (C) 2018 Marvell diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts index d1a966f4f..86c33fa10 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) /dts-v1/; #include diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 7c2069ed2..7f746e553 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -8,8 +8,7 @@ define Device/dsa-migration DEVICE_COMPAT_VERSION := 1.1 - DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA \ - (early adopters with DSA already set up may just force-flash keeping existing config) + DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA endef define Device/buffalo_ls421de @@ -24,8 +23,8 @@ define Device/buffalo_ls421de DEVICE_DTS := armada-370-buffalo-ls421de DEVICE_PACKAGES := \ kmod-rtc-rs5c372a kmod-hwmon-gpiofan kmod-hwmon-drivetemp kmod-usb3 \ - kmod-md-raid0 kmod-md-raid1 kmod-md-mod kmod-fs-xfs mkf2fs e2fsprogs \ - partx-utils + kmod-linkstation-poweroff kmod-md-raid0 kmod-md-raid1 kmod-md-mod \ + kmod-fs-xfs mkf2fs e2fsprogs partx-utils endef TARGET_DEVICES += buffalo_ls421de diff --git a/target/linux/mvebu/image/generic-arm64.bootscript b/target/linux/mvebu/image/generic-arm64.bootscript index bb7894825..c7688fd73 100644 --- a/target/linux/mvebu/image/generic-arm64.bootscript +++ b/target/linux/mvebu/image/generic-arm64.bootscript @@ -10,6 +10,14 @@ elif mmc dev 1; then setenv mmcdev 1 fi +if test -n "${fdt_addr_r}"; then + setenv fdt_addr ${fdt_addr_r} +fi + +if test -n "${kernel_addr_r}"; then + setenv kernel_addr ${kernel_addr_r} +fi + load mmc ${mmcdev}:1 ${fdt_addr} @DTB@.dtb load mmc ${mmcdev}:1 ${kernel_addr} Image diff --git a/target/linux/mvebu/modules.mk b/target/linux/mvebu/modules.mk new file mode 100644 index 000000000..3a5e31678 --- /dev/null +++ b/target/linux/mvebu/modules.mk @@ -0,0 +1,21 @@ +define KernelPackage/linkstation-poweroff + SUBMENU:=$(OTHER_MENU) + DEPENDS:=@TARGET_mvebu + TITLE:=Buffalo LinkStation power off driver + KCONFIG:= \ + CONFIG_POWER_RESET=y \ + CONFIG_POWER_RESET_LINKSTATION \ + CONFIG_POWER_RESET_QNAP=n + + FILES:=$(LINUX_DIR)/drivers/power/reset/linkstation-poweroff.ko + AUTOLOAD:=$(call AutoLoad,31,linkstation-poweroff,1) +endef + +define KernelPackage/linkstation-poweroff/description + This driver supports turning off some Buffalo LinkStations by + setting an output pin at the ethernet PHY to the correct state. + It also makes the device compatible with the WoL function. + Say Y here if you have a Buffalo LinkStation LS421D/E. +endef + +$(eval $(call KernelPackage,linkstation-poweroff)) diff --git a/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch b/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch new file mode 100644 index 000000000..7b7e8cd03 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/030-linkstation-poweroff.patch @@ -0,0 +1,177 @@ +--- a/drivers/power/reset/Kconfig ++++ b/drivers/power/reset/Kconfig +@@ -99,6 +99,17 @@ config POWER_RESET_HISI + help + Reboot support for Hisilicon boards. + ++config POWER_RESET_LINKSTATION ++ tristate "Buffalo LinkStation power-off driver" ++ depends on ARCH_MVEBU || COMPILE_TEST ++ depends on OF_MDIO && PHYLIB ++ help ++ This driver supports turning off some Buffalo LinkStations by ++ setting an output pin at the ethernet PHY to the correct state. ++ It also makes the device compatible with the WoL function. ++ ++ Say Y here if you have a Buffalo LinkStation LS421D/E. ++ + config POWER_RESET_MSM + bool "Qualcomm MSM power-off driver" + depends on ARCH_QCOM +--- a/drivers/power/reset/Makefile ++++ b/drivers/power/reset/Makefile +@@ -10,6 +10,7 @@ obj-$(CONFIG_POWER_RESET_GEMINI_POWEROFF + obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o + obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o + obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o ++obj-${CONFIG_POWER_RESET_LINKSTATION} += linkstation-poweroff.o + obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o + obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o + obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o +--- /dev/null ++++ b/drivers/power/reset/linkstation-poweroff.c +@@ -0,0 +1,144 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * LinkStation power off restart driver ++ * Copyright (C) 2020 Daniel GonzĂ¡lez Cabanelas ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Defines from the eth phy Marvell driver */ ++#define MII_MARVELL_COPPER_PAGE 0 ++#define MII_MARVELL_LED_PAGE 3 ++#define MII_MARVELL_WOL_PAGE 17 ++#define MII_MARVELL_PHY_PAGE 22 ++ ++#define MII_PHY_LED_CTRL 16 ++#define MII_88E1318S_PHY_LED_TCR 18 ++#define MII_88E1318S_PHY_WOL_CTRL 16 ++#define MII_M1011_IEVENT 19 ++ ++#define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE BIT(7) ++#define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15) ++#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS BIT(12) ++#define LED2_FORCE_ON (0x8 << 8) ++#define LEDMASK GENMASK(11,8) ++ ++static struct phy_device *phydev; ++ ++static void mvphy_reg_intn(u16 data) ++{ ++ int rc = 0, saved_page; ++ ++ saved_page = phy_select_page(phydev, MII_MARVELL_LED_PAGE); ++ if (saved_page < 0) ++ goto err; ++ ++ /* Force manual LED2 control to let INTn work */ ++ __phy_modify(phydev, MII_PHY_LED_CTRL, LEDMASK, LED2_FORCE_ON); ++ ++ /* Set the LED[2]/INTn pin to the required state */ ++ __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, ++ MII_88E1318S_PHY_LED_TCR_FORCE_INT, ++ MII_88E1318S_PHY_LED_TCR_INTn_ENABLE | data); ++ ++ if (!data) { ++ /* Clear interrupts to ensure INTn won't be holded in high state */ ++ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_COPPER_PAGE); ++ __phy_read(phydev, MII_M1011_IEVENT); ++ ++ /* If WOL was enabled and a magic packet was received before powering ++ * off, we won't be able to wake up by sending another magic packet. ++ * Clear WOL status. ++ */ ++ __phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_WOL_PAGE); ++ __phy_set_bits(phydev, MII_88E1318S_PHY_WOL_CTRL, ++ MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS); ++ } ++err: ++ rc = phy_restore_page(phydev, saved_page, rc); ++ if (rc < 0) ++ dev_err(&phydev->mdio.dev, "Write register failed, %d\n", rc); ++ ++ if (!data) { ++ /* Slow down the PHY to save energy */ ++ rc= phy_speed_down(phydev, false); ++ if (rc < 0) ++ dev_err(&phydev->mdio.dev, "PHY speed down failed, %d\n", rc); ++ } ++} ++ ++static int linkstation_reboot_notifier(struct notifier_block *nb, ++ unsigned long action, void *unused) ++{ ++ if (action == SYS_RESTART) ++ mvphy_reg_intn(MII_88E1318S_PHY_LED_TCR_FORCE_INT); ++ ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block linkstation_reboot_nb = { ++ .notifier_call = linkstation_reboot_notifier, ++}; ++ ++static void linkstation_poweroff(void) ++{ ++ unregister_reboot_notifier(&linkstation_reboot_nb); ++ mvphy_reg_intn(0); ++ ++ kernel_restart("Power off"); ++} ++ ++static const struct of_device_id ls_poweroff_of_match[] = { ++ { .compatible = "buffalo,ls421d" }, ++ { .compatible = "buffalo,ls421de" }, ++ { }, ++}; ++ ++static int __init linkstation_poweroff_init(void) ++{ ++ struct mii_bus *bus; ++ struct device_node *dn; ++ ++ dn = of_find_matching_node(NULL, ls_poweroff_of_match); ++ if (!dn) ++ return -ENODEV; ++ of_node_put(dn); ++ ++ dn = of_find_node_by_name(NULL, "mdio"); ++ if (!dn) ++ return -ENODEV; ++ ++ bus = of_mdio_find_bus(dn); ++ of_node_put(dn); ++ if (!bus) ++ return -EPROBE_DEFER; ++ ++ phydev = phy_find_first(bus); ++ if (!phydev) ++ return -EPROBE_DEFER; ++ ++ register_reboot_notifier(&linkstation_reboot_nb); ++ pm_power_off = linkstation_poweroff; ++ ++ pr_info("LinkStation power off driver registered\n"); ++ return 0; ++} ++ ++static void __exit linkstation_poweroff_exit(void) ++{ ++ pm_power_off = NULL; ++ unregister_reboot_notifier(&linkstation_reboot_nb); ++} ++ ++module_init(linkstation_poweroff_init); ++module_exit(linkstation_poweroff_exit); ++ ++MODULE_AUTHOR("Daniel GonzĂ¡lez Cabanelas "); ++MODULE_DESCRIPTION("LinkStation power off driver"); ++MODULE_LICENSE("GPL v2"); diff --git a/target/linux/oxnas/files/drivers/phy/phy-oxnas-pcie.c b/target/linux/oxnas/files/drivers/phy/phy-oxnas-pcie.c index 6ded8b2cf..39203239a 100644 --- a/target/linux/oxnas/files/drivers/phy/phy-oxnas-pcie.c +++ b/target/linux/oxnas/files/drivers/phy/phy-oxnas-pcie.c @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019 Daniel Golle * diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index a52e09786..f00cfe860 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -68,6 +68,10 @@ define Device/shuttle_kd20 DEVICE_VENDOR := Shuttle DEVICE_MODEL := KD20 SUPPORTED_DEVICES += kd20 + KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory + KERNEL_INITRAMFS_SUFFIX := .tar.gz + KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | \ + encrypt-3des sohmuntitnlaes DEVICE_PACKAGES := kmod-usb2-oxnas kmod-usb3 kmod-usb-ledtrig-usbport \ kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper kmod-hwmon-drivetemp \ kmod-hwmon-gpiofan kmod-ata-oxnas-sata kmod-md-mod kmod-md-raid0 \ diff --git a/target/linux/oxnas/patches-5.4/999-libata-hacks.patch b/target/linux/oxnas/patches-5.4/999-libata-hacks.patch index f846c3fee..28d6f8b57 100644 --- a/target/linux/oxnas/patches-5.4/999-libata-hacks.patch +++ b/target/linux/oxnas/patches-5.4/999-libata-hacks.patch @@ -15,7 +15,7 @@ /* initialize internal qc */ qc = __ata_qc_from_tag(ap, ATA_TAG_INTERNAL); -@@ -5122,6 +5130,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5121,6 +5129,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) return NULL; @@ -25,7 +25,7 @@ /* libsas case */ if (ap->flags & ATA_FLAG_SAS_HOST) { tag = ata_sas_allocate_tag(ap); -@@ -5167,6 +5178,8 @@ void ata_qc_free(struct ata_queued_cmd * +@@ -5166,6 +5177,8 @@ void ata_qc_free(struct ata_queued_cmd * qc->tag = ATA_TAG_POISON; if (ap->flags & ATA_FLAG_SAS_HOST) ata_sas_free_tag(tag, ap); @@ -36,7 +36,7 @@ --- a/include/linux/libata.h +++ b/include/linux/libata.h -@@ -908,6 +908,8 @@ struct ata_port_operations { +@@ -909,6 +909,8 @@ struct ata_port_operations { void (*qc_prep)(struct ata_queued_cmd *qc); unsigned int (*qc_issue)(struct ata_queued_cmd *qc); bool (*qc_fill_rtf)(struct ata_queued_cmd *qc); @@ -45,7 +45,7 @@ /* * Configuration and exception handling -@@ -998,6 +1000,9 @@ struct ata_port_operations { +@@ -999,6 +1001,9 @@ struct ata_port_operations { void (*phy_reset)(struct ata_port *ap); void (*eng_timeout)(struct ata_port *ap); diff --git a/target/linux/pistachio/Makefile b/target/linux/pistachio/Makefile index 0bf04dcc5..672cd3f62 100644 --- a/target/linux/pistachio/Makefile +++ b/target/linux/pistachio/Makefile @@ -13,8 +13,7 @@ FEATURES:=fpu usb usbgadget squashfs targz nand CPU_TYPE:=24kc CPU_SUBTYPE:=24kf -KERNEL_PATCHVER:=4.14 -KERNEL_TESTING_PATCHVER:=5.4 +KERNEL_PATCHVER:=5.4 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/pistachio/config-4.14 b/target/linux/pistachio/config-4.14 deleted file mode 100644 index bcb9ff468..000000000 --- a/target/linux/pistachio/config-4.14 +++ /dev/null @@ -1,355 +0,0 @@ -CONFIG_ARCH_BINFMT_ELF_STATE=y -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_DISCARD_MEMBLOCK=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set -# CONFIG_ARCH_HAS_SG_CHAIN is not set -# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set -# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_ARCH_MMAP_RND_BITS_MAX=15 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_SD=y -CONFIG_BLK_SCSI_REQUEST=y -CONFIG_BOARD_SCACHE=y -CONFIG_BOOT_ELF32=y -CONFIG_CEVT_R4K=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLKSRC_MIPS_GIC=y -CONFIG_CLKSRC_PISTACHIO=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -# CONFIG_COMMON_CLK_BOSTON is not set -CONFIG_CONNECTOR=y -CONFIG_CPU_GENERIC_DUMP_TLB=y -CONFIG_CPU_HAS_PREFETCH=y -CONFIG_CPU_HAS_RIXI=y -CONFIG_CPU_HAS_SYNC=y -# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set -CONFIG_CPU_IDLE=y -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CPU_MIPS32=y -CONFIG_CPU_MIPS32_R2=y -CONFIG_CPU_MIPSR2=y -CONFIG_CPU_MIPSR2_IRQ_EI=y -CONFIG_CPU_MIPSR2_IRQ_VI=y -CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y -CONFIG_CPU_PM=y -CONFIG_CPU_R4K_CACHE_TLB=y -CONFIG_CPU_R4K_FPU=y -CONFIG_CPU_RMAP=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -CONFIG_CPU_SUPPORTS_HIGHMEM=y -CONFIG_CPU_SUPPORTS_MSA=y -CONFIG_CRC16=y -CONFIG_CRC_CCITT=y -CONFIG_CRYPTO_ACOMP2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CBC=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_NULL=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_CSRC_R4K=y -CONFIG_DMADEVICES=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_NONCOHERENT=y -CONFIG_DMA_OF=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DTC=y -# CONFIG_DWMAC_DWC_QOS_ETH is not set -CONFIG_DWMAC_GENERIC=y -CONFIG_EARLY_PRINTK=y -CONFIG_EARLY_PRINTK_8250=y -CONFIG_EXT4_FS=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_EXT4_FS_SECURITY=y -CONFIG_FIXED_PHY=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -CONFIG_GENERIC_IRQ_IPI=y -CONFIG_GENERIC_IRQ_SHOW=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_SYSFS=y -# CONFIG_GRO_CELLS 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_HAVE_64BIT_ALIGNED_ACCESS is not set -# CONFIG_HAVE_ARCH_BITREVERSE is not set -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CBPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_COPY_THREAD_TLS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KVM=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MEMBLOCK_NODE_MAP=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HOTPLUG_CPU=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_IMG=y -CONFIG_IMGPDC_WDT=y -CONFIG_IMG_MDC_DMA=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_MIPS_CPU=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_LEDS_PWM=y -CONFIG_LIBFDT=y -CONFIG_LKDTM=y -CONFIG_LOG_BUF_SHIFT=18 -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MACH_PISTACHIO=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0 -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MFD_SYSCON=y -CONFIG_MICREL_PHY=y -CONFIG_MIPS=y -CONFIG_MIPS_ASID_BITS=8 -CONFIG_MIPS_ASID_SHIFT=0 -CONFIG_MIPS_CLOCK_VSYSCALL=y -CONFIG_MIPS_CM=y -# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set -CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_MIPS_CMDLINE_FROM_DTB is not set -CONFIG_MIPS_CPC=y -CONFIG_MIPS_CPS=y -# CONFIG_MIPS_CPS_CPUIDLE is not set -# CONFIG_MIPS_CPS_NS16550 is not set -CONFIG_MIPS_CPS_PM=y -CONFIG_MIPS_CPU_SCACHE=y -# CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_EXTERNAL_TIMER=y -CONFIG_MIPS_GIC=y -# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set -CONFIG_MIPS_L1_CACHE_SHIFT=5 -# CONFIG_MIPS_MACHINE is not set -CONFIG_MIPS_MT=y -CONFIG_MIPS_MT_FPAFF=y -CONFIG_MIPS_MT_SMP=y -CONFIG_MIPS_NO_APPENDED_DTB=y -CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y -# CONFIG_MIPS_RAW_APPENDED_DTB is not set -CONFIG_MIPS_SPRAM=y -# CONFIG_MIPS_VPE_LOADER is not set -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_DW=y -# CONFIG_MMC_DW_EXYNOS is not set -# CONFIG_MMC_DW_K3 is not set -CONFIG_MMC_DW_PLTFM=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_MODULE_FORCE_UNLOAD=y -CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_NAND=y -CONFIG_MTD_NAND_ECC=y -CONFIG_MTD_SPI_NAND=y -CONFIG_MTD_SPI_NAND_DEVICES=y -CONFIG_MTD_SPI_NOR=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_BEB_LIMIT=20 -CONFIG_MTD_UBI_BLOCK=y -CONFIG_MTD_UBI_FASTMAP=y -# CONFIG_MTD_UBI_GLUEBI is not set -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_NAMESPACES=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_NS=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NLS=y -CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y -CONFIG_NO_HZ=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -# CONFIG_NO_IOPORT_MAP is not set -CONFIG_NR_CPUS=4 -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_MDIO=y -CONFIG_OF_NET=y -CONFIG_PADATA=y -CONFIG_PCI_DRIVERS_LEGACY=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=2 -# CONFIG_PGTABLE_MAPPING is not set -CONFIG_PHYLIB=y -CONFIG_PHY_PISTACHIO_USB=y -CONFIG_PINCTRL=y -CONFIG_PINCTRL_PISTACHIO=y -CONFIG_PISTACHIO_GPTIMER_CLKSRC=y -CONFIG_POWER_SUPPLY=y -CONFIG_PPS=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_VOLUNTARY=y -CONFIG_PRINTK_TIME=y -CONFIG_PROC_EVENTS=y -CONFIG_PROFILING=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PWM=y -CONFIG_PWM_IMG=y -CONFIG_PWM_SYSFS=y -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_RATIONAL=y -CONFIG_RCU_NEED_SEGCBLIST=y -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPI=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_GPIO=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_PISTACHIO=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_SCHEDSTATS=y -CONFIG_SCHED_INFO=y -CONFIG_SCSI=y -CONFIG_SCSI_SPI_ATTRS=y -CONFIG_SERIAL_8250_DW=y -# CONFIG_SERIAL_8250_FSL is not set -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SG_POOL=y -CONFIG_SMP=y -CONFIG_SMP_UP=y -CONFIG_SPI=y -CONFIG_SPI_IMG_SPFI=y -CONFIG_SPI_MASTER=y -CONFIG_SRAM=y -CONFIG_SRCU=y -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_SWPHY=y -CONFIG_SYNC_R4K=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_HOTPLUG_CPU=y -CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -CONFIG_SYS_SUPPORTS_MIPS_CPS=y -CONFIG_SYS_SUPPORTS_MULTITHREADING=y -CONFIG_SYS_SUPPORTS_RELOCATABLE=y -CONFIG_SYS_SUPPORTS_SCHED_SMT=y -CONFIG_SYS_SUPPORTS_SMP=y -CONFIG_SYS_SUPPORTS_ZBOOT=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TIMER_OF=y -CONFIG_TIMER_PROBE=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TREE_RCU=y -CONFIG_TREE_SRCU=y -CONFIG_UBIFS_FS=y -# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -CONFIG_USB_COMMON=y -CONFIG_USB_DWC2=y -CONFIG_USB_DWC2_DUAL_ROLE=y -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set -CONFIG_USB_EHCI_HCD=y -# CONFIG_USB_EHCI_HCD_PLATFORM is not set -CONFIG_USB_GADGET=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USER_NS=y -CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y -CONFIG_USE_OF=y -CONFIG_WATCHDOG_CORE=y -CONFIG_WEAK_ORDERING=y -CONFIG_XPS=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZSMALLOC=y -# CONFIG_ZSMALLOC_STAT is not set diff --git a/target/linux/pistachio/patches-4.14/101-dmaengine-img-mdc-Handle-early-status-read.patch b/target/linux/pistachio/patches-4.14/101-dmaengine-img-mdc-Handle-early-status-read.patch deleted file mode 100644 index 92293f879..000000000 --- a/target/linux/pistachio/patches-4.14/101-dmaengine-img-mdc-Handle-early-status-read.patch +++ /dev/null @@ -1,68 +0,0 @@ -From a2dd154377c9aa6ddda00d39b8c7c334e4fa16ff Mon Sep 17 00:00:00 2001 -From: Damien Horsley -Date: Tue, 22 Mar 2016 12:46:09 +0000 -Subject: dmaengine: img-mdc: Handle early status read - -It is possible that mdc_tx_status may be called before the first -node has been read from memory. - -In this case, the residue value stored in the register is undefined. -Return the transfer size instead. - -Signed-off-by: Damien Horsley ---- - drivers/dma/img-mdc-dma.c | 40 ++++++++++++++++++++++++---------------- - 1 file changed, 24 insertions(+), 16 deletions(-) - ---- a/drivers/dma/img-mdc-dma.c -+++ b/drivers/dma/img-mdc-dma.c -@@ -620,25 +620,33 @@ static enum dma_status mdc_tx_status(str - (MDC_CMDS_PROCESSED_CMDS_DONE_MASK + 1); - - /* -- * If the command loaded event hasn't been processed yet, then -- * the difference above includes an extra command. -+ * If the first node has not yet been read from memory, -+ * the residue register value is undefined - */ -- if (!mdesc->cmd_loaded) -- cmds--; -- else -- cmds += mdesc->list_cmds_done; -- -- bytes = mdesc->list_xfer_size; -- ldesc = mdesc->list; -- for (i = 0; i < cmds; i++) { -- bytes -= ldesc->xfer_size + 1; -- ldesc = ldesc->next_desc; -- } -- if (ldesc) { -- if (residue != MDC_TRANSFER_SIZE_MASK) -- bytes -= ldesc->xfer_size - residue; -+ if (!mdesc->cmd_loaded && !cmds) { -+ bytes = mdesc->list_xfer_size; -+ } else { -+ /* -+ * If the command loaded event hasn't been processed yet, then -+ * the difference above includes an extra command. -+ */ -+ if (!mdesc->cmd_loaded) -+ cmds--; - else -+ cmds += mdesc->list_cmds_done; -+ -+ bytes = mdesc->list_xfer_size; -+ ldesc = mdesc->list; -+ for (i = 0; i < cmds; i++) { - bytes -= ldesc->xfer_size + 1; -+ ldesc = ldesc->next_desc; -+ } -+ if (ldesc) { -+ if (residue != MDC_TRANSFER_SIZE_MASK) -+ bytes -= ldesc->xfer_size - residue; -+ else -+ bytes -= ldesc->xfer_size + 1; -+ } - } - } - spin_unlock_irqrestore(&mchan->vc.lock, flags); diff --git a/target/linux/pistachio/patches-4.14/102-spi-img-spfi-Implement-dual-and-quad-mode.patch b/target/linux/pistachio/patches-4.14/102-spi-img-spfi-Implement-dual-and-quad-mode.patch deleted file mode 100644 index 15a5d3c80..000000000 --- a/target/linux/pistachio/patches-4.14/102-spi-img-spfi-Implement-dual-and-quad-mode.patch +++ /dev/null @@ -1,198 +0,0 @@ -From cd2a6af51553d38072cd31699b58d16ca6176ef5 Mon Sep 17 00:00:00 2001 -From: Ionela Voinescu -Date: Thu, 2 Feb 2017 16:46:14 +0000 -Subject: spi: img-spfi: Implement dual and quad mode - -For dual and quad modes to work the SPFI controller needs -to have information about command/address/dummy bytes in the -transaction register. This information is not relevant for -single mode, and therefore it can have any value in the -allowed range. Therefore, for any read or write transfers of less -than 8 bytes (cmd = 1 byte, addr up to 7 bytes), SPFI will be -configured, but not enabled (unless it is the last transfer in -the queue). The transfer will be enabled by the subsequent tranfer. -A pending transfer is determined by the content of the transaction -register: if command part is set and tsize is not. - -This way we ensure that for dual and quad transactions -the command request size will apear in the command/address part -of the transaction register, while the data size will be in -tsize, all data being sent/received in the same transaction (as -set up in the transaction register). - -Signed-off-by: Ionela Voinescu -Signed-off-by: Ezequiel Garcia ---- - drivers/spi/spi-img-spfi.c | 96 ++++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 85 insertions(+), 11 deletions(-) - ---- a/drivers/spi/spi-img-spfi.c -+++ b/drivers/spi/spi-img-spfi.c -@@ -40,7 +40,8 @@ - #define SPFI_CONTROL_SOFT_RESET BIT(11) - #define SPFI_CONTROL_SEND_DMA BIT(10) - #define SPFI_CONTROL_GET_DMA BIT(9) --#define SPFI_CONTROL_SE BIT(8) -+#define SPFI_CONTROL_SE BIT(8) -+#define SPFI_CONTROL_TX_RX BIT(1) - #define SPFI_CONTROL_TMODE_SHIFT 5 - #define SPFI_CONTROL_TMODE_MASK 0x7 - #define SPFI_CONTROL_TMODE_SINGLE 0 -@@ -51,6 +52,10 @@ - #define SPFI_TRANSACTION 0x18 - #define SPFI_TRANSACTION_TSIZE_SHIFT 16 - #define SPFI_TRANSACTION_TSIZE_MASK 0xffff -+#define SPFI_TRANSACTION_CMD_SHIFT 13 -+#define SPFI_TRANSACTION_CMD_MASK 0x7 -+#define SPFI_TRANSACTION_ADDR_SHIFT 10 -+#define SPFI_TRANSACTION_ADDR_MASK 0x7 - - #define SPFI_PORT_STATE 0x1c - #define SPFI_PORT_STATE_DEV_SEL_SHIFT 20 -@@ -87,6 +92,7 @@ - */ - #define SPFI_32BIT_FIFO_SIZE 64 - #define SPFI_8BIT_FIFO_SIZE 16 -+#define SPFI_DATA_REQUEST_MAX_SIZE 8 - - struct img_spfi { - struct device *dev; -@@ -103,6 +109,8 @@ struct img_spfi { - struct dma_chan *tx_ch; - bool tx_dma_busy; - bool rx_dma_busy; -+ -+ bool complete; - }; - - struct img_spfi_device_data { -@@ -123,9 +131,11 @@ static inline void spfi_start(struct img - { - u32 val; - -- val = spfi_readl(spfi, SPFI_CONTROL); -- val |= SPFI_CONTROL_SPFI_EN; -- spfi_writel(spfi, val, SPFI_CONTROL); -+ if (spfi->complete) { -+ val = spfi_readl(spfi, SPFI_CONTROL); -+ val |= SPFI_CONTROL_SPFI_EN; -+ spfi_writel(spfi, val, SPFI_CONTROL); -+ } - } - - static inline void spfi_reset(struct img_spfi *spfi) -@@ -138,12 +148,21 @@ static int spfi_wait_all_done(struct img - { - unsigned long timeout = jiffies + msecs_to_jiffies(50); - -+ if (!(spfi->complete)) -+ return 0; -+ - while (time_before(jiffies, timeout)) { - u32 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS); - - if (status & SPFI_INTERRUPT_ALLDONETRIG) { - spfi_writel(spfi, SPFI_INTERRUPT_ALLDONETRIG, - SPFI_INTERRUPT_CLEAR); -+ /* -+ * Disable SPFI for it not to interfere with -+ * pending transactions -+ */ -+ spfi_writel(spfi, spfi_readl(spfi, SPFI_CONTROL) -+ & ~SPFI_CONTROL_SPFI_EN, SPFI_CONTROL); - return 0; - } - cpu_relax(); -@@ -494,9 +513,32 @@ static void img_spfi_config(struct spi_m - struct spi_transfer *xfer) - { - struct img_spfi *spfi = spi_master_get_devdata(spi->master); -- u32 val, div; -+ u32 val, div, transact; -+ bool is_pending; - - /* -+ * For read or write transfers of less than 8 bytes (cmd = 1 byte, -+ * addr up to 7 bytes), SPFI will be configured, but not enabled -+ * (unless it is the last transfer in the queue).The transfer will -+ * be enabled by the subsequent transfer. -+ * A pending transfer is determined by the content of the -+ * transaction register: if command part is set and tsize -+ * is not -+ */ -+ transact = spfi_readl(spfi, SPFI_TRANSACTION); -+ is_pending = ((transact >> SPFI_TRANSACTION_CMD_SHIFT) & -+ SPFI_TRANSACTION_CMD_MASK) && -+ (!((transact >> SPFI_TRANSACTION_TSIZE_SHIFT) & -+ SPFI_TRANSACTION_TSIZE_MASK)); -+ -+ /* If there are no pending transactions it's OK to soft reset */ -+ if (!is_pending) { -+ /* Start the transaction from a known (reset) state */ -+ spfi_reset(spfi); -+ } -+ -+ /* -+ * Before anything else, set up parameters. - * output = spfi_clk * (BITCLK / 512), where BITCLK must be a - * power of 2 up to 128 - */ -@@ -509,20 +551,52 @@ static void img_spfi_config(struct spi_m - val |= div << SPFI_DEVICE_PARAMETER_BITCLK_SHIFT; - spfi_writel(spfi, val, SPFI_DEVICE_PARAMETER(spi->chip_select)); - -- spfi_writel(spfi, xfer->len << SPFI_TRANSACTION_TSIZE_SHIFT, -- SPFI_TRANSACTION); -+ if (!list_is_last(&xfer->transfer_list, &master->cur_msg->transfers) && -+ /* -+ * For duplex mode (both the tx and rx buffers are !NULL) the -+ * CMD, ADDR, and DUMMY byte parts of the transaction register -+ * should always be 0 and therefore the pending transfer -+ * technique cannot be used. -+ */ -+ (xfer->tx_buf) && (!xfer->rx_buf) && -+ (xfer->len <= SPFI_DATA_REQUEST_MAX_SIZE) && !is_pending) { -+ transact = (1 & SPFI_TRANSACTION_CMD_MASK) << -+ SPFI_TRANSACTION_CMD_SHIFT; -+ transact |= ((xfer->len - 1) & SPFI_TRANSACTION_ADDR_MASK) << -+ SPFI_TRANSACTION_ADDR_SHIFT; -+ spfi->complete = false; -+ } else { -+ spfi->complete = true; -+ if (is_pending) { -+ /* Keep setup from pending transfer */ -+ transact |= ((xfer->len & SPFI_TRANSACTION_TSIZE_MASK) << -+ SPFI_TRANSACTION_TSIZE_SHIFT); -+ } else { -+ transact = ((xfer->len & SPFI_TRANSACTION_TSIZE_MASK) << -+ SPFI_TRANSACTION_TSIZE_SHIFT); -+ } -+ } -+ spfi_writel(spfi, transact, SPFI_TRANSACTION); - - val = spfi_readl(spfi, SPFI_CONTROL); - val &= ~(SPFI_CONTROL_SEND_DMA | SPFI_CONTROL_GET_DMA); -- if (xfer->tx_buf) -+ /* -+ * We set up send DMA for pending transfers also, as -+ * those are always send transfers -+ */ -+ if ((xfer->tx_buf) || is_pending) - val |= SPFI_CONTROL_SEND_DMA; -- if (xfer->rx_buf) -+ if (xfer->tx_buf) -+ val |= SPFI_CONTROL_TX_RX; -+ if (xfer->rx_buf) { - val |= SPFI_CONTROL_GET_DMA; -+ val &= ~SPFI_CONTROL_TX_RX; -+ } - val &= ~(SPFI_CONTROL_TMODE_MASK << SPFI_CONTROL_TMODE_SHIFT); -- if (xfer->tx_nbits == SPI_NBITS_DUAL && -+ if (xfer->tx_nbits == SPI_NBITS_DUAL || - xfer->rx_nbits == SPI_NBITS_DUAL) - val |= SPFI_CONTROL_TMODE_DUAL << SPFI_CONTROL_TMODE_SHIFT; -- else if (xfer->tx_nbits == SPI_NBITS_QUAD && -+ else if (xfer->tx_nbits == SPI_NBITS_QUAD || - xfer->rx_nbits == SPI_NBITS_QUAD) - val |= SPFI_CONTROL_TMODE_QUAD << SPFI_CONTROL_TMODE_SHIFT; - val |= SPFI_CONTROL_SE; diff --git a/target/linux/pistachio/patches-4.14/103-spi-img-spfi-set-device-select-bits-for-SPFI-port-st.patch b/target/linux/pistachio/patches-4.14/103-spi-img-spfi-set-device-select-bits-for-SPFI-port-st.patch deleted file mode 100644 index ba70348da..000000000 --- a/target/linux/pistachio/patches-4.14/103-spi-img-spfi-set-device-select-bits-for-SPFI-port-st.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 145f5369510b86cd55c659388a26a0cc267f8874 Mon Sep 17 00:00:00 2001 -From: Ionela Voinescu -Date: Mon, 1 Feb 2016 10:58:08 +0000 -Subject: spi: img-spfi: set device select bits for SPFI port state - -Even if the chip select line is not controlled by the SPFI -hardware, the device select bits need to be set to specify -the chip select line in use for the hardware to know what -parameters to use for the current transfer. - -Signed-off-by: Ionela Voinescu ---- - drivers/spi/spi-img-spfi.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/spi/spi-img-spfi.c -+++ b/drivers/spi/spi-img-spfi.c -@@ -438,6 +438,9 @@ static int img_spfi_prepare(struct spi_m - u32 val; - - val = spfi_readl(spfi, SPFI_PORT_STATE); -+ val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK << -+ SPFI_PORT_STATE_DEV_SEL_SHIFT); -+ val |= msg->spi->chip_select << SPFI_PORT_STATE_DEV_SEL_SHIFT; - if (msg->spi->mode & SPI_CPHA) - val |= SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select); - else diff --git a/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch b/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch deleted file mode 100644 index 6c9e6b5a7..000000000 --- a/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 905ee06a9966113fe51d6bad1819759cb30fd0bd Mon Sep 17 00:00:00 2001 -From: Ionela Voinescu -Date: Tue, 9 Feb 2016 10:18:31 +0000 -Subject: spi: img-spfi: use device 0 configuration for all devices - -Given that we control the chip select line externally -we can use only one parameter register (device 0 parameter -register) and one set of configuration bits (port configuration -bits for device 0) for all devices (all chip select lines). - -Signed-off-by: Ionela Voinescu ---- - drivers/spi/spi-img-spfi.c | 23 ++++++++++++++++------- - 1 file changed, 16 insertions(+), 7 deletions(-) - ---- a/drivers/spi/spi-img-spfi.c -+++ b/drivers/spi/spi-img-spfi.c -@@ -437,18 +437,23 @@ static int img_spfi_prepare(struct spi_m - struct img_spfi *spfi = spi_master_get_devdata(master); - u32 val; - -+ /* -+ * The chip select line is controlled externally so -+ * we can use the CS0 configuration for all devices -+ */ - val = spfi_readl(spfi, SPFI_PORT_STATE); -+ -+ /* 0 for device selection */ - val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK << - SPFI_PORT_STATE_DEV_SEL_SHIFT); -- val |= msg->spi->chip_select << SPFI_PORT_STATE_DEV_SEL_SHIFT; - if (msg->spi->mode & SPI_CPHA) -- val |= SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select); -+ val |= SPFI_PORT_STATE_CK_PHASE(0); - else -- val &= ~SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select); -+ val &= ~SPFI_PORT_STATE_CK_PHASE(0); - if (msg->spi->mode & SPI_CPOL) -- val |= SPFI_PORT_STATE_CK_POL(msg->spi->chip_select); -+ val |= SPFI_PORT_STATE_CK_POL(0); - else -- val &= ~SPFI_PORT_STATE_CK_POL(msg->spi->chip_select); -+ val &= ~SPFI_PORT_STATE_CK_POL(0); - spfi_writel(spfi, val, SPFI_PORT_STATE); - - return 0; -@@ -548,11 +553,15 @@ static void img_spfi_config(struct spi_m - div = DIV_ROUND_UP(clk_get_rate(spfi->spfi_clk), xfer->speed_hz); - div = clamp(512 / (1 << get_count_order(div)), 1, 128); - -- val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(spi->chip_select)); -+ /* -+ * The chip select line is controlled externally so -+ * we can use the CS0 parameters for all devices -+ */ -+ val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(0)); - val &= ~(SPFI_DEVICE_PARAMETER_BITCLK_MASK << - SPFI_DEVICE_PARAMETER_BITCLK_SHIFT); - val |= div << SPFI_DEVICE_PARAMETER_BITCLK_SHIFT; -- spfi_writel(spfi, val, SPFI_DEVICE_PARAMETER(spi->chip_select)); -+ spfi_writel(spfi, val, SPFI_DEVICE_PARAMETER(0)); - - if (!list_is_last(&xfer->transfer_list, &master->cur_msg->transfers) && - /* diff --git a/target/linux/pistachio/patches-4.14/105-spi-img-spfi-RX-maximum-burst-size-for-DMA-is-8.patch b/target/linux/pistachio/patches-4.14/105-spi-img-spfi-RX-maximum-burst-size-for-DMA-is-8.patch deleted file mode 100644 index 0067b0ea4..000000000 --- a/target/linux/pistachio/patches-4.14/105-spi-img-spfi-RX-maximum-burst-size-for-DMA-is-8.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 56466f505f58f44b69feb7eaed3b506842800456 Mon Sep 17 00:00:00 2001 -From: Ionela Voinescu -Date: Tue, 1 Mar 2016 17:49:45 +0000 -Subject: spi: img-spfi: RX maximum burst size for DMA is 8 - -The depth of the FIFOs is 16 bytes. The DMA request line is tied -to the half full/empty (depending on the use of the TX or RX FIFO) -threshold. For the TX FIFO, if you set a burst size of 8 (equal to -half the depth) the first burst goes into FIFO without any issues, -but due the latency involved (the time the data leaves the DMA -engine to the time it arrives at the FIFO), the DMA might trigger -another burst of 8. But given that there is no space for 2 additonal -bursts of 8, this would result in a failure. Therefore, we have to -keep the burst size for TX to 4 to accomodate for an extra burst. - -For the read (RX) scenario, the DMA request line goes high when -there is at least 8 entries in the FIFO (half full), and we can -program the burst size to be 8 because the risk of accidental burst -does not exist. The DMA engine will not trigger another read until -the read data for all the burst it has sent out has been received. - -While here, move the burst size setting outside of the if/else branches -as they have the same value for both 8 and 32 bit data widths. - -Signed-off-by: Ionela Voinescu ---- - drivers/spi/spi-img-spfi.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - ---- a/drivers/spi/spi-img-spfi.c -+++ b/drivers/spi/spi-img-spfi.c -@@ -346,12 +346,11 @@ static int img_spfi_start_dma(struct spi - if (xfer->len % 4 == 0) { - rxconf.src_addr = spfi->phys + SPFI_RX_32BIT_VALID_DATA; - rxconf.src_addr_width = 4; -- rxconf.src_maxburst = 4; - } else { - rxconf.src_addr = spfi->phys + SPFI_RX_8BIT_VALID_DATA; - rxconf.src_addr_width = 1; -- rxconf.src_maxburst = 4; - } -+ rxconf.src_maxburst = 8; - dmaengine_slave_config(spfi->rx_ch, &rxconf); - - rxdesc = dmaengine_prep_slave_sg(spfi->rx_ch, xfer->rx_sg.sgl, -@@ -370,12 +369,11 @@ static int img_spfi_start_dma(struct spi - if (xfer->len % 4 == 0) { - txconf.dst_addr = spfi->phys + SPFI_TX_32BIT_VALID_DATA; - txconf.dst_addr_width = 4; -- txconf.dst_maxburst = 4; - } else { - txconf.dst_addr = spfi->phys + SPFI_TX_8BIT_VALID_DATA; - txconf.dst_addr_width = 1; -- txconf.dst_maxburst = 4; - } -+ txconf.dst_maxburst = 4; - dmaengine_slave_config(spfi->tx_ch, &txconf); - - txdesc = dmaengine_prep_slave_sg(spfi->tx_ch, xfer->tx_sg.sgl, diff --git a/target/linux/pistachio/patches-4.14/106-spi-img-spfi-finish-every-transfer-cleanly.patch b/target/linux/pistachio/patches-4.14/106-spi-img-spfi-finish-every-transfer-cleanly.patch deleted file mode 100644 index 0f958314e..000000000 --- a/target/linux/pistachio/patches-4.14/106-spi-img-spfi-finish-every-transfer-cleanly.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 5fcca3fd4b621d7b5bdeca18d36dfc6ca6cfe383 Mon Sep 17 00:00:00 2001 -From: Ionela Voinescu -Date: Wed, 10 Aug 2016 11:42:26 +0100 -Subject: spi: img-spfi: finish every transfer cleanly - -Before this change, the interrupt status bit that signaled -the end of a tranfers was cleared in the wait_all_done -function. That functionality triggered issues for DMA -duplex transactions where the wait function was called -twice, in both the TX and RX callbacks. - -In order to fix the issue, clear all interrupt data bits -at the end of a PIO transfer or at the end of both TX and RX -duplex transfers, if the transfer is not a pending tranfer -(command waiting for data). After that, the status register -is checked for new incoming data or new data requests to be -signaled. If SPFI finished cleanly, no new interrupt data -bits should be set. - -Signed-off-by: Ionela Voinescu ---- - drivers/spi/spi-img-spfi.c | 49 +++++++++++++++++++++++++++++++++------------- - 1 file changed, 35 insertions(+), 14 deletions(-) - ---- a/drivers/spi/spi-img-spfi.c -+++ b/drivers/spi/spi-img-spfi.c -@@ -83,6 +83,14 @@ - #define SPFI_INTERRUPT_SDE BIT(1) - #define SPFI_INTERRUPT_SDTRIG BIT(0) - -+#define SPFI_INTERRUPT_DATA_BITS (SPFI_INTERRUPT_SDHF |\ -+ SPFI_INTERRUPT_SDFUL |\ -+ SPFI_INTERRUPT_GDEX32BIT |\ -+ SPFI_INTERRUPT_GDHF |\ -+ SPFI_INTERRUPT_GDFUL |\ -+ SPFI_INTERRUPT_ALLDONETRIG |\ -+ SPFI_INTERRUPT_GDEX8BIT) -+ - /* - * There are four parallel FIFOs of 16 bytes each. The word buffer - * (*_32BIT_VALID_DATA) accesses all four FIFOs at once, resulting in an -@@ -144,6 +152,23 @@ static inline void spfi_reset(struct img - spfi_writel(spfi, 0, SPFI_CONTROL); - } - -+static inline void spfi_finish(struct img_spfi *spfi) -+{ -+ if (!(spfi->complete)) -+ return; -+ -+ /* Clear data bits as all transfers(TX and RX) have finished */ -+ spfi_writel(spfi, SPFI_INTERRUPT_DATA_BITS, SPFI_INTERRUPT_CLEAR); -+ if (spfi_readl(spfi, SPFI_INTERRUPT_STATUS) & SPFI_INTERRUPT_DATA_BITS) { -+ dev_err(spfi->dev, "SPFI did not finish transfer cleanly.\n"); -+ spfi_reset(spfi); -+ } -+ /* Disable SPFI for it not to interfere with pending transactions */ -+ spfi_writel(spfi, -+ spfi_readl(spfi, SPFI_CONTROL) & ~SPFI_CONTROL_SPFI_EN, -+ SPFI_CONTROL); -+} -+ - static int spfi_wait_all_done(struct img_spfi *spfi) - { - unsigned long timeout = jiffies + msecs_to_jiffies(50); -@@ -152,19 +177,9 @@ static int spfi_wait_all_done(struct img - return 0; - - while (time_before(jiffies, timeout)) { -- u32 status = spfi_readl(spfi, SPFI_INTERRUPT_STATUS); -- -- if (status & SPFI_INTERRUPT_ALLDONETRIG) { -- spfi_writel(spfi, SPFI_INTERRUPT_ALLDONETRIG, -- SPFI_INTERRUPT_CLEAR); -- /* -- * Disable SPFI for it not to interfere with -- * pending transactions -- */ -- spfi_writel(spfi, spfi_readl(spfi, SPFI_CONTROL) -- & ~SPFI_CONTROL_SPFI_EN, SPFI_CONTROL); -+ if (spfi_readl(spfi, SPFI_INTERRUPT_STATUS) & -+ SPFI_INTERRUPT_ALLDONETRIG) - return 0; -- } - cpu_relax(); - } - -@@ -296,6 +311,8 @@ static int img_spfi_start_pio(struct spi - } - - ret = spfi_wait_all_done(spfi); -+ spfi_finish(spfi); -+ - if (ret < 0) - return ret; - -@@ -311,8 +328,10 @@ static void img_spfi_dma_rx_cb(void *dat - - spin_lock_irqsave(&spfi->lock, flags); - spfi->rx_dma_busy = false; -- if (!spfi->tx_dma_busy) -+ if (!spfi->tx_dma_busy) { -+ spfi_finish(spfi); - spi_finalize_current_transfer(spfi->master); -+ } - spin_unlock_irqrestore(&spfi->lock, flags); - } - -@@ -325,8 +344,10 @@ static void img_spfi_dma_tx_cb(void *dat - - spin_lock_irqsave(&spfi->lock, flags); - spfi->tx_dma_busy = false; -- if (!spfi->rx_dma_busy) -+ if (!spfi->rx_dma_busy) { -+ spfi_finish(spfi); - spi_finalize_current_transfer(spfi->master); -+ } - spin_unlock_irqrestore(&spfi->lock, flags); - } - diff --git a/target/linux/pistachio/patches-4.14/107-clockevents-Retry-programming-min-delta-up-to-10-tim.patch b/target/linux/pistachio/patches-4.14/107-clockevents-Retry-programming-min-delta-up-to-10-tim.patch deleted file mode 100644 index 857823b78..000000000 --- a/target/linux/pistachio/patches-4.14/107-clockevents-Retry-programming-min-delta-up-to-10-tim.patch +++ /dev/null @@ -1,66 +0,0 @@ -From b46f8c74afdd30cd52bfdcc2231470a0bab04416 Mon Sep 17 00:00:00 2001 -From: James Hogan -Date: Fri, 22 Apr 2016 18:22:45 +0100 -Subject: clockevents: Retry programming min delta up to 10 times - -Under virtualisation it is possible to get unexpected latency during a -clockevent device's set_next_event() callback which can make it return --ETIME even for a delta based on min_delta_ns. - -The clockevents_program_min_delta() implementation for -CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=n doesn't handle retries when this -happens, nor does clockevents_program_event() or its callers when force -is true (for example hrtimer_reprogram()). This can result in hangs -until the clock event device does a full period. - -It isn't appropriate to use MIN_ADJUST in this case as occasional -hypervisor induced high latency will cause min_delta_ns to quickly -increase to the maximum. -Instead, borrow the retry pattern from the MIN_ADJUST case, but without -making adjustments. We retry up to 10 times before giving up. - -(picked https://patchwork.kernel.org/patch/8909491/) - -Signed-off-by: James Hogan ---- - kernel/time/clockevents.c | 26 +++++++++++++++++++------- - 1 file changed, 19 insertions(+), 7 deletions(-) - ---- a/kernel/time/clockevents.c -+++ b/kernel/time/clockevents.c -@@ -281,16 +281,28 @@ static int clockevents_program_min_delta - { - unsigned long long clc; - int64_t delta; -+ int i; - -- delta = dev->min_delta_ns; -- dev->next_event = ktime_add_ns(ktime_get(), delta); -+ for (i = 0;;) { -+ delta = dev->min_delta_ns; -+ dev->next_event = ktime_add_ns(ktime_get(), delta); - -- if (clockevent_state_shutdown(dev)) -- return 0; -+ if (clockevent_state_shutdown(dev)) -+ return 0; - -- dev->retries++; -- clc = ((unsigned long long) delta * dev->mult) >> dev->shift; -- return dev->set_next_event((unsigned long) clc, dev); -+ dev->retries++; -+ clc = ((unsigned long long) delta * dev->mult) >> dev->shift; -+ if (dev->set_next_event((unsigned long) clc, dev) == 0) -+ return 0; -+ -+ if (++i > 9) { -+ /* -+ * We tried 10 times to program the device with the -+ * given min_delta_ns. Get out of here. -+ */ -+ return -ETIME; -+ } -+ } - } - - #endif /* CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST */ diff --git a/target/linux/pistachio/patches-4.14/108-clk-pistachio-Fix-wrong-SDHost-card-speed.patch b/target/linux/pistachio/patches-4.14/108-clk-pistachio-Fix-wrong-SDHost-card-speed.patch deleted file mode 100644 index 5329ad62d..000000000 --- a/target/linux/pistachio/patches-4.14/108-clk-pistachio-Fix-wrong-SDHost-card-speed.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 3642843a06025ec333d7e92580cf52cb8db2a652 Mon Sep 17 00:00:00 2001 -From: Govindraj Raja -Date: Fri, 8 Jan 2016 16:36:07 +0000 -Subject: clk: pistachio: Fix wrong SDHost card speed - -The SDHost currently clocks the card 4x slower than it -should do, because there is fixed divide by 4 in the -sdhost wrapper that is not present in the clock tree. -To model this add a fixed divide by 4 clock node in -the SDHost clock path. - -This will ensure the right clock frequency is selected when -the mmc driver tries to configure frequency on card insert. - -Signed-off-by: Govindraj Raja ---- - drivers/clk/pistachio/clk-pistachio.c | 3 ++- - include/dt-bindings/clock/pistachio-clk.h | 1 + - 2 files changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/clk/pistachio/clk-pistachio.c -+++ b/drivers/clk/pistachio/clk-pistachio.c -@@ -44,7 +44,7 @@ static struct pistachio_gate pistachio_g - GATE(CLK_AUX_ADC_INTERNAL, "aux_adc_internal", "sys_internal_div", - 0x104, 22), - GATE(CLK_AUX_ADC, "aux_adc", "aux_adc_div", 0x104, 23), -- GATE(CLK_SD_HOST, "sd_host", "sd_host_div", 0x104, 24), -+ GATE(CLK_SD_HOST, "sd_host", "sd_host_div4", 0x104, 24), - GATE(CLK_BT, "bt", "bt_div", 0x104, 25), - GATE(CLK_BT_DIV4, "bt_div4", "bt_div4_div", 0x104, 26), - GATE(CLK_BT_DIV8, "bt_div8", "bt_div8_div", 0x104, 27), -@@ -54,6 +54,7 @@ static struct pistachio_gate pistachio_g - static struct pistachio_fixed_factor pistachio_ffs[] __initdata = { - FIXED_FACTOR(CLK_WIFI_DIV4, "wifi_div4", "wifi_pll", 4), - FIXED_FACTOR(CLK_WIFI_DIV8, "wifi_div8", "wifi_pll", 8), -+ FIXED_FACTOR(CLK_SDHOST_DIV4, "sd_host_div4", "sd_host_div", 4), - }; - - static struct pistachio_div pistachio_divs[] __initdata = { ---- a/include/dt-bindings/clock/pistachio-clk.h -+++ b/include/dt-bindings/clock/pistachio-clk.h -@@ -21,6 +21,7 @@ - /* Fixed-factor clocks */ - #define CLK_WIFI_DIV4 16 - #define CLK_WIFI_DIV8 17 -+#define CLK_SDHOST_DIV4 18 - - /* Gate clocks */ - #define CLK_MIPS 32 diff --git a/target/linux/pistachio/patches-4.14/109-MIPS-DTS-img-marduk-switch-mmc-to-1-bit-mode.patch b/target/linux/pistachio/patches-4.14/109-MIPS-DTS-img-marduk-switch-mmc-to-1-bit-mode.patch deleted file mode 100644 index 22fc42b98..000000000 --- a/target/linux/pistachio/patches-4.14/109-MIPS-DTS-img-marduk-switch-mmc-to-1-bit-mode.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 981c1d416af45eff207227aec106381ac23aac99 Mon Sep 17 00:00:00 2001 -From: Ian Pozella -Date: Mon, 20 Feb 2017 10:00:52 +0000 -Subject: MIPS: DTS: img: marduk: switch mmc to 1 bit mode - -The mmc block in Pistachio allows 1 to 8 data bits to be used. -Marduk uses 4 bits allowing the upper 4 bits to be allocated -to the Mikrobus ports. However these bits are still connected -internally meaning the mmc block recieves signals on all data lines -and seems the internal HW CRC checks get corrupted by this erroneous -data. - -We cannot control what data is sent on these lines because they go -to external ports. 1 bit mode does not exhibit the issue hence the -safe default is to use this. If a user knows that in their use case -they will not use the upper bits then they can set to 4 bit mode in -order to improve performance. - -Also make sure that the upper 4 bits don't get allocated to the mmc -driver (the default is to assign all 8 pins) so they can be allocated -to other drivers. Allocating all 4 despite setting 1 bit mode as this -matches what is there in hardware. - -Signed-off-by: Ian Pozella ---- - arch/mips/boot/dts/img/pistachio_marduk.dts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/arch/mips/boot/dts/img/pistachio_marduk.dts -+++ b/arch/mips/boot/dts/img/pistachio_marduk.dts -@@ -120,7 +120,7 @@ - - &sdhost { - status = "okay"; -- bus-width = <4>; -+ bus-width = <1>; - disable-wp; - }; - -@@ -130,6 +130,7 @@ - - &pin_sdhost_data { - drive-strength = <2>; -+ pins = "mfio17", "mfio18", "mfio19", "mfio20"; - }; - - &pwm { diff --git a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch deleted file mode 100644 index 065a0b77b..000000000 --- a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ /dev/null @@ -1,34 +0,0 @@ -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/spi-nor.c -+++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2671,6 +2671,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; - -@@ -2746,7 +2747,12 @@ int spi_nor_scan(struct spi_nor *nor, co - spi_nor_wait_till_ready(nor); - } - -- 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; diff --git a/target/linux/pistachio/patches-4.14/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch b/target/linux/pistachio/patches-4.14/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch deleted file mode 100644 index 3311de645..000000000 --- a/target/linux/pistachio/patches-4.14/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 42ebff638003be18fab503b37de4ad7853244e95 Mon Sep 17 00:00:00 2001 -From: Ezequiel Garcia -Date: Sat, 25 Feb 2017 15:58:22 +0000 -Subject: mtd: nand: Check length of ID before reading bits per cell - -The table-based NAND identification currently reads the number -of bits per cell from the 3rd byte of the extended ID. This is done -for the so-called 'full ID' devices; i.e. devices that have a known -length ID. - -However, if the ID length is shorter than three, there's no 3rd byte, -and so it's wrong to read the bits per cell from there. Fix this by -adding a check for the ID length. - -(picked from http://lists.infradead.org/pipermail/linux-mtd/2014-December/056764.html) - -Signed-off-by: Ezequiel Garcia ---- - drivers/mtd/nand/nand_base.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/mtd/nand/nand_base.c -+++ b/drivers/mtd/nand/nand_base.c -@@ -3803,7 +3803,8 @@ static bool find_full_id_nand(struct nan - mtd->erasesize = type->erasesize; - mtd->oobsize = type->oobsize; - -- chip->bits_per_cell = nand_get_bits_per_cell(id_data[2]); -+ if (type->id_len > 2) -+ chip->bits_per_cell = nand_get_bits_per_cell(id_data[2]); - chip->chipsize = (uint64_t)type->chipsize << 20; - chip->options |= type->options; - chip->ecc_strength_ds = NAND_ECC_STRENGTH(type); diff --git a/target/linux/pistachio/patches-4.14/412-mtd-nand-Add-JEDEC-manufacturer-ID-for-Gigadevice.patch b/target/linux/pistachio/patches-4.14/412-mtd-nand-Add-JEDEC-manufacturer-ID-for-Gigadevice.patch deleted file mode 100644 index a967124c8..000000000 --- a/target/linux/pistachio/patches-4.14/412-mtd-nand-Add-JEDEC-manufacturer-ID-for-Gigadevice.patch +++ /dev/null @@ -1,35 +0,0 @@ -From a4bc33b205fd9b1db862f1e45173dba57b0fa57f Mon Sep 17 00:00:00 2001 -From: Ezequiel Garcia -Date: Sat, 25 Feb 2017 15:43:09 +0000 -Subject: mtd: nand: Add JEDEC manufacturer ID for Gigadevice - -This commit adds Gigadevice to the list of manufacturer ID and name strings. - -(picked from http://lists.infradead.org/pipermail/linux-mtd/2014-December/056765.html) - -Signed-off-by: Ezequiel Garcia ---- - drivers/mtd/nand/nand_ids.c | 1 + - include/linux/mtd/rawnand.h | 1 + - 2 files changed, 2 insertions(+) - ---- a/drivers/mtd/nand/nand_ids.c -+++ b/drivers/mtd/nand/nand_ids.c -@@ -184,6 +184,7 @@ static const struct nand_manufacturer na - {NAND_MFR_SANDISK, "SanDisk"}, - {NAND_MFR_INTEL, "Intel"}, - {NAND_MFR_ATO, "ATO"}, -+ {NAND_MFR_GIGADEVICE, "Gigadevice"}, - {NAND_MFR_WINBOND, "Winbond"}, - }; - ---- a/include/linux/mtd/rawnand.h -+++ b/include/linux/mtd/rawnand.h -@@ -1014,6 +1014,7 @@ static inline void *nand_get_manufacture - #define NAND_MFR_SANDISK 0x45 - #define NAND_MFR_INTEL 0x89 - #define NAND_MFR_ATO 0x9b -+#define NAND_MFR_GIGADEVICE 0xc8 - #define NAND_MFR_WINBOND 0xef - - diff --git a/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch b/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch deleted file mode 100644 index d1189eeb8..000000000 --- a/target/linux/pistachio/patches-4.14/413-mtd-Introduce-SPI-NAND-framework.patch +++ /dev/null @@ -1,707 +0,0 @@ -From 082a89a78e29b15008284df90441747cb742f149 Mon Sep 17 00:00:00 2001 -From: Ezequiel Garcia -Date: Tue, 2 Dec 2014 09:58:52 -0300 -Subject: mtd: Introduce SPI NAND framework - -Add a new framework, to support SPI NAND devices. The framework registers -a NAND chip and handles the generic SPI NAND protocol, calling device-specific -hooks for each SPI NAND command. - -The following is the stack design, from userspace to hardware. This commit -adds the "SPI NAND core" layer. - - Userspace - ------------------ - MTD - ------------------ - NAND core - ------------------ - SPI NAND core - ------------------ - SPI NAND device - ------------------ - SPI core - ------------------ - SPI master - ------------------ - Hardware - -(based on http://lists.infradead.org/pipermail/linux-mtd/2014-December/056763.html) - -Signed-off-by: Ionela Voinescu -Signed-off-by: Ezequiel Garcia -Signed-off-by: Ian Pozella ---- - drivers/mtd/Kconfig | 2 + - drivers/mtd/Makefile | 1 + - drivers/mtd/spi-nand/Kconfig | 7 + - drivers/mtd/spi-nand/Makefile | 1 + - drivers/mtd/spi-nand/spi-nand-base.c | 566 +++++++++++++++++++++++++++++++++++ - include/linux/mtd/spi-nand.h | 54 ++++ - 6 files changed, 631 insertions(+) - create mode 100644 drivers/mtd/spi-nand/Kconfig - create mode 100644 drivers/mtd/spi-nand/Makefile - create mode 100644 drivers/mtd/spi-nand/spi-nand-base.c - create mode 100644 include/linux/mtd/spi-nand.h - ---- a/drivers/mtd/Kconfig -+++ b/drivers/mtd/Kconfig -@@ -373,6 +373,8 @@ source "drivers/mtd/onenand/Kconfig" - - source "drivers/mtd/lpddr/Kconfig" - -+source "drivers/mtd/spi-nand/Kconfig" -+ - source "drivers/mtd/spi-nor/Kconfig" - - source "drivers/mtd/ubi/Kconfig" ---- a/drivers/mtd/Makefile -+++ b/drivers/mtd/Makefile -@@ -37,6 +37,7 @@ inftl-objs := inftlcore.o inftlmount.o - - obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/ - -+obj-$(CONFIG_MTD_SPI_NAND) += spi-nand/ - obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/ - obj-$(CONFIG_MTD_UBI) += ubi/ - ---- /dev/null -+++ b/drivers/mtd/spi-nand/Kconfig -@@ -0,0 +1,7 @@ -+menuconfig MTD_SPI_NAND -+ tristate "SPI NAND device support" -+ depends on MTD -+ select MTD_NAND -+ help -+ This is the framework for the SPI NAND. -+ ---- /dev/null -+++ b/drivers/mtd/spi-nand/Makefile -@@ -0,0 +1 @@ -+obj-$(CONFIG_MTD_SPI_NAND) += spi-nand-base.o ---- /dev/null -+++ b/drivers/mtd/spi-nand/spi-nand-base.c -@@ -0,0 +1,566 @@ -+/* -+ * Copyright (C) 2014 Imagination Technologies Ltd. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; version 2 of the License. -+ * -+ * Notes: -+ * 1. Erase and program operations need to call write_enable() first, -+ * to clear the enable bit. This bit is cleared automatically after -+ * the erase or program operation. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Registers common to all devices */ -+#define SPI_NAND_LOCK_REG 0xa0 -+#define SPI_NAND_PROT_UNLOCK_ALL 0x0 -+ -+#define SPI_NAND_FEATURE_REG 0xb0 -+#define SPI_NAND_ECC_EN BIT(4) -+#define SPI_NAND_QUAD_EN BIT(0) -+ -+#define SPI_NAND_STATUS_REG 0xc0 -+#define SPI_NAND_STATUS_REG_ECC_MASK 0x3 -+#define SPI_NAND_STATUS_REG_ECC_SHIFT 4 -+#define SPI_NAND_STATUS_REG_PROG_FAIL BIT(3) -+#define SPI_NAND_STATUS_REG_ERASE_FAIL BIT(2) -+#define SPI_NAND_STATUS_REG_WREN BIT(1) -+#define SPI_NAND_STATUS_REG_BUSY BIT(0) -+ -+#define SPI_NAND_CMD_BUF_LEN 8 -+ -+/* Rewind and fill the buffer with 0xff */ -+static void spi_nand_clear_buffer(struct spi_nand *snand) -+{ -+ snand->buf_start = 0; -+ memset(snand->data_buf, 0xff, snand->buf_size); -+} -+ -+static int spi_nand_enable_ecc(struct spi_nand *snand) -+{ -+ int ret; -+ -+ ret = snand->read_reg(snand, SPI_NAND_FEATURE_REG, snand->buf); -+ if (ret) -+ return ret; -+ -+ snand->buf[0] |= SPI_NAND_ECC_EN; -+ ret = snand->write_reg(snand, SPI_NAND_FEATURE_REG, snand->buf); -+ if (ret) -+ return ret; -+ snand->ecc = true; -+ -+ return 0; -+} -+ -+static int spi_nand_disable_ecc(struct spi_nand *snand) -+{ -+ int ret; -+ -+ ret = snand->read_reg(snand, SPI_NAND_FEATURE_REG, snand->buf); -+ if (ret) -+ return ret; -+ -+ snand->buf[0] &= ~SPI_NAND_ECC_EN; -+ ret = snand->write_reg(snand, SPI_NAND_FEATURE_REG, snand->buf); -+ if (ret) -+ return ret; -+ snand->ecc = false; -+ -+ return 0; -+} -+ -+static int spi_nand_enable_quad(struct spi_nand *snand) -+{ -+ int ret; -+ -+ ret = snand->read_reg(snand, SPI_NAND_FEATURE_REG, snand->buf); -+ if (ret) -+ return ret; -+ -+ snand->buf[0] |= SPI_NAND_QUAD_EN; -+ ret = snand->write_reg(snand, SPI_NAND_FEATURE_REG, snand->buf); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+/* -+ * Wait until the status register busy bit is cleared. -+ * Returns a negatie errno on error or time out, and a non-negative status -+ * value if the device is ready. -+ */ -+static int spi_nand_wait_till_ready(struct spi_nand *snand) -+{ -+ unsigned long deadline = jiffies + msecs_to_jiffies(100); -+ bool timeout = false; -+ int ret; -+ -+ /* -+ * Perhaps we should set a different timeout for each -+ * operation (reset, read, write, erase). -+ */ -+ while (!timeout) { -+ if (time_after_eq(jiffies, deadline)) -+ timeout = true; -+ -+ ret = snand->read_reg(snand, SPI_NAND_STATUS_REG, snand->buf); -+ if (ret < 0) { -+ dev_err(snand->dev, "error reading status register\n"); -+ return ret; -+ } else if (!(snand->buf[0] & SPI_NAND_STATUS_REG_BUSY)) { -+ return snand->buf[0]; -+ } -+ -+ cond_resched(); -+ } -+ -+ dev_err(snand->dev, "operation timed out\n"); -+ -+ return -ETIMEDOUT; -+} -+ -+static int spi_nand_reset(struct spi_nand *snand) -+{ -+ int ret; -+ -+ ret = snand->reset(snand); -+ if (ret < 0) { -+ dev_err(snand->dev, "reset command failed\n"); -+ return ret; -+ } -+ -+ /* -+ * The NAND core won't wait after a device reset, so we need -+ * to do that here. -+ */ -+ ret = spi_nand_wait_till_ready(snand); -+ if (ret < 0) -+ return ret; -+ return 0; -+} -+ -+static int spi_nand_status(struct spi_nand *snand) -+{ -+ int ret, status; -+ -+ ret = snand->read_reg(snand, SPI_NAND_STATUS_REG, snand->buf); -+ if (ret < 0) { -+ dev_err(snand->dev, "error reading status register\n"); -+ return ret; -+ } -+ status = snand->buf[0]; -+ -+ /* Convert this into standard NAND_STATUS values */ -+ if (status & SPI_NAND_STATUS_REG_BUSY) -+ snand->buf[0] = 0; -+ else -+ snand->buf[0] = NAND_STATUS_READY; -+ -+ if (status & SPI_NAND_STATUS_REG_PROG_FAIL || -+ status & SPI_NAND_STATUS_REG_ERASE_FAIL) -+ snand->buf[0] |= NAND_STATUS_FAIL; -+ -+ /* -+ * Since we unlock the entire device at initialization, unconditionally -+ * set the WP bit to indicate it's not protected. -+ */ -+ snand->buf[0] |= NAND_STATUS_WP; -+ return 0; -+} -+ -+static int spi_nand_erase(struct spi_nand *snand, int page_addr) -+{ -+ int ret; -+ -+ ret = snand->write_enable(snand); -+ if (ret < 0) { -+ dev_err(snand->dev, "write enable command failed\n"); -+ return ret; -+ } -+ -+ ret = snand->block_erase(snand, page_addr); -+ if (ret < 0) { -+ dev_err(snand->dev, "block erase command failed\n"); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int spi_nand_write(struct spi_nand *snand) -+{ -+ int ret; -+ -+ /* Enable quad mode */ -+ ret = spi_nand_enable_quad(snand); -+ if (ret) { -+ dev_err(snand->dev, "error %d enabling quad mode\n", ret); -+ return ret; -+ } -+ /* Store the page to cache */ -+ ret = snand->store_cache(snand, 0, snand->buf_size, snand->data_buf); -+ if (ret < 0) { -+ dev_err(snand->dev, "error %d storing page 0x%x to cache\n", -+ ret, snand->page_addr); -+ return ret; -+ } -+ -+ ret = snand->write_enable(snand); -+ if (ret < 0) { -+ dev_err(snand->dev, "write enable command failed\n"); -+ return ret; -+ } -+ -+ /* Get page from the device cache into our internal buffer */ -+ ret = snand->write_page(snand, snand->page_addr); -+ if (ret < 0) { -+ dev_err(snand->dev, "error %d reading page 0x%x from cache\n", -+ ret, snand->page_addr); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int spi_nand_read_id(struct spi_nand *snand) -+{ -+ int ret; -+ -+ ret = snand->read_id(snand, snand->data_buf); -+ if (ret < 0) { -+ dev_err(snand->dev, "error %d reading ID\n", ret); -+ return ret; -+ } -+ return 0; -+} -+ -+static int spi_nand_read_page(struct spi_nand *snand, unsigned int page_addr, -+ unsigned int page_offset, size_t length) -+{ -+ unsigned int corrected = 0, ecc_error = 0; -+ int ret; -+ -+ /* Load a page into the cache register */ -+ ret = snand->load_page(snand, page_addr); -+ if (ret < 0) { -+ dev_err(snand->dev, "error %d loading page 0x%x to cache\n", -+ ret, page_addr); -+ return ret; -+ } -+ -+ ret = spi_nand_wait_till_ready(snand); -+ if (ret < 0) -+ return ret; -+ -+ if (snand->ecc) { -+ snand->get_ecc_status(ret, &corrected, &ecc_error); -+ snand->bitflips = corrected; -+ -+ /* -+ * If there's an ECC error, print a message and notify MTD -+ * about it. Then complete the read, to load actual data on -+ * the buffer (instead of the status result). -+ */ -+ if (ecc_error) { -+ dev_err(snand->dev, -+ "internal ECC error reading page 0x%x\n", -+ page_addr); -+ snand->nand_chip.mtd.ecc_stats.failed++; -+ } else { -+ snand->nand_chip.mtd.ecc_stats.corrected += corrected; -+ } -+ } -+ -+ /* Enable quad mode */ -+ ret = spi_nand_enable_quad(snand); -+ if (ret) { -+ dev_err(snand->dev, "error %d enabling quad mode\n", ret); -+ return ret; -+ } -+ /* Get page from the device cache into our internal buffer */ -+ ret = snand->read_cache(snand, page_offset, length, snand->data_buf); -+ if (ret < 0) { -+ dev_err(snand->dev, "error %d reading page 0x%x from cache\n", -+ ret, page_addr); -+ return ret; -+ } -+ return 0; -+} -+ -+static u8 spi_nand_read_byte(struct mtd_info *mtd) -+{ -+ struct nand_chip *chip = mtd_to_nand(mtd); -+ struct spi_nand *snand = nand_get_controller_data(chip); -+ char val = 0xff; -+ -+ if (snand->buf_start < snand->buf_size) -+ val = snand->data_buf[snand->buf_start++]; -+ return val; -+} -+ -+static void spi_nand_write_buf(struct mtd_info *mtd, const u8 *buf, int len) -+{ -+ struct nand_chip *chip = mtd_to_nand(mtd); -+ struct spi_nand *snand = nand_get_controller_data(chip); -+ size_t n = min_t(size_t, len, snand->buf_size - snand->buf_start); -+ -+ memcpy(snand->data_buf + snand->buf_start, buf, n); -+ snand->buf_start += n; -+} -+ -+static void spi_nand_read_buf(struct mtd_info *mtd, u8 *buf, int len) -+{ -+ struct nand_chip *chip = mtd_to_nand(mtd); -+ struct spi_nand *snand = nand_get_controller_data(chip); -+ size_t n = min_t(size_t, len, snand->buf_size - snand->buf_start); -+ -+ memcpy(buf, snand->data_buf + snand->buf_start, n); -+ snand->buf_start += n; -+} -+ -+static int spi_nand_write_page_hwecc(struct mtd_info *mtd, -+ struct nand_chip *chip, const uint8_t *buf, int oob_required, -+ int page) -+{ -+ chip->write_buf(mtd, buf, mtd->writesize); -+ chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); -+ -+ return 0; -+} -+ -+static int spi_nand_read_page_hwecc(struct mtd_info *mtd, -+ struct nand_chip *chip, uint8_t *buf, int oob_required, -+ int page) -+{ -+ struct spi_nand *snand = nand_get_controller_data(chip); -+ -+ chip->read_buf(mtd, buf, mtd->writesize); -+ chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); -+ -+ return snand->bitflips; -+} -+ -+static int spi_nand_waitfunc(struct mtd_info *mtd, struct nand_chip *chip) -+{ -+ struct spi_nand *snand = nand_get_controller_data(chip); -+ int ret; -+ -+ ret = spi_nand_wait_till_ready(snand); -+ -+ if (ret < 0) { -+ return NAND_STATUS_FAIL; -+ } else if (ret & SPI_NAND_STATUS_REG_PROG_FAIL) { -+ dev_err(snand->dev, "page program failed\n"); -+ return NAND_STATUS_FAIL; -+ } else if (ret & SPI_NAND_STATUS_REG_ERASE_FAIL) { -+ dev_err(snand->dev, "block erase failed\n"); -+ return NAND_STATUS_FAIL; -+ } -+ -+ return NAND_STATUS_READY; -+} -+ -+static void spi_nand_cmdfunc(struct mtd_info *mtd, unsigned int command, -+ int column, int page_addr) -+{ -+ struct nand_chip *chip = mtd_to_nand(mtd); -+ struct spi_nand *snand = nand_get_controller_data(chip); -+ -+ /* -+ * In case there's any unsupported command, let's make sure -+ * we don't keep garbage around in the buffer. -+ */ -+ if (command != NAND_CMD_PAGEPROG) { -+ spi_nand_clear_buffer(snand); -+ snand->page_addr = 0; -+ } -+ -+ switch (command) { -+ case NAND_CMD_READ0: -+ spi_nand_read_page(snand, page_addr, 0, mtd->writesize); -+ break; -+ case NAND_CMD_READOOB: -+ spi_nand_disable_ecc(snand); -+ spi_nand_read_page(snand, page_addr, mtd->writesize, -+ mtd->oobsize); -+ spi_nand_enable_ecc(snand); -+ break; -+ case NAND_CMD_READID: -+ spi_nand_read_id(snand); -+ break; -+ case NAND_CMD_ERASE1: -+ spi_nand_erase(snand, page_addr); -+ break; -+ case NAND_CMD_ERASE2: -+ /* There's nothing to do here, as the erase is one-step */ -+ break; -+ case NAND_CMD_SEQIN: -+ snand->buf_start = column; -+ snand->page_addr = page_addr; -+ break; -+ case NAND_CMD_PAGEPROG: -+ spi_nand_write(snand); -+ break; -+ case NAND_CMD_STATUS: -+ spi_nand_status(snand); -+ break; -+ case NAND_CMD_RESET: -+ spi_nand_reset(snand); -+ break; -+ default: -+ dev_err(&mtd->dev, "unknown command 0x%x\n", command); -+ } -+} -+ -+static void spi_nand_select_chip(struct mtd_info *mtd, int chip) -+{ -+ /* We need this to override the default */ -+} -+ -+int spi_nand_check(struct spi_nand *snand) -+{ -+ if (!snand->dev) -+ return -ENODEV; -+ if (!snand->read_cache) -+ return -ENODEV; -+ if (!snand->load_page) -+ return -ENODEV; -+ if (!snand->store_cache) -+ return -ENODEV; -+ if (!snand->write_page) -+ return -ENODEV; -+ if (!snand->write_reg) -+ return -ENODEV; -+ if (!snand->read_reg) -+ return -ENODEV; -+ if (!snand->block_erase) -+ return -ENODEV; -+ if (!snand->reset) -+ return -ENODEV; -+ if (!snand->write_enable) -+ return -ENODEV; -+ if (!snand->write_disable) -+ return -ENODEV; -+ if (!snand->get_ecc_status) -+ return -ENODEV; -+ return 0; -+} -+ -+int spi_nand_register(struct spi_nand *snand, struct nand_flash_dev *flash_ids) -+{ -+ struct nand_chip *chip = &snand->nand_chip; -+ struct mtd_info *mtd = nand_to_mtd(chip); -+ struct device_node *np = snand->dev->of_node; -+ const char __maybe_unused *of_mtd_name = NULL; -+ int ret; -+ -+ /* Let's check all the hooks are in-place so we don't panic later */ -+ ret = spi_nand_check(snand); -+ if (ret) -+ return ret; -+ -+ nand_set_controller_data(chip, snand); -+ nand_set_flash_node(chip, np); -+ chip->read_buf = spi_nand_read_buf; -+ chip->write_buf = spi_nand_write_buf; -+ chip->read_byte = spi_nand_read_byte; -+ chip->cmdfunc = spi_nand_cmdfunc; -+ chip->waitfunc = spi_nand_waitfunc; -+ chip->select_chip = spi_nand_select_chip; -+ chip->options |= NAND_NO_SUBPAGE_WRITE; -+ chip->bits_per_cell = 1; -+ -+ mtd_set_ooblayout(mtd, snand->ooblayout); -+ chip->ecc.read_page = spi_nand_read_page_hwecc; -+ chip->ecc.write_page = spi_nand_write_page_hwecc; -+ chip->ecc.mode = NAND_ECC_HW; -+ -+ if (of_property_read_bool(np, "nand-on-flash-bbt")) -+ chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB; -+ -+#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 -+ mtd->name = snand->name; -+ mtd->owner = THIS_MODULE; -+ -+ /* Allocate buffer to be used to read/write the internal registers */ -+ snand->buf = kmalloc(SPI_NAND_CMD_BUF_LEN, GFP_KERNEL); -+ if (!snand->buf) -+ return -ENOMEM; -+ -+ /* This is enabled at device power up but we'd better make sure */ -+ ret = spi_nand_enable_ecc(snand); -+ if (ret) -+ return ret; -+ -+ /* Preallocate buffer for flash identification (NAND_CMD_READID) */ -+ snand->buf_size = SPI_NAND_CMD_BUF_LEN; -+ snand->data_buf = kmalloc(snand->buf_size, GFP_KERNEL); -+ -+ ret = nand_scan_ident(mtd, 1, flash_ids); -+ if (ret) -+ return ret; -+ -+ /* -+ * SPI NAND has on-die ECC, which means we can correct as much as -+ * we are required to. This must be done after identification of -+ * the device. -+ */ -+ chip->ecc.strength = chip->ecc_strength_ds; -+ chip->ecc.size = chip->ecc_step_ds; -+ -+ /* -+ * Unlock all the device before calling nand_scan_tail. This is needed -+ * in case the in-flash bad block table needs to be created. -+ * We could override __nand_unlock(), but since it's not currently used -+ * by the NAND core we call this explicitly. -+ */ -+ snand->buf[0] = SPI_NAND_PROT_UNLOCK_ALL; -+ ret = snand->write_reg(snand, SPI_NAND_LOCK_REG, snand->buf); -+ if (ret) -+ return ret; -+ -+ /* Free the buffer and allocate a good one, to fit a page plus OOB */ -+ kfree(snand->data_buf); -+ -+ snand->buf_size = mtd->writesize + mtd->oobsize; -+ snand->data_buf = kmalloc(snand->buf_size, GFP_KERNEL); -+ if (!snand->data_buf) -+ return -ENOMEM; -+ -+ ret = nand_scan_tail(mtd); -+ if (ret) -+ return ret; -+ -+ return mtd_device_register(mtd, NULL, 0); -+} -+EXPORT_SYMBOL_GPL(spi_nand_register); -+ -+void spi_nand_unregister(struct spi_nand *snand) -+{ -+ kfree(snand->buf); -+ kfree(snand->data_buf); -+} -+EXPORT_SYMBOL_GPL(spi_nand_unregister); -+ -+MODULE_AUTHOR("Ezequiel Garcia "); -+MODULE_DESCRIPTION("Framework for SPI NAND"); -+MODULE_LICENSE("GPL v2"); ---- /dev/null -+++ b/include/linux/mtd/spi-nand.h -@@ -0,0 +1,54 @@ -+/* -+ * Copyright (C) 2014 Imagination Technologies Ltd. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; version 2 of the License. -+ */ -+ -+#ifndef __LINUX_MTD_SPI_NAND_H -+#define __LINUX_MTD_SPI_NAND_H -+ -+#include -+#include -+ -+struct spi_nand { -+ struct nand_chip nand_chip; -+ struct device *dev; -+ const char *name; -+ -+ u8 *buf, *data_buf; -+ size_t buf_size; -+ off_t buf_start; -+ unsigned int page_addr; -+ unsigned int bitflips; -+ bool ecc; -+ struct mtd_ooblayout_ops *ooblayout; -+ -+ int (*reset)(struct spi_nand *snand); -+ int (*read_id)(struct spi_nand *snand, u8 *buf); -+ -+ int (*write_disable)(struct spi_nand *snand); -+ int (*write_enable)(struct spi_nand *snand); -+ -+ int (*read_reg)(struct spi_nand *snand, u8 opcode, u8 *buf); -+ int (*write_reg)(struct spi_nand *snand, u8 opcode, u8 *buf); -+ void (*get_ecc_status)(unsigned int status, -+ unsigned int *corrected, -+ unsigned int *ecc_errors); -+ -+ int (*store_cache)(struct spi_nand *snand, unsigned int page_offset, -+ size_t length, u8 *write_buf); -+ int (*write_page)(struct spi_nand *snand, unsigned int page_addr); -+ int (*load_page)(struct spi_nand *snand, unsigned int page_addr); -+ int (*read_cache)(struct spi_nand *snand, unsigned int page_offset, -+ size_t length, u8 *read_buf); -+ int (*block_erase)(struct spi_nand *snand, unsigned int page_addr); -+ -+ void *priv; -+}; -+ -+int spi_nand_register(struct spi_nand *snand, struct nand_flash_dev *flash_ids); -+void spi_nand_unregister(struct spi_nand *snand); -+ -+#endif diff --git a/target/linux/pistachio/patches-4.14/414-mtd-spi-nand-Support-Gigadevice-GD5F.patch b/target/linux/pistachio/patches-4.14/414-mtd-spi-nand-Support-Gigadevice-GD5F.patch deleted file mode 100644 index 1f1461061..000000000 --- a/target/linux/pistachio/patches-4.14/414-mtd-spi-nand-Support-Gigadevice-GD5F.patch +++ /dev/null @@ -1,524 +0,0 @@ -From 7723e59d483a883578115a73eb87eb7fff0ff724 Mon Sep 17 00:00:00 2001 -From: Ezequiel Garcia -Date: Tue, 28 Feb 2017 10:37:24 +0000 -Subject: mtd: spi-nand: Support Gigadevice GD5F - -This commit uses the recently introduced SPI NAND framework to support -the Gigadevice GD5F serial NAND device. - -The current support includes: - - * Page read and page program operations (using on-die ECC) - * Page out-of-band read - * Erase - * Reset - * Device status retrieval - * Device ID retrieval - -(based on http://lists.infradead.org/pipermail/linux-mtd/2014-December/056769.html) - -Signed-off-by: Ezequiel Garcia -Signed-off-by: Ian Pozella ---- - drivers/mtd/spi-nand/Kconfig | 10 + - drivers/mtd/spi-nand/Makefile | 1 + - drivers/mtd/spi-nand/spi-nand-device.c | 472 +++++++++++++++++++++++++++++++++ - 3 files changed, 483 insertions(+) - create mode 100644 drivers/mtd/spi-nand/spi-nand-device.c - ---- a/drivers/mtd/spi-nand/Kconfig -+++ b/drivers/mtd/spi-nand/Kconfig -@@ -5,3 +5,13 @@ menuconfig MTD_SPI_NAND - help - This is the framework for the SPI NAND. - -+if MTD_SPI_NAND -+ -+config MTD_SPI_NAND_DEVICES -+ tristate "Support for SPI NAND devices" -+ default y -+ depends on MTD_SPI_NAND -+ help -+ Select this option if you require support for SPI NAND devices. -+ -+endif # MTD_SPI_NAND ---- a/drivers/mtd/spi-nand/Makefile -+++ b/drivers/mtd/spi-nand/Makefile -@@ -1 +1,2 @@ - obj-$(CONFIG_MTD_SPI_NAND) += spi-nand-base.o -+obj-$(CONFIG_MTD_SPI_NAND_DEVICES) += spi-nand-device.o ---- /dev/null -+++ b/drivers/mtd/spi-nand/spi-nand-device.c -@@ -0,0 +1,472 @@ -+/* -+ * Copyright (C) 2014 Imagination Technologies Ltd. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; version 2 of the License. -+ * -+ * Notes: -+ * 1. We avoid using a stack-allocated buffer for SPI messages. Using -+ * a kmalloced buffer is probably better, given we shouldn't assume -+ * any particular usage by SPI core. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* SPI NAND commands */ -+#define SPI_NAND_WRITE_ENABLE 0x06 -+#define SPI_NAND_WRITE_DISABLE 0x04 -+#define SPI_NAND_GET_FEATURE 0x0f -+#define SPI_NAND_SET_FEATURE 0x1f -+#define SPI_NAND_PAGE_READ 0x13 -+#define SPI_NAND_READ_CACHE 0x03 -+#define SPI_NAND_FAST_READ_CACHE 0x0b -+#define SPI_NAND_READ_CACHE_X2 0x3b -+#define SPI_NAND_READ_CACHE_X4 0x6b -+#define SPI_NAND_READ_CACHE_DUAL_IO 0xbb -+#define SPI_NAND_READ_CACHE_QUAD_IO 0xeb -+#define SPI_NAND_READ_ID 0x9f -+#define SPI_NAND_PROGRAM_LOAD 0x02 -+#define SPI_NAND_PROGRAM_LOAD4 0x32 -+#define SPI_NAND_PROGRAM_EXEC 0x10 -+#define SPI_NAND_PROGRAM_LOAD_RANDOM 0x84 -+#define SPI_NAND_PROGRAM_LOAD_RANDOM4 0xc4 -+#define SPI_NAND_BLOCK_ERASE 0xd8 -+#define SPI_NAND_RESET 0xff -+ -+#define SPI_NAND_GD5F_READID_LEN 2 -+ -+#define SPI_NAND_GD5F_ECC_MASK (BIT(0) | BIT(1) | BIT(2)) -+#define SPI_NAND_GD5F_ECC_UNCORR (BIT(0) | BIT(1) | BIT(2)) -+#define SPI_NAND_GD5F_ECC_SHIFT 4 -+ -+static int spi_nand_gd5f_ooblayout_256_ecc(struct mtd_info *mtd, int section, -+ struct mtd_oob_region *oobregion) -+{ -+ if (section) -+ return -ERANGE; -+ -+ oobregion->offset = 128; -+ oobregion->length = 128; -+ -+ return 0; -+} -+ -+static int spi_nand_gd5f_ooblayout_256_free(struct mtd_info *mtd, int section, -+ struct mtd_oob_region *oobregion) -+{ -+ if (section) -+ return -ERANGE; -+ -+ oobregion->offset = 1; -+ oobregion->length = 127; -+ -+ return 0; -+} -+ -+static const struct mtd_ooblayout_ops spi_nand_gd5f_oob_256_ops = { -+ .ecc = spi_nand_gd5f_ooblayout_256_ecc, -+ .free = spi_nand_gd5f_ooblayout_256_free, -+}; -+ -+static struct nand_flash_dev spi_nand_flash_ids[] = { -+ { -+ .name = "SPI NAND 512MiB 3,3V", -+ .id = { NAND_MFR_GIGADEVICE, 0xb4 }, -+ .chipsize = 512, -+ .pagesize = SZ_4K, -+ .erasesize = SZ_256K, -+ .id_len = 2, -+ .oobsize = 256, -+ .ecc.strength_ds = 8, -+ .ecc.step_ds = 512, -+ }, -+ { -+ .name = "SPI NAND 512MiB 1,8V", -+ .id = { NAND_MFR_GIGADEVICE, 0xa4 }, -+ .chipsize = 512, -+ .pagesize = SZ_4K, -+ .erasesize = SZ_256K, -+ .id_len = 2, -+ .oobsize = 256, -+ .ecc.strength_ds = 8, -+ .ecc.step_ds = 512, -+ }, -+}; -+ -+enum spi_nand_device_variant { -+ SPI_NAND_GENERIC, -+ SPI_NAND_GD5F, -+}; -+ -+struct spi_nand_device_cmd { -+ -+ /* -+ * Command and address. I/O errors have been observed if a -+ * separate spi_transfer is used for command and address, -+ * so keep them together. -+ */ -+ u32 n_cmd; -+ u8 cmd[5]; -+ -+ /* Tx data */ -+ u32 n_tx; -+ u8 *tx_buf; -+ -+ /* Rx data */ -+ u32 n_rx; -+ u8 *rx_buf; -+ u8 rx_nbits; -+ u8 tx_nbits; -+}; -+ -+struct spi_nand_device { -+ struct spi_nand spi_nand; -+ struct spi_device *spi; -+ -+ struct spi_nand_device_cmd cmd; -+}; -+ -+static int spi_nand_send_command(struct spi_device *spi, -+ struct spi_nand_device_cmd *cmd) -+{ -+ struct spi_message message; -+ struct spi_transfer x[2]; -+ -+ if (!cmd->n_cmd) { -+ dev_err(&spi->dev, "cannot send an empty command\n"); -+ return -EINVAL; -+ } -+ -+ if (cmd->n_tx && cmd->n_rx) { -+ dev_err(&spi->dev, "cannot send and receive data at the same time\n"); -+ return -EINVAL; -+ } -+ -+ spi_message_init(&message); -+ memset(x, 0, sizeof(x)); -+ -+ /* Command and address */ -+ x[0].len = cmd->n_cmd; -+ x[0].tx_buf = cmd->cmd; -+ x[0].tx_nbits = cmd->tx_nbits; -+ spi_message_add_tail(&x[0], &message); -+ -+ /* Data to be transmitted */ -+ if (cmd->n_tx) { -+ x[1].len = cmd->n_tx; -+ x[1].tx_buf = cmd->tx_buf; -+ x[1].tx_nbits = cmd->tx_nbits; -+ spi_message_add_tail(&x[1], &message); -+ } -+ -+ /* Data to be received */ -+ if (cmd->n_rx) { -+ x[1].len = cmd->n_rx; -+ x[1].rx_buf = cmd->rx_buf; -+ x[1].rx_nbits = cmd->rx_nbits; -+ spi_message_add_tail(&x[1], &message); -+ } -+ -+ return spi_sync(spi, &message); -+} -+ -+static int spi_nand_device_reset(struct spi_nand *snand) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 1; -+ cmd->cmd[0] = SPI_NAND_RESET; -+ -+ dev_dbg(snand->dev, "%s\n", __func__); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_read_reg(struct spi_nand *snand, u8 opcode, u8 *buf) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 2; -+ cmd->cmd[0] = SPI_NAND_GET_FEATURE; -+ cmd->cmd[1] = opcode; -+ cmd->n_rx = 1; -+ cmd->rx_buf = buf; -+ -+ dev_dbg(snand->dev, "%s: reg 0%x\n", __func__, opcode); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_write_reg(struct spi_nand *snand, u8 opcode, u8 *buf) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 2; -+ cmd->cmd[0] = SPI_NAND_SET_FEATURE; -+ cmd->cmd[1] = opcode; -+ cmd->n_tx = 1; -+ cmd->tx_buf = buf; -+ -+ dev_dbg(snand->dev, "%s: reg 0%x\n", __func__, opcode); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_write_enable(struct spi_nand *snand) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 1; -+ cmd->cmd[0] = SPI_NAND_WRITE_ENABLE; -+ -+ dev_dbg(snand->dev, "%s\n", __func__); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_write_disable(struct spi_nand *snand) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 1; -+ cmd->cmd[0] = SPI_NAND_WRITE_DISABLE; -+ -+ dev_dbg(snand->dev, "%s\n", __func__); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_write_page(struct spi_nand *snand, -+ unsigned int page_addr) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 4; -+ cmd->cmd[0] = SPI_NAND_PROGRAM_EXEC; -+ cmd->cmd[1] = (u8)((page_addr & 0xff0000) >> 16); -+ cmd->cmd[2] = (u8)((page_addr & 0xff00) >> 8); -+ cmd->cmd[3] = (u8)(page_addr & 0xff); -+ -+ dev_dbg(snand->dev, "%s: page 0x%x\n", __func__, page_addr); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_store_cache(struct spi_nand *snand, -+ unsigned int page_offset, size_t length, -+ u8 *write_buf) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ struct spi_device *spi = snand_dev->spi; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 3; -+ cmd->cmd[0] = spi->mode & SPI_TX_QUAD ? SPI_NAND_PROGRAM_LOAD4 : -+ SPI_NAND_PROGRAM_LOAD; -+ cmd->cmd[1] = (u8)((page_offset & 0xff00) >> 8); -+ cmd->cmd[2] = (u8)(page_offset & 0xff); -+ cmd->n_tx = length; -+ cmd->tx_buf = write_buf; -+ cmd->tx_nbits = spi->mode & SPI_TX_QUAD ? 4 : 1; -+ -+ dev_dbg(snand->dev, "%s: offset 0x%x\n", __func__, page_offset); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_load_page(struct spi_nand *snand, -+ unsigned int page_addr) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 4; -+ cmd->cmd[0] = SPI_NAND_PAGE_READ; -+ cmd->cmd[1] = (u8)((page_addr & 0xff0000) >> 16); -+ cmd->cmd[2] = (u8)((page_addr & 0xff00) >> 8); -+ cmd->cmd[3] = (u8)(page_addr & 0xff); -+ -+ dev_dbg(snand->dev, "%s: page 0x%x\n", __func__, page_addr); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_read_cache(struct spi_nand *snand, -+ unsigned int page_offset, size_t length, -+ u8 *read_buf) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ struct spi_device *spi = snand_dev->spi; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ if ((spi->mode & SPI_RX_DUAL) || (spi->mode & SPI_RX_QUAD)) -+ cmd->n_cmd = 5; -+ else -+ cmd->n_cmd = 4; -+ cmd->cmd[0] = (spi->mode & SPI_RX_QUAD) ? SPI_NAND_READ_CACHE_X4 : -+ ((spi->mode & SPI_RX_DUAL) ? SPI_NAND_READ_CACHE_X2 : -+ SPI_NAND_READ_CACHE); -+ cmd->cmd[1] = 0; /* dummy byte */ -+ cmd->cmd[2] = (u8)((page_offset & 0xff00) >> 8); -+ cmd->cmd[3] = (u8)(page_offset & 0xff); -+ cmd->cmd[4] = 0; /* dummy byte */ -+ cmd->n_rx = length; -+ cmd->rx_buf = read_buf; -+ cmd->rx_nbits = (spi->mode & SPI_RX_QUAD) ? 4 : -+ ((spi->mode & SPI_RX_DUAL) ? 2 : 1); -+ -+ dev_dbg(snand->dev, "%s: offset 0x%x\n", __func__, page_offset); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_device_block_erase(struct spi_nand *snand, -+ unsigned int page_addr) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 4; -+ cmd->cmd[0] = SPI_NAND_BLOCK_ERASE; -+ cmd->cmd[1] = (u8)((page_addr & 0xff0000) >> 16); -+ cmd->cmd[2] = (u8)((page_addr & 0xff00) >> 8); -+ cmd->cmd[3] = (u8)(page_addr & 0xff); -+ -+ dev_dbg(snand->dev, "%s: block 0x%x\n", __func__, page_addr); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static int spi_nand_gd5f_read_id(struct spi_nand *snand, u8 *buf) -+{ -+ struct spi_nand_device *snand_dev = snand->priv; -+ struct spi_nand_device_cmd *cmd = &snand_dev->cmd; -+ -+ memset(cmd, 0, sizeof(struct spi_nand_device_cmd)); -+ cmd->n_cmd = 1; -+ cmd->cmd[0] = SPI_NAND_READ_ID; -+ cmd->n_rx = SPI_NAND_GD5F_READID_LEN; -+ cmd->rx_buf = buf; -+ -+ dev_dbg(snand->dev, "%s\n", __func__); -+ -+ return spi_nand_send_command(snand_dev->spi, cmd); -+} -+ -+static void spi_nand_gd5f_ecc_status(unsigned int status, -+ unsigned int *corrected, -+ unsigned int *ecc_error) -+{ -+ unsigned int ecc_status = (status >> SPI_NAND_GD5F_ECC_SHIFT) & -+ SPI_NAND_GD5F_ECC_MASK; -+ -+ *ecc_error = (ecc_status == SPI_NAND_GD5F_ECC_UNCORR) ? 1 : 0; -+ if (*ecc_error == 0) -+ *corrected = (ecc_status > 1) ? (2 + ecc_status) : 0; -+} -+ -+static int spi_nand_device_probe(struct spi_device *spi) -+{ -+ enum spi_nand_device_variant variant; -+ struct spi_nand_device *priv; -+ struct spi_nand *snand; -+ int ret; -+ -+ priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL); -+ if (!priv) -+ return -ENOMEM; -+ -+ snand = &priv->spi_nand; -+ -+ snand->read_cache = spi_nand_device_read_cache; -+ snand->load_page = spi_nand_device_load_page; -+ snand->store_cache = spi_nand_device_store_cache; -+ snand->write_page = spi_nand_device_write_page; -+ snand->write_reg = spi_nand_device_write_reg; -+ snand->read_reg = spi_nand_device_read_reg; -+ snand->block_erase = spi_nand_device_block_erase; -+ snand->reset = spi_nand_device_reset; -+ snand->write_enable = spi_nand_device_write_enable; -+ snand->write_disable = spi_nand_device_write_disable; -+ snand->dev = &spi->dev; -+ snand->priv = priv; -+ -+ /* This'll mean we won't need to specify any specific compatible string -+ * for a given device, and instead just support spi-nand. -+ */ -+ variant = spi_get_device_id(spi)->driver_data; -+ switch (variant) { -+ case SPI_NAND_GD5F: -+ snand->read_id = spi_nand_gd5f_read_id; -+ snand->get_ecc_status = spi_nand_gd5f_ecc_status; -+ snand->ooblayout = &spi_nand_gd5f_oob_256_ops; -+ break; -+ default: -+ dev_err(snand->dev, "unknown device\n"); -+ return -ENODEV; -+ } -+ -+ spi_set_drvdata(spi, snand); -+ priv->spi = spi; -+ -+ ret = spi_nand_register(snand, spi_nand_flash_ids); -+ if (ret) -+ return ret; -+ return 0; -+} -+ -+static int spi_nand_device_remove(struct spi_device *spi) -+{ -+ struct spi_nand *snand = spi_get_drvdata(spi); -+ -+ spi_nand_unregister(snand); -+ -+ return 0; -+} -+ -+const struct spi_device_id spi_nand_id_table[] = { -+ { "spi-nand", SPI_NAND_GENERIC }, -+ { "gd5f", SPI_NAND_GD5F }, -+ { }, -+}; -+MODULE_DEVICE_TABLE(spi, spi_nand_id_table); -+ -+static struct spi_driver spi_nand_device_driver = { -+ .driver = { -+ .name = "spi_nand_device", -+ .owner = THIS_MODULE, -+ }, -+ .id_table = spi_nand_id_table, -+ .probe = spi_nand_device_probe, -+ .remove = spi_nand_device_remove, -+}; -+module_spi_driver(spi_nand_device_driver); -+ -+MODULE_AUTHOR("Ezequiel Garcia "); -+MODULE_DESCRIPTION("SPI NAND device support"); -+MODULE_LICENSE("GPL v2"); diff --git a/target/linux/pistachio/patches-4.14/901-MIPS-DTS-img-marduk-add-nor-partition-name.patch b/target/linux/pistachio/patches-4.14/901-MIPS-DTS-img-marduk-add-nor-partition-name.patch deleted file mode 100644 index 6af11eaa3..000000000 --- a/target/linux/pistachio/patches-4.14/901-MIPS-DTS-img-marduk-add-nor-partition-name.patch +++ /dev/null @@ -1,20 +0,0 @@ -From b5f49b448cd3c7ab930f1a53c88f739a86071df8 Mon Sep 17 00:00:00 2001 -From: Ian Pozella -Date: Mon, 20 Feb 2017 10:38:07 +0000 -Subject: MIPS: DTS: img: marduk: add nor partition name - -Signed-off-by: Ian Pozella ---- - arch/mips/boot/dts/img/pistachio_marduk.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/mips/boot/dts/img/pistachio_marduk.dts -+++ b/arch/mips/boot/dts/img/pistachio_marduk.dts -@@ -90,6 +90,7 @@ - compatible = "spansion,s25fl016k", "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <50000000>; -+ linux,mtd-name = "spi-nor"; - }; - }; - diff --git a/target/linux/pistachio/patches-4.14/902-MIPS-DTS-img-marduk-add-nand-device-support.patch b/target/linux/pistachio/patches-4.14/902-MIPS-DTS-img-marduk-add-nand-device-support.patch deleted file mode 100644 index bd03f0812..000000000 --- a/target/linux/pistachio/patches-4.14/902-MIPS-DTS-img-marduk-add-nand-device-support.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c13cfb3a49cf1578bb85f19a7066f262503a39ba Mon Sep 17 00:00:00 2001 -From: Abhimanyu Vishwakarma -Date: Thu, 24 Nov 2016 19:26:46 +0530 -Subject: MIPS: DTS: img: marduk: add nand device support - -Signed-off-by: Abhimanyu Vishwakarma ---- - arch/mips/boot/dts/img/pistachio_marduk.dts | 11 +++++++++++ - 1 file changed, 11 insertions(+) - ---- a/arch/mips/boot/dts/img/pistachio_marduk.dts -+++ b/arch/mips/boot/dts/img/pistachio_marduk.dts -@@ -92,6 +92,17 @@ - spi-max-frequency = <50000000>; - linux,mtd-name = "spi-nor"; - }; -+ flash@1 { -+ compatible = "gigadevice,gd5f"; -+ reg = <1>; -+ spi-max-frequency = <50000000>; -+ nand-on-flash-bbt; -+ spi-rx-bus-width = <2>; -+ spi-tx-bus-width = <4>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ linux,mtd-name = "spi-nand"; -+ }; - }; - - &uart0 { diff --git a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch index 333258767..39989ecca 100644 --- a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch +++ b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch @@ -14,7 +14,7 @@ Signed-off-by: René van Dorst --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -2793,6 +2793,7 @@ static const struct net_device_ops mtk_n +@@ -2887,6 +2887,7 @@ static const struct net_device_ops mtk_n static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) { @@ -22,7 +22,7 @@ Signed-off-by: René van Dorst const __be32 *_id = of_get_property(np, "reg", NULL); struct phylink *phylink; int phy_mode, id, err; -@@ -2885,6 +2886,9 @@ static int mtk_add_mac(struct mtk_eth *e +@@ -2979,6 +2980,9 @@ static int mtk_add_mac(struct mtk_eth *e eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN; diff --git a/target/linux/x86/patches-5.4/011-tune_lzma_options.patch b/target/linux/x86/patches-5.4/011-tune_lzma_options.patch index 8070af608..451c5bcb0 100644 --- a/target/linux/x86/patches-5.4/011-tune_lzma_options.patch +++ b/target/linux/x86/patches-5.4/011-tune_lzma_options.patch @@ -4,11 +4,11 @@ # --------------------------------------------------------------------------- quiet_cmd_lzma = LZMA $@ -- cmd_lzma = { cat $(real-prereqs) | lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so; $(size_append); } > $@ -+ cmd_lzma = { cat $(real-prereqs) | lzma e -lc8 -eos -si -so; $(size_append); } > $@ +- cmd_lzma = { cat $(real-prereqs) | $(LZMA) e -d20 -lc1 -lp2 -pb2 -eos -si -so; $(size_append); } > $@ ++ cmd_lzma = { cat $(real-prereqs) | $(LZMA) e -lc8 -eos -si -so; $(size_append); } > $@ quiet_cmd_lzo = LZO $@ - cmd_lzo = { cat $(real-prereqs) | lzop -9; $(size_append); } > $@ + cmd_lzo = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ --- a/arch/x86/include/asm/boot.h +++ b/arch/x86/include/asm/boot.h @@ -24,7 +24,7 @@