From 404209f6c4bcdeb5c2267f76b3b2bfce40ceda15 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 26 Aug 2020 11:31:50 +0800 Subject: [PATCH] kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350) kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350) 431fb8c mac80211: add AQL improvements 6bdd4c9 mac80211: add missing backports for building with 4.14 kernels 0106820 mac80211: add missing return code checks in AQL improvements e7f7101 mac80211: rework encapsulation offload support [package] base-files: add function for generating random MAC dnsmasq: abort dhcp_check on interface state boot: sync upstream source code ath10k-ct-firmware/mt76/sch_cake: update to latest git HEAD [script] download: add China Mirror Station [target] Sync: arc770, ath79, bcm63xx, kirkwood, lantiq, layerscape, mediatek, mvebu, octeon, oxnas, pistachio, uml Sync most of the target patches. Run-compiled-on: ipq40xx (4.19 & 5.4), ramips --- include/kernel-version.mk | 12 +- include/target.mk | 2 +- package/base-files/Makefile | 2 +- package/base-files/files/bin/config_generate | 8 +- .../base-files/files/lib/functions/system.sh | 12 + package/boot/mt7623n-preloader/Makefile | 61 + package/boot/tfa-layerscape/Makefile | 105 +- package/boot/uboot-envtools/files/ar71xx | 1 + package/boot/uboot-envtools/files/ath79 | 19 +- package/boot/uboot-envtools/files/imx6 | 36 +- package/boot/uboot-envtools/files/ipq806x | 1 + package/boot/uboot-envtools/files/kirkwood | 7 +- package/boot/uboot-envtools/files/mvebu | 3 +- package/boot/uboot-envtools/files/ramips | 1 + package/boot/uboot-kirkwood/Makefile | 12 + ...-kirkwood-add-CheckPoint-L-50-device.patch | 928 + .../uboot-kirkwood/patches/160-nsa310s.patch | 54 + .../patches/200-openwrt-config.patch | 46 +- ...xx-add-support-for-RGMII-TX-RX-delay.patch | 53 + ...-mv88e61xx-add-support-for-MV88E6171.patch | 67 + package/boot/uboot-layerscape/Makefile | 54 +- ...rdm-uEnv.txt => fsl_ls1012a-frdm-uEnv.txt} | 0 ...v.txt => fsl_ls1012a-frwy-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1012a-rdb-uEnv.txt} | 2 +- ...nv.txt => fsl_ls1021a-iot-sdboot-uEnv.txt} | 0 ...nv.txt => fsl_ls1021a-twr-sdboot-uEnv.txt} | 0 ...atwr-uEnv.txt => fsl_ls1021a-twr-uEnv.txt} | 2 +- ...nv.txt => fsl_ls1043a-rdb-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1043a-rdb-uEnv.txt} | 2 +- ...nv.txt => fsl_ls1046a-rdb-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1046a-rdb-uEnv.txt} | 2 +- ...nv.txt => fsl_ls1088a-rdb-sdboot-uEnv.txt} | 0 ...ardb-uEnv.txt => fsl_ls1088a-rdb-uEnv.txt} | 2 +- ...ardb-uEnv.txt => fsl_ls2088a-rdb-uEnv.txt} | 2 +- package/boot/uboot-mediatek/Makefile | 29 +- .../patches/005-update-bpir2-defconfig.patch | 18 + .../patches/006-mt7623-pinctrl-fix.patch | 237 + .../patches/007-env-fat-use-bootdevice.patch | 97 + ...ix-mmc_get_boot_dev-for-platforms-wi.patch | 51 + ...-Add-support-for-UniElec-U7623-board.patch | 326 + .../patches/010-no-binman.patch | 25 + .../patches/010-update-u7623-defconfig.patch | 17 + package/boot/uboot-mvebu/Makefile | 8 + package/firmware/ath10k-ct-firmware/Makefile | 60 +- .../firmware/layerscape/fman-ucode/Makefile | 6 +- package/firmware/layerscape/ls-dpl/Makefile | 10 +- package/firmware/layerscape/ls-mc/Makefile | 6 +- package/firmware/layerscape/ls-rcw/Makefile | 48 +- package/firmware/linux-firmware/misc.mk | 9 + package/kernel/broadcom-wl/Makefile | 2 +- .../broadcom-wl/files/lib/wifi/broadcom.sh | 2 +- package/kernel/kmod-sched-cake-oot/Makefile | 6 +- package/kernel/lantiq/ltq-vmmc/Makefile | 4 +- .../kernel/lantiq/ltq-vmmc/files/vmmc.init | 16 +- package/kernel/linux/modules/block.mk | 40 + package/kernel/linux/modules/crypto.mk | 10 +- package/kernel/linux/modules/lib.mk | 1 - package/kernel/linux/modules/other.mk | 22 +- package/kernel/linux/modules/usb.mk | 2 +- package/kernel/linux/modules/wpan.mk | 19 + ...backports-add-netif_receive_skb_list.patch | 30 + .../071-backports-add-skb_list_del_init.patch | 24 + ...e-provided-via-status-rate-on-ieee80.patch | 151 + ...out-code-to-look-up-the-average-pack.patch | 187 + ...-AQL-aggregation-estimation-for-low-.patch | 67 + ...-rework-tx-encapsulation-offload-API.patch | 651 + ...e-duplication-in-tx-status-functions.patch | 197 + ...tx-status-call-to-ieee80211_sta_regi.patch | 26 + ...-optimize-station-connection-monitor.patch | 174 + ...ED_TXPROCESSING-and-HW_80211_ENCAP-t.patch | 227 + ...02.3-offload-and-802.11-tx-status-co.patch | 159 + ...sing-queue-hash-initialization-to-80.patch | 25 + ...nd-refresh-aggregation-session-in-en.patch | 45 + ...-using-ieee80211_tx_status_ext-to-fr.patch | 63 + ...ieee80211_tx_status_ext-to-support-b.patch | 53 + ...the-driver-when-a-sta-uses-4-address.patch | 109 + ...cap-offload-for-tx-multicast-control.patch | 158 + ...o-control.hw_key-for-encap-offload-p.patch | 31 + .../500-mac80211_configure_antenna_gain.patch | 6 +- .../701-mac80211-build-on-linux_4_14.patch | 30 - package/kernel/mt76/Makefile | 6 +- package/kernel/nat46/Makefile | 6 +- .../nat46/patches/100-kernel-5.4-compat.patch | 34 - package/kernel/om-watchdog/Makefile | 2 +- .../kernel/om-watchdog/files/om-watchdog.init | 2 +- .../services/dnsmasq/files/dnsmasq.init | 6 +- package/network/utils/ltq-dsl-base/Makefile | 32 + .../files}/etc/hotplug.d/dsl/led_dsl.sh | 0 .../files}/etc/hotplug.d/dsl/pppoa.sh | 0 .../files}/lib/functions/lantiq_dsl.sh | 4 +- .../ltq-dsl-base/files}/sbin/dsl_notify.sh | 0 package/system/zram-swap/Makefile | 4 +- package/system/zram-swap/files/zram.init | 8 +- package/utils/busybox/Config-defaults.in | 4 +- .../patches/130-mconf_missing_sigwinch.patch | 13 - package/utils/ravpower-mcu/Makefile | 2 +- scripts/download.pl | 7 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 6 +- .../lib/preinit/05_set_iface_mac_apm821xx | 2 +- target/linux/apm821xx/image/Makefile | 1 + target/linux/apm821xx/image/nand.mk | 6 +- target/linux/apm821xx/image/sata.mk | 3 +- target/linux/apm821xx/nand/target.mk | 2 +- ...mware-loader-for-uPD720201-and-uPD72.patch | 6 +- ...mware-loader-for-uPD720201-and-uPD72.patch | 14 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- .../apm821xx/sata/profiles/00-default.mk | 2 +- .../910-unaligned_access_hacks.patch | 2 +- target/linux/arc770/Makefile | 2 +- .../arc770/base-files/etc/board.d/02_network | 2 +- target/linux/arc770/base-files/lib/arc.sh | 39 - .../base-files/lib/preinit/01_preinit_arc.sh | 7 - target/linux/arc770/config-5.4 | 199 + .../arc770/generic/profiles/00-default.mk | 2 +- ...c-Disable-frame-filtering-completely.patch | 31 + .../archs38/base-files/etc/board.d/02_network | 3 +- target/linux/archs38/base-files/lib/arc.sh | 43 - .../base-files/lib/preinit/01_preinit_arc.sh | 7 - .../archs38/generic/profiles/00-default.mk | 2 +- target/linux/at91/image/sam9x.mk | 3 +- target/linux/at91/image/sama5d4.mk | 0 target/linux/ath25/Makefile | 2 +- .../lib/preinit/15_preinit_iface_atheros | 9 +- target/linux/ath25/image/Makefile | 6 +- target/linux/ath79/config-4.19 | 1 + target/linux/ath79/config-5.4 | 1 + .../ath79/dts/ar7161_dlink_dir-825-b1.dts | 2 +- .../ath79/dts/ar7161_ubnt_routerstation.dts | 2 +- target/linux/ath79/dts/ar7240.dtsi | 2 + .../ath79/dts/ar7240_buffalo_whr-g301n.dts | 2 - .../ath79/dts/ar7240_dlink_dir-615-e4.dts | 4 - .../ath79/dts/ar7240_netgear_wnr1000-v2.dts | 2 - .../ath79/dts/ar7240_netgear_wnr612-v2.dtsi | 2 - .../linux/ath79/dts/ar7240_tplink_tl-wa.dtsi | 4 + .../linux/ath79/dts/ar7240_tplink_tl-wr.dtsi | 2 - .../ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts | 2 +- target/linux/ath79/dts/ar7241.dtsi | 2 + .../ath79/dts/ar7241_netgear_wnr2000-v3.dts | 3 +- .../ath79/dts/ar7241_netgear_wnr2200.dtsi | 3 +- target/linux/ath79/dts/ar7241_tplink.dtsi | 6 - .../ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 6 - .../linux/ath79/dts/ar7241_ubnt_airrouter.dts | 2 +- .../ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts | 2 +- .../ath79/dts/ar7241_ubnt_nanobridge-m.dts | 2 +- .../dts/ar7241_ubnt_nanostation-loco-m.dts | 2 +- .../ath79/dts/ar7241_ubnt_nanostation-m.dts | 2 +- .../ath79/dts/ar7241_ubnt_picostation-m.dts | 2 +- .../ath79/dts/ar7241_ubnt_powerbridge-m.dts | 15 + .../linux/ath79/dts/ar7241_ubnt_rocket-m.dts | 2 +- target/linux/ath79/dts/ar7241_ubnt_unifi.dts | 4 +- .../ath79/dts/ar9132_tplink_tl-wr941-v2.dts | 20 +- target/linux/ath79/dts/ar9330.dtsi | 2 - .../linux/ath79/dts/ar9330_dlink_dir-505.dts | 2 - .../ath79/dts/ar9330_glinet_gl-ar150.dts | 4 - target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 4 - .../ath79/dts/ar9331_8dev_carambola2.dts | 4 - .../ath79/dts/ar9331_alfa-network_ap121f.dts | 4 - target/linux/ath79/dts/ar9331_arduino_yun.dts | 223 + .../dts/ar9331_embeddedwireless_dorin.dts | 4 - .../linux/ath79/dts/ar9331_etactica_eg200.dts | 4 - .../linux/ath79/dts/ar9331_glinet_64xx.dtsi | 4 - .../linux/ath79/dts/ar9331_glinet_gl-mifi.dts | 152 + .../linux/ath79/dts/ar9331_pisen_ts-d084.dts | 4 - .../linux/ath79/dts/ar9331_pisen_wmm003n.dts | 4 - .../ath79/dts/ar9331_tplink_tl-mr3020-v1.dts | 4 - .../ath79/dts/ar9331_tplink_tl-mr3040-v2.dts | 4 - .../dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi | 4 - .../ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi | 39 + .../ath79/dts/ar9331_tplink_tl-wr710n-v1.dts | 122 +- .../dts/ar9331_tplink_tl-wr710n-v2.1.dts | 9 + .../ath79/dts/ar9331_tplink_tl-wr710n.dtsi | 88 + .../dts/ar9331_tplink_tl-wr741nd-v4.dtsi | 4 - target/linux/ath79/dts/ar9341_pcs_cr3000.dts | 4 - .../linux/ath79/dts/ar9341_pisen_wmb001n.dts | 4 - target/linux/ath79/dts/ar9341_tplink.dtsi | 11 - .../ath79/dts/ar9341_tplink_tl-mr3420-v2.dts | 23 +- .../ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts | 52 + .../ath79/dts/ar9341_tplink_tl-wr841-v8.dts | 24 +- .../ath79/dts/ar9341_tplink_tl-wr842n-v2.dts | 27 +- .../linux/ath79/dts/ar9342_ubnt_lap-120.dts | 5 +- target/linux/ath79/dts/ar9342_ubnt_wa.dtsi | 4 - target/linux/ath79/dts/ar9342_ubnt_xw.dtsi | 4 - .../ath79/dts/ar9344_aerohive_hiveap-121.dts | 2 - .../ath79/dts/ar9344_compex_wpj344-16m.dts | 153 + .../ath79/dts/ar9344_devolo_magic-2-wifi.dts | 2 - .../ath79/dts/ar9344_enterasys_ws-ap3705i.dts | 4 - .../ar9344_mikrotik_routerboard-sxt-5n.dtsi | 193 + ...ar9344_mikrotik_routerboard-sxt-5nd-r2.dts | 9 + .../linux/ath79/dts/ar9344_netgear_wndr.dtsi | 43 +- .../ath79/dts/ar9344_netgear_wndr3700-v4.dts | 2 + .../ath79/dts/ar9344_netgear_wndr4300.dts | 2 + .../ath79/dts/ar9344_netgear_wndr4300sw.dts | 2 + .../ath79/dts/ar9344_netgear_wndr4300tn.dts | 9 + .../ath79/dts/ar9344_netgear_wndr_usb.dtsi | 34 + .../ath79/dts/ar9344_netgear_wndr_wan.dtsi | 13 + .../linux/ath79/dts/ar9344_ocedo_raccoon.dts | 4 - target/linux/ath79/dts/ar9344_pcs_cap324.dts | 4 - target/linux/ath79/dts/ar9344_pcs_cr5000.dts | 4 - target/linux/ath79/dts/ar9344_qihoo_c301.dts | 6 +- .../ath79/dts/ar9344_tplink_tl-wdr4300.dtsi | 2 +- .../ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi | 2 +- .../linux/ath79/dts/ar9344_wd_mynet-n750.dts | 4 +- .../ath79/dts/ar9344_zbtlink_zbt-wd323.dts | 2 - target/linux/ath79/dts/ar934x.dtsi | 36 +- target/linux/ath79/dts/qca9531_8dev_lima.dts | 115 + .../ath79/dts/qca9531_comfast_cf-e313ac.dts | 3 +- .../ath79/dts/qca9531_comfast_cf-e314n-v2.dts | 5 +- .../linux/ath79/dts/qca9531_comfast_cf-e5.dts | 5 +- .../ath79/dts/qca9531_comfast_cf-ew72.dts | 1 + .../ath79/dts/qca9531_compex_wpj531-16m.dts | 8 +- .../ath79/dts/qca9531_dlink_dch-g020-a1.dts | 171 + .../ath79/dts/qca9531_engenius_ews511ap.dts | 4 - .../ath79/dts/qca9531_glinet_gl-ar300m.dtsi | 4 +- .../ath79/dts/qca9531_glinet_gl-ar750.dts | 5 +- .../ath79/dts/qca9531_glinet_gl-e750.dts | 140 + .../ath79/dts/qca9531_glinet_gl-x750.dts | 5 +- target/linux/ath79/dts/qca9531_telco_t1.dts | 144 + .../dts/qca9531_tplink_archer-d50-v1.dts | 8 +- .../ath79/dts/qca9531_tplink_tl-mr3420-v3.dts | 8 +- .../linux/ath79/dts/qca9531_yuncore_a770.dts | 31 +- .../ath79/dts/qca9533_comfast_cf-e110n-v2.dts | 5 +- .../ath79/dts/qca9533_dlink_dap-1330-a1.dts | 9 + .../ath79/dts/qca9533_dlink_dap-1365-a1.dts | 9 + .../ath79/dts/qca9533_dlink_dap-13xx.dtsi | 127 + .../dts/qca9533_mikrotik_routerboard-16m.dtsi | 87 + .../qca9533_mikrotik_routerboard-lhg-2nd.dts | 9 + .../qca9533_mikrotik_routerboard-lhg-hb.dtsi | 88 + .../ath79/dts/qca9533_tplink_cpe220-v3.dts | 2 - .../ath79/dts/qca9533_tplink_cpexxx.dtsi | 14 +- .../dts/qca9533_tplink_tl-wa850re-v2.dts | 14 +- .../ath79/dts/qca9533_tplink_tl-wr802n.dtsi | 14 +- .../ath79/dts/qca9533_tplink_tl-wr841.dtsi | 8 +- .../ath79/dts/qca9533_tplink_tl-wr842n-v3.dts | 8 +- .../linux/ath79/dts/qca9533_ubnt_acb-isp.dts | 5 +- .../ath79/dts/qca953x_tplink_tl-wr810n.dtsi | 8 +- .../linux/ath79/dts/qca9557_8dev_rambutan.dts | 131 + .../linux/ath79/dts/qca9557_zyxel_nbg6616.dts | 126 + .../dts/qca9558_allnet_all-wap02860ac.dts | 156 + .../ath79/dts/qca9558_comfast_cf-wr650ac.dtsi | 2 +- .../ath79/dts/qca9558_devolo_dvl1xxx.dtsi | 4 - .../qca9558_librerouter_librerouter-v1.dts | 4 - ..._mikrotik_routerboard-921gs-5hpacd-15s.dts | 30 + ...58_mikrotik_routerboard-922uags-5hpacd.dts | 126 +- .../dts/qca9558_mikrotik_routerboard-92x.dtsi | 132 + .../ath79/dts/qca9558_tplink_archer-c.dtsi | 4 - .../linux/ath79/dts/qca9558_tplink_rex5x.dtsi | 4 - .../ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi | 6 +- .../ath79/dts/qca9558_trendnet_tew-823dru.dts | 6 +- .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 164 +- target/linux/ath79/dts/qca955x.dtsi | 36 +- .../ath79/dts/qca955x_zyxel_nbg6x16.dtsi | 138 + .../linux/ath79/dts/qca9561_avm_fritz4020.dts | 4 - .../ath79/dts/qca9561_tplink_archer-c5x.dtsi | 4 - .../ath79/dts/qca9561_xiaomi_mi-router-4q.dts | 4 - .../linux/ath79/dts/qca9563_compex_wpj563.dts | 145 + .../ath79/dts/qca9563_dlink_dir-842-c.dtsi | 2 +- .../ath79/dts/qca9563_dlink_dir-859-a1.dts | 6 +- .../dts/qca9563_glinet_gl-ar750s-nor-nand.dts | 17 +- .../dts/qca9563_glinet_gl-ar750s-nor.dts | 12 +- .../ath79/dts/qca9563_glinet_gl-ar750s.dtsi | 15 +- .../linux/ath79/dts/qca9563_netgear_wndr.dtsi | 2 +- .../linux/ath79/dts/qca9563_phicomm_k2t.dts | 6 +- .../ath79/dts/qca9563_rosinson_wr818.dts | 4 - .../ath79/dts/qca9563_tplink_archer-c2-v3.dts | 4 - .../ath79/dts/qca9563_tplink_archer-c7-v4.dts | 4 - .../dts/qca9563_tplink_archer-x6-v2.dtsi | 4 - .../dts/qca9563_tplink_archer-x7-v5.dtsi | 6 +- .../linux/ath79/dts/qca9563_tplink_re450.dtsi | 4 - .../dts/qca9563_tplink_tl-wpa8630-v1.dts | 47 + .../ath79/dts/qca9563_tplink_tl-wpa8630.dtsi | 139 + .../dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts | 29 + .../dts/qca9563_tplink_tl-wpa8630p-v2-int.dts | 29 + .../dts/qca9563_tplink_tl-wpa8630p-v2.dtsi | 43 + .../ath79/dts/qca9563_tplink_tl-wr1043n.dtsi | 4 - .../ath79/dts/qca9563_ubnt_unifiac-lite.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-lr.dts | 2 +- .../dts/qca9563_ubnt_unifiac-mesh-pro.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-mesh.dts | 2 +- .../ath79/dts/qca9563_ubnt_unifiac-pro.dts | 2 +- .../linux/ath79/dts/qca9563_ubnt_unifiac.dtsi | 4 - .../ath79/dts/qca9563_yuncore_xd4200.dtsi | 6 +- .../generic/base-files/etc/board.d/01_leds | 28 +- .../generic/base-files/etc/board.d/02_network | 43 +- .../base-files/etc/board.d/03_gpio_switches | 3 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 8 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 20 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 10 + .../etc/uci-defaults/04_led_migration | 17 + .../base-files/lib/preinit/10_fix_eth_mac.sh | 5 + target/linux/ath79/generic/target.mk | 2 +- target/linux/ath79/image/common-mikrotik.mk | 14 + target/linux/ath79/image/common-netgear.mk | 5 +- target/linux/ath79/image/generic-tp-link.mk | 47 +- target/linux/ath79/image/generic-ubnt.mk | 32 +- target/linux/ath79/image/generic.mk | 178 +- target/linux/ath79/image/mikrotik.mk | 44 +- target/linux/ath79/image/nand.mk | 52 +- target/linux/ath79/image/tiny-netgear.mk | 32 +- target/linux/ath79/image/tiny-tp-link.mk | 10 + .../mikrotik/base-files/etc/board.d/01_leds | 26 + .../base-files/etc/board.d/02_network | 10 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 20 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../base-files/lib/upgrade/platform.sh | 7 +- target/linux/ath79/mikrotik/target.mk | 2 +- .../nand/base-files/etc/board.d/02_network | 7 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 5 + .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 5 + target/linux/ath79/nand/target.mk | 2 +- .../910-unaligned_access_hacks.patch | 4 +- ...support-for-boot-console-with-arbitr.patch | 54 + ...S-ath79-select-the-PINCTRL-subsystem.patch | 2 +- .../0032-MIPS-ath79-sanitize-symbols.patch | 2 +- .../910-unaligned_access_hacks.patch | 4 +- ...support-for-boot-console-with-arbitr.patch | 54 + .../ath79/tiny/base-files/etc/board.d/01_leds | 1 + .../tiny/base-files/etc/board.d/02_network | 1 + target/linux/ath79/tiny/target.mk | 2 +- target/linux/bcm27xx/image/Makefile | 8 +- ...smsx95xx-fix-crimes-against-truesize.patch | 4 +- ...ompletely-disable-the-spidev-warning.patch | 2 +- ...8xx-Enable-LEDs-and-auto-negotiation.patch | 6 +- .../950-0049-Add-cpufreq-driver.patch | 2 +- ...78xx-Read-initial-EEE-status-from-DT.patch | 2 +- ...Disable-TCP-Segmentation-Offload-TSO.patch | 4 +- ...e-enabling-of-EEE-into-PHY-init-code.patch | 4 +- ...e-link-events-to-minimize-poll-storm.patch | 17 +- ...xx-EEE-support-is-now-a-PHY-property.patch | 2 +- ...use-default-alignment-for-rx-buffers.patch | 2 +- ...m-Fix-platform-device-unregistration.patch | 27 - ...Show-that-the-VIA-VL805-supports-LPM.patch | 4 +- ...or-host-controllers-that-don-t-updat.patch | 4 +- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 4 +- ...m-Register-vcsm-cma-as-a-platform-dr.patch | 4 +- ...m-Register-bcm2835-codec-as-a-platfo.patch | 4 +- ...m-Unify-the-unload-handling-of-platf.patch | 29 - ...q_arm-Add-a-matching-unregister-call.patch | 25 - ...-inbound-resource-parsing-to-helpers.patch | 2 +- ...v-Fix-CS-polarity-if-GPIO-descriptor.patch | 4 +- .../bcm47xx/base-files/etc/board.d/01_network | 1 + .../generic/profiles/101-Broadcom-wl.mk | 2 +- .../generic/profiles/105-Broadcom-none.mk | 2 +- .../generic/profiles/201-Broadcom-b44-wl.mk | 2 +- .../generic/profiles/205-Broadcom-b44-none.mk | 2 +- .../generic/profiles/211-Broadcom-tg3-wl.mk | 2 +- .../generic/profiles/215-Broadcom-tg3-none.mk | 2 +- .../generic/profiles/221-Broadcom-bgmac-wl.mk | 2 +- .../profiles/225-Broadcom-bgmac-none.mk | 2 +- .../bcm47xx/generic/profiles/PS-1208MFG.mk | 2 +- target/linux/bcm47xx/generic/target.mk | 2 +- target/linux/bcm47xx/image/generic.mk | 24 +- target/linux/bcm47xx/image/legacy.mk | 124 +- target/linux/bcm47xx/image/mips74k.mk | 217 +- .../legacy/profiles/101-Broadcom-wl.mk | 2 +- target/linux/bcm47xx/legacy/target.mk | 2 +- .../mips74k/profiles/102-Broadcom-wl.mk | 2 +- .../mips74k/profiles/103-Broadcom-none.mk | 2 +- target/linux/bcm47xx/mips74k/target.mk | 2 +- .../905-BCM53573-minor-hacks.patch | 2 +- .../bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts | 10 +- target/linux/bcm63xx/image/Makefile | 10 +- ...-brcmnand-improve-hamming-oob-layout.patch | 2 +- ...cmnand-correctly-verify-erased-pages.patch | 63 - ...-mtd-rawnand-brcmnand-fix-CS0-layout.patch | 34 - ...support-second-hw-blinking-interval.patch} | 139 +- ...v5.9-MIPS-BCM63xx-add-endif-comments.patch | 155 + ...CM63xx-improve-CFE-version-detection.patch | 56 + ...rsers-bcm63xx-simplify-CFE-detection.patch | 78 + ...ister-OHCI-controller-if-board-enabl.patch | 2 +- ...ister-EHCI-controller-if-board-enabl.patch | 2 +- ...e-device-registration-code-into-its-.patch | 14 +- ...s-a-mac-addresss-allocator-to-board-.patch | 2 +- .../patches-5.4/309-cfe_version_mod.patch | 27 - .../310-cfe_simplify_detection.patch | 20 - .../311-bcm63xxpart_use_cfedetection.patch | 51 - ...22-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch | 2 +- ...IPS-BCM63XX-add-support-for-BCM63268.patch | 2 +- ...MIPS-BCM63XX-add-support-for-BCM6318.patch | 2 +- .../351-set-board-usbh-ports.patch | 2 +- ...ow-building-support-for-more-than-on.patch | 2 +- ...BCM63XX-make-fallback-sprom-optional.patch | 10 +- ...-support-for-matching-the-board_info.patch | 8 +- ...-register-lookup-for-ephy-reset-gpio.patch | 2 +- ...91-MIPS-BCM63XX-do-not-register-uart.patch | 12 +- ...MIPS-BCM63XX-remove-leds-and-buttons.patch | 8 +- .../patches-5.4/427-boards_probe_switch.patch | 12 +- ...low_better_context_for_board_patches.patch | 56 - ...late-the-compatible-to-board_info-l.patch} | 22 +- .../501-board_bcm6318-brcm-bcm96318ref.patch | 74 + ...-board_bcm6318-brcm-bcm96318ref-p300.patch | 67 + ...03-board_bcm6318-d-link-dsl-275xb-d.patch} | 62 +- .../504-board_bcm6318-sagem-fast-2704n.patch | 68 + ...505-board_bcm6318-comtrend-ar-5315u.patch} | 60 +- ...M63XX-add-96328avng-reference-board.patch} | 27 +- ...M63XX-add-963281TAN-reference-board.patch} | 47 +- ...23-board_bcm6328-d-link-dsl-274xb-f.patch} | 53 +- .../524-board_bcm6328-adb-a4001n1.patch | 68 + ...25-board_bcm6328-comtrend-ar-5387un.patch} | 64 +- ...526-board_bcm6328-comtrend-ar-5381u.patch} | 60 +- .../bcm63xx/patches-5.4/526-board_nb6.patch | 56 - ...27-board_bcm6328-sagem-fast-2704-v2.patch} | 47 +- .../patches-5.4/528-board_A4001N1.patch | 68 - .../528-board_bcm6328-adb-a4001n.patch | 68 + ... 529-board_bcm6328-nucom-r5010un-v2.patch} | 56 +- ...=> 530-board_bcm6328-sercomm-ad1018.patch} | 62 +- ...bcm6328-adb-pdg-a4001n-a-000-1a1-ax.patch} | 56 +- .../patches-5.4/531-board_rta770bw.patch | 39 - .../patches-5.4/533-board_rta770w.patch | 44 - .../patches-5.4/536-board_96318ref.patch | 78 - .../patches-5.4/537-board_96318ref_p300.patch | 69 - .../patches-5.4/538-board_bcm963269bhr.patch | 71 - .../patches-5.4/540-board_vw6339gu.patch | 72 - ... 541-board-bcm6338-d-link-dsl-2640u.patch} | 25 +- .../patches-5.4/541-board_963268gu_p300.patch | 91 - ... 542-board_bcm6338-dynalink-rta1320.patch} | 27 +- .../patches-5.4/547-board_A4001N.patch | 68 - ...rd_bcm6345-dynalink-rta770bw-rta770w.patch | 39 + .../patches-5.4/552-board_fast2704n.patch | 64 - ...4PW.patch => 561-board-bcm6348-D4PW.patch} | 26 +- ...oard_bcm6348-t-com-speedport-w-500v.patch} | 38 +- ...3-board_bcm6348-tecom-gw6000-gw6200.patch} | 70 +- ...h => 564-board-bcm6348-telsey-magic.patch} | 43 +- ...5-board_bcm6348-bt-voyager-2500v-bb.patch} | 45 +- ...> 566-board_bcm6348-bt-voyager-2110.patch} | 28 +- ...CM63XX-add-inventel-Livebox-support.patch} | 36 +- ...bcm6348-comtrend-ct-536plus-ct-5621.patch} | 43 +- ... 569-board_bcm6348-comtrend-ct-5365.patch} | 41 +- ...70-board_bcm6348-telsey-cpva502plus.patch} | 47 +- ...571-board_bcm6348-netgear-dg834g-v4.patch} | 33 +- ...> 572-board_bcm6348-sagem-fast-2604.patch} | 24 +- ...=> 573-board_bcm6348-asmax-ar-1004g.patch} | 32 +- ...h => 601-board-bcm6358-DWV-S0_fixes.patch} | 4 +- ... => 602-board-bcm6358-sfr-neufbox-4.patch} | 96 +- ...=> 603-board-bcm6358-telsey-cpva642.patch} | 36 +- ...04-board_bcm6358-d-link-dsl-274xb-c.patch} | 30 +- ...board_bcm6358-huawei-echolife-hg553.patch} | 45 +- ...oard_bcm6358-t-com-speedport-w-303v.patch} | 26 +- ... 607-board_bcm6358-comtrend-ct-6373.patch} | 42 +- ...board_bcm6358-d-link-dva-g3810bn-tl.patch} | 42 +- ...board_bcm6358-huawei-echolife-hg556.patch} | 138 +- ...oard_bcm6359-huawei-echolife-hg520v.patch} | 44 +- ...> 611-board_bcm6358-bt-home-hub-2-a.patch} | 44 +- .../631-board_bcm6361-sfr-neufbox-6.patch | 52 + ... 632-board_bcm6362-sagem-fast-2504n.patch} | 52 +- ...3-board-bcm6362-netgear-dgnd3700-v2.patch} | 41 +- ... 634-board-bcm6362-huawei-hg253s-v2.patch} | 16 +- ...3xx-add-support-for-96368MVWG-board.patch} | 73 +- ...xx-add-support-for-96368MVNgr-board.patch} | 60 +- ...53-board_bcm6369-comtrend-wap-5813n.patch} | 44 +- ...654-board_bcm6368-comtrend-vr-3025u.patch} | 62 +- ...55-board_bcm6368-comtrend-vr-3025un.patch} | 60 +- ...6-board_bcm6368-zyxel-p870hw-51a-v2.patch} | 58 +- ...7-board_bcm6368-netgear-dgnd3700-v1.patch} | 30 +- ...oard_bcm6368-huawei-echolife-hg655b.patch} | 56 +- ...659-board_bcm6368-comtrend-vr-3026e.patch} | 58 +- ...board_bcm6368-huawei-echolife-hg622.patch} | 54 +- ...> 661-board_bcm6369-netgear-evg2000.patch} | 39 +- ...ch => 662-board_bcm6368-adb-av4202n.patch} | 68 +- ...> 663-board_bcm6368-observa-vh4032n.patch} | 50 +- ... 664-board_bcm6368-actiontec-r1000h.patch} | 30 +- ...681-board_bcm63269-brcm-bcm963269bhr.patch | 67 + .../682-board_bcm63268-inteno-vg50.patch | 67 + ...board_bcm63268-brcm-bcm963268bu-p300.patch | 84 + ...tch => 684-board_bcm63168-sky-sr102.patch} | 55 +- ...85-board-bcm63168-comtrend-vr-3032u.patch} | 53 +- ...686-board-bcm63169-comtrend-vg-8050.patch} | 22 +- ...> 687-board-bcm63167-sercomm-h500-s.patch} | 27 +- target/linux/bcm63xx/profiles/default.mk | 2 +- target/linux/cns3xxx/Makefile | 2 +- .../linux/gemini/image/dns313_gen_hdd_img.sh | 20 +- ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 4 +- ...ption-fix-dwm-158-3g-modem-interface.patch | 2 +- ...y-serial-exar-generalize-rs485-setup.patch | 4 +- ...et-sched-Introduce-act_ctinfo-action.patch | 4 +- ...antage-of-skb-hash-where-appropriate.patch | 2 +- ...atory-attach-detach-methods-for-sfp-.patch | 4 +- ...et-sfp-remove-sfp-bus-use-of-netdevs.patch | 12 +- ...ve-fwnode-parsing-into-sfp-bus-layer.patch | 2 +- ....5-net-sfp-rework-upstream-interface.patch | 12 +- ...fix-sfp_bus_put-kernel-documentation.patch | 2 +- ...et-sfp-add-support-for-module-quirks.patch | 111 - ...sfp-add-some-quirks-for-GPON-modules.patch | 52 - ...Make-affinity-setting-if-activated-o.patch | 129 + ...5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch | 1650 ++ ...-vdso-fix-jalr-t9-crash-in-vdso-code.patch | 54 + ...antage-of-skb-hash-where-appropriate.patch | 2 +- ...ve-fwnode-parsing-into-sfp-bus-layer.patch | 2 +- ....5-net-sfp-rework-upstream-interface.patch | 12 +- ...fix-sfp_bus_put-kernel-documentation.patch | 2 +- ...et-sfp-add-support-for-module-quirks.patch | 111 - ...sfp-add-some-quirks-for-GPON-modules.patch | 52 - ...e6xxx-Add-support-for-port-mirroring.patch | 4 +- ...x-fix-broken-if-statement-because-of.patch | 2 +- ...6-leds-populate-the-device-s-of_node.patch | 2 +- target/linux/generic/config-4.14 | 4 +- target/linux/generic/config-4.19 | 4 +- target/linux/generic/config-5.4 | 10 +- .../generic/files/drivers/net/phy/ar8327.c | 14 +- .../generic/files/drivers/net/phy/ar8327.h | 8 +- .../drivers/platform/mikrotik/rb_hardconfig.c | 9 +- .../drivers/platform/mikrotik/rb_softconfig.c | 113 +- .../drivers/platform/mikrotik/routerboot.c | 10 +- .../generic/hack-4.14/220-gc_sections.patch | 4 +- .../hack-4.14/221-module_exports.patch | 6 +- .../generic/hack-4.14/721-phy_packets.patch | 10 +- .../generic/hack-4.19/204-module_strip.patch | 4 +- .../hack-4.19/221-module_exports.patch | 6 +- .../hack-4.19/259-regmap_dynamic.patch | 2 +- ...protocol-handling-in-the-presence-of.patch | 4 +- .../generic/hack-4.19/721-phy_packets.patch | 10 +- .../generic/hack-5.4/204-module_strip.patch | 4 +- .../generic/hack-5.4/221-module_exports.patch | 6 +- .../generic/hack-5.4/259-regmap_dynamic.patch | 2 +- .../301-mips_image_cmdline_hack.patch | 2 +- ...protocol-handling-in-the-presence-of.patch | 114 - .../generic/hack-5.4/721-phy_packets.patch | 10 +- .../generic/hack-5.4/902-debloat_proc.patch | 4 +- .../hack-5.4/904-debloat_dma_buf.patch | 4 +- ...-to-create-UBI-FS-version-4-on-empty.patch | 63 - ...dd-support-for-threaded-NAPI-polling.patch | 339 + .../810-pci_disable_common_quirks.patch | 6 +- ...-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch | 61 - ...-to-create-UBI-FS-version-4-on-empty.patch | 63 - ...dd-support-for-threaded-NAPI-polling.patch | 339 + .../810-pci_disable_common_quirks.patch | 6 +- ...0-add-linux-spidev-compatible-si3210.patch | 2 +- .../300-mips_expose_boot_raw.patch | 4 +- ...igadevice-Only-one-dummy-byte-in-QUA.patch | 39 + ...46-mtd-spinand-gigadevice-Add-QE-Bit.patch | 67 + ...igadevice-Add-support-for-GD5F4GQ4xC.patch | 87 + ...-to-create-UBI-FS-version-4-on-empty.patch | 66 - .../pending-5.4/630-packet_socket_type.patch | 16 +- ...ng-with-source-address-failed-policy.patch | 22 +- ...dd-support-for-threaded-NAPI-polling.patch | 343 + .../810-pci_disable_common_quirks.patch | 6 +- .../705-net-add-qualcomm-ar40xx-phy.patch | 20 +- ...mem-Add-support-for-krait-based-socs.patch | 2 +- .../kirkwood/base-files/etc/board.d/01_leds | 5 +- .../base-files/etc/board.d/02_network | 11 +- .../base-files/etc/board.d/03_gpio_switches | 18 + .../base-files/etc/board.d/05_compat-version | 21 + .../kirkwood/base-files/etc/init.d/bootcount | 5 +- .../etc/uci-defaults/05_fix-compat-version | 16 + .../base-files/lib/preinit/07_set_iface_mac | 25 + .../base-files/lib/upgrade/platform.sh | 5 +- .../arch/arm/boot/dts/kirkwood-e4200-v2.dts | 8 + ...d-linksys-audi.dts => kirkwood-ea3500.dts} | 4 +- .../arch/arm/boot/dts/kirkwood-ea4500.dts | 8 + .../arch/arm/boot/dts/kirkwood-nsa310s.dts | 271 + target/linux/kirkwood/image/Makefile | 96 +- ...-kirkwood-Add-Check-Point-L-50-board.patch | 485 + ...4500.patch => 105-linksys-viper-dts.patch} | 0 .../linux/kirkwood/patches-5.4/111-l-50.patch | 47 + target/linux/kirkwood/profiles/00-default.mk | 2 +- target/linux/lantiq/falcon/config-5.4 | 2 - .../boot/dts/lantiq/ar9_zyxel_p-2601hn.dts | 24 +- .../lantiq/danube_arcadyan_arv7510pw22.dts | 24 +- .../dts/lantiq/danube_arcadyan_arv7518pw.dts | 24 +- .../dts/lantiq/danube_arcadyan_arv752dpw.dts | 29 +- .../dts/lantiq/vr9_avm_fritz3370-rev2.dtsi | 4 +- .../boot/dts/lantiq/vr9_avm_fritz736x.dtsi | 2 +- .../dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi | 2 +- .../dts/lantiq/amazonse_netgear_dgn1000b.dts | 4 +- .../boot/dts/lantiq/ar9_zyxel_p-2601hn.dts | 24 +- .../lantiq/danube_arcadyan_arv4518pwr01.dtsi | 2 +- .../dts/lantiq/danube_arcadyan_arv4525pw.dts | 2 +- .../lantiq/danube_arcadyan_arv7510pw22.dts | 24 +- .../dts/lantiq/danube_arcadyan_arv7518pw.dts | 26 +- .../dts/lantiq/danube_arcadyan_arv7525pw.dts | 2 +- .../dts/lantiq/danube_arcadyan_arv752dpw.dts | 29 +- .../dts/lantiq/vr9_arcadyan_arv7519rw22.dts | 26 +- .../dts/lantiq/vr9_avm_fritz3370-rev2.dtsi | 4 +- .../boot/dts/lantiq/vr9_avm_fritz7360-v2.dts | 3 - .../boot/dts/lantiq/vr9_avm_fritz7360sl.dts | 3 - .../boot/dts/lantiq/vr9_avm_fritz7362sl.dts | 3 - .../boot/dts/lantiq/vr9_avm_fritz736x.dtsi | 4 +- .../boot/dts/lantiq/vr9_avm_fritz7412.dts | 4 - .../dts/lantiq/vr9_buffalo_wbmr-300hpd.dts | 26 +- .../boot/dts/lantiq/vr9_lantiq_easy80920.dtsi | 32 +- .../boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi | 14 +- .../boot/dts/lantiq/vr9_tplink_vr200.dtsi | 14 +- .../dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi | 2 +- target/linux/lantiq/image/amazonse.mk | 4 +- target/linux/lantiq/image/ar9.mk | 18 +- target/linux/lantiq/image/danube.mk | 27 +- target/linux/lantiq/image/falcon.mk | 2 + target/linux/lantiq/image/tp-link.mk | 8 +- target/linux/lantiq/image/vr9.mk | 30 +- target/linux/lantiq/image/xway_legacy.mk | 15 +- .../lantiq/patches-5.4/0152-lantiq-VPE.patch | 2 +- .../etc/uci-defaults/01_led_migration | 32 + .../xway/base-files/etc/board.d/02_network | 1 + .../etc/uci-defaults/01_led_migration | 8 +- target/linux/lantiq/xway/config-5.4 | 3 + .../etc/uci-defaults/01_led_migration | 28 + target/linux/lantiq/xway_legacy/config-5.4 | 3 + target/linux/layerscape/Makefile | 3 +- .../base-files/lib/preinit/02_sysinfo_fixup | 13 + .../base-files/lib/upgrade/platform.sh | 121 +- target/linux/layerscape/image/Makefile | 3 + target/linux/layerscape/image/armv7.mk | 33 +- target/linux/layerscape/image/armv8_64b.mk | 149 +- ...1028a-rdb-use-Ethernet-PHY-interrupt.patch | 51 - ...92-arm64-dts-ls1028a-Add-DP-DT-nodes.patch | 2 +- ...-LS1028a-rdb-use-Ethernet-PHY-interr.patch | 85 - ...ls1043a-rdb-add-compatible-for-board.patch | 23 + ...an-backup-and-restore-ICID-registers.patch | 8 +- ...tocol-information-to-set-up-the-port.patch | 8 +- ...tc-WA-for-MDIO-register-access-issue.patch | 2 +- ...etc_gregs-with-a-readers-writer-lock.patch | 2 +- ...move-mdio-bus-on-PF-probe-error-path.patch | 2 +- ...s-for-parsing-SGMII-auto-negotiation.patch | 117 - ...-QSGMII-a-valid-PHY-mode-for-in-band.patch | 26 - ...-mac_an_restart-for-SGMII-QSGMII-inb.patch | 29 - ...tc_mdio-definitionns-to-include-linu.patch | 192 - ...FG_HOLD-to-the-recommended-value-of-.patch | 58 - ...do-not-force-Felix-MACs-at-lower-spe.patch | 154 - ...1-net-mscc-ocelot-convert-to-PHYLINK.patch | 689 - ...introduce-more-focused-PCS-ops-for-P.patch | 169 - ...felix-Add-PCS-operations-for-PHYLINK.patch | 442 - ...ort-tsn-capabilities-qbv-qci-qbu-cbs.patch | 2 +- ...x-probing-allocation-and-cleanup-pat.patch | 6 +- ...ocelot-add-VCAP-IS2-rule-to-trap-PTP.patch | 6 +- ...Workaround-to-allow-traffic-to-CPU-i.patch | 2 +- ...felix-Add-PCS-operations-for-PHYLINK.patch | 440 - ...ocelot-introduce-more-focused-PCS-op.patch | 164 - ...t-net-mscc-ocelot-convert-to-PHYLINK.patch | 653 - ...ocelot-do-not-force-Felix-MACs-at-lo.patch | 145 - ...-MDIO_CFG_HOLD-to-the-recommended-va.patch | 55 - ...ort-enetc_mdio-definitionns-to-inclu.patch | 192 - ...nk-call-mac_an_restart-for-SGMII-QSG.patch | 26 - ...nk-make-QSGMII-a-valid-PHY-mode-for-.patch | 23 - ...elpers-for-parsing-SGMII-auto-negoti.patch | 110 - ...oC-fsl_sai-Fix-noise-when-using-EDMA.patch | 2 +- ...-ASoC-fsl_sai-Add-support-for-imx8qm.patch | 2 +- ...l_sai-Add-support-for-imx7ulp-imx8mq.patch | 2 +- ..._sai-Add-support-for-SAI-new-version.patch | 31 +- ...mx-pcm-dma-v2-platform-driver-part-2.patch | 38 - ...oC-fsl_sai-support-latest-sai-module.patch | 4 +- ...-fsl_sai-refine-the-pm-runtime-funct.patch | 4 +- ...sl-fix-wrong-usage-of-filter_data-pa.patch | 30 - ...C-fsl_sai-support-multi-fifo-and-DSD.patch | 2 +- ...LK-17580-ASoC-fsl-sai-Use-DSD-helper.patch | 2 +- ...SoC-fsl-sai-check-for-pinctrl-status.patch | 2 +- ...-build-failture-due-to-5.1-RC7-upgra.patch | 2 +- ...C-fsl_sai-Mark-cache-dirty-at-resume.patch | 2 +- ...-ASoC-fsl_sai-request-BUS_FREQ_AUDIO.patch | 4 +- ...-ASoC-fsl-fix-wrong-usage-of-filter_.patch | 24 - ...add-imx-pcm-dma-v2-platform-driver-p.patch | 31 - ...p-fix-issue-with-non-SCDC-HDMI-sinks.patch | 60 - ...dp-fix-issue-with-non-SCDC-HDMI-sink.patch | 63 - ...-patch-which-merges-imx-drm-core-and.patch | 116 - ...y-0043-gpu-Move-ipu-v3-to-imx-folder.patch | 19995 ---------------- ...IPUv3-specific-KMS-functions-to-ipuv.patch | 142 - ...5-drm-imx-Add-DPU-KMS-support-part-2.patch | 4 +- ...x-Avoid-leaking-dangling-pointer-dev.patch | 4 +- ...535-6-drm-imx-core-add-LCDIF-support.patch | 2 +- ...xtract-IPUv3-specific-KMS-functions-.patch | 135 - ...Revert-gpu-Move-ipu-v3-to-imx-folder.patch | 19991 --------------- ...evert-a-patch-which-merges-imx-drm-c.patch | 107 - ...ma-calculate-the-real-count-for-slav.patch | 4 +- ...ma-Add-eDMA-support-for-QorIQ-LS1028.patch | 4 +- ...low-specifying-s2-prot-bits-when-map.patch | 2 +- ...rop-qman-mmio-cacheable-mapping-hack.patch | 4 +- ...sable-MSI-on-CYW4356-and-CYW4359-chi.patch | 2 +- ...-on-marvel-88w9098-and-88w8997-chips.patch | 2 +- target/linux/malta/Makefile | 2 +- target/linux/malta/be/config-default | 8 + target/linux/malta/be64/config-default | 6 - target/linux/malta/config-4.19 | 3 - target/linux/malta/config-5.4 | 11 +- target/linux/malta/le/config-default | 9 +- target/linux/malta/le64/config-default | 7 - .../base-files/etc/uci-defaults/99-net-ps | 21 +- .../lib/preinit/05_set_preinit_iface | 2 +- .../mt7622-bananapi-bpi-r64-rootdisk.dts | 20 +- .../mediatek/mt7622-elecom-wrc-2533gent.dts | 22 +- .../boot/dts/mediatek/mt7622-rfb1-ubi.dts | 646 + target/linux/mediatek/image/Config.in | 4 + target/linux/mediatek/image/Makefile | 18 +- .../mediatek/image/gen_mt7623_emmc_img.sh | 22 +- .../linux/mediatek/image/gen_mtk_mmc_img.sh | 150 + .../linux/mediatek/image/gen_scatterfile.sh | 75 + target/linux/mediatek/image/mt7622.mk | 20 +- target/linux/mediatek/image/mt7623.mk | 82 +- .../image/mt7623a_unielec_u7623-uEnv.txt | 20 + .../mediatek/image/mt7623n_bpir2-uEnv.txt | 78 + target/linux/mediatek/modules.mk | 2 +- .../mt7622/base-files/etc/board.d/02_network | 3 + .../mt7622/base-files/lib/upgrade/platform.sh | 3 + target/linux/mediatek/mt7622/config-5.4 | 28 +- target/linux/mediatek/mt7622/target.mk | 2 +- .../base-files/lib/preinit/07_set_iface_mac | 65 +- .../base-files/lib/preinit/79_move_config | 24 +- .../mt7623/base-files/lib/upgrade/platform.sh | 175 +- target/linux/mediatek/mt7623/config-5.4 | 4 + target/linux/mediatek/mt7623/target.mk | 2 +- .../patches-5.4/0005-dts-mt7622-add-gsw.patch | 110 +- ...-phy-phy-mtk-tphy-Add-hifsys-support.patch | 66 + .../0227-arm-dts-Add-Unielec-U7623-DTS.patch | 16 +- .../0308-dts-mt7622-add-snand-support.patch | 4 +- ...dts-add-wmac-support-for-mt7622-rfb1.patch | 4 +- .../0400-eth-fix-rx-vlan-hw-offload.patch | 2 +- .../0401-eth-fix-eth1-tx-timeout.patch | 6 +- ...ypto-add-eip97-inside-secure-support.patch | 4 +- ...ngs-PCI-Mediatek-Update-PCIe-binding.patch | 415 + ...e-regmap-to-get-shared-pcie-cfg-base.patch | 217 + ...ek-Split-PCIe-node-for-MT2712-MT7622.patch | 417 + ...dts-mediatek-Update-mt7629-PCIe-node.patch | 203 + .../mediatek/patches-5.4/0999-hnat.patch | 12 +- .../1000-eth-gdm-config-backport.patch | 10 +- ...1001-eth-mtk-disable-TBDDONE-support.patch | 4 +- target/linux/mpc85xx/Makefile | 2 +- .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 14 +- .../arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 2 +- target/linux/mvebu/config-4.19 | 2 + target/linux/mvebu/config-5.4 | 3 + target/linux/mvebu/cortexa53/config-5.4 | 1 - .../base-files/etc/board.d/02_network | 3 +- .../base-files/lib/upgrade/platform.sh | 9 +- .../cortexa9/base-files/etc/board.d/01_leds | 3 + .../base-files/etc/board.d/02_network | 12 +- .../base-files/etc/board.d/05_compat-version | 26 + .../etc/uci-defaults/05_fix-compat-version | 21 + .../base-files/lib/upgrade/platform.sh | 3 + .../boot/dts/armada-370-buffalo-ls421de.dts | 65 +- target/linux/mvebu/image/cortexa72.mk | 22 +- target/linux/mvebu/image/cortexa9.mk | 49 +- .../260-align-mcbin-compatible-with-5.4.patch | 14 + .../560-helios4-dts-status-led-alias.patch | 28 + ...-mvebu-armada-38x-enable-libata-leds.patch | 10 + ...ntroduce-mvneta_update_stats-routine.patch | 10 +- ...duce-page-pool-API-for-sw-buffer-man.patch | 12 +- ...on-build_skb-in-mvneta_rx_swbm-poll-.patch | 16 +- ...013-net-mvneta-add-basic-XDP-support.patch | 30 +- ...header-prefetch-in-mvneta_swbm_rx_fr.patch | 4 +- ...mvneta-make-tx-buffer-array-agnostic.patch | 30 +- .../016-net-mvneta-add-XDP_TX-support.patch | 8 +- ...fix-build-skb-for-bm-capable-devices.patch | 4 +- ...on-page_pool_recycle_direct-in-mvnet.patch | 4 +- ...sallow-XDP-program-on-hardware-buffe.patch | 2 +- ...DP-support-if-sw-bm-is-used-as-fallb.patch | 10 +- .../300-mvneta-tx-queue-workaround.patch | 4 +- .../560-helios4-dts-status-led-alias.patch | 28 + ...-mvebu-armada-38x-enable-libata-leds.patch | 10 + .../linux/mxs/profiles/02-olinuxino-maxi.mk | 2 +- .../octeon/base-files/etc/board.d/01_network | 3 + .../octeon/base-files/lib/preinit/01_sysinfo | 4 + .../base-files/lib/preinit/79_move_config | 5 + .../octeon/base-files/lib/upgrade/platform.sh | 55 +- target/linux/octeon/config-5.4 | 1 - target/linux/octeon/image/Makefile | 9 + .../patches-5.4/130-itus_shield_support.patch | 42 + target/linux/octeontx/config-5.4 | 1 - ...r-Gateworks-PLX-PEX860x-switch-with-.patch | 2 +- target/linux/omap/image/Makefile | 6 +- target/linux/omap/profiles/00-default.mk | 3 +- .../oxnas/files/drivers/ata/sata_oxnas.c | 2 +- target/linux/oxnas/image/ox810se.mk | 7 +- target/linux/oxnas/image/ox820.mk | 6 +- target/linux/pistachio/Makefile | 1 + target/linux/pistachio/base-files/etc/diag.sh | 30 - target/linux/pistachio/config-5.4 | 381 + target/linux/pistachio/image/Makefile | 6 +- ...ine-img-mdc-Handle-early-status-read.patch | 68 + ...mg-spfi-Implement-dual-and-quad-mode.patch | 198 + ...-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 + ...istachio-Fix-wrong-SDHost-card-speed.patch | 49 + ...-img-marduk-switch-mmc-to-1-bit-mode.patch | 47 + ...img-Fix-null-pointer-access-in-probe.patch | 42 + ...or-support-mtd-name-from-device-tree.patch | 54 + ...PS-DTS-img-marduk-Add-SPI-NAND-flash.patch | 30 + ...mg-marduk-Add-Cascoda-CA8210-6LoWPAN.patch | 43 + ...-DTS-img-marduk-Add-NXP-SC16IS752IPW.patch | 81 + ...PS-DTS-img-marduk-Add-partition-name.patch | 27 + ...-MIPS-DTS-img-marduk-Add-led-aliases.patch | 27 + .../mt7621/base-files/etc/board.d/02_network | 4 +- .../0069-awake-rt305x-dwc2-controller.patch | 2 +- .../0069-awake-rt305x-dwc2-controller.patch | 14 +- ...hernet-mediatek-use-napi_consume_skb.patch | 12 +- ...ethernet-mediatek-support-net-labels.patch | 8 +- target/linux/rb532/Makefile | 2 +- ...usb3-controller-node-for-RK3328-SoCs.patch | 2 +- ...ckchip-enable-LAN-port-on-NanoPi-R2S.patch | 4 +- ...dd-OF-node-for-USB-eth-on-NanoPi-R2S.patch | 2 +- .../base-files/lib/preinit/03_b53_hack.sh | 2 +- target/linux/sunxi/image/cortexa7.mk | 10 +- target/linux/sunxi/profiles/00-default.mk | 2 +- target/linux/tegra/image/Makefile | 2 +- target/linux/uml/Makefile | 10 +- target/linux/uml/config/i386 | 107 +- target/linux/uml/config/x86_64 | 68 +- .../files/arch/um/include/uapi/asm/Kbuild} | 0 .../101-mconsole-exec.patch | 32 +- .../102-pseudo-random-mac.patch | 31 +- tools/firmware-utils/Makefile | 3 +- tools/firmware-utils/src/addpattern.c | 2 +- tools/firmware-utils/src/fw.h | 15 +- tools/firmware-utils/src/hcsmakeimage.c | 4 + tools/firmware-utils/src/mkfwimage.c | 18 +- tools/firmware-utils/src/mktplinkfw2.c | 6 + tools/firmware-utils/src/ptgen.c | 30 +- tools/firmware-utils/src/tplink-safeloader.c | 168 +- tools/firmware-utils/src/utils.h | 11 + 806 files changed, 21518 insertions(+), 50657 deletions(-) create mode 100644 package/boot/mt7623n-preloader/Makefile create mode 100644 package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch create mode 100644 package/boot/uboot-kirkwood/patches/160-nsa310s.patch create mode 100644 package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch create mode 100644 package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch rename package/boot/uboot-layerscape/files/{ls1012afrdm-uEnv.txt => fsl_ls1012a-frdm-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1012afrwy-uEnv.txt => fsl_ls1012a-frwy-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1012ardb-uEnv.txt => fsl_ls1012a-rdb-uEnv.txt} (51%) rename package/boot/uboot-layerscape/files/{ls1021aiot-sdboot-uEnv.txt => fsl_ls1021a-iot-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1021atwr-sdboot-uEnv.txt => fsl_ls1021a-twr-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1021atwr-uEnv.txt => fsl_ls1021a-twr-uEnv.txt} (84%) rename package/boot/uboot-layerscape/files/{ls1043ardb-sdboot-uEnv.txt => fsl_ls1043a-rdb-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1043ardb-uEnv.txt => fsl_ls1043a-rdb-uEnv.txt} (85%) rename package/boot/uboot-layerscape/files/{ls1046ardb-sdboot-uEnv.txt => fsl_ls1046a-rdb-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1046ardb-uEnv.txt => fsl_ls1046a-rdb-uEnv.txt} (52%) rename package/boot/uboot-layerscape/files/{ls1088ardb-sdboot-uEnv.txt => fsl_ls1088a-rdb-sdboot-uEnv.txt} (100%) rename package/boot/uboot-layerscape/files/{ls1088ardb-uEnv.txt => fsl_ls1088a-rdb-uEnv.txt} (64%) rename package/boot/uboot-layerscape/files/{ls2088ardb-uEnv.txt => fsl_ls2088a-rdb-uEnv.txt} (88%) create mode 100644 package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch create mode 100644 package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch create mode 100644 package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch create mode 100644 package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch create mode 100644 package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch create mode 100644 package/boot/uboot-mediatek/patches/010-no-binman.patch create mode 100644 package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch create mode 100644 package/firmware/linux-firmware/misc.mk create mode 100644 package/kernel/mac80211/patches/subsys/070-backports-add-netif_receive_skb_list.patch create mode 100644 package/kernel/mac80211/patches/subsys/071-backports-add-skb_list_del_init.patch create mode 100644 package/kernel/mac80211/patches/subsys/311-mac80211-use-rate-provided-via-status-rate-on-ieee80.patch create mode 100644 package/kernel/mac80211/patches/subsys/312-mac80211-factor-out-code-to-look-up-the-average-pack.patch create mode 100644 package/kernel/mac80211/patches/subsys/313-mac80211-improve-AQL-aggregation-estimation-for-low-.patch create mode 100644 package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch create mode 100644 package/kernel/mac80211/patches/subsys/315-mac80211-reduce-duplication-in-tx-status-functions.patch create mode 100644 package/kernel/mac80211/patches/subsys/316-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch create mode 100644 package/kernel/mac80211/patches/subsys/317-mac80211-optimize-station-connection-monitor.patch create mode 100644 package/kernel/mac80211/patches/subsys/318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch create mode 100644 package/kernel/mac80211/patches/subsys/319-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch create mode 100644 package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch create mode 100644 package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch create mode 100644 package/kernel/mac80211/patches/subsys/322-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch create mode 100644 package/kernel/mac80211/patches/subsys/323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch create mode 100644 package/kernel/mac80211/patches/subsys/324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch create mode 100644 package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch create mode 100644 package/kernel/mac80211/patches/subsys/326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch delete mode 100644 package/kernel/mac80211/patches/subsys/701-mac80211-build-on-linux_4_14.patch delete mode 100644 package/kernel/nat46/patches/100-kernel-5.4-compat.patch create mode 100644 package/network/utils/ltq-dsl-base/Makefile rename {target/linux/lantiq/base-files => package/network/utils/ltq-dsl-base/files}/etc/hotplug.d/dsl/led_dsl.sh (100%) rename {target/linux/lantiq/base-files => package/network/utils/ltq-dsl-base/files}/etc/hotplug.d/dsl/pppoa.sh (100%) rename {target/linux/lantiq/base-files => package/network/utils/ltq-dsl-base/files}/lib/functions/lantiq_dsl.sh (99%) rename {target/linux/lantiq/base-files => package/network/utils/ltq-dsl-base/files}/sbin/dsl_notify.sh (100%) delete mode 100644 package/utils/busybox/patches/130-mconf_missing_sigwinch.patch delete mode 100644 target/linux/arc770/base-files/lib/arc.sh delete mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh create mode 100644 target/linux/arc770/config-5.4 create mode 100644 target/linux/arc770/patches-5.4/700-stmmac-Disable-frame-filtering-completely.patch delete mode 100644 target/linux/archs38/base-files/lib/arc.sh delete mode 100644 target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh delete mode 100644 target/linux/at91/image/sama5d4.mk create mode 100644 target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts create mode 100644 target/linux/ath79/dts/ar9331_arduino_yun.dts create mode 100644 target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts create mode 100644 target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi create mode 100644 target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts create mode 100644 target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi create mode 100644 target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts create mode 100644 target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts create mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi create mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi create mode 100644 target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi create mode 100644 target/linux/ath79/dts/qca9531_8dev_lima.dts create mode 100644 target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts create mode 100644 target/linux/ath79/dts/qca9531_glinet_gl-e750.dts create mode 100644 target/linux/ath79/dts/qca9531_telco_t1.dts create mode 100644 target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts create mode 100644 target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts create mode 100644 target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi create mode 100644 target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi create mode 100644 target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts create mode 100644 target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi create mode 100644 target/linux/ath79/dts/qca9557_8dev_rambutan.dts create mode 100644 target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts create mode 100644 target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts create mode 100644 target/linux/ath79/dts/qca9558_mikrotik_routerboard-921gs-5hpacd-15s.dts create mode 100644 target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi create mode 100644 target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi create mode 100644 target/linux/ath79/dts/qca9563_compex_wpj563.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts create mode 100644 target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi create mode 100644 target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds create mode 100644 target/linux/ath79/patches-4.19/921-serial-core-add-support-for-boot-console-with-arbitr.patch create mode 100644 target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch delete mode 100644 target/linux/bcm27xx/patches-5.4/950-0163-staging-vchiq_arm-Fix-platform-device-unregistration.patch delete mode 100644 target/linux/bcm27xx/patches-5.4/950-0338-staging-vchiq_arm-Unify-the-unload-handling-of-platf.patch delete mode 100644 target/linux/bcm27xx/patches-5.4/950-0428-staging-vchiq_arm-Add-a-matching-unregister-call.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/022-v5.8-mtd-rawnand-brcmnand-correctly-verify-erased-pages.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/024-v5.8-mtd-rawnand-brcmnand-fix-CS0-layout.patch rename target/linux/bcm63xx/patches-5.4/{120-leds-bcm6328-support-second-hw-blinking-interval.patch => 030-v5.9-leds-bcm6328-support-second-hw-blinking-interval.patch} (53%) create mode 100644 target/linux/bcm63xx/patches-5.4/031-v5.9-MIPS-BCM63xx-add-endif-comments.patch create mode 100644 target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch create mode 100644 target/linux/bcm63xx/patches-5.4/033-v5.9-mtd-parsers-bcm63xx-simplify-CFE-detection.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/310-cfe_simplify_detection.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/311-bcm63xxpart_use_cfedetection.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/499-allow_better_context_for_board_patches.patch rename target/linux/bcm63xx/patches-5.4/{369-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch => 500-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch} (83%) create mode 100644 target/linux/bcm63xx/patches-5.4/501-board_bcm6318-brcm-bcm96318ref.patch create mode 100644 target/linux/bcm63xx/patches-5.4/502-board_bcm6318-brcm-bcm96318ref-p300.patch rename target/linux/bcm63xx/patches-5.4/{548-board_dsl-2751b_e1.patch => 503-board_bcm6318-d-link-dsl-275xb-d.patch} (64%) create mode 100644 target/linux/bcm63xx/patches-5.4/504-board_bcm6318-sagem-fast-2704n.patch rename target/linux/bcm63xx/patches-5.4/{560-board_AR-5315u.patch => 505-board_bcm6318-comtrend-ar-5315u.patch} (65%) rename target/linux/bcm63xx/patches-5.4/{520-MIPS-BCM63XX-add-96328avng-reference-board.patch => 521-MIPS-BCM63XX-add-96328avng-reference-board.patch} (69%) rename target/linux/bcm63xx/patches-5.4/{521-MIPS-BCM63XX-add-963281TAN-reference-board.patch => 522-MIPS-BCM63XX-add-963281TAN-reference-board.patch} (59%) rename target/linux/bcm63xx/patches-5.4/{522-board_dsl_274xb_rev_f.patch => 523-board_bcm6328-d-link-dsl-274xb-f.patch} (64%) create mode 100644 target/linux/bcm63xx/patches-5.4/524-board_bcm6328-adb-a4001n1.patch rename target/linux/bcm63xx/patches-5.4/{529-board_AR-5387un.patch => 525-board_bcm6328-comtrend-ar-5387un.patch} (68%) rename target/linux/bcm63xx/patches-5.4/{530-board_AR-5381u.patch => 526-board_bcm6328-comtrend-ar-5381u.patch} (61%) delete mode 100644 target/linux/bcm63xx/patches-5.4/526-board_nb6.patch rename target/linux/bcm63xx/patches-5.4/{534-board_fast2704.patch => 527-board_bcm6328-sagem-fast-2704-v2.patch} (67%) delete mode 100644 target/linux/bcm63xx/patches-5.4/528-board_A4001N1.patch create mode 100644 target/linux/bcm63xx/patches-5.4/528-board_bcm6328-adb-a4001n.patch rename target/linux/bcm63xx/patches-5.4/{554-board_R5010UNv2.patch => 529-board_bcm6328-nucom-r5010un-v2.patch} (54%) rename target/linux/bcm63xx/patches-5.4/{561-board_AD1018.patch => 530-board_bcm6328-sercomm-ad1018.patch} (68%) rename target/linux/bcm63xx/patches-5.4/{567-board-adb_pdg-a4001n-a-000-1a1-ax.patch => 531-board-bcm6328-adb-pdg-a4001n-a-000-1a1-ax.patch} (56%) delete mode 100644 target/linux/bcm63xx/patches-5.4/531-board_rta770bw.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/533-board_rta770w.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/536-board_96318ref.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/537-board_96318ref_p300.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/538-board_bcm963269bhr.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/540-board_vw6339gu.patch rename target/linux/bcm63xx/patches-5.4/{502-board-96338W2_E7T.patch => 541-board-bcm6338-d-link-dsl-2640u.patch} (63%) delete mode 100644 target/linux/bcm63xx/patches-5.4/541-board_963268gu_p300.patch rename target/linux/bcm63xx/patches-5.4/{509-board_rta1320_16m.patch => 542-board_bcm6338-dynalink-rta1320.patch} (60%) delete mode 100644 target/linux/bcm63xx/patches-5.4/547-board_A4001N.patch create mode 100644 target/linux/bcm63xx/patches-5.4/551-board_bcm6345-dynalink-rta770bw-rta770w.patch delete mode 100644 target/linux/bcm63xx/patches-5.4/552-board_fast2704n.patch rename target/linux/bcm63xx/patches-5.4/{500-board-D4PW.patch => 561-board-bcm6348-D4PW.patch} (67%) rename target/linux/bcm63xx/patches-5.4/{505-board_spw500v.patch => 562-board_bcm6348-t-com-speedport-w-500v.patch} (62%) rename target/linux/bcm63xx/patches-5.4/{506-board_gw6200_gw6000.patch => 563-board_bcm6348-tecom-gw6000-gw6200.patch} (63%) rename target/linux/bcm63xx/patches-5.4/{507-board-MAGIC.patch => 564-board-bcm6348-telsey-magic.patch} (56%) rename target/linux/bcm63xx/patches-5.4/{511-board_V2500V.patch => 565-board_bcm6348-bt-voyager-2500v-bb.patch} (74%) rename target/linux/bcm63xx/patches-5.4/{512-board_BTV2110.patch => 566-board_bcm6348-bt-voyager-2110.patch} (69%) rename target/linux/bcm63xx/patches-5.4/{513-MIPS-BCM63XX-add-inventel-Livebox-support.patch => 567-MIPS-BCM63XX-add-inventel-Livebox-support.patch} (91%) rename target/linux/bcm63xx/patches-5.4/{514-board_ct536_ct5621.patch => 568-board_bcm6348-comtrend-ct-536plus-ct-5621.patch} (66%) rename target/linux/bcm63xx/patches-5.4/{516-board_96348A-122.patch => 569-board_bcm6348-comtrend-ct-5365.patch} (65%) rename target/linux/bcm63xx/patches-5.4/{517_board_CPVA502plus.patch => 570-board_bcm6348-telsey-cpva502plus.patch} (58%) rename target/linux/bcm63xx/patches-5.4/{523-board_96348w3.patch => 571-board_bcm6348-netgear-dg834g-v4.patch} (64%) rename target/linux/bcm63xx/patches-5.4/{527-board_fast2604.patch => 572-board_bcm6348-sagem-fast-2604.patch} (69%) rename target/linux/bcm63xx/patches-5.4/{539-board_AR1004G.patch => 573-board_bcm6348-asmax-ar-1004g.patch} (67%) rename target/linux/bcm63xx/patches-5.4/{515-board_DWV-S0_fixes.patch => 601-board-bcm6358-DWV-S0_fixes.patch} (59%) rename target/linux/bcm63xx/patches-5.4/{501-board-NB4.patch => 602-board-bcm6358-sfr-neufbox-4.patch} (51%) rename target/linux/bcm63xx/patches-5.4/{503-board-CPVA642.patch => 603-board-bcm6358-telsey-cpva642.patch} (60%) rename target/linux/bcm63xx/patches-5.4/{504-board_dsl_274xb_rev_c.patch => 604-board_bcm6358-d-link-dsl-274xb-c.patch} (64%) rename target/linux/bcm63xx/patches-5.4/{508-board_hw553.patch => 605-board_bcm6358-huawei-echolife-hg553.patch} (57%) rename target/linux/bcm63xx/patches-5.4/{510-board_spw303v.patch => 606-board_bcm6358-t-com-speedport-w-303v.patch} (61%) rename target/linux/bcm63xx/patches-5.4/{524-board_CT6373-1.patch => 607-board_bcm6358-comtrend-ct-6373.patch} (57%) rename target/linux/bcm63xx/patches-5.4/{525-board_dva-g3810bn-tl-1.patch => 608-board_bcm6358-d-link-dva-g3810bn-tl.patch} (59%) rename target/linux/bcm63xx/patches-5.4/{532-board_hw556.patch => 609-board_bcm6358-huawei-echolife-hg556.patch} (50%) rename target/linux/bcm63xx/patches-5.4/{546-board_hw520.patch => 610-board_bcm6359-huawei-echolife-hg520v.patch} (58%) rename target/linux/bcm63xx/patches-5.4/{550-board_homehub2a.patch => 611-board_bcm6358-bt-home-hub-2-a.patch} (51%) create mode 100644 target/linux/bcm63xx/patches-5.4/631-board_bcm6361-sfr-neufbox-6.patch rename target/linux/bcm63xx/patches-5.4/{535-board_fast2504n.patch => 632-board_bcm6362-sagem-fast-2504n.patch} (53%) rename target/linux/bcm63xx/patches-5.4/{564-board-DGND3700v2.patch => 633-board-bcm6362-netgear-dgnd3700-v2.patch} (55%) rename target/linux/bcm63xx/patches-5.4/{566-board-HG253s-v2.patch => 634-board-bcm6362-huawei-hg253s-v2.patch} (79%) rename target/linux/bcm63xx/patches-5.4/{518-bcm63xx-add-support-for-96368MVWG-board.patch => 651-bcm63xx-add-support-for-96368MVWG-board.patch} (68%) rename target/linux/bcm63xx/patches-5.4/{519-bcm63xx-add-support-for-96368MVNgr-board.patch => 652-bcm63xx-add-support-for-96368MVNgr-board.patch} (57%) rename target/linux/bcm63xx/patches-5.4/{542-board_WAP-5813n.patch => 653-board_bcm6369-comtrend-wap-5813n.patch} (65%) rename target/linux/bcm63xx/patches-5.4/{543-board_VR-3025u.patch => 654-board_bcm6368-comtrend-vr-3025u.patch} (59%) rename target/linux/bcm63xx/patches-5.4/{544-board_VR-3025un.patch => 655-board_bcm6368-comtrend-vr-3025un.patch} (60%) rename target/linux/bcm63xx/patches-5.4/{545-board_P870HW-51a_v2.patch => 656-board_bcm6368-zyxel-p870hw-51a-v2.patch} (52%) rename target/linux/bcm63xx/patches-5.4/{549-board_DGND3700v1_3800B.patch => 657-board_bcm6368-netgear-dgnd3700-v1.patch} (69%) rename target/linux/bcm63xx/patches-5.4/{551-board_HG655b.patch => 658-board_bcm6368-huawei-echolife-hg655b.patch} (58%) rename target/linux/bcm63xx/patches-5.4/{553-board_VR-3026e.patch => 659-board_bcm6368-comtrend-vr-3026e.patch} (62%) rename target/linux/bcm63xx/patches-5.4/{555-board_HG622.patch => 660-board_bcm6368-huawei-echolife-hg622.patch} (59%) rename target/linux/bcm63xx/patches-5.4/{556-board_EVG2000.patch => 661-board_bcm6369-netgear-evg2000.patch} (64%) rename target/linux/bcm63xx/patches-5.4/{557-board_AV4202N.patch => 662-board_bcm6368-adb-av4202n.patch} (53%) rename target/linux/bcm63xx/patches-5.4/{558-board_VH4032N.patch => 663-board_bcm6368-observa-vh4032n.patch} (81%) rename target/linux/bcm63xx/patches-5.4/{559-board_R1000H.patch => 664-board_bcm6368-actiontec-r1000h.patch} (65%) create mode 100644 target/linux/bcm63xx/patches-5.4/681-board_bcm63269-brcm-bcm963269bhr.patch create mode 100644 target/linux/bcm63xx/patches-5.4/682-board_bcm63268-inteno-vg50.patch create mode 100644 target/linux/bcm63xx/patches-5.4/683-board_bcm63268-brcm-bcm963268bu-p300.patch rename target/linux/bcm63xx/patches-5.4/{562-board_sr102.patch => 684-board_bcm63168-sky-sr102.patch} (53%) rename target/linux/bcm63xx/patches-5.4/{563-board-VR-3032u.patch => 685-board-bcm63168-comtrend-vr-3032u.patch} (55%) rename target/linux/bcm63xx/patches-5.4/{565-board-VG-8050.patch => 686-board-bcm63169-comtrend-vg-8050.patch} (72%) rename target/linux/bcm63xx/patches-5.4/{568-board-H500s.patch => 687-board-bcm63167-sercomm-h500-s.patch} (69%) delete mode 100644 target/linux/generic/backport-4.19/742-v5.5-net-sfp-add-support-for-module-quirks.patch delete mode 100644 target/linux/generic/backport-4.19/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch create mode 100644 target/linux/generic/backport-5.4/041-genirq-affinity-Make-affinity-setting-if-activated-o.patch create mode 100644 target/linux/generic/backport-5.4/070-v5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch create mode 100644 target/linux/generic/backport-5.4/310-v5.6-mips-vdso-fix-jalr-t9-crash-in-vdso-code.patch delete mode 100644 target/linux/generic/backport-5.4/742-v5.5-net-sfp-add-support-for-module-quirks.patch delete mode 100644 target/linux/generic/backport-5.4/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch delete mode 100644 target/linux/generic/hack-5.4/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch delete mode 100644 target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch create mode 100644 target/linux/generic/pending-4.14/690-net-add-support-for-threaded-NAPI-polling.patch delete mode 100644 target/linux/generic/pending-4.19/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch delete mode 100644 target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch create mode 100644 target/linux/generic/pending-4.19/690-net-add-support-for-threaded-NAPI-polling.patch create mode 100644 target/linux/generic/pending-5.4/445-mtd-spinand-gigadevice-Only-one-dummy-byte-in-QUA.patch create mode 100644 target/linux/generic/pending-5.4/446-mtd-spinand-gigadevice-Add-QE-Bit.patch create mode 100644 target/linux/generic/pending-5.4/447-mtd-spinand-gigadevice-Add-support-for-GD5F4GQ4xC.patch delete mode 100644 target/linux/generic/pending-5.4/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch create mode 100644 target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch create mode 100755 target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches create mode 100755 target/linux/kirkwood/base-files/etc/board.d/05_compat-version create mode 100644 target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version create mode 100644 target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac create mode 100644 target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-e4200-v2.dts rename target/linux/kirkwood/files-5.4/arch/arm/boot/dts/{kirkwood-linksys-audi.dts => kirkwood-ea3500.dts} (96%) create mode 100644 target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea4500.dts create mode 100644 target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-nsa310s.dts create mode 100644 target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch rename target/linux/kirkwood/patches-5.4/{105-ea4500.patch => 105-linksys-viper-dts.patch} (100%) create mode 100644 target/linux/kirkwood/patches-5.4/111-l-50.patch create mode 100644 target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration rename target/linux/lantiq/{ => xway}/base-files/etc/uci-defaults/01_led_migration (81%) create mode 100644 target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration create mode 100644 target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup delete mode 100644 target/linux/layerscape/patches-5.4/302-dts-0085-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interrupt.patch delete mode 100644 target/linux/layerscape/patches-5.4/302-dts-0108-Revert-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interr.patch create mode 100644 target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0275-mii-Add-helpers-for-parsing-SGMII-auto-negotiation.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0276-net-phylink-make-QSGMII-a-valid-PHY-mode-for-in-band.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0277-net-phylink-call-mac_an_restart-for-SGMII-QSGMII-inb.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0278-enetc-export-enetc_mdio-definitionns-to-include-linu.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0279-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-value-of-.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0280-net-mscc-ocelot-do-not-force-Felix-MACs-at-lower-spe.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0281-net-mscc-ocelot-convert-to-PHYLINK.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0282-net-mscc-ocelot-introduce-more-focused-PCS-ops-for-P.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0283-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0368-Revert-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0369-Revert-net-mscc-ocelot-introduce-more-focused-PCS-op.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0370-Revert-net-mscc-ocelot-convert-to-PHYLINK.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0371-Revert-net-mscc-ocelot-do-not-force-Felix-MACs-at-lo.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0372-Revert-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-va.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0373-Revert-enetc-export-enetc_mdio-definitionns-to-inclu.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0374-Revert-net-phylink-call-mac_an_restart-for-SGMII-QSG.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0375-Revert-net-phylink-make-QSGMII-a-valid-PHY-mode-for-.patch delete mode 100644 target/linux/layerscape/patches-5.4/701-net-0376-Revert-mii-Add-helpers-for-parsing-SGMII-auto-negoti.patch delete mode 100644 target/linux/layerscape/patches-5.4/801-audio-0023-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-part-2.patch delete mode 100644 target/linux/layerscape/patches-5.4/801-audio-0036-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_data-pa.patch delete mode 100644 target/linux/layerscape/patches-5.4/801-audio-0067-Revert-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_.patch delete mode 100644 target/linux/layerscape/patches-5.4/801-audio-0068-Revert-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-p.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0030-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sinks.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0031-Revert-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sink.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0042-drm-imx-Revert-a-patch-which-merges-imx-drm-core-and.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0043-gpu-Move-ipu-v3-to-imx-folder.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0044-drm-imx-Extract-IPUv3-specific-KMS-functions-to-ipuv.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0048-Revert-drm-imx-Extract-IPUv3-specific-KMS-functions-.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0049-Revert-gpu-Move-ipu-v3-to-imx-folder.patch delete mode 100644 target/linux/layerscape/patches-5.4/805-display-0050-Revert-drm-imx-Revert-a-patch-which-merges-imx-drm-c.patch create mode 100644 target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7622-rfb1-ubi.dts create mode 100644 target/linux/mediatek/image/Config.in create mode 100644 target/linux/mediatek/image/gen_mtk_mmc_img.sh create mode 100644 target/linux/mediatek/image/gen_scatterfile.sh create mode 100644 target/linux/mediatek/image/mt7623a_unielec_u7623-uEnv.txt create mode 100644 target/linux/mediatek/image/mt7623n_bpir2-uEnv.txt create mode 100644 target/linux/mediatek/patches-5.4/0226-phy-phy-mtk-tphy-Add-hifsys-support.patch create mode 100644 target/linux/mediatek/patches-5.4/0991-dt-bindings-PCI-Mediatek-Update-PCIe-binding.patch create mode 100644 target/linux/mediatek/patches-5.4/0992-PCI-mediatek-Use-regmap-to-get-shared-pcie-cfg-base.patch create mode 100644 target/linux/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch create mode 100644 target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch create mode 100644 target/linux/mvebu/cortexa9/base-files/etc/board.d/05_compat-version create mode 100644 target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version create mode 100644 target/linux/mvebu/patches-4.19/260-align-mcbin-compatible-with-5.4.patch create mode 100644 target/linux/mvebu/patches-4.19/560-helios4-dts-status-led-alias.patch create mode 100644 target/linux/mvebu/patches-4.19/561-mvebu-armada-38x-enable-libata-leds.patch create mode 100644 target/linux/mvebu/patches-5.4/560-helios4-dts-status-led-alias.patch create mode 100644 target/linux/mvebu/patches-5.4/561-mvebu-armada-38x-enable-libata-leds.patch create mode 100644 target/linux/octeon/patches-5.4/130-itus_shield_support.patch delete mode 100755 target/linux/pistachio/base-files/etc/diag.sh create mode 100644 target/linux/pistachio/config-5.4 create mode 100644 target/linux/pistachio/patches-5.4/101-dmaengine-img-mdc-Handle-early-status-read.patch create mode 100644 target/linux/pistachio/patches-5.4/102-spi-img-spfi-Implement-dual-and-quad-mode.patch create mode 100644 target/linux/pistachio/patches-5.4/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch create mode 100644 target/linux/pistachio/patches-5.4/105-spi-img-spfi-RX-maximum-burst-size-for-DMA-is-8.patch create mode 100644 target/linux/pistachio/patches-5.4/106-spi-img-spfi-finish-every-transfer-cleanly.patch create mode 100644 target/linux/pistachio/patches-5.4/108-clk-pistachio-Fix-wrong-SDHost-card-speed.patch create mode 100644 target/linux/pistachio/patches-5.4/109-MIPS-DTS-img-marduk-switch-mmc-to-1-bit-mode.patch create mode 100644 target/linux/pistachio/patches-5.4/150-pwm-img-Fix-null-pointer-access-in-probe.patch create mode 100644 target/linux/pistachio/patches-5.4/401-mtd-nor-support-mtd-name-from-device-tree.patch create mode 100644 target/linux/pistachio/patches-5.4/901-MIPS-DTS-img-marduk-Add-SPI-NAND-flash.patch create mode 100644 target/linux/pistachio/patches-5.4/902-MIPS-DTS-img-marduk-Add-Cascoda-CA8210-6LoWPAN.patch create mode 100644 target/linux/pistachio/patches-5.4/903-MIPS-DTS-img-marduk-Add-NXP-SC16IS752IPW.patch create mode 100644 target/linux/pistachio/patches-5.4/904-MIPS-DTS-img-marduk-Add-partition-name.patch create mode 100644 target/linux/pistachio/patches-5.4/905-MIPS-DTS-img-marduk-Add-led-aliases.patch rename target/linux/{at91/image/sama5d3.mk => uml/files/arch/um/include/uapi/asm/Kbuild} (100%) rename target/linux/uml/{patches-4.14 => patches-5.4}/101-mconsole-exec.patch (87%) rename target/linux/uml/{patches-4.14 => patches-5.4}/102-pseudo-random-mac.patch (83%) create mode 100644 tools/firmware-utils/src/utils.h diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 624c31590..39d31e479 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.14 = .187 -LINUX_VERSION-4.19 = .131 -LINUX_VERSION-5.4 = .51 +LINUX_VERSION-4.14 = .193 +LINUX_VERSION-4.19 = .138 +LINUX_VERSION-5.4 = .59 -LINUX_KERNEL_HASH-4.14.187 = 5b223475eaeea196aa7e127d3f253bca5c35d8afdc72ca75230ce1ecdd1454bd -LINUX_KERNEL_HASH-4.19.131 = 19dfb9f6cc4ba30104b65dcce7d78240a4ae188cb366747d5f8eae35e98964ba -LINUX_KERNEL_HASH-5.4.51 = 9e8bea8b4cd636726b7e495a3b467c8ffe96f8eddc159a45fe4a7e6e07a2069d +LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03 +LINUX_KERNEL_HASH-4.19.138 = d15c27d05f6c527269b75b30cc72972748e55720e7e00ad8abbaa4fe3b1d5e02 +LINUX_KERNEL_HASH-5.4.59 = 9bcb9db2e4435f2e5948375862baf0973f1d7860ebe3d750383e5a6deac4b2fd remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/include/target.mk b/include/target.mk index 44a199b59..2a5f23fd5 100644 --- a/include/target.mk +++ b/include/target.mk @@ -62,7 +62,7 @@ endif DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE)) filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1)) -extra_packages = $(if $(filter wpad-mini wpad-basic wpad nas,$(1)),iwinfo) +extra_packages = $(if $(filter wpad-mini wpad-basic wpad-basic-wolfssl wpad nas,$(1)),iwinfo) define ProfileDefault NAME:= diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 284899bd6..d32bae863 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=223 +PKG_RELEASE:=224 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index abb1388ba..b8665f262 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -251,10 +251,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.openwrt.pool.ntp.org' - add_list system.ntp.server='1.openwrt.pool.ntp.org' - add_list system.ntp.server='2.openwrt.pool.ntp.org' - add_list system.ntp.server='3.openwrt.pool.ntp.org' + add_list system.ntp.server='ntp1.aliyun.com' + add_list system.ntp.server='time1.cloud.tencent.com' + add_list system.ntp.server='time.ustc.edu.cn' + add_list system.ntp.server='cn.pool.ntp.org' EOF if json_is_a system object; then diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh index c7aa7bf75..b01e24f0a 100644 --- a/package/base-files/files/lib/functions/system.sh +++ b/package/base-files/files/lib/functions/system.sh @@ -158,6 +158,18 @@ macaddr_setbit_la() { printf "%02x:%s" $((0x${mac%%:*} | 0x02)) ${mac#*:} } +macaddr_unsetbit_mc() { + local mac=$1 + + printf "%02x:%s" $((0x${mac%%:*} & ~0x01)) ${mac#*:} +} + +macaddr_random() { + local randsrc=$(get_mac_binary /dev/urandom 0) + + echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${randsrc}")")" +} + macaddr_2bin() { local mac=$1 diff --git a/package/boot/mt7623n-preloader/Makefile b/package/boot/mt7623n-preloader/Makefile new file mode 100644 index 000000000..801c6d19b --- /dev/null +++ b/package/boot/mt7623n-preloader/Makefile @@ -0,0 +1,61 @@ +# +# Copyright © 2020 David Woodhouse +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=mt7623n-preloader +PKG_VERSION:=2020-03-11 +PKG_RELEASE:=b27114e184449a33b5d875fda14198f5e6fee2bb + +PKG_MAINTAINER:=David Woodhouse + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_RELEASE) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +BPI_PRELOADER_URL:=@GITHUB/BPI-SINOVOIP/BPI-files/$(PKG_RELEASE)/SD/100MB/ +BPI_PRELOADER_PREFIX:=bpi-preloader-$(PKG_RELEASE) + +define Download/BPI-R2-preloader-2k.img.gz + FILE:=$(BPI_PRELOADER_PREFIX)-BPI-R2-preloader-DDR1600-20191024-2k.img.gz + URL:=$(BPI_PRELOADER_URL) + URL_FILE:=BPI-R2-preloader-DDR1600-20191024-2k.img.gz + HASH:=c731cc166c912c84846e2ed5faf727504e4dec1463754baa6328e9908c84a373 +endef +$(eval $(call Download,BPI-R2-preloader-2k.img.gz)) + + +define Package/mt7623n-preloader + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_mediatek_mt7623 + TITLE:=mt7623n-preloader + DEFAULT:=y if TARGET_mediatek +endef + +define Package/mt7623n-preloader/description + Preloader image for mt7623n based boards like Banana Pi R2. +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 +endef + +define Build/Compile + true +endef + +define Build/InstallDev + mkdir -p $(STAGING_DIR_IMAGE) + gunzip -c $(PKG_BUILD_DIR)/mt7623n_bpir2-preloader.bin.gz > $(STAGING_DIR_IMAGE)/mt7623n_bpir2-preloader.bin +endef + +$(eval $(call BuildPackage,mt7623n-preloader)) diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile index 3110a21fc..b3e947f3b 100644 --- a/package/boot/tfa-layerscape/Makefile +++ b/package/boot/tfa-layerscape/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tfa-layerscape PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf @@ -37,130 +37,115 @@ define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap endef -define Package/tfa-layerscape/ls1012afrdm +define Package/tfa-generic + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-fsl_$(subst tfa-,,$(1)) + VARIANT:=$(subst tfa-,,$(1)) +endef + +define Package/tfa-ls1012a-frdm + $(Package/tfa-generic) TITLE:=NXP LS1012AFRDM Trusted Firmware PLAT:=ls1012afrdm BOOT_MODE:=qspi - BIN_BL2:=build/ls1012afrdm/release/bl2_qspi.pbl - BIN_FIP:=build/ls1012afrdm/release/fip.bin endef -define Package/tfa-layerscape/ls1012ardb +define Package/tfa-ls1012a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1012ARDB Trusted Firmware PLAT:=ls1012ardb BOOT_MODE:=qspi - BIN_BL2:=build/ls1012ardb/release/bl2_qspi.pbl - BIN_FIP:=build/ls1012ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1012afrwy +define Package/tfa-ls1012a-frwy-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1012AFRWY Trusted Firmware PLAT:=ls1012afrwy BOOT_MODE:=qspi - BIN_BL2:=build/ls1012afrwy/release/bl2_qspi.pbl - BIN_FIP:=build/ls1012afrwy/release/fip.bin endef -define Package/tfa-layerscape/ls1043ardb +define Package/tfa-ls1043a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1043ARDB Trusted Firmware PLAT:=ls1043ardb BOOT_MODE:=nor - BIN_BL2:=build/ls1043ardb/release/bl2_nor.pbl - BIN_FIP:=build/ls1043ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1043ardb-sdboot +define Package/tfa-ls1043a-rdb-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1043ARDB SD Boot Trusted Firmware PLAT:=ls1043ardb BOOT_MODE:=sd - BIN_BL2:=build/ls1043ardb/release/bl2_sd.pbl - BIN_FIP:=build/ls1043ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1046ardb +define Package/tfa-ls1046a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1046ARDB Trusted Firmware PLAT:=ls1046ardb BOOT_MODE:=qspi - BIN_BL2:=build/ls1046ardb/release/bl2_qspi.pbl - BIN_FIP:=build/ls1046ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1046ardb-sdboot +define Package/tfa-ls1046a-rdb-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1046ARDB SD Boot Trusted Firmware PLAT:=ls1046ardb BOOT_MODE:=sd - BIN_BL2:=build/ls1046ardb/release/bl2_sd.pbl - BIN_FIP:=build/ls1046ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1088ardb +define Package/tfa-ls1088a-rdb + $(Package/tfa-generic) TITLE:=NXP LS1088ARDB Trusted Firmware PLAT:=ls1088ardb BOOT_MODE:=qspi - BIN_BL2:=build/ls1088ardb/release/bl2_qspi.pbl - BIN_FIP:=build/ls1088ardb/release/fip.bin endef -define Package/tfa-layerscape/ls1088ardb-sdboot +define Package/tfa-ls1088a-rdb-sdboot + $(Package/tfa-generic) TITLE:=NXP LS1088ARDB SD Boot Trusted Firmware PLAT:=ls1088ardb BOOT_MODE:=sd - BIN_BL2:=build/ls1088ardb/release/bl2_sd.pbl - BIN_FIP:=build/ls1088ardb/release/fip.bin endef -define Package/tfa-layerscape/ls2088ardb +define Package/tfa-ls2088a-rdb + $(Package/tfa-generic) TITLE:=NXP LS2088ARDB Trusted Firmware PLAT:=ls2088ardb BOOT_MODE:=nor - BIN_BL2:=build/ls2088ardb/release/bl2_nor.pbl - BIN_FIP:=build/ls2088ardb/release/fip.bin -endef - -define Package/tfa-layerscape/Config - define Package/tfa-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=$(2) - DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-$(1) - VARIANT:=$(1) - BIN_BL2:=$(3) - BIN_FIP:=$(4) - endef endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.pbl - $(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl2_$(BOOT_MODE).pbl \ + $(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-bl2.pbl + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \ + $(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-fip.bin endef define Build/Compile - $(eval $(Package/tfa-layerscape/$(BUILD_VARIANT))) \ + $(eval $(Package/tfa-$(BUILD_VARIANT))) \ $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \ fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \ - RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \ - BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \ + RCW=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-rcw.bin \ + BL33=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-uboot.bin \ FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \ CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \ BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap endef TFAS := \ - ls1012afrdm \ - ls1012ardb \ - ls1012afrwy \ - ls1043ardb \ - ls1043ardb-sdboot \ - ls1046ardb \ - ls1046ardb-sdboot \ - ls1088ardb \ - ls1088ardb-sdboot \ - ls2088ardb + ls1012a-frdm \ + ls1012a-rdb \ + ls1012a-frwy-sdboot \ + ls1043a-rdb \ + ls1043a-rdb-sdboot \ + ls1046a-rdb \ + ls1046a-rdb-sdboot \ + ls1088a-rdb \ + ls1088a-rdb-sdboot \ + ls2088a-rdb $(eval $(call HostBuild)) $(foreach tfa,$(TFAS), \ - $(eval $(Package/tfa-layerscape/$(tfa))) \ - $(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \ $(eval $(call BuildPackage,tfa-$(tfa))) \ ) diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 9625c6bdd..04c986ee5 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -47,6 +47,7 @@ mr600v2|\ mr900|\ mr900v2|\ n5q|\ +nbg6616|\ nbg6716|\ om5p|\ om5p-ac|\ diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 3754b521a..c0873c6e0 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -14,14 +14,12 @@ board=$(board_name) case "$board" in alfa-network,ap121f|\ +allnet,all-wap02860ac|\ +arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ engenius,ecb1750|\ etactica,eg200|\ -glinet,gl-ar300m-lite|\ -glinet,gl-ar300m-nand|\ -glinet,gl-ar300m-nor|\ -glinet,gl-ar300m16|\ glinet,gl-ar750s-nor|\ glinet,gl-ar750s-nor-nand|\ librerouter,librerouter-v1|\ @@ -37,9 +35,11 @@ netgear,wnr612-v2|\ ocedo,koala|\ ocedo,raccoon|\ openmesh,om5p-ac-v2|\ +ubnt,nanostation-m|\ yuncore,a770|\ yuncore,a782|\ -yuncore,xd4200) +yuncore,xd4200|\ +zyxel,nbg6616) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; buffalo,wzr-hp-ag300h) @@ -51,6 +51,14 @@ domywifi,dw33d) glinet,gl-ar150) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" ;; +glinet,gl-ar300m-lite|\ +glinet,gl-ar300m-nand|\ +glinet,gl-ar300m-nor|\ +glinet,gl-ar300m16) + idx="$(find_mtd_index u-boot-env)" + [ -n "$idx" ] && \ + ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" + ;; netgear,wndr3700|\ netgear,wndr3700-v2|\ netgear,wndrmac-v1) @@ -58,6 +66,7 @@ netgear,wndrmac-v1) ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ +netgear,wndr4300tn|\ netgear,wndr4300sw) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" ;; diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6 index 330efb283..5d960df9c 100644 --- a/package/boot/uboot-envtools/files/imx6 +++ b/package/boot/uboot-envtools/files/imx6 @@ -14,10 +14,31 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -apalis*) - ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10 - ;; -*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 ) if [ -c /dev/mtd1 ]; then # board boots from NAND ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000 @@ -28,7 +49,12 @@ apalis*) ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 fi ;; -wandboard) +toradex,apalis_imx6q-eval |\ +toradex,apalis_imx6q-ixora |\ +toradex,apalis_imx6q-ixora-v1.1 ) + ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10 + ;; +wand,imx6dl-wandboard) ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000" ;; esac diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x index c27bea71c..e2f2e611c 100644 --- a/package/boot/uboot-envtools/files/ipq806x +++ b/package/boot/uboot-envtools/files/ipq806x @@ -31,6 +31,7 @@ ubootenv_mtdinfo () { } case "$board" in +linksys,ea7500-v1 |\ linksys,ea8500) ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" ;; diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index b5f7ddccb..401df7459 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -13,17 +13,20 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in +checkpoint,l-50|\ cloudengines,pogoe02|\ cloudengines,pogoplugv4|\ iom,ix2-200|\ -linksys,viper|\ +linksys,e4200-v2|\ +linksys,ea4500|\ raidsonic,ib-nas62x0|\ seagate,dockstar|\ zyxel,nsa310b|\ +zyxel,nsa310s|\ zyxel,nsa325) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; -linksys,audi) +linksys,ea3500) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" ;; esac diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 72e2df5d1..8ed1f87ea 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -24,7 +24,8 @@ globalscale,espressobin|\ globalscale,espressobin-emmc|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc|\ -marvell,armada8040-mcbin) +marvell,armada8040-mcbin-doubleshot|\ +marvell,armada8040-mcbin-singleshot) ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1" ;; linksys,wrt1200ac|\ diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 59f6f4d60..ca0a4d544 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -33,6 +33,7 @@ xiaomi,miwifi-nano|\ zbtlink,zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +linksys,ea7300-v1|\ linksys,ea7500-v2|\ xiaomi,mir3p|\ xiaomi,mir3g|\ diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index c1b33b4a8..e1493bf0e 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -54,11 +54,21 @@ define U-Boot/iconnect_second_stage BUILD_DEVICES:=iom_iconnect-1.1 endef +define U-Boot/l-50 + NAME:=CheckPoint L-50 + BUILD_DEVICES:=checkpoint_l-50 +endef + define U-Boot/nsa310 NAME:=Zyxel NSA310 BUILD_DEVICES:=zyxel_nsa310b endef +define U-Boot/nsa310s + NAME:=Zyxel NSA310S + BUILD_DEVICES:=zyxel_nsa310s +endef + define U-Boot/nsa325 NAME:=Zyxel NSA325v1 and v2 BUILD_DEVICES:=zyxel_nsa325 @@ -84,7 +94,9 @@ UBOOT_TARGETS := \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ + l-50 \ nsa310 \ + nsa310s \ nsa325 \ pogo_e02 pogo_e02_second_stage \ pogoplugv4 diff --git a/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch b/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch new file mode 100644 index 000000000..b228be6aa --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/151-arm-kirkwood-add-CheckPoint-L-50-device.patch @@ -0,0 +1,928 @@ +From 742f780f62ace452b83e2463f1f1afdda4b724ea Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Sun, 26 Jan 2020 07:27:24 +0100 +Subject: [PATCH] arm: kirkwood: add CheckPoint L-50 device + +This patch adds support for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+4)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Known limitations: +- In board is used two switches in chain. Second Marvell is not used + in u-Boot. + +Signed-off-by: Pawel Dembicki +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/kirkwood-l-50.dts | 439 +++++++++++++++++++++++++++++ + arch/arm/mach-kirkwood/Kconfig | 4 + + board/checkpoint/l-50/Kconfig | 12 + + board/checkpoint/l-50/MAINTAINERS | 6 + + board/checkpoint/l-50/Makefile | 11 + + board/checkpoint/l-50/kwbimage.cfg | 36 +++ + board/checkpoint/l-50/l-50.c | 172 +++++++++++ + board/checkpoint/l-50/l-50.h | 29 ++ + configs/l-50_defconfig | 59 ++++ + include/configs/l-50.h | 59 ++++ + 11 files changed, 828 insertions(+) + create mode 100644 arch/arm/dts/kirkwood-l-50.dts + create mode 100644 board/checkpoint/l-50/Kconfig + create mode 100644 board/checkpoint/l-50/MAINTAINERS + create mode 100644 board/checkpoint/l-50/Makefile + create mode 100644 board/checkpoint/l-50/kwbimage.cfg + create mode 100644 board/checkpoint/l-50/l-50.c + create mode 100644 board/checkpoint/l-50/l-50.h + create mode 100644 configs/l-50_defconfig + create mode 100644 include/configs/l-50.h + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -51,6 +51,7 @@ dtb-$(CONFIG_KIRKWOOD) += \ + kirkwood-iconnect.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-lsxhl.dtb \ + kirkwood-lschlv2.dtb \ + kirkwood-net2big.dtb \ +--- /dev/null ++++ b/arch/arm/dts/kirkwood-l-50.dts +@@ -0,0 +1,439 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ phy-handle = <&switch0>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -74,6 +74,9 @@ config TARGET_DB_88F6281_BP + config TARGET_NSA325 + bool "Zyxel NSA325 board" + ++config TARGET_L50 ++ bool "Check Point L-50" ++ + endchoice + + config SYS_SOC +@@ -102,5 +105,6 @@ source "board/zyxel/nsa325/Kconfig" + source "board/alliedtelesis/SBx81LIFKW/Kconfig" + source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" + source "board/Marvell/db-88f6281-bp/Kconfig" ++source "board/checkpoint/l-50/Kconfig" + + endif +--- /dev/null ++++ b/board/checkpoint/l-50/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_L50 ++ ++config SYS_BOARD ++ default "l-50" ++ ++config SYS_VENDOR ++ default "checkpoint" ++ ++config SYS_CONFIG_NAME ++ default "l-50" ++ ++endif +--- /dev/null ++++ b/board/checkpoint/l-50/MAINTAINERS +@@ -0,0 +1,6 @@ ++L50 BOARD ++M: Pawel Dembicki ++S: Maintained ++F: board/checkpoint/l-50/ ++F: include/configs/l-50.h ++F: configs/l-50_defconfig +--- /dev/null ++++ b/board/checkpoint/l-50/Makefile +@@ -0,0 +1,11 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# (C) Copyright 2020 ++# Pawel Dembicki ++# ++# Based on Kirkwood support: ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++ ++obj-y := l-50.o +--- /dev/null ++++ b/board/checkpoint/l-50/kwbimage.cfg +@@ -0,0 +1,36 @@ ++# SPDX-License-Identifier: GPL-2.0+ ++# ++# Values taken from original bootloader source. ++# Based on: ++# dramregs_seattle_400rd_A.txt from uboot_src_CP600_1100. ++ ++# Boot Media configurations ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++DATA 0xFFD100e0 0x1b1b1b9b ++DATA 0xFFD01400 0x43000c30 ++DATA 0xFFD01404 0x39543000 ++DATA 0xFFD01408 0x22125451 ++DATA 0xFFD0140C 0x00000833 ++DATA 0xFFD01410 0x000000cc ++DATA 0xFFD01414 0x00000000 ++DATA 0xFFD01418 0x00000000 ++DATA 0xFFD0141C 0x00000C52 ++DATA 0xFFD01420 0x00000004 ++DATA 0xFFD01424 0x0000F17F ++DATA 0xFFD01428 0x00085520 ++DATA 0xFFD0147C 0x00008552 ++DATA 0xFFD01504 0x0FFFFFF1 ++DATA 0xFFD01508 0x10000000 ++DATA 0xFFD0150C 0x0FFFFFF5 ++DATA 0xFFD01514 0x00000000 ++DATA 0xFFD0151C 0x00000000 ++DATA 0xFFD01494 0x00120012 ++DATA 0xFFD01498 0x00000000 ++DATA 0xFFD0149C 0x0000E40F ++DATA 0xFFD01480 0x00000001 ++DATA 0xFFD20134 0x66666666 ++DATA 0xFFD20138 0x66666666 ++DATA 0x0 0x0 +--- /dev/null ++++ b/board/checkpoint/l-50/l-50.c +@@ -0,0 +1,172 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "l-50.h" ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* Gpio configuration */ ++ mvebu_config_gpio(L50_OE_VAL_LOW, L50_OE_VAL_HIGH, ++ L50_OE_LOW, L50_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ static const u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_SPI_SCn, ++ MPP8_TW_SDA, ++ MPP9_TW_SCK, ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_SD_CLK, ++ MPP13_SD_CMD, ++ MPP14_SD_D0, ++ MPP15_SD_D1, ++ MPP16_SD_D2, ++ MPP17_SD_D3, ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GE1_0, ++ MPP21_GE1_1, ++ MPP22_GE1_2, ++ MPP23_GE1_3, ++ MPP24_GE1_4, ++ MPP25_GE1_5, ++ MPP26_GE1_6, ++ MPP27_GE1_7, ++ MPP28_GPIO, ++ MPP29_GPIO, ++ MPP30_GE1_10, ++ MPP31_GE1_11, ++ MPP32_GE1_12, ++ MPP33_GE1_13, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_AUDIO_SPDIFI, /* value from stock u-boot */ ++ MPP37_GPIO, ++ MPP38_GPIO, ++ MPP39_TDM_SPI_CS0, ++ MPP40_GPIO, ++ MPP41_GPIO, ++ MPP42_TDM_SPI_MOSI, ++ MPP43_TDM_CODEC_INTn, ++ MPP44_GPIO, ++ MPP45_TDM_PCLK, ++ MPP46_GPIO, ++ MPP47_TDM_DRX, ++ MPP48_GPIO, ++ MPP49_GPIO, ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ ++ return 0; ++} ++ ++void board_gpio_expander_init(void) ++{ ++ struct udevice *dev0, *dev1; ++ uchar data_buffer; ++ int ret; ++ ++ ret = i2c_get_chip_for_busnum(0, L50_GPIO0_I2C_ADDRESS, 1, &dev0); ++ if (ret) { ++ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n", ++ __func__, L50_GPIO0_I2C_ADDRESS); ++ return; ++ } ++ ++ ret = i2c_get_chip_for_busnum(0, L50_GPIO1_I2C_ADDRESS, 1, &dev1); ++ if (ret) { ++ debug("%s: Cannot find I2C GPIO expander chip 0x02%X\n", ++ __func__, L50_GPIO1_I2C_ADDRESS); ++ return; ++ } ++ ++ /* Set IO as output */ ++ data_buffer = 0x0; ++ dm_i2c_write(dev0, 1, &data_buffer, 1); ++ dm_i2c_write(dev1, 1, &data_buffer, 1); ++ ++ /* Set all leds off, reset asserted, pwr off */ ++ data_buffer = 0xbf; ++ dm_i2c_write(dev0, 0, &data_buffer, 1); ++ data_buffer = 0x1c; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++ ++ mdelay(100); ++ ++ /* Set pwr on */ ++ data_buffer = 0xa5; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++ ++ mdelay(100); ++ ++ /* Set reset deasserted, status red led enabled*/ ++ data_buffer = 0xff; ++ dm_i2c_write(dev0, 0, &data_buffer, 1); ++ data_buffer = 0xe3; ++ dm_i2c_write(dev1, 0, &data_buffer, 1); ++} ++ ++int board_init(void) ++{ ++ /* Boot parameters address */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ board_gpio_expander_init(); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and initialize PHY */ ++void reset_phy(void) ++{ ++ u16 devadr; ++ char *name = "ethernet-controller@72000"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *)&devadr)) { ++ printf("Err..(%s) could not read PHY dev address\n", __func__); ++ return; ++ } ++ ++ /* ++ * Fix PHY led configuration ++ */ ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 3); ++ miiphy_write(name, devadr, 0x10, 0x1177); ++ miiphy_write(name, devadr, 0x11, 0x4417); ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); ++ ++ debug("88E1116 Initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ +--- /dev/null ++++ b/board/checkpoint/l-50/l-50.h +@@ -0,0 +1,29 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef __L50_H ++#define __L50_H ++ ++/* GPIO configuration */ ++#define L50_OE_LOW 0x30000000 ++#define L50_OE_HIGH 0x0000004c ++#define L50_OE_VAL_LOW 0x00000000 ++#define L50_OE_VAL_HIGH 0x00000000 ++ ++/* Expander GPIO addresses */ ++ ++#define L50_GPIO0_I2C_ADDRESS 0x20 ++#define L50_GPIO1_I2C_ADDRESS 0x21 ++ ++/* PHY register */ ++#define MV88E1116_PGADR_REG 22 ++ ++#endif /* __L50_H */ +--- /dev/null ++++ b/configs/l-50_defconfig +@@ -0,0 +1,59 @@ ++CONFIG_ARM=y ++CONFIG_SYS_DCACHE_OFF=y ++CONFIG_ARCH_CPU_INIT=y ++CONFIG_KIRKWOOD=y ++CONFIG_SYS_TEXT_BASE=0x600000 ++CONFIG_TARGET_L50=y ++CONFIG_ENV_SIZE=0x20000 ++CONFIG_ENV_OFFSET=0xC0000 ++CONFIG_ENV_SECT_SIZE=0x20000 ++CONFIG_ENV_ADDR=0xC0000 ++CONFIG_IDENT_STRING="\nCheck Point L-50" ++CONFIG_NR_DRAM_BANKS=2 ++# CONFIG_SYS_MALLOC_F is not set ++CONFIG_BOOTDELAY=1 ++CONFIG_CONSOLE_MUX=y ++CONFIG_DISPLAY_BOARDINFO=y ++CONFIG_HUSH_PARSER=y ++# CONFIG_CMD_FLASH is not set ++#CONFIG_CMD_IDE=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_MTD=y ++CONFIG_MTD_RAW_NAND=y ++CONFIG_MTDIDS_DEFAULT="nand0=orion_nand" ++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xc0000@0x0(u-boot)ro,0x40000@0xc0000(bootldr-env),0x7900000@0x100000(ubi),0x800000@0x7a00000(kernel-2),0x7100000@0x8200000(rootfs-2),0x7900000@0xf300000(default_sw),0x1800000@0x16c00000(logs),0x100000@0x18400000(preset_cfg),0x100000@0x18500000(adsl),-@0x18600000(storage)" ++CONFIG_CMD_UBI=y ++CONFIG_ISO_PARTITION=y ++CONFIG_OF_CONTROL=y ++CONFIG_DEFAULT_DEVICE_TREE="kirkwood-l-50" ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_DM=y ++CONFIG_DM_ETH=y ++#CONFIG_MVSATA_IDE=y ++CONFIG_MMC=y ++CONFIG_MVGBE=y ++CONFIG_MII=y ++CONFIG_PHYLIB=y ++CONFIG_PHY_MARVELL=y ++CONFIG_MV88E61XX_SWITCH=y ++CONFIG_MV88E61XX_CPU_PORT=6 ++CONFIG_MV88E61XX_PHY_PORTS=0x01f ++CONFIG_MV88E61XX_FIXED_PORTS=0 ++#CONFIG_DM_RTC=y ++#CONFIG_RTC_MV=y ++CONFIG_SYS_NS16550=y ++CONFIG_DM_I2C=y ++CONFIG_SYS_I2C_MVTWSI=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y +--- /dev/null ++++ b/include/configs/l-50.h +@@ -0,0 +1,59 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2020 ++ * Pawel Dembicki ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ */ ++ ++#ifndef _CONFIG_L50_H ++#define _CONFIG_L50_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 /* SOC Name */ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* Remove or override few declarations from mv-common.h */ ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_MVGBE_PORTS {1, 1} /* enable port 0 only */ ++#define CONFIG_NETCONSOLE ++#endif ++ ++#define CONFIG_MV88E61XX_CPU_PORT_RX_DELAY ++#define CONFIG_MV88E61XX_CPU_PORT_TX_DELAY ++ ++/* ++ * Enable GPI0 support ++ */ ++#define CONFIG_KIRKWOOD_GPIO ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "bootargs=console=ttyS0,115200\0" \ ++ "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \ ++ "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ ++ "bootargs_root=\0" ++#endif /* _CONFIG_L50_H */ diff --git a/package/boot/uboot-kirkwood/patches/160-nsa310s.patch b/package/boot/uboot-kirkwood/patches/160-nsa310s.patch new file mode 100644 index 000000000..fe0cd3f43 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/160-nsa310s.patch @@ -0,0 +1,54 @@ +--- a/configs/nsa310s_defconfig ++++ b/configs/nsa310s_defconfig +@@ -5,7 +5,7 @@ CONFIG_KIRKWOOD=y + CONFIG_SYS_TEXT_BASE=0x600000 + CONFIG_TARGET_NSA310S=y + CONFIG_ENV_SIZE=0x20000 +-CONFIG_ENV_OFFSET=0xE0000 ++CONFIG_ENV_OFFSET=0xC0000 + CONFIG_NR_DRAM_BANKS=2 + CONFIG_BOOTDELAY=3 + CONFIG_USE_PREBOOT=y +@@ -25,7 +25,7 @@ CONFIG_CMD_EXT2=y + CONFIG_CMD_FAT=y + CONFIG_CMD_JFFS2=y + CONFIG_CMD_MTDPARTS=y +-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(root)" ++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xc0000@0x0(uboot),0x80000@0xc0000(uboot_env),-@0x140000(ubi)" + CONFIG_CMD_UBI=y + CONFIG_ISO_PARTITION=y + CONFIG_ENV_IS_IN_NAND=y +--- a/include/configs/nsa310s.h ++++ b/include/configs/nsa310s.h +@@ -30,22 +30,17 @@ + + /* default environment variables */ + #define CONFIG_BOOTCOMMAND \ +- "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ +- "ubi part root; " \ +- "ubifsmount ubi:rootfs; " \ +- "ubifsload 0x800000 ${kernel}; " \ +- "ubifsload 0x700000 ${fdt}; " \ +- "ubifsumount; " \ +- "fdt addr 0x700000; fdt resize; fdt chosen; " \ +- "bootz 0x800000 - 0x700000" ++ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ ++ "ubi part ubi; " \ ++ "ubifsmount ubi:rootfs; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" + + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "console=console=ttyS0,115200\0" \ +- "mtdids=nand0=orion_nand\0" \ +- "mtdparts="CONFIG_MTDPARTS_DEFAULT \ +- "kernel=/boot/zImage\0" \ +- "fdt=/boot/nsa310s.dtb\0" \ +- "bootargs_root=ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw\0" ++ "console=console=ttyS0,115200\0" \ ++ "mtdids=nand0=orion_nand\0" \ ++ "mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \ ++ "bootargs_root=\0" + + /* Ethernet driver configuration */ + #ifdef CONFIG_CMD_NET diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 2ff4f2f18..83eb0f9d2 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -103,4 +103,7 @@ source "board/alliedtelesis/SBx81LIFKW/K - source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" +@@ -107,4 +107,7 @@ source "board/alliedtelesis/SBx81LIFXCAT source "board/Marvell/db-88f6281-bp/Kconfig" + source "board/checkpoint/l-50/Kconfig" +config SECOND_STAGE + bool "OpenWrt second stage hack" @@ -35,6 +35,17 @@ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ +--- a/include/configs/l-50.h ++++ b/include/configs/l-50.h +@@ -12,6 +12,8 @@ + #ifndef _CONFIG_L50_H + #define _CONFIG_L50_H + ++#include "openwrt-kirkwood-common.h" ++ + /* + * High Level Configuration Options (easy to change) + */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h @@ -0,0 +1,31 @@ @@ -139,6 +150,17 @@ +CONFIG_FIT_VERBOSE=y CONFIG_LZMA=y +CONFIG_LZO=y +--- a/configs/l-50_defconfig ++++ b/configs/l-50_defconfig +@@ -57,3 +57,8 @@ CONFIG_SYS_I2C_MVTWSI=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y --- a/configs/nsa310_defconfig +++ b/configs/nsa310_defconfig @@ -43,6 +43,9 @@ CONFIG_CMD_UBI=y @@ -162,3 +184,23 @@ +CONFIG_FIT_VERBOSE=y +CONFIG_LZMA=y +CONFIG_LZO=y +--- a/configs/nsa310s_defconfig ++++ b/configs/nsa310s_defconfig +@@ -40,5 +40,8 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y + CONFIG_LZMA=y ++CONFIG_LZO=y + CONFIG_OF_LIBFDT=y +--- a/include/configs/nsa310s.h ++++ b/include/configs/nsa310s.h +@@ -63,4 +63,6 @@ + #define CONFIG_RTC_MV + #endif /* CONFIG_CMD_DATE */ + ++#include "openwrt-kirkwood-common.h" ++ + #endif /* _CONFIG_NSA310S_H */ diff --git a/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch new file mode 100644 index 000000000..6e358857b --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch @@ -0,0 +1,53 @@ +From 940e9a5828480e4185c9a276ad7f35a4069a2393 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Thu, 23 Jan 2020 22:04:15 +0100 +Subject: [PATCH 1/2] phy: mv88e61xx: add support for RGMII TX/RX delay + +Clock delay in RGMII is required for some boards. +This patch introduce CONFIG_MV88E61XX_CPU_PORT_TX_DELAY and +CONFIG_MV88E61XX_CPU_PORT_RX_DELAY defines, which are setting +proper bits in PORT_REG_PHYS_CTRL register. + +Cc: Chris Packham +Cc: Joe Hershberger +Cc: Anatolij Gustschin +Cc: Tim Harvey +Signed-off-by: Pawel Dembicki +--- + drivers/net/phy/mv88e61xx.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c +index 5aff7ed397..889327639d 100644 +--- a/drivers/net/phy/mv88e61xx.c ++++ b/drivers/net/phy/mv88e61xx.c +@@ -94,6 +94,8 @@ + #define PORT_REG_STATUS_CMODE_1000BASE_X 0x9 + #define PORT_REG_STATUS_CMODE_SGMII 0xa + ++#define PORT_REG_PHYS_CTRL_RGMII_RX_DELAY BIT(15) ++#define PORT_REG_PHYS_CTRL_RGMII_TX_DELAY BIT(14) + #define PORT_REG_PHYS_CTRL_PCS_AN_EN BIT(10) + #define PORT_REG_PHYS_CTRL_PCS_AN_RST BIT(9) + #define PORT_REG_PHYS_CTRL_FC_VALUE BIT(7) +@@ -747,9 +749,16 @@ static int mv88e61xx_fixed_port_setup(struct phy_device *phydev, u8 port) + PORT_REG_PHYS_CTRL_SPD1000; + } + +- if (port == CONFIG_MV88E61XX_CPU_PORT) ++ if (port == CONFIG_MV88E61XX_CPU_PORT) { + val |= PORT_REG_PHYS_CTRL_LINK_VALUE | + PORT_REG_PHYS_CTRL_LINK_FORCE; ++#if defined(CONFIG_MV88E61XX_CPU_PORT_RX_DELAY) ++ val |= PORT_REG_PHYS_CTRL_RGMII_RX_DELAY; ++#endif ++#if defined(CONFIG_MV88E61XX_CPU_PORT_TX_DELAY) ++ val |= PORT_REG_PHYS_CTRL_RGMII_TX_DELAY; ++#endif ++ } + + return mv88e61xx_port_write(phydev, port, PORT_REG_PHYS_CTRL, + val); +-- +2.20.1 + diff --git a/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch new file mode 100644 index 000000000..c91a06cbe --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch @@ -0,0 +1,67 @@ +From 7ffab66a99831ce5e3037b608d73565c9d1abd20 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Thu, 23 Jan 2020 22:09:51 +0100 +Subject: [PATCH 2/2] phy: mv88e61xx: add support for MV88E6171 + +This patch add MV88E6171 id to driver data. + +Tested on Checkpoint L-50 board. + +Cc: Chris Packham +Cc: Joe Hershberger +Cc: Anatolij Gustschin +Cc: Tim Harvey +Signed-off-by: Pawel Dembicki +--- + drivers/net/phy/mv88e61xx.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c +index 889327639d..e0b648a54e 100644 +--- a/drivers/net/phy/mv88e61xx.c ++++ b/drivers/net/phy/mv88e61xx.c +@@ -180,6 +180,7 @@ + #define PORT_SWITCH_ID_6071 0x0710 + #define PORT_SWITCH_ID_6096 0x0980 + #define PORT_SWITCH_ID_6097 0x0990 ++#define PORT_SWITCH_ID_6171 0x1710 + #define PORT_SWITCH_ID_6172 0x1720 + #define PORT_SWITCH_ID_6176 0x1760 + #define PORT_SWITCH_ID_6220 0x2200 +@@ -997,6 +998,7 @@ static int mv88e61xx_probe(struct phy_device *phydev) + switch (priv->id) { + case PORT_SWITCH_ID_6096: + case PORT_SWITCH_ID_6097: ++ case PORT_SWITCH_ID_6171: + case PORT_SWITCH_ID_6172: + case PORT_SWITCH_ID_6176: + case PORT_SWITCH_ID_6240: +@@ -1152,6 +1154,17 @@ static struct phy_driver mv88e61xx_driver = { + .shutdown = &genphy_shutdown, + }; + ++static struct phy_driver mv88e617x_driver = { ++ .name = "Marvell MV88E617x", ++ .uid = 0x01410e70, ++ .mask = 0xfffffff0, ++ .features = PHY_GBIT_FEATURES, ++ .probe = mv88e61xx_probe, ++ .config = mv88e61xx_phy_config, ++ .startup = mv88e61xx_phy_startup, ++ .shutdown = &genphy_shutdown, ++}; ++ + static struct phy_driver mv88e609x_driver = { + .name = "Marvell MV88E609x", + .uid = 0x1410c89, +@@ -1177,6 +1190,7 @@ static struct phy_driver mv88e6071_driver = { + int phy_mv88e61xx_init(void) + { + phy_register(&mv88e61xx_driver); ++ phy_register(&mv88e617x_driver); + phy_register(&mv88e609x_driver); + phy_register(&mv88e6071_driver); + +-- +2.20.1 + diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index 1cc746f9a..294045288 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-layerscape PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot @@ -27,67 +27,67 @@ define U-Boot/Default ENV_SIZE:=0x2000 endef -define U-Boot/ls1012afrdm +define U-Boot/fsl_ls1012a-frdm NAME:=NXP LS1012AFRDM UBOOT_CONFIG:=ls1012afrdm_tfa ENV_SIZE:=0x40000 endef -define U-Boot/ls1012ardb +define U-Boot/fsl_ls1012a-rdb NAME:=NXP LS1012ARDB UBOOT_CONFIG:=ls1012ardb_tfa ENV_SIZE:=0x40000 endef -define U-Boot/ls1012afrwy +define U-Boot/fsl_ls1012a-frwy-sdboot NAME:=NXP LS1012AFRWY UBOOT_CONFIG:=ls1012afrwy_tfa ENV_SIZE:=0x10000 endef -define U-Boot/ls1043ardb +define U-Boot/fsl_ls1043a-rdb NAME:=NXP LS1043ARDB UBOOT_CONFIG:=ls1043ardb_tfa endef -define U-Boot/ls1043ardb-sdboot +define U-Boot/fsl_ls1043a-rdb-sdboot NAME:=NXP LS1043ARDB SD Card Boot UBOOT_CONFIG:=ls1043ardb_tfa endef -define U-Boot/ls1046ardb +define U-Boot/fsl_ls1046a-rdb NAME:=NXP LS1046ARDB UBOOT_CONFIG:=ls1046ardb_tfa endef -define U-Boot/ls1046ardb-sdboot +define U-Boot/fsl_ls1046a-rdb-sdboot NAME:=NXP LS1046ARDB SD Card Boot UBOOT_CONFIG:=ls1046ardb_tfa endef -define U-Boot/ls1088ardb +define U-Boot/fsl_ls1088a-rdb NAME:=NXP LS1088ARDB UBOOT_CONFIG:=ls1088ardb_tfa endef -define U-Boot/ls1088ardb-sdboot +define U-Boot/fsl_ls1088a-rdb-sdboot NAME:=NXP LS1088ARDB SD Card Boot UBOOT_CONFIG:=ls1088ardb_tfa endef -define U-Boot/ls2088ardb +define U-Boot/fsl_ls2088a-rdb NAME:=NXP LS2088ARDB UBOOT_CONFIG:=ls2088ardb_tfa endef -define U-Boot/ls1021atwr +define U-Boot/fsl_ls1021a-twr NAME:=NXP LS1021ATWR BUILD_SUBTARGET:=armv7 UBOOT_CONFIG:=ls1021atwr_nor ENV_SIZE:=0x20000 endef -define U-Boot/ls1021atwr-sdboot +define U-Boot/fsl_ls1021a-twr-sdboot NAME:=NXP LS1021ATWR SD Card Boot BUILD_SUBTARGET:=armv7 UBOOT_CONFIG:=ls1021atwr_sdcard_ifc @@ -95,7 +95,7 @@ define U-Boot/ls1021atwr-sdboot ENV_SIZE:=0x20000 endef -define U-Boot/ls1021aiot-sdboot +define U-Boot/fsl_ls1021a-iot-sdboot NAME:=NXP LS1021AIOT SD Card Boot BUILD_SUBTARGET:=armv7 UBOOT_CONFIG:=ls1021aiot_sdcard @@ -104,19 +104,19 @@ define U-Boot/ls1021aiot-sdboot endef UBOOT_TARGETS := \ - ls1012afrdm \ - ls1012ardb \ - ls1012afrwy \ - ls1043ardb \ - ls1043ardb-sdboot \ - ls1046ardb \ - ls1046ardb-sdboot \ - ls1088ardb \ - ls1088ardb-sdboot \ - ls2088ardb \ - ls1021atwr \ - ls1021atwr-sdboot \ - ls1021aiot-sdboot + fsl_ls1012a-frdm \ + fsl_ls1012a-rdb \ + fsl_ls1012a-frwy-sdboot \ + fsl_ls1043a-rdb \ + fsl_ls1043a-rdb-sdboot \ + fsl_ls1046a-rdb \ + fsl_ls1046a-rdb-sdboot \ + fsl_ls1088a-rdb \ + fsl_ls1088a-rdb-sdboot \ + fsl_ls2088a-rdb \ + fsl_ls1021a-twr \ + fsl_ls1021a-twr-sdboot \ + fsl_ls1021a-iot-sdboot define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) diff --git a/package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-frdm-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1012a-frdm-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1012afrwy-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1012afrwy-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1012a-frwy-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt similarity index 51% rename from package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt index 99e61ff11..f109a98b8 100644 --- a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/fsl_ls1012a-rdb-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1021aiot-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1021aiot-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1021a-iot-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1021atwr-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1021atwr-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1021a-twr-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt similarity index 84% rename from package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt index 387cfeb9f..d6c5f56fd 100644 --- a/package/boot/uboot-layerscape/files/ls1021atwr-uEnv.txt +++ b/package/boot/uboot-layerscape/files/fsl_ls1021a-twr-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffff initrd_high=0xffffffff nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs) cma=64M@0x0-0xb0000000 +bootargs=root=/dev/mtdblock6 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),11m(reserved-1),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) cma=64M@0x0-0xb0000000 bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1043ardb-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt similarity index 85% rename from package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt index b040cffdb..1214bf40c 100644 --- a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/fsl_ls1043a-rdb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1046ardb-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt similarity index 52% rename from package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt index 7bc7e2c97..975b1c1e7 100644 --- a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/fsl_ls1046a-rdb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-sdboot-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt similarity index 100% rename from package/boot/uboot-layerscape/files/ls1088ardb-sdboot-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-sdboot-uEnv.txt diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt similarity index 64% rename from package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt index 89004d247..7ab555040 100644 --- a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/fsl_ls1088a-rdb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs) +bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.spi-0:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt similarity index 88% rename from package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt rename to package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt index 31e937ffc..fe2febd2c 100644 --- a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/fsl_ls2088a-rdb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000 nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs),48m@0x1000000(firmware) bootcmd=echo starting openwrt ...;run mc_init;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index a8256529b..8cb20075a 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_VERSION:=2020.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372 include $(INCLUDE_DIR)/u-boot.mk @@ -15,19 +15,32 @@ define U-Boot/Default DEFAULT:=y endef -define U-Boot/mt7629 - NAME:=MT7629 - BUILD_SUBTARGET:=mt7629 - UBOOT_CONFIG:=mt7629_rfb -endef - define U-Boot/mt7622 NAME:=MT7622 BUILD_SUBTARGET:=mt7622 UBOOT_CONFIG:=mt7622_rfb endef -UBOOT_TARGETS := mt7629 mt7622 +define U-Boot/mt7623a_unielec_u7623 + NAME:=UniElec U7623 (mt7623) + BUILD_SUBTARGET:=mt7623 + UBOOT_CONFIG:=mt7623a_unielec_u7623_02 +endef + +define U-Boot/mt7623n_bpir2 + NAME:=Banana Pi R2 (mt7623) + BUILD_SUBTARGET:=mt7623 + UBOOT_IMAGE:=u-boot.bin + UBOOT_CONFIG:=mt7623n_bpir2 +endef + +define U-Boot/mt7629 + NAME:=MT7629 + BUILD_SUBTARGET:=mt7629 + UBOOT_CONFIG:=mt7629_rfb +endef + +UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2 mt7623a_unielec_u7623 UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) diff --git a/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch b/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch new file mode 100644 index 000000000..a45665eff --- /dev/null +++ b/package/boot/uboot-mediatek/patches/005-update-bpir2-defconfig.patch @@ -0,0 +1,18 @@ +diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig +index 6b9fbd7e22..fb2a004803 100644 +--- a/configs/mt7623n_bpir2_defconfig ++++ b/configs/mt7623n_bpir2_defconfig +@@ -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 ++CONFIG_ENV_IS_IN_FAT=y ++CONFIG_ENV_FAT_INTERFACE="mmc" ++CONFIG_ENV_FAT_DEVICE_AND_PART=":2" ++CONFIG_ENV_FAT_FILE="uboot.env" ++CONFIG_CMD_ASKENV=y ++CONFIG_ENV_SIZE=0x2000 ++CONFIG_CMD_SETEXPR=y diff --git a/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch b/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch new file mode 100644 index 000000000..2e50717b7 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/006-mt7623-pinctrl-fix.patch @@ -0,0 +1,237 @@ +From e05fdd93645dab2217bb5bfabcc04845415cf7ed Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Fri, 19 Jun 2020 12:40:20 +0100 +Subject: [PATCH] pinctrl: mediatek: add PUPD/R0/R1 support for MT7623 + +The pins for the MMC controller weren't being set up correctly because the +pinctrl driver only sets the GPIO pullup/pulldown config and doesn't +handle the special cases with PUPD/R0/R1 control. + +Signed-off-by: David Woodhouse +Tested-by: Frank Wunderlich +--- + drivers/pinctrl/mediatek/pinctrl-mt7623.c | 129 ++++++++++++++++++ + drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 19 ++- + drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 3 + + 3 files changed, 146 insertions(+), 5 deletions(-) + +diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7623.c b/drivers/pinctrl/mediatek/pinctrl-mt7623.c +index d58d840e08..0f5dcb2c63 100644 +--- a/drivers/pinctrl/mediatek/pinctrl-mt7623.c ++++ b/drivers/pinctrl/mediatek/pinctrl-mt7623.c +@@ -262,6 +262,132 @@ static const struct mtk_pin_field_calc mt7623_pin_drv_range[] = { + PIN_FIELD16(278, 278, 0xf70, 0x10, 8, 4), + }; + ++static const struct mtk_pin_field_calc mt7623_pin_pupd_range[] = { ++ /* MSDC0 */ ++ PIN_FIELD16(111, 111, 0xd00, 0x10, 12, 1), ++ PIN_FIELD16(112, 112, 0xd00, 0x10, 8, 1), ++ PIN_FIELD16(113, 113, 0xd00, 0x10, 4, 1), ++ PIN_FIELD16(114, 114, 0xd00, 0x10, 0, 1), ++ PIN_FIELD16(115, 115, 0xd10, 0x10, 0, 1), ++ PIN_FIELD16(116, 116, 0xcd0, 0x10, 8, 1), ++ PIN_FIELD16(117, 117, 0xcc0, 0x10, 8, 1), ++ PIN_FIELD16(118, 118, 0xcf0, 0x10, 12, 1), ++ PIN_FIELD16(119, 119, 0xcf0, 0x10, 8, 1), ++ PIN_FIELD16(120, 120, 0xcf0, 0x10, 4, 1), ++ PIN_FIELD16(121, 121, 0xcf0, 0x10, 0, 1), ++ /* MSDC1 */ ++ PIN_FIELD16(105, 105, 0xd40, 0x10, 8, 1), ++ PIN_FIELD16(106, 106, 0xd30, 0x10, 8, 1), ++ PIN_FIELD16(107, 107, 0xd60, 0x10, 0, 1), ++ PIN_FIELD16(108, 108, 0xd60, 0x10, 10, 1), ++ PIN_FIELD16(109, 109, 0xd60, 0x10, 4, 1), ++ PIN_FIELD16(110, 110, 0xc60, 0x10, 12, 1), ++ /* MSDC1 */ ++ PIN_FIELD16(85, 85, 0xda0, 0x10, 8, 1), ++ PIN_FIELD16(86, 86, 0xd90, 0x10, 8, 1), ++ PIN_FIELD16(87, 87, 0xdc0, 0x10, 0, 1), ++ PIN_FIELD16(88, 88, 0xdc0, 0x10, 10, 1), ++ PIN_FIELD16(89, 89, 0xdc0, 0x10, 4, 1), ++ PIN_FIELD16(90, 90, 0xdc0, 0x10, 12, 1), ++ /* MSDC0E */ ++ PIN_FIELD16(249, 249, 0x140, 0x10, 0, 1), ++ PIN_FIELD16(250, 250, 0x130, 0x10, 12, 1), ++ PIN_FIELD16(251, 251, 0x130, 0x10, 8, 1), ++ PIN_FIELD16(252, 252, 0x130, 0x10, 4, 1), ++ PIN_FIELD16(253, 253, 0x130, 0x10, 0, 1), ++ PIN_FIELD16(254, 254, 0xf40, 0x10, 12, 1), ++ PIN_FIELD16(255, 255, 0xf40, 0x10, 8, 1), ++ PIN_FIELD16(256, 256, 0xf40, 0x10, 4, 1), ++ PIN_FIELD16(257, 257, 0xf40, 0x10, 0, 1), ++ PIN_FIELD16(258, 258, 0xcb0, 0x10, 8, 1), ++ PIN_FIELD16(259, 259, 0xc90, 0x10, 8, 1), ++ PIN_FIELD16(261, 261, 0x140, 0x10, 8, 1), ++}; ++ ++static const struct mtk_pin_field_calc mt7623_pin_r1_range[] = { ++ /* MSDC0 */ ++ PIN_FIELD16(111, 111, 0xd00, 0x10, 13, 1), ++ PIN_FIELD16(112, 112, 0xd00, 0x10, 9, 1), ++ PIN_FIELD16(113, 113, 0xd00, 0x10, 5, 1), ++ PIN_FIELD16(114, 114, 0xd00, 0x10, 1, 1), ++ PIN_FIELD16(115, 115, 0xd10, 0x10, 1, 1), ++ PIN_FIELD16(116, 116, 0xcd0, 0x10, 9, 1), ++ PIN_FIELD16(117, 117, 0xcc0, 0x10, 9, 1), ++ PIN_FIELD16(118, 118, 0xcf0, 0x10, 13, 1), ++ PIN_FIELD16(119, 119, 0xcf0, 0x10, 9, 1), ++ PIN_FIELD16(120, 120, 0xcf0, 0x10, 5, 1), ++ PIN_FIELD16(121, 121, 0xcf0, 0x10, 1, 1), ++ /* MSDC1 */ ++ PIN_FIELD16(105, 105, 0xd40, 0x10, 9, 1), ++ PIN_FIELD16(106, 106, 0xd30, 0x10, 9, 1), ++ PIN_FIELD16(107, 107, 0xd60, 0x10, 1, 1), ++ PIN_FIELD16(108, 108, 0xd60, 0x10, 9, 1), ++ PIN_FIELD16(109, 109, 0xd60, 0x10, 5, 1), ++ PIN_FIELD16(110, 110, 0xc60, 0x10, 13, 1), ++ /* MSDC2 */ ++ PIN_FIELD16(85, 85, 0xda0, 0x10, 9, 1), ++ PIN_FIELD16(86, 86, 0xd90, 0x10, 9, 1), ++ PIN_FIELD16(87, 87, 0xdc0, 0x10, 1, 1), ++ PIN_FIELD16(88, 88, 0xdc0, 0x10, 9, 1), ++ PIN_FIELD16(89, 89, 0xdc0, 0x10, 5, 1), ++ PIN_FIELD16(90, 90, 0xdc0, 0x10, 13, 1), ++ /* MSDC0E */ ++ PIN_FIELD16(249, 249, 0x140, 0x10, 1, 1), ++ PIN_FIELD16(250, 250, 0x130, 0x10, 13, 1), ++ PIN_FIELD16(251, 251, 0x130, 0x10, 9, 1), ++ PIN_FIELD16(252, 252, 0x130, 0x10, 5, 1), ++ PIN_FIELD16(253, 253, 0x130, 0x10, 1, 1), ++ PIN_FIELD16(254, 254, 0xf40, 0x10, 13, 1), ++ PIN_FIELD16(255, 255, 0xf40, 0x10, 9, 1), ++ PIN_FIELD16(256, 256, 0xf40, 0x10, 5, 1), ++ PIN_FIELD16(257, 257, 0xf40, 0x10, 1, 1), ++ PIN_FIELD16(258, 258, 0xcb0, 0x10, 9, 1), ++ PIN_FIELD16(259, 259, 0xc90, 0x10, 9, 1), ++ PIN_FIELD16(261, 261, 0x140, 0x10, 9, 1), ++}; ++ ++static const struct mtk_pin_field_calc mt7623_pin_r0_range[] = { ++ /* MSDC0 */ ++ PIN_FIELD16(111, 111, 0xd00, 0x10, 14, 1), ++ PIN_FIELD16(112, 112, 0xd00, 0x10, 10, 1), ++ PIN_FIELD16(113, 113, 0xd00, 0x10, 6, 1), ++ PIN_FIELD16(114, 114, 0xd00, 0x10, 2, 1), ++ PIN_FIELD16(115, 115, 0xd10, 0x10, 2, 1), ++ PIN_FIELD16(116, 116, 0xcd0, 0x10, 10, 1), ++ PIN_FIELD16(117, 117, 0xcc0, 0x10, 10, 1), ++ PIN_FIELD16(118, 118, 0xcf0, 0x10, 14, 1), ++ PIN_FIELD16(119, 119, 0xcf0, 0x10, 10, 1), ++ PIN_FIELD16(120, 120, 0xcf0, 0x10, 6, 1), ++ PIN_FIELD16(121, 121, 0xcf0, 0x10, 2, 1), ++ /* MSDC1 */ ++ PIN_FIELD16(105, 105, 0xd40, 0x10, 10, 1), ++ PIN_FIELD16(106, 106, 0xd30, 0x10, 10, 1), ++ PIN_FIELD16(107, 107, 0xd60, 0x10, 2, 1), ++ PIN_FIELD16(108, 108, 0xd60, 0x10, 8, 1), ++ PIN_FIELD16(109, 109, 0xd60, 0x10, 6, 1), ++ PIN_FIELD16(110, 110, 0xc60, 0x10, 14, 1), ++ /* MSDC2 */ ++ PIN_FIELD16(85, 85, 0xda0, 0x10, 10, 1), ++ PIN_FIELD16(86, 86, 0xd90, 0x10, 10, 1), ++ PIN_FIELD16(87, 87, 0xdc0, 0x10, 2, 1), ++ PIN_FIELD16(88, 88, 0xdc0, 0x10, 8, 1), ++ PIN_FIELD16(89, 89, 0xdc0, 0x10, 6, 1), ++ PIN_FIELD16(90, 90, 0xdc0, 0x10, 14, 1), ++ /* MSDC0E */ ++ PIN_FIELD16(249, 249, 0x140, 0x10, 2, 1), ++ PIN_FIELD16(250, 250, 0x130, 0x10, 14, 1), ++ PIN_FIELD16(251, 251, 0x130, 0x10, 10, 1), ++ PIN_FIELD16(252, 252, 0x130, 0x10, 6, 1), ++ PIN_FIELD16(253, 253, 0x130, 0x10, 2, 1), ++ PIN_FIELD16(254, 254, 0xf40, 0x10, 14, 1), ++ PIN_FIELD16(255, 255, 0xf40, 0x10, 10, 1), ++ PIN_FIELD16(256, 256, 0xf40, 0x10, 6, 1), ++ PIN_FIELD16(257, 257, 0xf40, 0x10, 5, 1), ++ PIN_FIELD16(258, 258, 0xcb0, 0x10, 10, 1), ++ PIN_FIELD16(259, 259, 0xc90, 0x10, 10, 1), ++ PIN_FIELD16(261, 261, 0x140, 0x10, 10, 1), ++}; ++ + static const struct mtk_pin_reg_calc mt7623_reg_cals[] = { + [PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7623_pin_mode_range), + [PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7623_pin_dir_range), +@@ -272,6 +398,9 @@ static const struct mtk_pin_reg_calc mt7623_reg_cals[] = { + [PINCTRL_PIN_REG_PULLSEL] = MTK_RANGE(mt7623_pin_pullsel_range), + [PINCTRL_PIN_REG_PULLEN] = MTK_RANGE(mt7623_pin_pullen_range), + [PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt7623_pin_drv_range), ++ [PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt7623_pin_pupd_range), ++ [PINCTRL_PIN_REG_R0] = MTK_RANGE(mt7623_pin_r0_range), ++ [PINCTRL_PIN_REG_R1] = MTK_RANGE(mt7623_pin_r1_range), + }; + + static const struct mtk_pin_desc mt7623_pins[] = { +diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +index e8187a3780..6553dde45c 100644 +--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c ++++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +@@ -296,7 +296,7 @@ static const struct pinconf_param mtk_conf_params[] = { + }; + + +-int mtk_pinconf_bias_set_v0(struct udevice *dev, u32 pin, u32 arg) ++int mtk_pinconf_bias_set_v0(struct udevice *dev, u32 pin, u32 arg, u32 val) + { + int err, disable, pullup; + +@@ -323,12 +323,14 @@ int mtk_pinconf_bias_set_v0(struct udevice *dev, u32 pin, u32 arg) + return 0; + } + +-int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, u32 arg) ++int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, u32 arg, u32 val) + { +- int err, disable, pullup; ++ int err, disable, pullup, r0, r1; + + disable = (arg == PIN_CONFIG_BIAS_DISABLE); + pullup = (arg == PIN_CONFIG_BIAS_PULL_UP); ++ r0 = !!(val & 1); ++ r1 = !!(val & 2); + + if (disable) { + err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PULLEN, 0); +@@ -344,6 +346,13 @@ int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, u32 arg) + return err; + } + ++ /* Also set PUPD/R0/R1 if the pin has them */ ++ err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup); ++ if (err != -EINVAL) { ++ mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0); ++ mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1); ++ } ++ + return 0; + } + +@@ -419,9 +428,9 @@ static int mtk_pinconf_set(struct udevice *dev, unsigned int pin, + case PIN_CONFIG_BIAS_PULL_UP: + case PIN_CONFIG_BIAS_PULL_DOWN: + if (rev == MTK_PINCTRL_V0) +- err = mtk_pinconf_bias_set_v0(dev, pin, param); ++ err = mtk_pinconf_bias_set_v0(dev, pin, param, arg); + else +- err = mtk_pinconf_bias_set_v1(dev, pin, param); ++ err = mtk_pinconf_bias_set_v1(dev, pin, param, arg); + if (err) + goto err; + break; +diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h +index e815761450..5e51a9a90c 100644 +--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h ++++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h +@@ -51,6 +51,9 @@ enum { + PINCTRL_PIN_REG_PULLEN, + PINCTRL_PIN_REG_PULLSEL, + PINCTRL_PIN_REG_DRV, ++ PINCTRL_PIN_REG_PUPD, ++ PINCTRL_PIN_REG_R0, ++ PINCTRL_PIN_REG_R1, + PINCTRL_PIN_REG_MAX, + }; + +-- +2.26.2 + 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 new file mode 100644 index 000000000..a0236785d --- /dev/null +++ b/package/boot/uboot-mediatek/patches/007-env-fat-use-bootdevice.patch @@ -0,0 +1,97 @@ +From 6731bef6966ea2b26cdcfe0109ff5a950003fd03 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Fri, 19 Jun 2020 23:07:17 +0100 +Subject: [PATCH] env/fat.c: allow loading from a FAT partition on the MMC boot + device + +I don't want to have to specify the device; only the partition. + +This allows me to use the same image on internal eMMC or SD card for +Banana Pi R2, and it finds its own environment either way. + +Signed-off-by: David Woodhouse +[trini: Add #if/#else/#endif logic around CONFIG_SYS_MMC_ENV_DEV usage, + whitespace changes] +Signed-off-by: Tom Rini +--- + env/Kconfig | 4 ++++ + env/fat.c | 32 ++++++++++++++++++++++++++++++-- + 2 files changed, 34 insertions(+), 2 deletions(-) + +diff --git a/env/Kconfig b/env/Kconfig +index 38e7fadbb9..5784136674 100644 +--- a/env/Kconfig ++++ b/env/Kconfig +@@ -434,6 +434,10 @@ config ENV_FAT_DEVICE_AND_PART + If none, first valid partition in device D. If no + partition table then means device D. + ++ If ENV_FAT_INTERFACE is set to "mmc" then device 'D' can be omitted, ++ leaving the string starting with a colon, and the boot device will ++ be used. ++ + config ENV_FAT_FILE + string "Name of the FAT file to use for the environment" + depends on ENV_IS_IN_FAT +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 + #endif + ++#if defined(CMD_SAVEENV) || defined(CMD_LOADENV) ++__weak int mmc_get_env_dev(void) ++{ ++#ifdef CONFIG_SYS_MMC_ENV_DEV ++ return CONFIG_SYS_MMC_ENV_DEV; ++#else ++ return 0; ++#endif ++} ++ ++static char *env_fat_device_and_part(void) ++{ ++#ifdef CONFIG_MMC ++ static char *part_str; ++ ++ if (!part_str) { ++ part_str = CONFIG_ENV_FAT_DEVICE_AND_PART; ++ if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc") && part_str[0] == ':') { ++ part_str = "0" CONFIG_ENV_FAT_DEVICE_AND_PART; ++ part_str[0] += mmc_get_env_dev(); ++ } ++ } ++ ++ return part_str; ++#else ++ return CONFIG_ENV_FAT_DEVICE_AND_PART; ++#endif ++} ++#endif ++ + #ifdef CMD_SAVEENV + static int env_fat_save(void) + { +@@ -43,7 +71,7 @@ static int env_fat_save(void) + return err; + + part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE, +- CONFIG_ENV_FAT_DEVICE_AND_PART, ++ env_fat_device_and_part(), + &dev_desc, &info, 1); + if (part < 0) + return 1; +@@ -89,7 +117,7 @@ static int env_fat_load(void) + #endif + + part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE, +- CONFIG_ENV_FAT_DEVICE_AND_PART, ++ env_fat_device_and_part(), + &dev_desc, &info, 1); + if (part < 0) + goto err_env_relocate; +-- +2.26.2 + diff --git a/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch b/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch new file mode 100644 index 000000000..f57beed09 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/008-board-mediatek-fix-mmc_get_boot_dev-for-platforms-wi.patch @@ -0,0 +1,51 @@ +From e3cc511eef5d99491e0c51324be499b688dde8de Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Sun, 12 Jul 2020 23:33:01 +0100 +Subject: [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms + without external SD + +On the UniElec U7623 board there is no external SD slot and the preloader +doesn't fill in the magic field at 0x81dffff0 to indicate that it was +booted from eMMC. + +Signed-off-by: David Woodhouse +--- + board/mediatek/mt7623/mt7623_rfb.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/board/mediatek/mt7623/mt7623_rfb.c b/board/mediatek/mt7623/mt7623_rfb.c +index 4ec2764976..984e75ccaf 100644 +--- a/board/mediatek/mt7623/mt7623_rfb.c ++++ b/board/mediatek/mt7623/mt7623_rfb.c +@@ -4,6 +4,7 @@ + */ + + #include ++#include + + DECLARE_GLOBAL_DATA_PTR; + +@@ -15,10 +16,15 @@ int board_init(void) + return 0; + } + ++#ifdef CONFIG_MMC + int mmc_get_boot_dev(void) + { + int g_mmc_devid = -1; + char *uflag = (char *)0x81DFFFF0; ++ ++ if (!find_mmc_device(1)) ++ return 0; ++ + if (strncmp(uflag,"eMMC",4)==0) { + g_mmc_devid = 0; + printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid); +@@ -33,3 +39,4 @@ int mmc_get_env_dev(void) + { + return mmc_get_boot_dev(); + } ++#endif +-- +2.26.2 + diff --git a/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch b/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch new file mode 100644 index 000000000..e4cf8e56a --- /dev/null +++ b/package/boot/uboot-mediatek/patches/009-board-mediatek-Add-support-for-UniElec-U7623-board.patch @@ -0,0 +1,326 @@ +From 3fad1ca28d4c87346d18b89438bf2084fb2c3896 Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Sun, 12 Jul 2020 23:33:03 +0100 +Subject: [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board + +This is an MT7623A-based board, very similar to the Banana Pi R2. + +http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN + +Signed-off-by: David Woodhouse +--- + arch/arm/dts/Makefile | 1 + + .../arm/dts/mt7623a-unielec-u7623-02-emmc.dts | 211 ++++++++++++++++++ + board/mediatek/mt7623/MAINTAINERS | 7 + + configs/mt7623a_unielec_u7623_02_defconfig | 54 +++++ + 4 files changed, 273 insertions(+) + create mode 100644 arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts + create mode 100644 configs/mt7623a_unielec_u7623_02_defconfig + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index a3a1e3fbe4..caa7756c5d 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -949,6 +949,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \ + + dtb-$(CONFIG_ARCH_MEDIATEK) += \ + mt7622-rfb.dtb \ ++ mt7623a-unielec-u7623-02-emmc.dtb \ + mt7623n-bananapi-bpi-r2.dtb \ + mt7629-rfb.dtb \ + mt8512-bm1-emmc.dtb \ +diff --git a/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts +new file mode 100644 +index 0000000000..fdeec75b05 +--- /dev/null ++++ b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts +@@ -0,0 +1,211 @@ ++/* ++ * Copyright (C) 2018 MediaTek Inc. ++ * Author: Ryder Lee ++ * ++ * SPDX-License-Identifier: (GPL-2.0 OR MIT) ++ */ ++ ++/dts-v1/; ++#include "mt7623.dtsi" ++#include "mt7623-u-boot.dtsi" ++ ++/ { ++ model = "UniElec U7623-02 eMMC"; ++ compatible = "unielec,u7623-02-emmc", "mediatek,mt7623"; ++ ++ memory@80000000 { ++ device_type = "memory"; ++ reg = <0 0x80000000 0 0x20000000>; ++ }; ++ ++ chosen { ++ stdout-path = &uart2; ++ tick-timer = &timer0; ++ }; ++ ++ reg_1p8v: regulator-1p8v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-1.8V"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ reg_3p3v: regulator-3p3v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-3.3V"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ reg_5v: regulator-5v { ++ compatible = "regulator-fixed"; ++ regulator-name = "fixed-5V"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-boot-on; ++ regulator-always-on; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led3 { ++ label = "u7623-01:green:led3"; ++ gpios = <&gpio 14 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ ++ led4 { ++ label = "u7623-01:green:led4"; ++ gpios = <&gpio 15 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ }; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "rgmii"; ++ mediatek,switch = "mt7530"; ++ mediatek,mcm; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_default>; ++ status = "okay"; ++ bus-width = <8>; ++ max-frequency = <50000000>; ++ cap-mmc-highspeed; ++ vmmc-supply = <®_3p3v>; ++ vqmmc-supply = <®_1p8v>; ++ non-removable; ++}; ++ ++&pinctrl { ++ ephy_default: ephy_default { ++ mux { ++ function = "eth"; ++ groups = "mdc_mdio", "ephy"; ++ }; ++ ++ conf { ++ pins = "G2_TXEN", "G2_TXD0", "G2_TXD1", "G2_TXD2", ++ "G2_TXD3", "G2_TXC", "G2_RXC", "G2_RXD0", ++ "G2_RXD1", "G2_RXD2", "G2_RXD3", "G2_RXDV", ++ "MDC", "MDIO"; ++ drive-strength = <12>; ++ mediatek,tdsel = <5>; ++ }; ++ }; ++ ++ mmc0_pins_default: mmc0default { ++ mux { ++ function = "msdc"; ++ groups = "msdc0"; ++ }; ++ ++ conf-cmd-data { ++ pins = "MSDC0_CMD", "MSDC0_DAT0", "MSDC0_DAT1", ++ "MSDC0_DAT2", "MSDC0_DAT3", "MSDC0_DAT4", ++ "MSDC0_DAT5", "MSDC0_DAT6", "MSDC0_DAT7"; ++ input-enable; ++ bias-pull-up; ++ }; ++ ++ conf-clk { ++ pins = "MSDC0_CLK"; ++ bias-pull-down; ++ }; ++ ++ conf-rst { ++ pins = "MSDC0_RSTB"; ++ bias-pull-up; ++ }; ++ }; ++ ++ pcie_default: pcie-default { ++ mux { ++ function = "pcie"; ++ groups = "pcie0_0_perst", "pcie1_0_perst"; ++ }; ++ }; ++ ++ uart0_pins_a: uart0-default { ++ mux { ++ function = "uart"; ++ groups = "uart0_0_txd_rxd"; ++ }; ++ }; ++ ++ uart1_pins_a: uart1-default { ++ mux { ++ function = "uart"; ++ groups = "uart1_0_txd_rxd"; ++ }; ++ }; ++ ++ uart2_pins_a: uart2-default { ++ mux { ++ function = "uart"; ++ groups = "uart2_0_txd_rxd"; ++ }; ++ }; ++ ++ uart2_pins_b: uart2-alt { ++ mux { ++ function = "uart"; ++ groups = "uart2_1_txd_rxd"; ++ }; ++ }; ++}; ++ ++&pcie { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_default>; ++ status = "okay"; ++ ++ pcie@0,0 { ++ status = "okay"; ++ }; ++ ++ pcie@1,0 { ++ status = "okay"; ++ }; ++}; ++ ++&pcie0_phy { ++ status = "okay"; ++}; ++ ++&pcie1_phy { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins_a>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pins_b>; ++ status = "okay"; ++}; +diff --git a/board/mediatek/mt7623/MAINTAINERS b/board/mediatek/mt7623/MAINTAINERS +index eeb0375d70..1a8d796bd3 100644 +--- a/board/mediatek/mt7623/MAINTAINERS ++++ b/board/mediatek/mt7623/MAINTAINERS +@@ -5,3 +5,10 @@ S: Maintained + F: board/mediatek/mt7623 + F: include/configs/mt7623.h + F: configs/mt7623n_bpir2_defconfig ++ ++UNIELEC U7623 ++M: Ryder Lee ++M: David Woodhouse ++S: Maintained ++F: arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts ++F: configs/mt7623a_unielec_u7623_02_defconfig +diff --git a/configs/mt7623a_unielec_u7623_02_defconfig b/configs/mt7623a_unielec_u7623_02_defconfig +new file mode 100644 +index 0000000000..72b5f31092 +--- /dev/null ++++ b/configs/mt7623a_unielec_u7623_02_defconfig +@@ -0,0 +1,54 @@ ++CONFIG_ARM=y ++CONFIG_SYS_THUMB_BUILD=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_SYS_TEXT_BASE=0x81e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_ENV_SIZE=0x1000 ++CONFIG_ENV_OFFSET=0x100000 ++CONFIG_TARGET_MT7623=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DISTRO_DEFAULTS=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_BOOTDELAY=3 ++CONFIG_SYS_CONSOLE_IS_IN_ENV=y ++CONFIG_DEFAULT_FDT_FILE="mt7623a-unielec-u7623-02-emmc.dtb" ++# CONFIG_DISPLAY_BOARDINFO is not set ++CONFIG_SYS_PROMPT="U-Boot> " ++CONFIG_CMD_BOOTMENU=y ++# CONFIG_CMD_ELF is not set ++# CONFIG_CMD_XIMG is not set ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_READ=y ++# CONFIG_CMD_SETEXPR is not set ++# CONFIG_CMD_NFS is not set ++CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc" ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_DM_MMC=y ++# CONFIG_MMC_QUIRKS is not set ++CONFIG_SUPPORT_EMMC_BOOT=y ++CONFIG_MMC_HS400_SUPPORT=y ++CONFIG_MMC_MTK=y ++CONFIG_PHY_FIXED=y ++CONFIG_DM_ETH=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7623=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SYSRESET=y ++CONFIG_SYSRESET_WATCHDOG=y ++CONFIG_TIMER=y ++CONFIG_MTK_TIMER=y ++CONFIG_WDT_MTK=y ++CONFIG_LZMA=y +-- +2.26.2 + diff --git a/package/boot/uboot-mediatek/patches/010-no-binman.patch b/package/boot/uboot-mediatek/patches/010-no-binman.patch new file mode 100644 index 000000000..8a05a2d41 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/010-no-binman.patch @@ -0,0 +1,25 @@ +--- a/Makefile ++++ b/Makefile +@@ -1667,8 +1667,10 @@ u-boot-elf.lds: arch/u-boot-elf.lds prepare FORCE + ifeq ($(CONFIG_SPL),y) + spl/u-boot-spl-mtk.bin: spl/u-boot-spl + +-u-boot-mtk.bin: u-boot.dtb u-boot.img spl/u-boot-spl-mtk.bin FORCE +- $(call if_changed,binman) ++OBJCOPYFLAGS_u-boot-mtk.bin = -I binary -O binary \ ++ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff ++u-boot-mtk.bin: u-boot.img spl/u-boot-spl-mtk.bin FORCE ++ $(call if_changed,pad_cat) + else + MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \ + -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \ +--- a/arch/arm/mach-mediatek/Kconfig ++++ b/arch/arm/mach-mediatek/Kconfig +@@ -36,7 +36,6 @@ config TARGET_MT7629 + bool "MediaTek MT7629 SoC" + select CPU_V7A + select SPL +- select BINMAN + help + The MediaTek MT7629 is a ARM-based SoC with a dual-core Cortex-A7 + including DDR3, crypto engine, 3x3 11n/ac Wi-Fi, Gigabit Ethernet, diff --git a/package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch b/package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch new file mode 100644 index 000000000..ec189f82d --- /dev/null +++ b/package/boot/uboot-mediatek/patches/010-update-u7623-defconfig.patch @@ -0,0 +1,17 @@ +diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig +index 6b9fbd7e22..fb2a004803 100644 +--- a/configs/mt7623a_unielec_u7623_02_defconfig ++++ b/configs/mt7623a_unielec_u7623_02_defconfig +@@ -52,3 +52,12 @@ CONFIG_TIMER=y + CONFIG_MTK_TIMER=y + CONFIG_WDT_MTK=y + CONFIG_LZMA=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_OF_LIBFDT_OVERLAY=y ++#enables savenenv-command ++CONFIG_ENV_IS_IN_FAT=y ++CONFIG_ENV_FAT_INTERFACE="mmc" ++CONFIG_ENV_FAT_DEVICE_AND_PART="0:2" ++CONFIG_ENV_FAT_FILE="uboot.env" ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_SETEXPR=y diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 029018b41..6a1cd3379 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -29,6 +29,13 @@ define U-Boot/clearfog UBOOT_IMAGE:=u-boot-spl.kwb endef +define U-Boot/helios4 + NAME:=Kobol Helios 4 + BUILD_DEVICES:=kobol_helios4 + BUILD_SUBTARGET:=cortexa9 + UBOOT_IMAGE:=u-boot-spl.kwb +endef + define U-Boot/uDPU NAME:=Methode uDPU BUILD_DEVICES:=methode_udpu @@ -37,6 +44,7 @@ endef UBOOT_TARGETS:= \ clearfog \ + helios4 \ uDPU Build/Exports:=$(Host/Exports) diff --git a/package/firmware/ath10k-ct-firmware/Makefile b/package/firmware/ath10k-ct-firmware/Makefile index 18370b7d8..c298f8018 100644 --- a/package/firmware/ath10k-ct-firmware/Makefile +++ b/package/firmware/ath10k-ct-firmware/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct-firmware -PKG_VERSION:=2020-04-24 -PKG_RELEASE:=2 +PKG_VERSION:=2020-07-02 +PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk @@ -95,14 +95,14 @@ define Download/ct-firmware-htt URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT) endef -QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.018 +QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.019 define Download/ath10k-firmware-qca988x-ct $(call Download/ct-firmware,QCA988X,) HASH:=8b4c99253aa309d35f2e060c190091b8db1b84dbda06a6a15c83ac0f9a938126 endef $(eval $(call Download,ath10k-firmware-qca988x-ct)) -QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.018 +QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.019 define Download/ath10k-firmware-qca988x-ct-full-htt $(call Download/ct-firmware-full-htt,QCA988X,) HASH:=a7168916d6aa5e4d7858f8b620c0c980c76d03f390929db6f4077685ce2051e7 @@ -110,14 +110,14 @@ endef $(eval $(call Download,ath10k-firmware-qca988x-ct-full-htt)) -QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.018 +QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.019 define Download/ath10k-firmware-qca9887-ct $(call Download/ct-firmware,QCA9887,ath10k-9887) HASH:=459692deb186a63ab8eeddb7ad5d54779266e68ca686e7c46062554db6dca12b endef $(eval $(call Download,ath10k-firmware-qca9887-ct)) -QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.018 +QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.019 define Download/ath10k-firmware-qca9887-ct-full-htt $(call Download/ct-firmware-full-htt,QCA9887,ath10k-9887) HASH:=fd126a457d0927d0c8ea10d66ef5b67d5e1e0741f8692bb3016bb602d0af3098 @@ -125,90 +125,90 @@ endef $(eval $(call Download,ath10k-firmware-qca9887-ct-full-htt)) -QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018 +QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 define Download/ath10k-firmware-qca99x0-ct $(call Download/ct-firmware,QCA99X0,ath10k-10-4b) - HASH:=cf26eb37524de54af51fe9b2efffc85e0e70ab849e8607ef63ce5a8ecffeaa42 + HASH:=7dc934f934bc4973c9273a4f22cfead8e26ec6f579647af31b718a860eca0a4b endef $(eval $(call Download,ath10k-firmware-qca99x0-ct)) -QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018 +QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca99x0-ct-full-htt $(call Download/ct-firmware-full-htt,QCA99X0,ath10k-10-4b) - HASH:=e9737538d7379e13ad4e4c8c519a63659b5e34a35455ed9ac4399ae8097caabc + HASH:=71a27b245a382fe009938d2826d5c97a90dceb10ddf638325268df91837ea302 endef $(eval $(call Download,ath10k-firmware-qca99x0-ct-full-htt)) -QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018 +QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca99x0-ct-htt $(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b) - HASH:=4d4f74afca487d452f244cd48304cf9710d8941eb97a6346a949ed6b6877d657 + HASH:=9ed4fe41e5b0f30172f71ae0fe382dc0aab8aa4f8a898417af4f7ee936575ef6 endef $(eval $(call Download,ath10k-firmware-qca99x0-ct-htt)) -QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018 +QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 define Download/ath10k-firmware-qca9984-ct $(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b) - HASH:=a6b3d66efe640a430a837f238e91eddcd423eed6b887d3ae19716d87a71fd0b1 + HASH:=32d13f432691fe759ded7d027052e925233adb436cd8f729f85ec3d19ccd1dfd endef $(eval $(call Download,ath10k-firmware-qca9984-ct)) -QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018 +QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca9984-ct-full-htt $(call Download/ct-firmware-full-htt,QCA9984,ath10k-9984-10-4b) - HASH:=96060227e372b3b210badccbe6b0bd75d9a35335a7a0f2966964e9e89f66b00f + HASH:=e8ab69777bd00b5fc6b1b7acccb55b903553a99932a5b0351602b5f690106588 endef $(eval $(call Download,ath10k-firmware-qca9984-ct-full-htt)) -QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018 +QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca9984-ct-htt $(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b) - HASH:=ee593fb5724d75c372de02ac7894e1630ee9f909fcb2e2bbf17aadef67cb9d43 + HASH:=74449b303b626e0713b3fd4f2d6103d65859403b2dd7bdd8882aa772b69b59c7 endef $(eval $(call Download,ath10k-firmware-qca9984-ct-htt)) -QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018 +QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 define Download/ath10k-firmware-qca4019-ct $(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b) - HASH:=46d8f8f1e780813299dc8780eedcfceda103c6b4d8908589ad1adbef921714c0 + HASH:=4b89763087c7ed9b56046c4e621b7f045e452436d8d9b430a5d171179e313592 endef $(eval $(call Download,ath10k-firmware-qca4019-ct)) -QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018 +QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca4019-ct-full-htt $(call Download/ct-firmware-full-htt,QCA4019,ath10k-4019-10-4b) - HASH:=d884624fc34f4b5de7a3ec0534627c46cea25fca45657f3a2f6bb85f6c5893d7 + HASH:=fba591e5777c53b82542ba16cae69d9bb4684837f2fa4cee1b9b26f648096748 endef $(eval $(call Download,ath10k-firmware-qca4019-ct-full-htt)) -QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018 +QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca4019-ct-htt $(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b) - HASH:=51fe06f66365771647d16039cca8b541de3d642c45271977a4cfd433c2c5d45b + HASH:=0d534c3c424184b8ec2773f15c8933bdab0d39b6f664d2578c6602b0eb7035d1 endef $(eval $(call Download,ath10k-firmware-qca4019-ct-htt)) -QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.018 +QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.019 define Download/ath10k-firmware-qca9888-ct $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b) - HASH:=d01f1429aaf0bfac07eee3547e5821d19136840b2f983e75e76979a5ac19b6f0 + HASH:=048f4300725e6ebbf94a6bf4f3f4e4592c446fcdbe1d801aaac024b15e89e0c9 endef $(eval $(call Download,ath10k-firmware-qca9888-ct)) -QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.018 +QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca9888-ct-full-htt $(call Download/ct-firmware-full-htt,QCA9888,ath10k-9888-10-4b) - HASH:=68c42f8e0dcf77f18d4813ac93174bf06ff5cf5aa4f69befe7f35f9fae1de1e3 + HASH:=d2a7e9fea6bd854721b3fc03a3a00d379d303b2bce339377ee87a1c14a60312d endef $(eval $(call Download,ath10k-firmware-qca9888-ct-full-htt)) -QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.018 +QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.019 define Download/ath10k-firmware-qca9888-ct-htt $(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b) - HASH:=6c692141155f5bb74c0117553d5d48ff2aaba73bd4d5e90a5044a5e2ec0faab0 + HASH:=e52a6db33347c641ee791fd9a3a57a2503cdda1adc6b8d943e336431528b9d2a endef $(eval $(call Download,ath10k-firmware-qca9888-ct-htt)) diff --git a/package/firmware/layerscape/fman-ucode/Makefile b/package/firmware/layerscape/fman-ucode/Makefile index ba1dcf916..8c76774ac 100644 --- a/package/firmware/layerscape/fman-ucode/Makefile +++ b/package/firmware/layerscape/fman-ucode/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fman-ucode PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/NXP/qoriq-fm-ucode.git @@ -31,9 +31,9 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1043_r1.1_106_4_18.bin \ - $(STAGING_DIR_IMAGE)/ls1043ardb-fman.bin + $(STAGING_DIR_IMAGE)/fsl_ls1043a-rdb-fman.bin $(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1046_r1.0_106_4_18.bin \ - $(STAGING_DIR_IMAGE)/ls1046ardb-fman.bin + $(STAGING_DIR_IMAGE)/fsl_ls1046a-rdb-fman.bin endef $(eval $(call BuildPackage,layerscape-fman)) diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile index 89238dce3..d056825ac 100644 --- a/package/firmware/layerscape/ls-dpl/Makefile +++ b/package/firmware/layerscape/ls-dpl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-dpl PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils @@ -33,13 +33,13 @@ MAKE_VARS+= \ define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpl-eth.0x1D_0x0D.dtb \ - $(STAGING_DIR_IMAGE)/ls1088ardb-dpl.dtb + $(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpl.dtb $(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpc.0x1D-0x0D.dtb \ - $(STAGING_DIR_IMAGE)/ls1088ardb-dpc.dtb + $(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpc.dtb $(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpl-eth.0x2A_0x41.dtb \ - $(STAGING_DIR_IMAGE)/ls2088ardb-dpl.dtb + $(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpl.dtb $(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpc.0x2A_0x41.dtb \ - $(STAGING_DIR_IMAGE)/ls2088ardb-dpc.dtb + $(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpc.dtb endef $(eval $(call BuildPackage,layerscape-dpl)) diff --git a/package/firmware/layerscape/ls-mc/Makefile b/package/firmware/layerscape/ls-mc/Makefile index d7b88e01a..0da0b9153 100644 --- a/package/firmware/layerscape/ls-mc/Makefile +++ b/package/firmware/layerscape/ls-mc/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-mc PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/NXP/qoriq-mc-binary.git @@ -31,9 +31,9 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/ls1088a/mc_10.20.4_ls1088a.itb \ - $(STAGING_DIR_IMAGE)/ls1088ardb-mc.itb + $(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-mc.itb $(CP) $(PKG_BUILD_DIR)/ls2088a/mc_10.20.4_ls2088a.itb \ - $(STAGING_DIR_IMAGE)/ls2088ardb-mc.itb + $(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-mc.itb endef $(eval $(call BuildPackage,layerscape-mc)) diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile index 848c284d5..dca0f0ff2 100644 --- a/package/firmware/layerscape/ls-rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ls-rcw PKG_VERSION:=LSDK-20.04 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/rcw @@ -26,34 +26,34 @@ define Package/layerscape-rcw endef BOARDS := \ - ls1012ardb \ - ls1012afrdm \ - ls1012afrwy \ - ls1043ardb \ - ls1043ardb-sdboot \ - ls1046ardb \ - ls1046ardb-sdboot \ - ls1088ardb \ - ls1088ardb-sdboot \ - ls2088ardb \ - ls1021atwr + ls1012a-rdb \ + ls1012a-frdm \ + ls1012a-frwy-sdboot \ + ls1043a-rdb \ + ls1043a-rdb-sdboot \ + ls1046a-rdb \ + ls1046a-rdb-sdboot \ + ls1088a-rdb \ + ls1088a-rdb-sdboot \ + ls2088a-rdb \ + ls1021a-twr -RCW_ls1012ardb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin -RCW_ls1012afrdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin -RCW_ls1012afrwy :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin -RCW_ls1043ardb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin -RCW_ls1043ardb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin -RCW_ls1046ardb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin -RCW_ls1046ardb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin -RCW_ls1088ardb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin -RCW_ls1088ardb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin -RCW_ls2088ardb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin -RCW_ls1021atwr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin +RCW_ls1012a-rdb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin +RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin +RCW_ls1012a-frwy-sdboot :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin +RCW_ls1043a-rdb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin +RCW_ls1043a-rdb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin +RCW_ls1046a-rdb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin +RCW_ls1046a-rdb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin +RCW_ls1088a-rdb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin +RCW_ls1088a-rdb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin +RCW_ls2088a-rdb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin +RCW_ls1021a-twr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(foreach board,$(BOARDS), \ - $(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/$(board)-rcw.bin;) + $(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/fsl_$(board)-rcw.bin;) endef $(eval $(call BuildPackage,layerscape-rcw)) diff --git a/package/firmware/linux-firmware/misc.mk b/package/firmware/linux-firmware/misc.mk new file mode 100644 index 000000000..d0956f77b --- /dev/null +++ b/package/firmware/linux-firmware/misc.mk @@ -0,0 +1,9 @@ +Package/eip197-mini-firmware = $(call Package/firmware-default,Inside Secure EIP197 mini firmware) +define Package/eip197-mini-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/inside-secure/eip197_minifw + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ifpp.bin \ + $(PKG_BUILD_DIR)/inside-secure/eip197_minifw/ipue.bin \ + $(1)/lib/firmware/inside-secure/eip197_minifw +endef +$(eval $(call BuildPackage,eip197-mini-firmware)) diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index 1ed5012b8..1e1447cde 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=broadcom-wl PKG_VERSION:=5.10.56.27.3 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 33447341b..352c365f2 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -223,7 +223,7 @@ enable_broadcom() { } local _c=0 - local nas="$(which nas)" + local nas="$(command -v nas)" local if_pre_up if_up nas_cmd local vif vif_pre_up vif_post_up vif_do_up vif_txpower local bssmax=$(wlc ifname "$device" bssmax) diff --git a/package/kernel/kmod-sched-cake-oot/Makefile b/package/kernel/kmod-sched-cake-oot/Makefile index 65042ce1f..a6ab1eb4c 100644 --- a/package/kernel/kmod-sched-cake-oot/Makefile +++ b/package/kernel/kmod-sched-cake-oot/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2020-01-10 -PKG_SOURCE_VERSION:=aeff7a3e61ffa3159a8a95384d33e47a006211f4 -PKG_MIRROR_HASH:=5bf06a804824db36ae393fc174aeec7b12633176e05a765c0931b39df5bd34df +PKG_SOURCE_DATE:=2020-07-24 +PKG_SOURCE_VERSION:=48979385757f3408c3427b3ebbf5963efdada5aa +PKG_MIRROR_HASH:=0e8ed53f55e28ad0c30f20293c16988876bae8d6f70f5629a43cf2ce1e49fc51 PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile index 99263cce4..def676b83 100644 --- a/package/kernel/lantiq/ltq-vmmc/Makefile +++ b/package/kernel/lantiq/ltq-vmmc/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=drv_vmmc PKG_VERSION:=1.9.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57 @@ -170,7 +170,7 @@ endef define KernelPackage/ltq-vmmc/install $(INSTALL_DIR) $(1)/etc/init.d $(1)/$(FW_DIR) $(INSTALL_BIN) ./files/vmmc.init $(1)/etc/init.d/vmmc - $(CP) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/firmware/$(FW_SOURCE) $(1)/$(FW_DIR)/$(FW_TARGET) ln -s /$(FW_DIR)/$(FW_TARGET) $(1)/$(FW_DIR)/$(FW_TARGET_GENERIC) $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC) $(1)/$(FW_DIR)/$(COEF_TARGET) $(CP) $(PKG_BUILD_DIR)/coef/$(COEF_SRC_FXO) $(1)/$(FW_DIR)/$(COEF_TARGET_FXO) diff --git a/package/kernel/lantiq/ltq-vmmc/files/vmmc.init b/package/kernel/lantiq/ltq-vmmc/files/vmmc.init index 100a97dc4..402376e29 100644 --- a/package/kernel/lantiq/ltq-vmmc/files/vmmc.init +++ b/package/kernel/lantiq/ltq-vmmc/files/vmmc.init @@ -5,15 +5,9 @@ START=31 start() { - [ ! -c /dev/vmmc10 ] && { - mknod /dev/vmmc10 c 122 10 - mknod /dev/vmmc11 c 122 11 - mknod /dev/vmmc12 c 122 12 - mknod /dev/vmmc13 c 122 13 - mknod /dev/vmmc14 c 122 14 - mknod /dev/vmmc15 c 122 15 - mknod /dev/vmmc16 c 122 16 - mknod /dev/vmmc17 c 122 17 - mknod /dev/vmmc18 c 122 18 - } + for i in 10 11 12 13 14 15 16 17 18; do + if ! [ -e /dev/vmmc$i ]; then + mknod -m 664 /dev/vmmc$i c 122 $i + fi + done } diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index b870304ad..8a7232d8b 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -270,6 +270,32 @@ endef $(eval $(call KernelPackage,dm-raid)) +define KernelPackage/iscsi-initiator + SUBMENU:=$(BLOCK_MENU) + TITLE:=iSCSI Initiator over TCP/IP + DEPENDS:=+kmod-scsi-core +kmod-crypto-hash + KCONFIG:= \ + CONFIG_INET \ + CONFIG_SCSI_LOWLEVEL=y \ + CONFIG_ISCSI_TCP \ + CONFIG_SCSI_ISCSI_ATTRS=y + FILES:= \ + $(LINUX_DIR)/drivers/scsi/iscsi_tcp.ko \ + $(LINUX_DIR)/drivers/scsi/libiscsi.ko \ + $(LINUX_DIR)/drivers/scsi/libiscsi_tcp.ko \ + $(LINUX_DIR)/drivers/scsi/scsi_transport_iscsi.ko + AUTOLOAD:=$(call AutoProbe,libiscsi libiscsi_tcp scsi_transport_iscsi iscsi_tcp) +endef + +define KernelPackage/iscsi-initiator/description +The iSCSI Driver provides a host with the ability to access storage through an +IP network. The driver uses the iSCSI protocol to transport SCSI requests and +responses over a TCP/IP network between the host (the "initiator") and "targets". +endef + +$(eval $(call KernelPackage,iscsi-initiator)) + + define KernelPackage/md-mod SUBMENU:=$(BLOCK_MENU) TITLE:=MD RAID @@ -539,3 +565,17 @@ define KernelPackage/scsi-tape endef $(eval $(call KernelPackage,scsi-tape)) + +define KernelPackage/iosched-bfq + SUBMENU:=$(BLOCK_MENU) + TITLE:=Kernel support for BFQ I/O scheduler + KCONFIG:= \ + CONFIG_IOSCHED_BFQ \ + CONFIG_BFQ_GROUP_IOSCHED=y \ + CONFIG_BFQ_CGROUP_DEBUG=n + FILES:= \ + $(LINUX_DIR)/block/bfq.ko + AUTOLOAD:=$(call AutoLoad,10,bfq) +endef + +$(eval $(call KernelPackage,iosched-bfq)) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 900172179..48777764a 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -377,7 +377,7 @@ $(eval $(call KernelPackage,crypto-hw-padlock)) define KernelPackage/crypto-hw-safexcel TITLE:= MVEBU SafeXcel Crypto Engine module - DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) \ + DEPENDS:=@!LINUX_4_14 @(TARGET_mvebu_cortexa53||TARGET_mvebu_cortexa72) +eip197-mini-firmware \ +kmod-crypto-authenc +kmod-crypto-md5 +kmod-crypto-hmac +kmod-crypto-sha256 +kmod-crypto-sha512 KCONFIG:= \ CONFIG_CRYPTO_HW=y \ @@ -392,9 +392,11 @@ MVEBU's EIP97 and EIP197 Cryptographic Engine driver designed by Inside Secure. This is found on Marvell Armada 37xx/7k/8k SoCs. Particular version of these IP (EIP197B and EIP197D) require firmware. -Unfortunately it's not freely available and needs signed Non-Disclosure -Agreement (NDA) with Marvell. For those who have signed NDA the firmware can be -obtained at https://extranet.marvell.com. +The mini firmware package provides limited functionality, for most operations +a full-featured firmware is required. Unfortunately the "full" firmware is not +freely available and needs signed Non-Disclosure Agreement (NDA) with Marvell. +For those who have signed NDA the firmware can be obtained at +https://extranet.marvell.com. endef $(eval $(call KernelPackage,crypto-hw-safexcel)) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index e14c6b31c..1289cc1f2 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -147,7 +147,6 @@ define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support DEPENDS:=+kmod-crypto-acompress - HIDDEN:=1 KCONFIG:= \ CONFIG_CRYPTO_LZ4 \ CONFIG_LZ4_COMPRESS \ diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 15d67b467..6eb940483 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -732,6 +732,23 @@ endef $(eval $(call KernelPackage,rtc-rx8025)) +define KernelPackage/rtc-s35390a + SUBMENU:=$(OTHER_MENU) + TITLE:=Seico S-35390A + DEFAULT:=m if ALL_KMODS && RTC_SUPPORT + DEPENDS:=+kmod-i2c-core + KCONFIG:=CONFIG_RTC_DRV_S35390A \ + CONFIG_RTC_CLASS=y + FILES:=$(LINUX_DIR)/drivers/rtc/rtc-s35390a.ko + AUTOLOAD:=$(call AutoLoad,50,rtc-s35390a,1) +endef + +define KernelPackage/rtc-s35390a/description + Kernel module for Seiko Instruments S-35390A I2C RTC chip +endef + +$(eval $(call KernelPackage,rtc-s35390a)) + define KernelPackage/mtdtests SUBMENU:=$(OTHER_MENU) @@ -913,15 +930,14 @@ $(eval $(call KernelPackage,ikconfig)) define KernelPackage/zram SUBMENU:=$(OTHER_MENU) TITLE:=ZRAM - DEPENDS:=+kmod-lib-lzo +kmod-lib-lz4 + DEPENDS:=+kmod-lib-lzo KCONFIG:= \ CONFIG_ZSMALLOC \ CONFIG_ZRAM \ CONFIG_ZRAM_DEBUG=n \ CONFIG_PGTABLE_MAPPING=n \ CONFIG_ZRAM_WRITEBACK=n \ - CONFIG_ZSMALLOC_STAT=n \ - CONFIG_ZRAM_LZ4_COMPRESS=y + CONFIG_ZSMALLOC_STAT=n FILES:= \ $(LINUX_DIR)/mm/zsmalloc.ko \ $(LINUX_DIR)/drivers/block/zram/zram.ko diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 314bda0a1..fc411c5a5 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -1118,7 +1118,7 @@ $(eval $(call KernelPackage,usb-net)) define AddDepends/usb-net SUBMENU:=$(USB_MENU) - DEPENDS+=kmod-usb-net $(1) + DEPENDS+=+kmod-usb-net $(1) endef diff --git a/package/kernel/linux/modules/wpan.mk b/package/kernel/linux/modules/wpan.mk index 053fa1e4b..dab8a0cb7 100644 --- a/package/kernel/linux/modules/wpan.mk +++ b/package/kernel/linux/modules/wpan.mk @@ -88,6 +88,7 @@ define KernelPackage/at86rf230 CONFIG_SPI=y \ CONFIG_SPI_MASTER=y FILES:=$(LINUX_DIR)/drivers/net/ieee802154/at86rf230.ko + AUTOLOAD:=$(call AutoProbe,at86rf230) endef $(eval $(call KernelPackage,at86rf230)) @@ -100,6 +101,7 @@ define KernelPackage/mrf24j40 CONFIG_SPI=y \ CONFIG_SPI_MASTER=y FILES:=$(LINUX_DIR)/drivers/net/ieee802154/mrf24j40.ko + AUTOLOAD:=$(call AutoProbe,mrf24j40) endef $(eval $(call KernelPackage,mrf24j40)) @@ -112,10 +114,27 @@ define KernelPackage/cc2520 CONFIG_SPI=y \ CONFIG_SPI_MASTER=y FILES:=$(LINUX_DIR)/drivers/net/ieee802154/cc2520.ko + AUTOLOAD:=$(call AutoProbe,cc2520) endef $(eval $(call KernelPackage,cc2520)) + +define KernelPackage/ca8210 + SUBMENU:=$(WPAN_MENU) + TITLE:=CA8210 transceiver driver + DEPENDS:=+kmod-mac802154 + KCONFIG:=CONFIG_IEEE802154_CA8210 \ + CONFIG_SPI=y \ + CONFIG_SPI_MASTER=y \ + CONFIG_IEEE802154_CA8210_DEBUGFS=n + FILES:=$(LINUX_DIR)/drivers/net/ieee802154/ca8210.ko + AUTOLOAD:=$(call AutoProbe,ca8210) +endef + +$(eval $(call KernelPackage,ca8210)) + + define KernelPackage/ieee802154-6lowpan SUBMENU:=$(WPAN_MENU) TITLE:= 6LoWPAN support over IEEE-802.15.4 diff --git a/package/kernel/mac80211/patches/subsys/070-backports-add-netif_receive_skb_list.patch b/package/kernel/mac80211/patches/subsys/070-backports-add-netif_receive_skb_list.patch new file mode 100644 index 000000000..b26a6bc38 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/070-backports-add-netif_receive_skb_list.patch @@ -0,0 +1,30 @@ +From: Felix Fietkau +Date: Fri, 14 Aug 2020 16:13:45 +0200 +Subject: [PATCH] backports: add netif_receive_skb_list + +It will be needed by pending mac80211 changes + +Signed-off-by: Felix Fietkau +--- + +--- a/backport-include/linux/netdevice.h ++++ b/backport-include/linux/netdevice.h +@@ -372,6 +372,18 @@ static inline int _bp_netdev_upper_dev_l + macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__) + #endif + ++#if LINUX_VERSION_IS_LESS(4,19,0) ++static inline void netif_receive_skb_list(struct list_head *head) ++{ ++ struct sk_buff *skb, *next; ++ ++ list_for_each_entry_safe(skb, next, head, list) { ++ skb_list_del_init(skb); ++ netif_receive_skb(skb); ++ } ++} ++#endif ++ + #if LINUX_VERSION_IS_LESS(5,0,0) + static inline int backport_dev_open(struct net_device *dev, struct netlink_ext_ack *extack) + { diff --git a/package/kernel/mac80211/patches/subsys/071-backports-add-skb_list_del_init.patch b/package/kernel/mac80211/patches/subsys/071-backports-add-skb_list_del_init.patch new file mode 100644 index 000000000..ee7e63498 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/071-backports-add-skb_list_del_init.patch @@ -0,0 +1,24 @@ +From: Felix Fietkau +Date: Fri, 14 Aug 2020 16:13:55 +0200 +Subject: [PATCH] backports: add skb_list_del_init + +It will be needed by pending mac80211 changes + +Signed-off-by: Felix Fietkau +--- + +--- a/backport-include/linux/skbuff.h ++++ b/backport-include/linux/skbuff.h +@@ -384,6 +384,12 @@ static inline void skb_mark_not_on_list( + { + skb->next = NULL; + } ++ ++static inline void skb_list_del_init(struct sk_buff *skb) ++{ ++ __list_del_entry(&skb->list); ++ skb_mark_not_on_list(skb); ++} + #endif /* 4.19.10 <= x < 4.20 */ + #endif + diff --git a/package/kernel/mac80211/patches/subsys/311-mac80211-use-rate-provided-via-status-rate-on-ieee80.patch b/package/kernel/mac80211/patches/subsys/311-mac80211-use-rate-provided-via-status-rate-on-ieee80.patch new file mode 100644 index 000000000..ee1db716e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/311-mac80211-use-rate-provided-via-status-rate-on-ieee80.patch @@ -0,0 +1,151 @@ +From: Felix Fietkau +Date: Wed, 12 Aug 2020 17:04:22 +0200 +Subject: [PATCH] mac80211: use rate provided via status->rate on + ieee80211_tx_status_ext for AQL + +Since ieee80211_tx_info does not have enough room to encode HE rates, HE +drivers use status->rate to provide rate info. +Store it in struct sta_info and use it for AQL. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/airtime.c ++++ b/net/mac80211/airtime.c +@@ -487,14 +487,61 @@ u32 ieee80211_calc_rx_airtime(struct iee + } + EXPORT_SYMBOL_GPL(ieee80211_calc_rx_airtime); + ++static bool ieee80211_fill_rate_info(struct ieee80211_hw *hw, ++ struct ieee80211_rx_status *stat, u8 band, ++ struct rate_info *ri) ++{ ++ struct ieee80211_supported_band *sband = hw->wiphy->bands[band]; ++ int i; ++ ++ if (!ri || !sband) ++ return false; ++ ++ stat->bw = ri->bw; ++ stat->nss = ri->nss; ++ stat->rate_idx = ri->mcs; ++ ++ if (ri->flags & RATE_INFO_FLAGS_HE_MCS) ++ stat->encoding = RX_ENC_HE; ++ else if (ri->flags & RATE_INFO_FLAGS_VHT_MCS) ++ stat->encoding = RX_ENC_VHT; ++ else if (ri->flags & RATE_INFO_FLAGS_MCS) ++ stat->encoding = RX_ENC_HT; ++ else ++ stat->encoding = RX_ENC_LEGACY; ++ ++ if (ri->flags & RATE_INFO_FLAGS_SHORT_GI) ++ stat->enc_flags |= RX_ENC_FLAG_SHORT_GI; ++ ++ stat->he_gi = ri->he_gi; ++ ++ if (stat->encoding != RX_ENC_LEGACY) ++ return true; ++ ++ stat->rate_idx = 0; ++ for (i = 0; i < sband->n_bitrates; i++) { ++ if (ri->legacy != sband->bitrates[i].bitrate) ++ continue; ++ ++ stat->rate_idx = i; ++ return true; ++ } ++ ++ return false; ++} ++ + static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw, + struct ieee80211_tx_rate *rate, ++ struct rate_info *ri, + u8 band, int len) + { + struct ieee80211_rx_status stat = { + .band = band, + }; + ++ if (ieee80211_fill_rate_info(hw, &stat, band, ri)) ++ goto out; ++ + if (rate->idx < 0 || !rate->count) + return 0; + +@@ -522,6 +569,7 @@ static u32 ieee80211_calc_tx_airtime_rat + stat.encoding = RX_ENC_LEGACY; + } + ++out: + return ieee80211_calc_rx_airtime(hw, &stat, len); + } + +@@ -536,7 +584,7 @@ u32 ieee80211_calc_tx_airtime(struct iee + struct ieee80211_tx_rate *rate = &info->status.rates[i]; + u32 cur_duration; + +- cur_duration = ieee80211_calc_tx_airtime_rate(hw, rate, ++ cur_duration = ieee80211_calc_tx_airtime_rate(hw, rate, NULL, + info->band, len); + if (!cur_duration) + break; +@@ -573,6 +621,7 @@ u32 ieee80211_calc_expected_tx_airtime(s + struct sta_info *sta = container_of(pubsta, struct sta_info, + sta); + struct ieee80211_tx_rate *rate = &sta->tx_stats.last_rate; ++ struct rate_info *ri = &sta->tx_stats.last_rate_info; + u32 airtime; + + if (!(rate->flags & (IEEE80211_TX_RC_VHT_MCS | +@@ -586,7 +635,7 @@ u32 ieee80211_calc_expected_tx_airtime(s + * This will not be very accurate, but much better than simply + * assuming un-aggregated tx. + */ +- airtime = ieee80211_calc_tx_airtime_rate(hw, rate, band, ++ airtime = ieee80211_calc_tx_airtime_rate(hw, rate, ri, band, + ampdu ? len * 16 : len); + if (ampdu) + airtime /= 16; +--- a/net/mac80211/sta_info.h ++++ b/net/mac80211/sta_info.h +@@ -609,6 +609,7 @@ struct sta_info { + u64 packets[IEEE80211_NUM_ACS]; + u64 bytes[IEEE80211_NUM_ACS]; + struct ieee80211_tx_rate last_rate; ++ struct rate_info last_rate_info; + u64 msdu[IEEE80211_NUM_TIDS + 1]; + } tx_stats; + u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1]; +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -1147,9 +1147,17 @@ void ieee80211_tx_status_ext(struct ieee + struct ieee80211_tx_info *info = status->info; + struct ieee80211_sta *pubsta = status->sta; + struct ieee80211_supported_band *sband; ++ struct sta_info *sta; + int retry_count; + bool acked, noack_success; + ++ if (pubsta) { ++ sta = container_of(pubsta, struct sta_info, sta); ++ ++ if (status->rate) ++ sta->tx_stats.last_rate_info = *status->rate; ++ } ++ + if (status->skb) + return __ieee80211_tx_status(hw, status); + +@@ -1164,10 +1172,6 @@ void ieee80211_tx_status_ext(struct ieee + noack_success = !!(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED); + + if (pubsta) { +- struct sta_info *sta; +- +- sta = container_of(pubsta, struct sta_info, sta); +- + if (!acked && !noack_success) + sta->status_stats.retry_failed++; + sta->status_stats.retry_count += retry_count; diff --git a/package/kernel/mac80211/patches/subsys/312-mac80211-factor-out-code-to-look-up-the-average-pack.patch b/package/kernel/mac80211/patches/subsys/312-mac80211-factor-out-code-to-look-up-the-average-pack.patch new file mode 100644 index 000000000..06db852c3 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/312-mac80211-factor-out-code-to-look-up-the-average-pack.patch @@ -0,0 +1,187 @@ +From: Felix Fietkau +Date: Wed, 12 Aug 2020 17:06:12 +0200 +Subject: [PATCH] mac80211: factor out code to look up the average packet + length duration for a rate + +This will be used to enhance AQL estimated aggregation length + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/airtime.c ++++ b/net/mac80211/airtime.c +@@ -405,18 +405,14 @@ ieee80211_calc_legacy_rate_duration(u16 + return duration; + } + +-u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, +- struct ieee80211_rx_status *status, +- int len) ++static u32 ieee80211_get_rate_duration(struct ieee80211_hw *hw, ++ struct ieee80211_rx_status *status, ++ u32 *overhead) + { +- struct ieee80211_supported_band *sband; +- const struct ieee80211_rate *rate; + bool sgi = status->enc_flags & RX_ENC_FLAG_SHORT_GI; +- bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE; + int bw, streams; + int group, idx; + u32 duration; +- bool cck; + + switch (status->bw) { + case RATE_INFO_BW_20: +@@ -437,20 +433,6 @@ u32 ieee80211_calc_rx_airtime(struct iee + } + + switch (status->encoding) { +- case RX_ENC_LEGACY: +- if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ)) +- return 0; +- +- sband = hw->wiphy->bands[status->band]; +- if (!sband || status->rate_idx >= sband->n_bitrates) +- return 0; +- +- rate = &sband->bitrates[status->rate_idx]; +- cck = rate->flags & IEEE80211_RATE_MANDATORY_B; +- +- return ieee80211_calc_legacy_rate_duration(rate->bitrate, sp, +- cck, len); +- + case RX_ENC_VHT: + streams = status->nss; + idx = status->rate_idx; +@@ -477,13 +459,47 @@ u32 ieee80211_calc_rx_airtime(struct iee + + duration = airtime_mcs_groups[group].duration[idx]; + duration <<= airtime_mcs_groups[group].shift; ++ *overhead = 36 + (streams << 2); ++ ++ return duration; ++} ++ ++ ++u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, ++ struct ieee80211_rx_status *status, ++ int len) ++{ ++ struct ieee80211_supported_band *sband; ++ u32 duration, overhead = 0; ++ ++ if (status->encoding == RX_ENC_LEGACY) { ++ const struct ieee80211_rate *rate; ++ bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE; ++ bool cck; ++ ++ if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ)) ++ return 0; ++ ++ sband = hw->wiphy->bands[status->band]; ++ if (!sband || status->rate_idx >= sband->n_bitrates) ++ return 0; ++ ++ rate = &sband->bitrates[status->rate_idx]; ++ cck = rate->flags & IEEE80211_RATE_MANDATORY_B; ++ ++ return ieee80211_calc_legacy_rate_duration(rate->bitrate, sp, ++ cck, len); ++ } ++ ++ duration = ieee80211_get_rate_duration(hw, status, &overhead); ++ if (!duration) ++ return 0; ++ + duration *= len; + duration /= AVG_PKT_SIZE; + duration /= 1024; + +- duration += 36 + (streams << 2); +- +- return duration; ++ return duration + overhead; + } + EXPORT_SYMBOL_GPL(ieee80211_calc_rx_airtime); + +@@ -530,46 +546,57 @@ static bool ieee80211_fill_rate_info(str + return false; + } + +-static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw, +- struct ieee80211_tx_rate *rate, +- struct rate_info *ri, +- u8 band, int len) ++static int ieee80211_fill_rx_status(struct ieee80211_rx_status *stat, ++ struct ieee80211_hw *hw, ++ struct ieee80211_tx_rate *rate, ++ struct rate_info *ri, u8 band, int len) + { +- struct ieee80211_rx_status stat = { +- .band = band, +- }; ++ memset(stat, 0, sizeof(*stat)); ++ stat->band = band; + +- if (ieee80211_fill_rate_info(hw, &stat, band, ri)) +- goto out; ++ if (ieee80211_fill_rate_info(hw, stat, band, ri)) ++ return 0; + + if (rate->idx < 0 || !rate->count) +- return 0; ++ return -1; + + if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH) +- stat.bw = RATE_INFO_BW_80; ++ stat->bw = RATE_INFO_BW_80; + else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) +- stat.bw = RATE_INFO_BW_40; ++ stat->bw = RATE_INFO_BW_40; + else +- stat.bw = RATE_INFO_BW_20; ++ stat->bw = RATE_INFO_BW_20; + +- stat.enc_flags = 0; ++ stat->enc_flags = 0; + if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) +- stat.enc_flags |= RX_ENC_FLAG_SHORTPRE; ++ stat->enc_flags |= RX_ENC_FLAG_SHORTPRE; + if (rate->flags & IEEE80211_TX_RC_SHORT_GI) +- stat.enc_flags |= RX_ENC_FLAG_SHORT_GI; ++ stat->enc_flags |= RX_ENC_FLAG_SHORT_GI; + +- stat.rate_idx = rate->idx; ++ stat->rate_idx = rate->idx; + if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { +- stat.encoding = RX_ENC_VHT; +- stat.rate_idx = ieee80211_rate_get_vht_mcs(rate); +- stat.nss = ieee80211_rate_get_vht_nss(rate); ++ stat->encoding = RX_ENC_VHT; ++ stat->rate_idx = ieee80211_rate_get_vht_mcs(rate); ++ stat->nss = ieee80211_rate_get_vht_nss(rate); + } else if (rate->flags & IEEE80211_TX_RC_MCS) { +- stat.encoding = RX_ENC_HT; ++ stat->encoding = RX_ENC_HT; + } else { +- stat.encoding = RX_ENC_LEGACY; ++ stat->encoding = RX_ENC_LEGACY; + } + +-out: ++ return 0; ++} ++ ++static u32 ieee80211_calc_tx_airtime_rate(struct ieee80211_hw *hw, ++ struct ieee80211_tx_rate *rate, ++ struct rate_info *ri, ++ u8 band, int len) ++{ ++ struct ieee80211_rx_status stat; ++ ++ if (ieee80211_fill_rx_status(&stat, hw, rate, ri, band, len)) ++ return 0; ++ + return ieee80211_calc_rx_airtime(hw, &stat, len); + } + diff --git a/package/kernel/mac80211/patches/subsys/313-mac80211-improve-AQL-aggregation-estimation-for-low-.patch b/package/kernel/mac80211/patches/subsys/313-mac80211-improve-AQL-aggregation-estimation-for-low-.patch new file mode 100644 index 000000000..7f7c75db5 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/313-mac80211-improve-AQL-aggregation-estimation-for-low-.patch @@ -0,0 +1,67 @@ +From: Felix Fietkau +Date: Wed, 12 Aug 2020 17:07:10 +0200 +Subject: [PATCH] mac80211: improve AQL aggregation estimation for low data + rates + +Links with low data rates use much smaller aggregates and are much more +sensitive to latency added by bufferbloat. +Tune the assumed aggregation length based on the tx rate duration. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/airtime.c ++++ b/net/mac80211/airtime.c +@@ -647,27 +647,41 @@ u32 ieee80211_calc_expected_tx_airtime(s + if (pubsta) { + struct sta_info *sta = container_of(pubsta, struct sta_info, + sta); ++ struct ieee80211_rx_status stat; + struct ieee80211_tx_rate *rate = &sta->tx_stats.last_rate; + struct rate_info *ri = &sta->tx_stats.last_rate_info; +- u32 airtime; ++ u32 duration, overhead; ++ u8 agg_shift; + +- if (!(rate->flags & (IEEE80211_TX_RC_VHT_MCS | +- IEEE80211_TX_RC_MCS))) +- ampdu = false; ++ if (ieee80211_fill_rx_status(&stat, hw, rate, ri, band, len)) ++ return 0; + ++ if (stat.encoding == RX_ENC_LEGACY || !ampdu) ++ return ieee80211_calc_rx_airtime(hw, &stat, len); ++ ++ duration = ieee80211_get_rate_duration(hw, &stat, &overhead); + /* + * Assume that HT/VHT transmission on any AC except VO will + * use aggregation. Since we don't have reliable reporting +- * of aggregation length, assume an average of 16. ++ * of aggregation length, assume an average size based on the ++ * tx rate. + * This will not be very accurate, but much better than simply +- * assuming un-aggregated tx. ++ * assuming un-aggregated tx in all cases. + */ +- airtime = ieee80211_calc_tx_airtime_rate(hw, rate, ri, band, +- ampdu ? len * 16 : len); +- if (ampdu) +- airtime /= 16; ++ if (duration > 400) /* <= VHT20 MCS2 1S */ ++ agg_shift = 1; ++ else if (duration > 250) /* <= VHT20 MCS3 1S or MCS1 2S */ ++ agg_shift = 2; ++ else if (duration > 150) /* <= VHT20 MCS5 1S or MCS3 2S */ ++ agg_shift = 3; ++ else ++ agg_shift = 4; + +- return airtime; ++ duration *= len; ++ duration /= AVG_PKT_SIZE; ++ duration /= 1024; ++ ++ return duration + (overhead >> agg_shift); + } + + if (!conf) diff --git a/package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch b/package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch new file mode 100644 index 000000000..22697718f --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/314-mac80211-rework-tx-encapsulation-offload-API.patch @@ -0,0 +1,651 @@ +From: Felix Fietkau +Date: Thu, 13 Aug 2020 15:37:11 +0200 +Subject: [PATCH] mac80211: rework tx encapsulation offload API + +The current API (which lets the driver turn on/off per vif directly) has a +number of limitations: +- it does not deal with AP_VLAN +- conditions for enabling (no tkip, no monitor) are only checked at + add_interface time +- no way to indicate 4-addr support + +In order to address this, store offload flags in struct ieee80211_vif +(easy to extend for decap offload later). mac80211 initially sets the enable +flag, but gives the driver a chance to modify it before its settings are +applied. In addition to the .add_interface op, a .update_vif_offload op is +introduced, which can be used for runtime changes. + +If a driver can't disable encap offload at runtime, or if it has some extra +limitations, it can simply override the flags within those ops. + +Support for encap offload with 4-address mode interfaces can be enabled +by setting a flag from .add_interface or .update_vif_offload. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -4150,6 +4150,35 @@ static int ath11k_set_he_mu_sounding_mod + return ret; + } + ++static void ath11k_mac_op_update_vif_offload(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif) ++{ ++ struct ath11k *ar = hw->priv; ++ struct ath11k_base *ab = ar->ab; ++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); ++ u32 param_id, param_value; ++ int ret; ++ ++ param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE; ++ if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET || ++ (vif->type != NL80211_IFTYPE_STATION && ++ vif->type != NL80211_IFTYPE_AP)) ++ vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ ++ if (vif->offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED) ++ param_value = ATH11K_HW_TXRX_ETHERNET; ++ else ++ param_value = ATH11K_HW_TXRX_NATIVE_WIFI; ++ ++ ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, ++ param_id, param_value); ++ if (ret) { ++ ath11k_warn(ab, "failed to set vdev %d tx encap mode: %d\n", ++ arvif->vdev_id, ret); ++ vif->offload_flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ } ++} ++ + static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) + { +@@ -4159,7 +4188,6 @@ static int ath11k_mac_op_add_interface(s + struct vdev_create_params vdev_param = {0}; + struct peer_create_params peer_param; + u32 param_id, param_value; +- int hw_encap = 0; + u16 nss; + int i; + int ret; +@@ -4253,30 +4281,7 @@ static int ath11k_mac_op_add_interface(s + list_add(&arvif->list, &ar->arvifs); + spin_unlock_bh(&ar->data_lock); + +- param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE; +- if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET) +- switch (vif->type) { +- case NL80211_IFTYPE_STATION: +- case NL80211_IFTYPE_AP_VLAN: +- case NL80211_IFTYPE_AP: +- hw_encap = 1; +- break; +- default: +- break; +- } +- +- if (ieee80211_set_hw_80211_encap(vif, hw_encap)) +- param_value = ATH11K_HW_TXRX_ETHERNET; +- else +- param_value = ATH11K_HW_TXRX_NATIVE_WIFI; +- +- ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, +- param_id, param_value); +- if (ret) { +- ath11k_warn(ab, "failed to set vdev %d tx encap mode: %d\n", +- arvif->vdev_id, ret); +- goto err_vdev_del; +- } ++ ath11k_mac_op_update_vif_offload(hw, vif); + + nss = get_num_chains(ar->cfg_tx_chainmask) ? : 1; + ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, +@@ -5599,6 +5604,7 @@ static const struct ieee80211_ops ath11k + .reconfig_complete = ath11k_mac_op_reconfig_complete, + .add_interface = ath11k_mac_op_add_interface, + .remove_interface = ath11k_mac_op_remove_interface, ++ .update_vif_offload = ath11k_mac_op_update_vif_offload, + .config = ath11k_mac_op_config, + .bss_info_changed = ath11k_mac_op_bss_info_changed, + .configure_filter = ath11k_mac_op_configure_filter, +@@ -5852,6 +5858,7 @@ static int __ath11k_mac_register(struct + ieee80211_hw_set(ar->hw, QUEUE_CONTROL); + ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); + ieee80211_hw_set(ar->hw, REPORTS_LOW_ACK); ++ ieee80211_hw_set(ar->hw, SUPPORTS_TX_ENCAP_OFFLOAD); + if (ht_cap & WMI_HT_CAP_ENABLED) { + ieee80211_hw_set(ar->hw, AMPDU_AGGREGATION); + ieee80211_hw_set(ar->hw, TX_AMPDU_SETUP_IN_HW); +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1603,6 +1603,21 @@ enum ieee80211_vif_flags { + IEEE80211_VIF_GET_NOA_UPDATE = BIT(3), + }; + ++ ++/** ++ * enum ieee80211_offload_flags - virtual interface offload flags ++ * ++ * @IEEE80211_OFFLOAD_ENCAP_ENABLED: tx encapsulation offload is enabled ++ * The driver supports sending frames passed as 802.3 frames by mac80211. ++ * It must also support sending 802.11 packets for the same interface. ++ * @IEEE80211_OFFLOAD_ENCAP_4ADDR: support 4-address mode encapsulation offload ++ */ ++ ++enum ieee80211_offload_flags { ++ IEEE80211_OFFLOAD_ENCAP_ENABLED = BIT(0), ++ IEEE80211_OFFLOAD_ENCAP_4ADDR = BIT(1), ++}; ++ + /** + * struct ieee80211_vif - per-interface data + * +@@ -1623,6 +1638,11 @@ enum ieee80211_vif_flags { + * these need to be set (or cleared) when the interface is added + * or, if supported by the driver, the interface type is changed + * at runtime, mac80211 will never touch this field ++ * @offloaad_flags: hardware offload capabilities/flags for this interface. ++ * These are initialized by mac80211 before calling .add_interface, ++ * .change_interface or .update_vif_offload and updated by the driver ++ * within these ops, based on supported features or runtime change ++ * restrictions. + * @hw_queue: hardware queue for each AC + * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only + * @chanctx_conf: The channel context this interface is assigned to, or %NULL +@@ -1659,6 +1679,7 @@ struct ieee80211_vif { + struct ieee80211_chanctx_conf __rcu *chanctx_conf; + + u32 driver_flags; ++ u32 offload_flags; + + #ifdef CPTCFG_MAC80211_DEBUGFS + struct dentry *debugfs_dir; +@@ -2325,6 +2346,9 @@ struct ieee80211_txq { + * aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx + * A-MPDU sessions active while rekeying with Extended Key ID. + * ++ * @IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD: Hardware supports tx encapsulation ++ * offload ++ * + * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays + */ + enum ieee80211_hw_flags { +@@ -2377,6 +2401,7 @@ enum ieee80211_hw_flags { + IEEE80211_HW_SUPPORTS_MULTI_BSSID, + IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, + IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT, ++ IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD, + + /* keep last, obviously */ + NUM_IEEE80211_HW_FLAGS +@@ -3811,6 +3836,8 @@ enum ieee80211_reconfig_type { + * @set_tid_config: Apply TID specific configurations. This callback may sleep. + * @reset_tid_config: Reset TID specific configuration for the peer. + * This callback may sleep. ++ * @update_vif_config: Update virtual interface offload flags ++ * This callback may sleep. + */ + struct ieee80211_ops { + void (*tx)(struct ieee80211_hw *hw, +@@ -4122,6 +4149,8 @@ struct ieee80211_ops { + int (*reset_tid_config)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, u8 tids); ++ void (*update_vif_offload)(struct ieee80211_hw *hw, ++ struct ieee80211_vif *vif); + }; + + /** +--- 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[] = { + FLAG(SUPPORTS_MULTI_BSSID), + FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID), + FLAG(AMPDU_KEYBORDER_SUPPORT), ++ FLAG(SUPPORTS_TX_ENCAP_OFFLOAD), + #undef FLAG + }; + +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -1385,4 +1385,19 @@ static inline int drv_reset_tid_config(s + + return ret; + } ++ ++static inline void drv_update_vif_offload(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata) ++{ ++ might_sleep(); ++ check_sdata_in_driver(sdata); ++ ++ if (!local->ops->update_vif_offload) ++ return; ++ ++ trace_drv_update_vif_offload(local, sdata); ++ local->ops->update_vif_offload(&local->hw, &sdata->vif); ++ trace_drv_return_void(local); ++} ++ + #endif /* __MAC80211_DRIVER_OPS */ +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -990,8 +990,6 @@ struct ieee80211_sub_if_data { + } debugfs; + #endif + +- bool hw_80211_encap; +- + /* must be last, dynamically sized area in this! */ + struct ieee80211_vif vif; + }; +@@ -1769,6 +1767,7 @@ void ieee80211_del_virtual_monitor(struc + bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata); + void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata, + bool update_bss); ++void ieee80211_recalc_offload(struct ieee80211_local *local); + + static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata) + { +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -43,6 +43,7 @@ + */ + + 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) + { +@@ -348,6 +349,99 @@ static int ieee80211_check_queues(struct + return 0; + } + ++static bool ieee80211_iftype_supports_encap_offload(enum nl80211_iftype iftype) ++{ ++ switch (iftype) { ++ case NL80211_IFTYPE_AP: ++ case NL80211_IFTYPE_P2P_GO: ++ case NL80211_IFTYPE_P2P_CLIENT: ++ case NL80211_IFTYPE_STATION: ++ return true; ++ default: ++ return false; ++ } ++} ++ ++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; ++ ++ 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) ++ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ ++ if (local->monitors) ++ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ } else { ++ flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED; ++ } ++ ++ if (sdata->vif.offload_flags == flags) ++ return false; ++ ++ sdata->vif.offload_flags = flags; ++ return true; ++} ++ ++ ++static void ieee80211_recalc_sdata_offload(struct ieee80211_sub_if_data *sdata) ++{ ++ struct ieee80211_local *local = sdata->local; ++ struct ieee80211_sub_if_data *vsdata; ++ ++ if (ieee80211_set_sdata_offload_flags(sdata)) { ++ drv_update_vif_offload(local, sdata); ++ ieee80211_set_vif_encap_ops(sdata); ++ } ++ ++ list_for_each_entry(vsdata, &local->interfaces, list) { ++ if (vsdata->vif.type != NL80211_IFTYPE_AP_VLAN || ++ vsdata->bss != &sdata->u.ap) ++ continue; ++ ++ ieee80211_set_vif_encap_ops(vsdata); ++ } ++} ++ ++void ieee80211_recalc_offload(struct ieee80211_local *local) ++{ ++ struct ieee80211_sub_if_data *sdata; ++ ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD)) ++ return; ++ ++ mutex_lock(&local->iflist_mtx); ++ ++ list_for_each_entry(sdata, &local->interfaces, list) { ++ if (!ieee80211_sdata_running(sdata)) ++ continue; ++ ++ ieee80211_recalc_sdata_offload(sdata); ++ } ++ ++ mutex_unlock(&local->iflist_mtx); ++} ++ + 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 + if (rtnl_dereference(sdata->bss->beacon)) { + ieee80211_vif_vlan_copy_chanctx(sdata); + netif_carrier_on(dev); ++ ieee80211_set_vif_encap_ops(sdata); + } else { + netif_carrier_off(dev); + } +@@ -616,6 +711,7 @@ int ieee80211_do_open(struct wireless_de + + ieee80211_adjust_monitor_flags(sdata, 1); + ieee80211_configure_filter(local); ++ ieee80211_recalc_offload(local); + mutex_lock(&local->mtx); + ieee80211_recalc_idle(local); + mutex_unlock(&local->mtx); +@@ -625,10 +721,13 @@ int ieee80211_do_open(struct wireless_de + default: + if (coming_up) { + ieee80211_del_virtual_monitor(local); ++ ieee80211_set_sdata_offload_flags(sdata); + + res = drv_add_interface(local, sdata); + if (res) + goto err_stop; ++ ++ ieee80211_set_vif_encap_ops(sdata); + res = ieee80211_check_queues(sdata, + ieee80211_vif_type_p2p(&sdata->vif)); + if (res) +@@ -1286,61 +1385,6 @@ static const struct net_device_ops ieee8 + + }; + +-static void __ieee80211_set_hw_80211_encap(struct ieee80211_sub_if_data *sdata, +- bool enable) +-{ +- sdata->dev->netdev_ops = enable ? &ieee80211_dataif_8023_ops : +- &ieee80211_dataif_ops; +- sdata->hw_80211_encap = enable; +-} +- +-bool ieee80211_set_hw_80211_encap(struct ieee80211_vif *vif, bool enable) +-{ +- struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); +- struct ieee80211_local *local = sdata->local; +- struct ieee80211_sub_if_data *iter; +- struct ieee80211_key *key; +- +- mutex_lock(&local->iflist_mtx); +- list_for_each_entry(iter, &local->interfaces, list) { +- struct ieee80211_sub_if_data *disable = NULL; +- +- if (vif->type == NL80211_IFTYPE_MONITOR) { +- disable = iter; +- __ieee80211_set_hw_80211_encap(iter, false); +- } else if (iter->vif.type == NL80211_IFTYPE_MONITOR) { +- disable = sdata; +- enable = false; +- } +- if (disable) +- sdata_dbg(disable, +- "disable hw 80211 encap due to mon co-exist\n"); +- } +- mutex_unlock(&local->iflist_mtx); +- +- if (enable == sdata->hw_80211_encap) +- return enable; +- +- if (!sdata->dev) +- return false; +- +- if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) && +- (local->hw.wiphy->frag_threshold != (u32)-1)) +- enable = false; +- +- mutex_lock(&sdata->local->key_mtx); +- list_for_each_entry(key, &sdata->key_list, list) { +- if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) +- enable = false; +- } +- mutex_unlock(&sdata->local->key_mtx); +- +- __ieee80211_set_hw_80211_encap(sdata, enable); +- +- return enable; +-} +-EXPORT_SYMBOL(ieee80211_set_hw_80211_encap); +- + 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( + #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; ++ struct ieee80211_key *key; ++ 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; ++ ++ /* ++ * 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; ++} ++ + 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 + sdata->vif.bss_conf.txpower = INT_MIN; /* unset */ + + sdata->noack_map = 0; +- sdata->hw_80211_encap = false; + + /* only monitor/p2p-device differ */ + if (sdata->dev) { +@@ -1688,6 +1776,7 @@ static int ieee80211_runtime_change_ifty + + ieee80211_teardown_sdata(sdata); + ++ ieee80211_set_sdata_offload_flags(sdata); + 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 + ieee80211_check_queues(sdata, type); + + ieee80211_setup_sdata(sdata, type); ++ ieee80211_set_vif_encap_ops(sdata); + + err = ieee80211_do_open(&sdata->wdev, false); + WARN(err, "type change: do_open returned %d", err); +--- a/net/mac80211/key.c ++++ b/net/mac80211/key.c +@@ -177,13 +177,6 @@ static int ieee80211_key_enable_hw_accel + } + } + +- /* TKIP countermeasures don't work in encap offload mode */ +- if (key->conf.cipher == WLAN_CIPHER_SUITE_TKIP && +- sdata->hw_80211_encap) { +- sdata_dbg(sdata, "TKIP is not allowed in hw 80211 encap mode\n"); +- return -EINVAL; +- } +- + ret = drv_set_key(key->local, SET_KEY, sdata, + sta ? &sta->sta : NULL, &key->conf); + +@@ -219,14 +212,6 @@ static int ieee80211_key_enable_hw_accel + case WLAN_CIPHER_SUITE_CCMP_256: + case WLAN_CIPHER_SUITE_GCMP: + case WLAN_CIPHER_SUITE_GCMP_256: +- /* We cannot do software crypto of data frames with +- * encapsulation offload enabled. However for 802.11w to +- * function properly we need cmac/gmac keys. +- */ +- if (sdata->hw_80211_encap) +- return -EINVAL; +- /* Fall through */ +- + 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, + ) + ); + ++DEFINE_EVENT(local_sdata_addr_evt, drv_update_vif_offload, ++ TP_PROTO(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata), ++ TP_ARGS(local, sdata) ++); ++ + #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ + + #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; + +- if (WARN_ON(!sdata->hw_80211_encap)) { +- kfree_skb(skb); +- return NETDEV_TX_OK; +- } +- + if (unlikely(skb->len < ETH_HLEN)) { + kfree_skb(skb); + 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/315-mac80211-reduce-duplication-in-tx-status-functions.patch new file mode 100644 index 000000000..8b664d689 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/315-mac80211-reduce-duplication-in-tx-status-functions.patch @@ -0,0 +1,197 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 13:16:59 +0200 +Subject: [PATCH] mac80211: reduce duplication in tx status functions + +Move redundant functionality from __ieee80211_tx_status into +ieee80211_tx_status_ext. Preparation for unifying with the 802.3 tx status +codepath. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -184,18 +184,6 @@ static void ieee80211_frame_acked(struct + struct ieee80211_mgmt *mgmt = (void *) skb->data; + struct ieee80211_local *local = sta->local; + struct ieee80211_sub_if_data *sdata = sta->sdata; +- struct ieee80211_tx_info *txinfo = IEEE80211_SKB_CB(skb); +- +- if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { +- sta->status_stats.last_ack = jiffies; +- if (txinfo->status.is_valid_ack_signal) { +- sta->status_stats.last_ack_signal = +- (s8)txinfo->status.ack_signal; +- sta->status_stats.ack_signal_filled = true; +- ewma_avg_signal_add(&sta->status_stats.avg_ack_signal, +- -txinfo->status.ack_signal); +- } +- } + + if (ieee80211_is_data_qos(mgmt->frame_control)) { + struct ieee80211_hdr *hdr = (void *) skb->data; +@@ -899,7 +887,8 @@ void ieee80211_tx_monitor(struct ieee802 + } + + static void __ieee80211_tx_status(struct ieee80211_hw *hw, +- struct ieee80211_tx_status *status) ++ struct ieee80211_tx_status *status, ++ int rates_idx, int retry_count) + { + struct sk_buff *skb = status->skb; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +@@ -908,8 +897,6 @@ static void __ieee80211_tx_status(struct + struct sta_info *sta; + __le16 fc; + struct ieee80211_supported_band *sband; +- int retry_count; +- int rates_idx; + bool send_to_cooked; + bool acked; + bool noack_success; +@@ -918,8 +905,6 @@ static void __ieee80211_tx_status(struct + int tid = IEEE80211_NUM_TIDS; + u16 tx_time_est; + +- rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); +- + sband = local->hw.wiphy->bands[info->band]; + fc = hdr->frame_control; + +@@ -996,24 +981,14 @@ static void __ieee80211_tx_status(struct + if (info->flags & IEEE80211_TX_STAT_TX_FILTERED) { + ieee80211_handle_filtered_frame(local, sta, skb); + return; +- } else { ++ } else if (ieee80211_is_data_present(fc)) { + if (!acked && !noack_success) +- sta->status_stats.retry_failed++; +- sta->status_stats.retry_count += retry_count; +- +- if (ieee80211_is_data_present(fc)) { +- if (!acked && !noack_success) +- sta->status_stats.msdu_failed[tid]++; ++ sta->status_stats.msdu_failed[tid]++; + +- sta->status_stats.msdu_retries[tid] += +- retry_count; +- } ++ sta->status_stats.msdu_retries[tid] += ++ retry_count; + } + +- rate_control_tx_status(local, sband, status); +- if (ieee80211_vif_is_mesh(&sta->sdata->vif)) +- ieee80211s_update_metric(local, sta, status); +- + if (!(info->flags & IEEE80211_TX_CTL_INJECTED) && acked) + ieee80211_frame_acked(sta, skb); + +@@ -1038,20 +1013,6 @@ static void __ieee80211_tx_status(struct + true); + ieee80211_info_set_tx_time_est(info, 0); + } +- +- if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { +- if (acked) { +- if (sta->status_stats.lost_packets) +- sta->status_stats.lost_packets = 0; +- +- /* Track when last TDLS packet was ACKed */ +- sta->status_stats.last_pkt_time = jiffies; +- } else if (noack_success) { +- /* nothing to do here, do not account as lost */ +- } else { +- ieee80211_lost_packet(sta, info); +- } +- } + } + + /* SNMP counters +@@ -1135,7 +1096,7 @@ void ieee80211_tx_status(struct ieee8021 + if (sta) + status.sta = &sta->sta; + +- __ieee80211_tx_status(hw, &status); ++ ieee80211_tx_status_ext(hw, &status); + rcu_read_unlock(); + } + EXPORT_SYMBOL(ieee80211_tx_status); +@@ -1148,7 +1109,7 @@ void ieee80211_tx_status_ext(struct ieee + struct ieee80211_sta *pubsta = status->sta; + struct ieee80211_supported_band *sband; + struct sta_info *sta; +- int retry_count; ++ int rates_idx, retry_count; + bool acked, noack_success; + + if (pubsta) { +@@ -1158,13 +1119,7 @@ void ieee80211_tx_status_ext(struct ieee + sta->tx_stats.last_rate_info = *status->rate; + } + +- if (status->skb) +- return __ieee80211_tx_status(hw, status); +- +- if (!status->sta) +- return; +- +- ieee80211_tx_get_rates(hw, info, &retry_count); ++ rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); + + sband = hw->wiphy->bands[info->band]; + +@@ -1176,20 +1131,30 @@ void ieee80211_tx_status_ext(struct ieee + sta->status_stats.retry_failed++; + sta->status_stats.retry_count += retry_count; + +- if (acked) { +- sta->status_stats.last_ack = jiffies; ++ if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { ++ if (acked) { ++ sta->status_stats.last_ack = jiffies; + +- if (sta->status_stats.lost_packets) +- sta->status_stats.lost_packets = 0; ++ if (sta->status_stats.lost_packets) ++ sta->status_stats.lost_packets = 0; + +- /* Track when last packet was ACKed */ +- sta->status_stats.last_pkt_time = jiffies; +- } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { +- return; +- } else if (noack_success) { +- /* nothing to do here, do not account as lost */ +- } else { +- ieee80211_lost_packet(sta, info); ++ /* Track when last packet was ACKed */ ++ sta->status_stats.last_pkt_time = jiffies; ++ ++ if (info->status.is_valid_ack_signal) { ++ sta->status_stats.last_ack_signal = ++ (s8)info->status.ack_signal; ++ sta->status_stats.ack_signal_filled = true; ++ ewma_avg_signal_add(&sta->status_stats.avg_ack_signal, ++ -info->status.ack_signal); ++ } ++ } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { ++ return; ++ } else if (noack_success) { ++ /* nothing to do here, do not account as lost */ ++ } else { ++ ieee80211_lost_packet(sta, info); ++ } + } + + rate_control_tx_status(local, sband, status); +@@ -1197,6 +1162,10 @@ void ieee80211_tx_status_ext(struct ieee + ieee80211s_update_metric(local, sta, status); + } + ++ if (status->skb) ++ return __ieee80211_tx_status(hw, status, rates_idx, ++ retry_count); ++ + if (acked || noack_success) { + I802_DEBUG_INC(local->dot11TransmittedFrameCount); + if (!pubsta) 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/316-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch new file mode 100644 index 000000000..168d6458a --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/316-mac80211-remove-tx-status-call-to-ieee80211_sta_regi.patch @@ -0,0 +1,26 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 13:29:12 +0200 +Subject: [PATCH] mac80211: remove tx status call to + ieee80211_sta_register_airtime + +All drivers using airtime fairness are calling ieee80211_sta_register_airtime +directly + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -997,12 +997,6 @@ static void __ieee80211_tx_status(struct + ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data, + acked, info->status.tx_time); + +- if (info->status.tx_time && +- wiphy_ext_feature_isset(local->hw.wiphy, +- NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) +- ieee80211_sta_register_airtime(&sta->sta, tid, +- info->status.tx_time, 0); +- + if ((tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) { + /* Do this here to avoid the expensive lookup of the sta + * in ieee80211_report_used_skb(). diff --git a/package/kernel/mac80211/patches/subsys/317-mac80211-optimize-station-connection-monitor.patch b/package/kernel/mac80211/patches/subsys/317-mac80211-optimize-station-connection-monitor.patch new file mode 100644 index 000000000..ed9efb2b0 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/317-mac80211-optimize-station-connection-monitor.patch @@ -0,0 +1,174 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 13:29:56 +0200 +Subject: [PATCH] mac80211: optimize station connection monitor + +Calling mod_timer for every rx/tx packet can be quite expensive. +Instead of constantly updating the timer, we can simply let it run out +and check the timestamp of the last ACK or rx packet to re-arm it. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -2045,8 +2045,6 @@ void ieee80211_dynamic_ps_timer(struct t + void ieee80211_send_nullfunc(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + bool powersave); +-void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, +- struct ieee80211_hdr *hdr); + void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata, + struct ieee80211_hdr *hdr, bool ack, u16 tx_time); + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -2432,23 +2432,6 @@ static void ieee80211_set_disassoc(struc + sdata->encrypt_headroom = IEEE80211_ENCRYPT_HEADROOM; + } + +-void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, +- struct ieee80211_hdr *hdr) +-{ +- /* +- * We can postpone the mgd.timer whenever receiving unicast frames +- * from AP because we know that the connection is working both ways +- * at that time. But multicast frames (and hence also beacons) must +- * be ignored here, because we need to trigger the timer during +- * data idle periods for sending the periodic probe request to the +- * AP we're connected to. +- */ +- if (is_multicast_ether_addr(hdr->addr1)) +- return; +- +- ieee80211_sta_reset_conn_monitor(sdata); +-} +- + static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata) + { + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; +@@ -2521,21 +2504,13 @@ void ieee80211_sta_tx_notify(struct ieee + { + ieee80211_sta_tx_wmm_ac_notify(sdata, hdr, tx_time); + +- if (!ieee80211_is_data(hdr->frame_control)) +- return; +- +- if (ieee80211_is_any_nullfunc(hdr->frame_control) && +- sdata->u.mgd.probe_send_count > 0) { +- if (ack) +- ieee80211_sta_reset_conn_monitor(sdata); +- else +- sdata->u.mgd.nullfunc_failed = true; +- ieee80211_queue_work(&sdata->local->hw, &sdata->work); ++ if (!ieee80211_is_any_nullfunc(hdr->frame_control) || ++ !sdata->u.mgd.probe_send_count) + return; +- } + +- if (ack) +- ieee80211_sta_reset_conn_monitor(sdata); ++ if (!ack) ++ sdata->u.mgd.nullfunc_failed = true; ++ ieee80211_queue_work(&sdata->local->hw, &sdata->work); + } + + static void ieee80211_mlme_send_probe_req(struct ieee80211_sub_if_data *sdata, +@@ -3600,8 +3575,8 @@ static bool ieee80211_assoc_success(stru + * Start timer to probe the connection to the AP now. + * Also start the timer that will detect beacon loss. + */ +- ieee80211_sta_rx_notify(sdata, (struct ieee80211_hdr *)mgmt); + ieee80211_sta_reset_beacon_monitor(sdata); ++ ieee80211_sta_reset_conn_monitor(sdata); + + ret = true; + out: +@@ -4569,10 +4544,26 @@ static void ieee80211_sta_conn_mon_timer + from_timer(sdata, t, u.mgd.conn_mon_timer); + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; + struct ieee80211_local *local = sdata->local; ++ struct sta_info *sta; ++ unsigned long timeout; + + if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn) + return; + ++ sta = sta_info_get(sdata, ifmgd->bssid); ++ if (!sta) ++ return; ++ ++ timeout = sta->status_stats.last_ack; ++ if (time_before(sta->status_stats.last_ack, sta->rx_stats.last_rx)) ++ timeout = sta->rx_stats.last_rx; ++ timeout += IEEE80211_CONNECTION_IDLE_TIME; ++ ++ if (time_is_before_jiffies(timeout)) { ++ mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout)); ++ return; ++ } ++ + ieee80211_queue_work(&local->hw, &ifmgd->monitor_work); + } + +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -1811,9 +1811,6 @@ ieee80211_rx_h_sta_process(struct ieee80 + sta->rx_stats.last_rate = sta_stats_encode_rate(status); + } + +- if (rx->sdata->vif.type == NL80211_IFTYPE_STATION) +- ieee80211_sta_rx_notify(rx->sdata, hdr); +- + sta->rx_stats.fragments++; + + u64_stats_update_begin(&rx->sta->rx_stats.syncp); +@@ -4148,7 +4145,6 @@ void ieee80211_check_fast_rx(struct sta_ + fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2); + fastrx.expected_ds_bits = 0; + } else { +- fastrx.sta_notify = sdata->u.mgd.probe_send_count > 0; + fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1); + fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr3); + fastrx.expected_ds_bits = +@@ -4378,11 +4374,6 @@ static bool ieee80211_invoke_fast_rx(str + pskb_trim(skb, skb->len - fast_rx->icv_len)) + goto drop; + +- if (unlikely(fast_rx->sta_notify)) { +- ieee80211_sta_rx_notify(rx->sdata, hdr); +- fast_rx->sta_notify = false; +- } +- + /* statistics part of ieee80211_rx_h_sta_process() */ + if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) { + stats->last_signal = status->signal; +--- a/net/mac80211/sta_info.h ++++ b/net/mac80211/sta_info.h +@@ -336,7 +336,6 @@ struct ieee80211_fast_tx { + * @expected_ds_bits: from/to DS bits expected + * @icv_len: length of the MIC if present + * @key: bool indicating encryption is expected (key is set) +- * @sta_notify: notify the MLME code (once) + * @internal_forward: forward froms internally on AP/VLAN type interfaces + * @uses_rss: copy of USES_RSS hw flag + * @da_offs: offset of the DA in the header (for header conversion) +@@ -352,7 +351,6 @@ struct ieee80211_fast_rx { + __le16 expected_ds_bits; + u8 icv_len; + u8 key:1, +- sta_notify:1, + internal_forward:1, + uses_rss:1; + u8 da_offs, sa_offs; +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -1227,9 +1227,6 @@ void ieee80211_tx_status_8023(struct iee + sta->status_stats.retry_count += retry_count; + + if (ieee80211_hw_check(hw, REPORTS_TX_ACK_STATUS)) { +- if (acked && vif->type == NL80211_IFTYPE_STATION) +- ieee80211_sta_reset_conn_monitor(sdata); +- + sta->status_stats.last_ack = jiffies; + if (info->flags & IEEE80211_TX_STAT_ACK) { + if (sta->status_stats.lost_packets) 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/318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch new file mode 100644 index 000000000..a0ce6a2b1 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/318-mac80211-swap-NEED_TXPROCESSING-and-HW_80211_ENCAP-t.patch @@ -0,0 +1,227 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 13:35:32 +0200 +Subject: [PATCH] mac80211: swap NEED_TXPROCESSING and HW_80211_ENCAP tx + flags + +In order to unify the tx status path, the hw 802.11 encapsulation flag +needs to survive the trip to the tx status call. +Since we don't have any free bits in info->flags, we need to move one. +IEEE80211_TX_INTFL_NEED_TXPROCESSING is only used internally in mac80211, +and only before the call into the driver. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -14,7 +14,7 @@ ath11k_dp_tx_get_encap_type(struct ath11 + { + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); + +- if (tx_info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) ++ if (tx_info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) + return HAL_TCL_ENCAP_TYPE_ETHERNET; + + return HAL_TCL_ENCAP_TYPE_NATIVE_WIFI; +@@ -93,7 +93,7 @@ int ath11k_dp_tx(struct ath11k *ar, stru + if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags)) + return -ESHUTDOWN; + +- if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) && ++ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + !ieee80211_is_data(hdr->frame_control)) + return -ENOTSUPP; + +--- a/drivers/net/wireless/ath/ath11k/mac.c ++++ b/drivers/net/wireless/ath/ath11k/mac.c +@@ -3749,7 +3749,7 @@ static int ath11k_mac_mgmt_tx_wmi(struct + return -ENOSPC; + + info = IEEE80211_SKB_CB(skb); +- if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)) { ++ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) { + if ((ieee80211_is_action(hdr->frame_control) || + ieee80211_is_deauth(hdr->frame_control) || + ieee80211_is_disassoc(hdr->frame_control)) && +@@ -3876,7 +3876,7 @@ static void ath11k_mac_op_tx(struct ieee + bool is_prb_rsp; + int ret; + +- if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) { ++ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) { + skb_cb->flags |= ATH11K_SKB_HW_80211_ENCAP; + } else if (ieee80211_is_mgmt(hdr->frame_control)) { + is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control); +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -720,9 +720,8 @@ struct ieee80211_bss_conf { + * @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate + * that a frame can be transmitted while the queues are stopped for + * off-channel operation. +- * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, +- * used to indicate that a pending frame requires TX processing before +- * it can be sent out. ++ * @IEEE80211_TX_CTL_HW_80211_ENCAP: This frame uses hardware encapsulation ++ * (header conversion) + * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, + * used to indicate that a frame was already retried due to PS + * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, +@@ -791,7 +790,7 @@ enum mac80211_tx_info_flags { + IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), + IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), + IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13), +- IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), ++ IEEE80211_TX_CTL_HW_80211_ENCAP = BIT(14), + IEEE80211_TX_INTFL_RETRIED = BIT(15), + IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), + IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), +@@ -823,8 +822,9 @@ enum mac80211_tx_info_flags { + * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame + * @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path + * @IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP: This frame skips mesh path lookup +- * @IEEE80211_TX_CTRL_HW_80211_ENCAP: This frame uses hardware encapsulation +- * (header conversion) ++ * @IEEE80211_TX_INTCFL_NEED_TXPROCESSING: completely internal to mac80211, ++ * used to indicate that a pending frame requires TX processing before ++ * it can be sent out. + * + * These flags are used in tx_info->control.flags. + */ +@@ -835,7 +835,7 @@ enum mac80211_tx_control_flags { + IEEE80211_TX_CTRL_AMSDU = BIT(3), + IEEE80211_TX_CTRL_FAST_XMIT = BIT(4), + IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP = BIT(5), +- IEEE80211_TX_CTRL_HW_80211_ENCAP = BIT(6), ++ IEEE80211_TX_INTCFL_NEED_TXPROCESSING = BIT(6), + }; + + /* +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -212,7 +212,7 @@ static void prepare_frame_for_deferred_t + skb->priority = 7; + + info->control.vif = &sdata->vif; +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + ieee80211_set_qos_hdr(sdata, skb); + ieee80211_mps_set_frame_flags(sdata, NULL, hdr); + } +@@ -1163,7 +1163,7 @@ int mesh_nexthop_resolve(struct ieee8021 + if (skb_queue_len(&mpath->frame_queue) >= MESH_FRAME_QUEUE_LEN) + skb_to_free = skb_dequeue(&mpath->frame_queue); + +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + ieee80211_set_qos_hdr(sdata, skb); + skb_queue_tail(&mpath->frame_queue, skb); + if (skb_to_free) +--- a/net/mac80211/mesh_ps.c ++++ b/net/mac80211/mesh_ps.c +@@ -432,7 +432,7 @@ static void mpsp_qos_null_append(struct + + info = IEEE80211_SKB_CB(new_skb); + info->control.vif = &sdata->vif; +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + + __skb_queue_tail(frames, new_skb); + } +--- a/net/mac80211/rx.c ++++ b/net/mac80211/rx.c +@@ -2896,7 +2896,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80 + fwd_hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_RETRY); + info = IEEE80211_SKB_CB(fwd_skb); + memset(info, 0, sizeof(*info)); +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + info->control.vif = &rx->sdata->vif; + info->control.jiffies = jiffies; + if (is_multicast_ether_addr(fwd_hdr->addr1)) { +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -66,8 +66,8 @@ static void ieee80211_handle_filtered_fr + + info->control.jiffies = jiffies; + info->control.vif = &sta->sdata->vif; +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING | +- IEEE80211_TX_INTFL_RETRANSMISSION; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; ++ info->flags |= IEEE80211_TX_INTFL_RETRANSMISSION; + info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS; + + sta->status_stats.filtered++; +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -530,7 +530,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee + + info->control.jiffies = jiffies; + info->control.vif = &tx->sdata->vif; +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS; + skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); + spin_unlock(&sta->ps_lock); +@@ -1132,7 +1132,7 @@ static bool ieee80211_tx_prep_agg(struct + tx->sta->sta.addr, tx->sta->sta.aid); + } + info->control.vif = &tx->sdata->vif; +- info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS; + __skb_queue_tail(&tid_tx->pending, skb); + if (skb_queue_len(&tid_tx->pending) > STA_MAX_TX_BUFFER) +@@ -1177,7 +1177,7 @@ ieee80211_tx_prepare(struct ieee80211_su + * we are doing the needed processing, so remove the flag + * now. + */ +- info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING; ++ info->control.flags &= ~IEEE80211_TX_INTCFL_NEED_TXPROCESSING; + + hdr = (struct ieee80211_hdr *) skb->data; + +@@ -1256,7 +1256,7 @@ static struct txq_info *ieee80211_get_tx + (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) + return NULL; + +- if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) && ++ if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && + unlikely(!ieee80211_is_data_present(hdr->frame_control))) { + if ((!ieee80211_is_mgmt(hdr->frame_control) || + ieee80211_is_bufferable_mmpdu(hdr->frame_control) || +@@ -3640,7 +3640,7 @@ begin: + else + info->flags &= ~IEEE80211_TX_CTL_AMPDU; + +- if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) ++ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) + goto encap_out; + + if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) { +@@ -4253,7 +4253,7 @@ static void ieee80211_8023_xmit(struct i + sdata = container_of(sdata->bss, + struct ieee80211_sub_if_data, u.ap); + +- info->control.flags |= IEEE80211_TX_CTRL_HW_80211_ENCAP; ++ 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 + + sdata = vif_to_sdata(info->control.vif); + +- if (info->flags & IEEE80211_TX_INTFL_NEED_TXPROCESSING) { ++ if (info->control.flags & IEEE80211_TX_INTCFL_NEED_TXPROCESSING) { + 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 + } + info->band = chanctx_conf->def.chan->band; + result = ieee80211_tx(sdata, NULL, skb, true, 0); +- } else if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) { ++ } else if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) { + if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) { + dev_kfree_skb(skb); + return true; 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/319-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch new file mode 100644 index 000000000..7bb54f499 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/319-mac80211-unify-802.3-offload-and-802.11-tx-status-co.patch @@ -0,0 +1,159 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 13:54:19 +0200 +Subject: [PATCH] mac80211: unify 802.3 (offload) and 802.11 tx status + codepath + +Make ieee80211_tx_status_8023 call ieee80211_tx_status_ext, similar to +ieee80211_tx_status. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -903,7 +903,6 @@ static void __ieee80211_tx_status(struct + struct ieee80211_bar *bar; + int shift = 0; + int tid = IEEE80211_NUM_TIDS; +- u16 tx_time_est; + + sband = local->hw.wiphy->bands[info->band]; + fc = hdr->frame_control; +@@ -996,17 +995,6 @@ static void __ieee80211_tx_status(struct + ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) + ieee80211_sta_tx_notify(sta->sdata, (void *) skb->data, + acked, info->status.tx_time); +- +- if ((tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) { +- /* Do this here to avoid the expensive lookup of the sta +- * in ieee80211_report_used_skb(). +- */ +- ieee80211_sta_update_pending_airtime(local, sta, +- skb_get_queue_mapping(skb), +- tx_time_est, +- true); +- ieee80211_info_set_tx_time_est(info, 0); +- } + } + + /* SNMP counters +@@ -1102,9 +1090,11 @@ void ieee80211_tx_status_ext(struct ieee + struct ieee80211_tx_info *info = status->info; + struct ieee80211_sta *pubsta = status->sta; + struct ieee80211_supported_band *sband; +- struct sta_info *sta; ++ struct sk_buff *skb = status->skb; ++ struct sta_info *sta = NULL; + int rates_idx, retry_count; + bool acked, noack_success; ++ u16 tx_time_est; + + if (pubsta) { + sta = container_of(pubsta, struct sta_info, sta); +@@ -1156,7 +1146,18 @@ void ieee80211_tx_status_ext(struct ieee + ieee80211s_update_metric(local, sta, status); + } + +- if (status->skb) ++ if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) { ++ /* Do this here to avoid the expensive lookup of the sta ++ * in ieee80211_report_used_skb(). ++ */ ++ ieee80211_sta_update_pending_airtime(local, sta, ++ skb_get_queue_mapping(skb), ++ tx_time_est, ++ true); ++ ieee80211_info_set_tx_time_est(info, 0); ++ } ++ ++ if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) + return __ieee80211_tx_status(hw, status, rates_idx, + retry_count); + +@@ -1171,6 +1172,12 @@ void ieee80211_tx_status_ext(struct ieee + } else { + I802_DEBUG_INC(local->dot11FailedCount); + } ++ ++ if (!skb) ++ return; ++ ++ ieee80211_report_used_skb(local, skb, false); ++ dev_kfree_skb(skb); + } + EXPORT_SYMBOL(ieee80211_tx_status_ext); + +@@ -1197,66 +1204,23 @@ void ieee80211_tx_status_8023(struct iee + struct ieee80211_vif *vif, + struct sk_buff *skb) + { +- struct ieee80211_local *local = hw_to_local(hw); + struct ieee80211_sub_if_data *sdata; +- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ struct ieee80211_tx_status status = { ++ .skb = skb, ++ .info = IEEE80211_SKB_CB(skb), ++ }; + struct sta_info *sta; +- int retry_count; +- int rates_idx; +- bool acked; + + sdata = vif_to_sdata(vif); + +- acked = info->flags & IEEE80211_TX_STAT_ACK; +- rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); +- + rcu_read_lock(); + +- if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) +- goto counters_update; +- +- if (IS_ERR(sta)) +- goto counters_update; +- +- if (!acked) +- sta->status_stats.retry_failed++; +- +- if (rates_idx != -1) +- sta->tx_stats.last_rate = info->status.rates[rates_idx]; +- +- sta->status_stats.retry_count += retry_count; +- +- if (ieee80211_hw_check(hw, REPORTS_TX_ACK_STATUS)) { +- sta->status_stats.last_ack = jiffies; +- if (info->flags & IEEE80211_TX_STAT_ACK) { +- if (sta->status_stats.lost_packets) +- sta->status_stats.lost_packets = 0; ++ if (!ieee80211_lookup_ra_sta(sdata, skb, &sta) && !IS_ERR(sta)) ++ status.sta = &sta->sta; + +- sta->status_stats.last_pkt_time = jiffies; +- } else { +- ieee80211_lost_packet(sta, info); +- } +- } ++ ieee80211_tx_status_ext(hw, &status); + +-counters_update: + rcu_read_unlock(); +- ieee80211_led_tx(local); +- +- if (!(info->flags & IEEE80211_TX_STAT_ACK) && +- !(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED)) +- goto skip_stats_update; +- +- I802_DEBUG_INC(local->dot11TransmittedFrameCount); +- if (is_multicast_ether_addr(skb->data)) +- I802_DEBUG_INC(local->dot11MulticastTransmittedFrameCount); +- if (retry_count > 0) +- I802_DEBUG_INC(local->dot11RetryCount); +- if (retry_count > 1) +- I802_DEBUG_INC(local->dot11MultipleRetryCount); +- +-skip_stats_update: +- ieee80211_report_used_skb(local, skb, false); +- dev_kfree_skb(skb); + } + EXPORT_SYMBOL(ieee80211_tx_status_8023); + diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch new file mode 100644 index 000000000..1ec22dbbc --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/320-mac80211-add-missing-queue-hash-initialization-to-80.patch @@ -0,0 +1,25 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 13:55:56 +0200 +Subject: [PATCH] mac80211: add missing queue/hash initialization to 802.3 + xmit + +Fixes AQL for encap-offloaded tx + +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 + if (is_zero_ether_addr(ra)) + goto out_free; + ++ if (local->ops->wake_tx_queue) { ++ u16 queue = __ieee80211_select_queue(sdata, sta, skb); ++ skb_set_queue_mapping(skb, queue); ++ skb_get_hash(skb); ++ } ++ + multicast = is_multicast_ether_addr(ra); + + if (sta) diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch b/package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch new file mode 100644 index 000000000..5c149e7d9 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/321-mac80211-check-and-refresh-aggregation-session-in-en.patch @@ -0,0 +1,45 @@ +From: Felix Fietkau +Date: Mon, 17 Aug 2020 21:11:25 +0200 +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 + +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 + bool authorized = false; + bool multicast; + unsigned char *ra = ehdr->h_dest; ++ struct tid_ampdu_tx *tid_tx; ++ u8 tid; + + if (IS_ERR(sta) || (sta && !sta->uploaded)) + sta = NULL; +@@ -4232,6 +4234,22 @@ static void ieee80211_8023_xmit(struct i + + memset(info, 0, sizeof(*info)); + ++ if (sta) { ++ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; ++ tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); ++ if (tid_tx) { ++ if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) { ++ /* fall back to non-offload slow path */ ++ __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL); ++ return; ++ } ++ ++ info->flags |= IEEE80211_TX_CTL_AMPDU; ++ if (tid_tx->timeout) ++ tid_tx->last_tx = jiffies; ++ } ++ } ++ + if (unlikely(!multicast && skb->sk && + skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) + info->ack_frame_id = ieee80211_store_ack_skb(local, skb, 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/322-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch new file mode 100644 index 000000000..5469a419b --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/322-mac80211-support-using-ieee80211_tx_status_ext-to-fr.patch @@ -0,0 +1,63 @@ +From: Felix Fietkau +Date: Thu, 20 Aug 2020 17:27:00 +0200 +Subject: [PATCH] mac80211: support using ieee80211_tx_status_ext to free + skbs without status info + +For encap-offloaded packets, ieee80211_free_txskb cannot be used, since it +does not have the vif pointer. +Using ieee80211_tx_status_ext for this purpose has the advantage of being able +avoid an extra station lookup for AQL + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -1103,6 +1103,21 @@ void ieee80211_tx_status_ext(struct ieee + sta->tx_stats.last_rate_info = *status->rate; + } + ++ if (skb && (tx_time_est = ++ ieee80211_info_get_tx_time_est(IEEE80211_SKB_CB(skb))) > 0) { ++ /* Do this here to avoid the expensive lookup of the sta ++ * in ieee80211_report_used_skb(). ++ */ ++ ieee80211_sta_update_pending_airtime(local, sta, ++ skb_get_queue_mapping(skb), ++ tx_time_est, ++ true); ++ ieee80211_info_set_tx_time_est(IEEE80211_SKB_CB(skb), 0); ++ } ++ ++ if (!status->info) ++ goto free; ++ + rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); + + sband = hw->wiphy->bands[info->band]; +@@ -1146,17 +1161,6 @@ void ieee80211_tx_status_ext(struct ieee + ieee80211s_update_metric(local, sta, status); + } + +- if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) { +- /* Do this here to avoid the expensive lookup of the sta +- * in ieee80211_report_used_skb(). +- */ +- ieee80211_sta_update_pending_airtime(local, sta, +- skb_get_queue_mapping(skb), +- tx_time_est, +- true); +- ieee80211_info_set_tx_time_est(info, 0); +- } +- + if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) + return __ieee80211_tx_status(hw, status, rates_idx, + retry_count); +@@ -1173,6 +1177,7 @@ void ieee80211_tx_status_ext(struct ieee + I802_DEBUG_INC(local->dot11FailedCount); + } + ++free: + if (!skb) + return; + 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/323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch new file mode 100644 index 000000000..c0f2b7b10 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/323-mac80211-extend-ieee80211_tx_status_ext-to-support-b.patch @@ -0,0 +1,53 @@ +From: Felix Fietkau +Date: Fri, 21 Aug 2020 05:49:07 +0200 +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 + +Signed-off-by: Felix Fietkau +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1092,12 +1092,14 @@ ieee80211_info_get_tx_time_est(struct ie + * @info: Basic tx status information + * @skb: Packet skb (can be NULL if not provided by the driver) + * @rate: The TX rate that was used when sending the packet ++ * @free_list: list where processed skbs are stored to be free'd by the driver + */ + struct ieee80211_tx_status { + struct ieee80211_sta *sta; + struct ieee80211_tx_info *info; + struct sk_buff *skb; + struct rate_info *rate; ++ struct list_head *free_list; + }; + + /** +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -1053,7 +1053,10 @@ static void __ieee80211_tx_status(struct + * with this test... + */ + if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) { +- dev_kfree_skb(skb); ++ if (status->free_list) ++ list_add_tail(&skb->list, status->free_list); ++ else ++ dev_kfree_skb(skb); + return; + } + +@@ -1182,7 +1185,10 @@ free: + return; + + ieee80211_report_used_skb(local, skb, false); +- dev_kfree_skb(skb); ++ if (status->free_list) ++ list_add_tail(&skb->list, status->free_list); ++ else ++ dev_kfree_skb(skb); + } + EXPORT_SYMBOL(ieee80211_tx_status_ext); + 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/324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch new file mode 100644 index 000000000..abfb5b76d --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/324-mac80211-notify-the-driver-when-a-sta-uses-4-address.patch @@ -0,0 +1,109 @@ +From: Felix Fietkau +Date: Fri, 21 Aug 2020 05:51:58 +0200 +Subject: [PATCH] mac80211: notify the driver when a sta uses 4-address + mode + +This is needed for encapsulation offload of 4-address mode packets + +Signed-off-by: Felix Fietkau +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -3840,6 +3840,8 @@ enum ieee80211_reconfig_type { + * This callback may sleep. + * @update_vif_config: Update virtual interface offload flags + * This callback may sleep. ++ * @sta_set_4addr: Called to notify the driver when a station starts/stops using ++ * 4-address mode + */ + struct ieee80211_ops { + void (*tx)(struct ieee80211_hw *hw, +@@ -4153,6 +4155,8 @@ struct ieee80211_ops { + struct ieee80211_sta *sta, u8 tids); + void (*update_vif_offload)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif); ++ void (*sta_set_4addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ struct ieee80211_sta *sta, bool enabled); + }; + + /** +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -1698,6 +1698,7 @@ static int ieee80211_change_station(stru + + rcu_assign_pointer(vlansdata->u.vlan.sta, sta); + __ieee80211_check_fast_rx_iface(vlansdata); ++ drv_sta_set_4addr(local, sta->sdata, &sta->sta, true); + } + + if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && +--- a/net/mac80211/driver-ops.h ++++ b/net/mac80211/driver-ops.h +@@ -1400,4 +1400,18 @@ static inline void drv_update_vif_offloa + trace_drv_return_void(local); + } + ++static inline void drv_sta_set_4addr(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_sta *sta, bool enabled) ++{ ++ sdata = get_bss_sdata(sdata); ++ if (!check_sdata_in_driver(sdata)) ++ return; ++ ++ trace_drv_sta_set_4addr(local, sdata, sta, enabled); ++ if (local->ops->sta_set_4addr) ++ local->ops->sta_set_4addr(&local->hw, &sdata->vif, sta, enabled); ++ trace_drv_return_void(local); ++} ++ + #endif /* __MAC80211_DRIVER_OPS */ +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -3518,6 +3518,9 @@ static bool ieee80211_assoc_success(stru + goto out; + } + ++ if (sdata->wdev.use_4addr) ++ drv_sta_set_4addr(local, sdata, &sta->sta, true); ++ + mutex_unlock(&sdata->local->sta_mtx); + + /* +--- a/net/mac80211/trace.h ++++ b/net/mac80211/trace.h +@@ -2739,6 +2739,33 @@ DEFINE_EVENT(local_sdata_addr_evt, drv_u + TP_ARGS(local, sdata) + ); + ++TRACE_EVENT(drv_sta_set_4addr, ++ TP_PROTO(struct ieee80211_local *local, ++ struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_sta *sta, bool enabled), ++ ++ TP_ARGS(local, sdata, sta, enabled), ++ ++ TP_STRUCT__entry( ++ LOCAL_ENTRY ++ VIF_ENTRY ++ STA_ENTRY ++ __field(bool, enabled) ++ ), ++ ++ TP_fast_assign( ++ LOCAL_ASSIGN; ++ VIF_ASSIGN; ++ STA_ASSIGN; ++ __entry->enabled = enabled; ++ ), ++ ++ TP_printk( ++ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " enabled:%d", ++ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->enabled ++ ) ++); ++ + #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ + + #undef TRACE_INCLUDE_PATH diff --git a/package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch b/package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch new file mode 100644 index 000000000..6ea9c3c91 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/325-mac80211-skip-encap-offload-for-tx-multicast-control.patch @@ -0,0 +1,158 @@ +From: Felix Fietkau +Date: Fri, 21 Aug 2020 05:54:10 +0200 +Subject: [PATCH] mac80211: skip encap offload for tx multicast/control + packets + +This simplifies the checks in the encap offload tx handler and allows using +it in cases where software crypto is used for multicast packets, e.g. when +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 + struct sk_buff *skb) + { + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +- struct ethhdr *ehdr = (struct ethhdr *)skb->data; + struct ieee80211_local *local = sdata->local; +- bool authorized = false; +- bool multicast; +- unsigned char *ra = ehdr->h_dest; + struct tid_ampdu_tx *tid_tx; + u8 tid; + +- if (IS_ERR(sta) || (sta && !sta->uploaded)) +- sta = NULL; +- +- if (sdata->vif.type == NL80211_IFTYPE_STATION && +- (!sta || !test_sta_flag(sta, WLAN_STA_TDLS_PEER))) +- ra = sdata->u.mgd.bssid; +- +- if (is_zero_ether_addr(ra)) +- goto out_free; +- + if (local->ops->wake_tx_queue) { + u16 queue = __ieee80211_select_queue(sdata, sta, skb); + skb_set_queue_mapping(skb, queue); + skb_get_hash(skb); + } + +- multicast = is_multicast_ether_addr(ra); +- +- if (sta) +- authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); +- +- if (!multicast && !authorized && +- (ehdr->h_proto != sdata->control_port_protocol || +- !ether_addr_equal(sdata->vif.addr, ehdr->h_source))) +- goto out_free; +- +- if (multicast && sdata->vif.type == NL80211_IFTYPE_AP && +- !atomic_read(&sdata->u.ap.num_mcast_sta)) +- goto out_free; +- + if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)) && + test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state)) + goto out_free; + + memset(info, 0, sizeof(*info)); + +- if (sta) { +- tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; +- tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); +- if (tid_tx) { +- if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) { +- /* fall back to non-offload slow path */ +- __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL); +- return; +- } +- +- info->flags |= IEEE80211_TX_CTL_AMPDU; +- if (tid_tx->timeout) +- tid_tx->last_tx = jiffies; ++ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; ++ tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); ++ if (tid_tx) { ++ if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state)) { ++ /* fall back to non-offload slow path */ ++ __ieee80211_subif_start_xmit(skb, dev, 0, 0, NULL); ++ return; + } ++ ++ info->flags |= IEEE80211_TX_CTL_AMPDU; ++ if (tid_tx->timeout) ++ tid_tx->last_tx = jiffies; + } + +- if (unlikely(!multicast && skb->sk && ++ if (unlikely(skb->sk && + skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)) + info->ack_frame_id = ieee80211_store_ack_skb(local, skb, + &info->flags, NULL); + +- if (unlikely(sdata->control_port_protocol == ehdr->h_proto)) { +- if (sdata->control_port_no_encrypt) +- info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; +- info->control.flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO; +- } +- +- if (multicast) +- info->flags |= IEEE80211_TX_CTL_NO_ACK; +- + info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)]; + + ieee80211_tx_stats(dev, skb->len); + +- if (sta) { +- sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; +- sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; +- } ++ sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; ++ sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; + + 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 + 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 (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); + else + ieee80211_8023_xmit(sdata, dev, sta, 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/326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch new file mode 100644 index 000000000..2b7579b24 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/326-mac80211-set-info-control.hw_key-for-encap-offload-p.patch @@ -0,0 +1,31 @@ +From: Felix Fietkau +Date: Fri, 21 Aug 2020 06:03:45 +0200 +Subject: [PATCH] mac80211: set info->control.hw_key for encap offload + packets + +This is needed for drivers that don't do the key lookup themselves + +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 + { + 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; + +@@ -4239,6 +4240,10 @@ static void ieee80211_8023_xmit(struct i + info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP; + info->control.vif = &sdata->vif; + ++ key = rcu_dereference(sta->ptk[sta->ptk_idx]); ++ if (key) ++ info->control.hw_key = &key->conf; ++ + ieee80211_tx_8023(sdata, skb, skb->len, sta, false); + + return; 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 b816146c2..1487e10f4 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 @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2610,6 +2610,19 @@ static int ieee80211_get_tx_power(struct +@@ -2615,6 +2615,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) { -@@ -4040,6 +4053,7 @@ const struct cfg80211_ops mac80211_confi +@@ -4045,6 +4058,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, @@ -87,7 +87,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1385,6 +1385,7 @@ struct ieee80211_local { +@@ -1383,6 +1383,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ diff --git a/package/kernel/mac80211/patches/subsys/701-mac80211-build-on-linux_4_14.patch b/package/kernel/mac80211/patches/subsys/701-mac80211-build-on-linux_4_14.patch deleted file mode 100644 index 5aa69a584..000000000 --- a/package/kernel/mac80211/patches/subsys/701-mac80211-build-on-linux_4_14.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c -index bd5988e..df6bd18 100644 ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -4774,12 +4774,25 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta, - rcu_read_unlock(); - - if (!napi) { -+#if LINUX_VERSION_IS_GEQ(4,19,0) - netif_receive_skb_list(&list); -+#else -+ list_for_each_entry_safe(skb, tmp, &list, list) { -+ __list_del_entry(&skb->list); -+ skb->next = NULL; -+ netif_receive_skb(skb); -+ } -+#endif - return; - } - - list_for_each_entry_safe(skb, tmp, &list, list) { -+#if LINUX_VERSION_IS_GEQ(4,19,0) - skb_list_del_init(skb); -+#else -+ __list_del_entry(&skb->list); -+ skb->next = NULL; -+#endif - napi_gro_receive(napi, skb); - } - } diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 30146f552..61c59cab3 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2020-07-22 -PKG_SOURCE_VERSION:=b5df0fbb1847a51f0a11f03a3fa8dc9d98d4df82 -PKG_MIRROR_HASH:=70aca7f8912b89af975c7b63fdf25d41be831c434e0c991fcbdaa60127d4acd5 +PKG_SOURCE_DATE:=2020-08-22 +PKG_SOURCE_VERSION:=8c7c1a207d25cd880c7f54d3fe86e82f14d6ecda +PKG_MIRROR_HASH:=0411bc634cb4065f748754e02758c172a4c65298696667f198c41d580d165d69 PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/nat46/Makefile b/package/kernel/nat46/Makefile index dfe7539c5..f37ee6e39 100644 --- a/package/kernel/nat46/Makefile +++ b/package/kernel/nat46/Makefile @@ -3,11 +3,11 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=nat46 -PKG_MIRROR_HASH:=3f5ef0a56e9b02c3ec10ec95f3f81c0ed04b983b2d857c16304c379106d6beb6 +PKG_MIRROR_HASH:=d0bc80038cadeb7e857118e8d6bae242670ab27377af49f74bad494e0e5da598 PKG_SOURCE_URL:=https://github.com/ayourtch/nat46.git -PKG_SOURCE_DATE:=2017-05-12 +PKG_SOURCE_DATE:=2020-08-06 PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=683fbd2b765506332a1af141545652bf58f03166 +PKG_SOURCE_VERSION:=71e9f0941a666c7010bb6d31d45bb795439038fa PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 diff --git a/package/kernel/nat46/patches/100-kernel-5.4-compat.patch b/package/kernel/nat46/patches/100-kernel-5.4-compat.patch deleted file mode 100644 index 076bf2a61..000000000 --- a/package/kernel/nat46/patches/100-kernel-5.4-compat.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/nat46/modules/nat46-core.c -+++ b/nat46/modules/nat46-core.c -@@ -17,6 +17,7 @@ - */ - - #include -+#include - - #include "nat46-glue.h" - #include "nat46-core.h" -@@ -1598,7 +1599,11 @@ void nat46_ipv6_input(struct sk_buff *ol - /* Remove any debris in the socket control block */ - memset(IPCB(new_skb), 0, sizeof(struct inet_skb_parm)); - /* Remove netfilter references to IPv6 packet, new netfilter references will be created based on IPv4 packet */ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) - nf_reset(new_skb); -+#else -+ nf_reset_ct(new_skb); -+#endif - - /* modify packet: actual IPv6->IPv4 transformation */ - truncSize = v6packet_l3size - sizeof(struct iphdr); /* chop first 20 bytes */ -@@ -1803,7 +1808,11 @@ void nat46_ipv4_input(struct sk_buff *ol - /* Remove any debris in the socket control block */ - memset(IPCB(new_skb), 0, sizeof(struct inet_skb_parm)); - /* Remove netfilter references to IPv4 packet, new netfilter references will be created based on IPv6 packet */ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) - nf_reset(new_skb); -+#else -+ nf_reset_ct(new_skb); -+#endif - - /* expand header (add 20 extra bytes at the beginning of sk_buff) */ - pskb_expand_head(new_skb, IPV6V4HDRDELTA + (add_frag_header?8:0), 0, GFP_ATOMIC); diff --git a/package/kernel/om-watchdog/Makefile b/package/kernel/om-watchdog/Makefile index 403069b81..c138a5987 100644 --- a/package/kernel/om-watchdog/Makefile +++ b/package/kernel/om-watchdog/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=om-watchdog -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_VERSION:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init index 4c407dada..12ff66583 100644 --- a/package/kernel/om-watchdog/files/om-watchdog.init +++ b/package/kernel/om-watchdog/files/om-watchdog.init @@ -47,7 +47,7 @@ get_gpio() { return 17 ;; esac - elif [ "$board" = "teltonika_rut5xx" ]; then + elif [ "$board" = "teltonika,rut5xx" ]; then # ramips return 11 else diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 8d3d58ebf..f718932ee 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -102,9 +102,9 @@ dhcp_check() { [ -s "$stamp" ] && return $(cat "$stamp") - # If there's no carrier yet, skip this interface. + # If interface is down, skip it. # The init script will be called again once the link is up - case "$(devstatus "$ifname" | jsonfilter -e @.carrier)" in + case "$(devstatus "$ifname" | jsonfilter -e @.up)" in false) return 1;; esac @@ -867,7 +867,7 @@ dnsmasq_start() append_bool "$cfg" noping "--no-ping" append_bool "$cfg" rapidcommit "--dhcp-rapid-commit" append_bool "$cfg" scriptarp "--script-arp" - + append_bool "$cfg" filter_aaaa "--filter-aaaa" append_parm "$cfg" logfacility "--log-facility" diff --git a/package/network/utils/ltq-dsl-base/Makefile b/package/network/utils/ltq-dsl-base/Makefile new file mode 100644 index 000000000..e2cfc4004 --- /dev/null +++ b/package/network/utils/ltq-dsl-base/Makefile @@ -0,0 +1,32 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ltq-dsl-base +PKG_RELEASE:=2 + +include $(INCLUDE_DIR)/package.mk + +define Package/ltq-dsl-base + SECTION:=net + CATEGORY:=Network + TITLE:=DSL related files for Intel/Lantiq DSL Chipsets + URL:=http://openwrt.org/ + DEPENDS:=@TARGET_lantiq +jshn +endef + +define Package/ltq-dsl-base/description + This package contains DSL related files for Intel/Lantiq DSL Chipsets. +endef + +define Build/Compile +endef + +define Package/ltq-dsl-base/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,ltq-dsl-base)) diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/dsl/led_dsl.sh b/package/network/utils/ltq-dsl-base/files/etc/hotplug.d/dsl/led_dsl.sh similarity index 100% rename from target/linux/lantiq/base-files/etc/hotplug.d/dsl/led_dsl.sh rename to package/network/utils/ltq-dsl-base/files/etc/hotplug.d/dsl/led_dsl.sh diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/dsl/pppoa.sh b/package/network/utils/ltq-dsl-base/files/etc/hotplug.d/dsl/pppoa.sh similarity index 100% rename from target/linux/lantiq/base-files/etc/hotplug.d/dsl/pppoa.sh rename to package/network/utils/ltq-dsl-base/files/etc/hotplug.d/dsl/pppoa.sh diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/package/network/utils/ltq-dsl-base/files/lib/functions/lantiq_dsl.sh similarity index 99% rename from target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh rename to package/network/utils/ltq-dsl-base/files/lib/functions/lantiq_dsl.sh index 11b02fc4a..5842a7879 100755 --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh +++ b/package/network/utils/ltq-dsl-base/files/lib/functions/lantiq_dsl.sh @@ -19,10 +19,10 @@ dsl_cmd() { ) } dsl_val() { - echo $(expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*') + expr "$1" : '.*'$2'=\([-\.[:alnum:]]*\).*' } dsl_string() { - echo $(expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))') + expr "$1" : '.*'$2'=(\([A-Z0-9,]*\))' } # diff --git a/target/linux/lantiq/base-files/sbin/dsl_notify.sh b/package/network/utils/ltq-dsl-base/files/sbin/dsl_notify.sh similarity index 100% rename from target/linux/lantiq/base-files/sbin/dsl_notify.sh rename to package/network/utils/ltq-dsl-base/files/sbin/dsl_notify.sh diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index ee5e85927..486a60085 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zram-swap PKG_VERSION:=1.1 -PKG_RELEASE:=4 +PKG_RELEASE:=6 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -18,7 +18,7 @@ include $(INCLUDE_DIR)/package.mk define Package/zram-swap SECTION:=utils CATEGORY:=Base system - DEPENDS:=+kmod-zram +!(BUSYBOX_DEFAULT_MKSWAP||BUSYBOX_CONFIG_MKSWAP):swap-utils +!((BUSYBOX_DEFAULT_SWAPON||BUSYBOX_CONFIG_SWAPON)&&(BUSYBOX_DEFAULT_SWAPOFF||BUSYBOX_CONFIG_SWAPOFF)):block-mount + DEPENDS:=+kmod-zram +!(BUSYBOX_CONFIG_MKSWAP&&BUSYBOX_CONFIG_SWAPON&&BUSYBOX_CONFIG_SWAPOFF):swap-utils TITLE:=ZRAM swap scripts PKGARCH:=all endef diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index c855bbc08..42c084855 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -35,17 +35,17 @@ zram_applicable() return 1 } - which mkswap >/dev/null || { + command -v mkswap >/dev/null || { logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed" return 1 } - which swapon >/dev/null || { + command -v swapon >/dev/null || { logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed" return 1 } - which swapoff >/dev/null || { + command -v swapoff >/dev/null || { logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed" return 1 } @@ -182,7 +182,7 @@ start() zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" - swapon $zram_priority "$zram_dev" + swapon -d $zram_priority "$zram_dev" } stop() diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 91c9b9b5b..29724041f 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -24,7 +24,7 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE default y config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE bool - default y + default n config BUSYBOX_DEFAULT_LFS bool default y @@ -303,7 +303,7 @@ config BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS default n config BUSYBOX_DEFAULT_MONOTONIC_SYSCALL bool - default n + default y config BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR bool default y diff --git a/package/utils/busybox/patches/130-mconf_missing_sigwinch.patch b/package/utils/busybox/patches/130-mconf_missing_sigwinch.patch deleted file mode 100644 index b8ca2122b..000000000 --- a/package/utils/busybox/patches/130-mconf_missing_sigwinch.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/scripts/kconfig/mconf.c -+++ b/scripts/kconfig/mconf.c -@@ -31,6 +31,10 @@ - #define SIGWINCH 28 - #endif - -+#ifndef SIGWINCH -+#define SIGWINCH 28 -+#endif -+ - #define LKC_DIRECT_LINK - #include "lkc.h" - diff --git a/package/utils/ravpower-mcu/Makefile b/package/utils/ravpower-mcu/Makefile index 435445fcc..949ccfcce 100644 --- a/package/utils/ravpower-mcu/Makefile +++ b/package/utils/ravpower-mcu/Makefile @@ -1,6 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ravpower-mcu +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/blocktrron/ravpower-mcu.git @@ -16,7 +17,6 @@ define Package/ravpower-mcu SECTION:=utils CATEGORY:=Utilities TITLE:=Utility to control the RAVPower RP-WD009 PMIC - DEPENDS:=@TARGET_ramips_mt76x8 URL:=https://github.com/blocktrron/ravpower-mcu/ endef diff --git a/scripts/download.pl b/scripts/download.pl index e296303a8..66675fb19 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -194,6 +194,7 @@ foreach my $mirror (@ARGV) { push @mirrors, "https://downloads.sourceforge.net/$1"; } } elsif ($mirror =~ /^\@APACHE\/(.+)$/) { + push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1"; push @mirrors, "https://mirror.netcologne.de/apache.org/$1"; push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1"; @@ -213,6 +214,7 @@ foreach my $mirror (@ARGV) { push @mirrors, "https://raw.githubusercontent.com/$dir"; } } elsif ($mirror =~ /^\@GNU\/(.+)$/) { + push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1"; push @mirrors, "https://mirror.netcologne.de/gnu/$1"; push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1"; @@ -238,7 +240,7 @@ foreach my $mirror (@ARGV) { push @extra, "$extra[0]/longterm/v$1"; } foreach my $dir (@extra) { - push @mirrors, "http://mirrors.ustc.edu.cn/kernel.org/$dir"; + push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir"; push @mirrors, "https://cdn.kernel.org/pub/$dir"; push @mirrors, "https://mirror.rackspace.com/kernel.org/pub/$dir"; push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir"; @@ -249,6 +251,7 @@ foreach my $mirror (@ARGV) { push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir"; } } elsif ($mirror =~ /^\@GNOME\/(.+)$/) { + push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1"; push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1"; push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1"; @@ -263,7 +266,7 @@ foreach my $mirror (@ARGV) { } } -unshift @mirrors, 'https://sources.cdn.openwrt.org'; +push @mirrors, 'https://sources.cdn.openwrt.org'; #push @mirrors, 'https://mirror1.openwrt.org'; push @mirrors, 'https://sources.openwrt.org'; push @mirrors, 'https://mirror2.openwrt.org/sources'; 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 597b5dcca..a78a1054f 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 @@ -1,10 +1,10 @@ #!/bin/ash -[ "$ACTION" == "add" ] || exit 0 +[ "$ACTION" = "add" ] || exit 0 PHYNBR=${DEVPATH##*/phy} -[ -n $PHYNBR ] || exit 0 +[ -n "$PHYNBR" ] || exit 0 . /lib/functions.sh . /lib/functions/system.sh @@ -14,7 +14,7 @@ board=$(board_name) case "$board" in netgear,wndap620|\ netgear,wndap660) - echo $(macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress + macaddr_add $(mtd_get_mac_ascii u-boot-env baseMAC) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress ;; *) ;; diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx index 1f8c1c29f..5f92c0193 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx @@ -5,7 +5,7 @@ preinit_set_mac_address() { meraki,mr24|\ meraki,mx60) mac_lan=$(mtd_get_mac_binary_ubi board-config 0x66) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + [ -n "$mac_lan" ] && ip link set eth0 address "$mac_lan" ;; esac } diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 1b7c466a4..2331947e3 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -87,6 +87,7 @@ define Device/Default KERNEL_ENTRY := 0x00000000 KERNEL_LOADADDR := 0x00000000 DEVICE_DTS_DIR := ../dts + DEVICE_DTS = $(subst _,-,$(1)) SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index a7338e79a..845770b89 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -29,7 +29,6 @@ define Device/meraki_mr24 DEVICE_MODEL := MR24 DEVICE_PACKAGES := kmod-spi-gpio -swconfig BOARD_NAME := mr24 - DEVICE_DTS := meraki-mr24 IMAGES := sysupgrade.bin DTB_SIZE := 64512 IMAGE_SIZE := 8191k @@ -47,7 +46,6 @@ define Device/meraki_mx60 DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \ kmod-usb-storage block-mount BOARD_NAME := mx60 - DEVICE_DTS := meraki-mx60 BLOCKSIZE := 63k IMAGES := sysupgrade.bin DTB_SIZE := 64512 @@ -80,14 +78,12 @@ endef define Device/netgear_wndap620 $(Device/netgear_wndap6x0) DEVICE_MODEL := WNDAP620 (Premium Wireless-N) - DEVICE_DTS := netgear-wndap620 endef TARGET_DEVICES += netgear_wndap620 define Device/netgear_wndap660 $(Device/netgear_wndap6x0) DEVICE_MODEL := WNDAP660 (Dual Radio Dual Band Wireless-N) - DEVICE_DTS := netgear-wndap660 endef TARGET_DEVICES += netgear_wndap660 @@ -100,7 +96,6 @@ define Device/netgear_wndr4700 kmod-nls-utf8 kmod-usb3 kmod-usb-dwc2 kmod-usb-storage \ partx-utils BOARD_NAME := wndr4700 - DEVICE_DTS := netgear-wndr4700 PAGESIZE := 2048 SUBPAGESIZE := 512 BLOCKSIZE := 128k @@ -122,5 +117,6 @@ define Device/netgear_wndr4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 SUPPORTED_DEVICES += wndr4700 + DEFAULT := n endef TARGET_DEVICES += netgear_wndr4700 diff --git a/target/linux/apm821xx/image/sata.mk b/target/linux/apm821xx/image/sata.mk index 444b2441f..bcb612c22 100644 --- a/target/linux/apm821xx/image/sata.mk +++ b/target/linux/apm821xx/image/sata.mk @@ -6,8 +6,7 @@ endef define Device/wd_mybooklive DEVICE_VENDOR := Western Digital DEVICE_MODEL := My Book Live Series (Single + Duo) - DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic - DEVICE_DTS := wd-mybooklive + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-wolfssl SUPPORTED_DEVICES += mbl wd,mybooklive-duo BLOCKSIZE := 1k DTB_SIZE := 16384 diff --git a/target/linux/apm821xx/nand/target.mk b/target/linux/apm821xx/nand/target.mk index 16475307d..d40b0fbc1 100644 --- a/target/linux/apm821xx/nand/target.mk +++ b/target/linux/apm821xx/nand/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=Devices with NAND flash (Routers) FEATURES += nand pcie ramdisk squashfs usb -DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic +DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic-wolfssl define Target/Description Build firmware images for APM821XX boards with NAND flash. diff --git a/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index f3bd671cf..e5000c911 100644 --- a/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.19/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -265,6 +267,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -268,6 +270,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -306,6 +760,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -309,6 +763,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -364,6 +834,16 @@ static void xhci_pci_remove(struct pci_d +@@ -367,6 +837,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 36eab9349..937382fdf 100644 --- a/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-5.4/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -48,9 +48,9 @@ Signed-off-by: Vinod Koul #include "xhci.h" #include "xhci-trace.h" -@@ -57,6 +59,44 @@ - #define PCI_DEVICE_ID_AMD_PROMONTORYA_1 0x43bc - #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142 +@@ -60,6 +62,44 @@ + #define PCI_DEVICE_ID_ASMEDIA_1142_XHCI 0x1242 + #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI 0x2142 +#define RENESAS_FW_VERSION 0x6C +#define RENESAS_ROM_CONFIG 0xF0 @@ -93,7 +93,7 @@ Signed-off-by: Vinod Koul static const char hcd_name[] = "xhci_hcd"; static struct hc_driver __read_mostly xhci_pci_hc_driver; -@@ -284,6 +324,873 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -291,6 +331,873 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -967,7 +967,7 @@ Signed-off-by: Vinod Koul /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -325,6 +1232,27 @@ static int xhci_pci_probe(struct pci_dev +@@ -332,6 +1239,27 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -995,7 +995,7 @@ Signed-off-by: Vinod Koul driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -386,6 +1314,16 @@ static void xhci_pci_remove(struct pci_d +@@ -393,6 +1321,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; @@ -1012,7 +1012,7 @@ Signed-off-by: Vinod Koul xhci = hcd_to_xhci(pci_get_drvdata(dev)); xhci->xhc_state |= XHCI_STATE_REMOVING; -@@ -513,6 +1451,11 @@ static int xhci_pci_resume(struct usb_hc +@@ -520,6 +1458,11 @@ static int xhci_pci_resume(struct usb_hc if (pdev->vendor == PCI_VENDOR_ID_INTEL) usb_enable_intel_xhci_ports(pdev); diff --git a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch index 7f09adf6a..02c9bcb2b 100644 --- a/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-5.4/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -275,6 +275,7 @@ static void xhci_pci_quirks(struct devic +@@ -278,6 +278,7 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x0015) { xhci->quirks |= XHCI_RESET_ON_RESUME; xhci->quirks |= XHCI_ZERO_64B_REGS; diff --git a/target/linux/apm821xx/sata/profiles/00-default.mk b/target/linux/apm821xx/sata/profiles/00-default.mk index db48353bf..887741abd 100644 --- a/target/linux/apm821xx/sata/profiles/00-default.mk +++ b/target/linux/apm821xx/sata/profiles/00-default.mk @@ -8,7 +8,7 @@ define Profile/Default NAME:=Default Profile PRIORITY:=1 - PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic + PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-wolfssl endef define Profile/Default/Description diff --git a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch index 52f48d0d0..6938f9655 100644 --- a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch @@ -757,7 +757,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3878,14 +3878,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3879,14 +3879,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile index 018d6e544..530fb1ea6 100644 --- a/target/linux/arc770/Makefile +++ b/target/linux/arc770/Makefile @@ -11,7 +11,7 @@ BOARD:=arc770 BOARDNAME:=Synopsys DesignWare ARC 770D SUBTARGETS:=generic -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=5.4 DEVICE_TYPE:=basic diff --git a/target/linux/arc770/base-files/etc/board.d/02_network b/target/linux/arc770/base-files/etc/board.d/02_network index 3f5329370..7f1d61907 100755 --- a/target/linux/arc770/base-files/etc/board.d/02_network +++ b/target/linux/arc770/base-files/etc/board.d/02_network @@ -8,7 +8,7 @@ board_config_update case "$(board_name)" in -"arc-sdp"*) +"snps,axs101") ucidef_set_interface_lan "eth0" "dhcp" ;; esac diff --git a/target/linux/arc770/base-files/lib/arc.sh b/target/linux/arc770/base-files/lib/arc.sh deleted file mode 100644 index 3ad0b3367..000000000 --- a/target/linux/arc770/base-files/lib/arc.sh +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# - -# defaults -ARC_BOARD_NAME="generic" -ARC_BOARD_MODEL="Generic ARC board" - -arc_board_detect() { - local board - local model - local compatible - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - model="$( cat /proc/device-tree/model )" - compatible="$( cat /proc/device-tree/compatible )" - - case "$compatible" in - "snps,axs101""snps,arc-sdp") - board="arc-sdp"; - ;; - "snps,nsim") - board="arc-nsim"; - ;; - esac - - if [ "$board" != "" ]; then - ARC_BOARD_NAME="$board" - fi - - if [ "$model" != "" ]; then - ARC_BOARD_MODEL="$model" - fi - - echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model - echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL" -} diff --git a/target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh b/target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh deleted file mode 100644 index c5cd90582..000000000 --- a/target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh +++ /dev/null @@ -1,7 +0,0 @@ -do_arc() { - . /lib/arc.sh - - arc_board_detect -} - -boot_hook_add preinit_main do_arc diff --git a/target/linux/arc770/config-5.4 b/target/linux/arc770/config-5.4 new file mode 100644 index 000000000..fcbad961f --- /dev/null +++ b/target/linux/arc770/config-5.4 @@ -0,0 +1,199 @@ +# CONFIG_16KSTACKS is not set +CONFIG_ARC=y +CONFIG_ARCH_32BIT_OFF_T=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y +CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y +CONFIG_ARCH_HAS_PTE_SPECIAL=y +CONFIG_ARCH_HAS_SETUP_DMA_OPS=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y +CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +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_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_TIMERS=y +CONFIG_AXS101=y +CONFIG_CC_HAS_KASAN_GENERIC=y +# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32BIT_TIME=y +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_DMA_DIRECT_REMAP=y +CONFIG_DMA_REMAP=y +CONFIG_DTC=y +CONFIG_DWMAC_ANARION=y +CONFIG_DWMAC_GENERIC=y +CONFIG_DW_APB_ICTL=y +CONFIG_EXT4_FS=y +# CONFIG_EZNPS_GIC is not set +CONFIG_FIXED_PHY=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_FW_LOADER_PAGED_BUF=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CSUM=y +CONFIG_GENERIC_FIND_FIRST_BIT=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_DWAPB=y +CONFIG_GPIO_GENERIC=y +# CONFIG_GPIO_SNPS_CREG is not set +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_FUTEX_CMPXCHG=y +CONFIG_HAVE_IOREMAP_PROT=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_HZ=100 +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_LOCK_DEBUGGING_SUPPORT=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MEMFD_CREATE=y +CONFIG_MFD_SYSCON=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_DW=y +# CONFIG_MMC_DW_BLUEFIELD is not set +# CONFIG_MMC_DW_EXYNOS is not set +# CONFIG_MMC_DW_HI3798CV200 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_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_KM=y +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_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_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_PAGE_POOL=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +CONFIG_PPS=y +CONFIG_PREEMPT=y +CONFIG_PREEMPTION=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_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_RESET_AXS10X=y +CONFIG_RESET_CONTROLLER=y +CONFIG_RESET_SIMPLE=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_8250_DWLIB=y +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_MCTRL_GPIO=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SRCU=y +CONFIG_STACKTRACE=y +CONFIG_STMMAC_ETH=y +CONFIG_STMMAC_PLATFORM=y +# CONFIG_STMMAC_SELFTESTS is not set +CONFIG_SWPHY=y +CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW=y +CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN=y +CONFIG_TASKS_RCU=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 +CONFIG_WATCHDOG_CORE=y diff --git a/target/linux/arc770/generic/profiles/00-default.mk b/target/linux/arc770/generic/profiles/00-default.mk index 2ca93ddb0..9f6966317 100644 --- a/target/linux/arc770/generic/profiles/00-default.mk +++ b/target/linux/arc770/generic/profiles/00-default.mk @@ -7,7 +7,7 @@ define Profile/Default NAME:=Default Profile (all drivers) - PACKAGES:= kmod-usb-ohci kmod-usb2 kmod-ath9k-htc wpad-basic + PACKAGES:= kmod-usb-ohci kmod-usb2 kmod-ath9k-htc wpad-basic-wolfssl endef define Profile/Default/Description diff --git a/target/linux/arc770/patches-5.4/700-stmmac-Disable-frame-filtering-completely.patch b/target/linux/arc770/patches-5.4/700-stmmac-Disable-frame-filtering-completely.patch new file mode 100644 index 000000000..9adfcb1be --- /dev/null +++ b/target/linux/arc770/patches-5.4/700-stmmac-Disable-frame-filtering-completely.patch @@ -0,0 +1,31 @@ +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 +@@ -42,7 +42,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/archs38/base-files/etc/board.d/02_network b/target/linux/archs38/base-files/etc/board.d/02_network index 60a260231..dcf33788c 100755 --- a/target/linux/archs38/base-files/etc/board.d/02_network +++ b/target/linux/archs38/base-files/etc/board.d/02_network @@ -8,7 +8,8 @@ board_config_update case "$(board_name)" in -"arc-sdp"*|"arc-hsdk"*) +snps,axs103|\ +snps,hsdk) ucidef_set_interface_lan "eth0" "dhcp" ;; esac diff --git a/target/linux/archs38/base-files/lib/arc.sh b/target/linux/archs38/base-files/lib/arc.sh deleted file mode 100644 index 50aaaa2d2..000000000 --- a/target/linux/archs38/base-files/lib/arc.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 OpenWrt.org -# - -# defaults -ARC_BOARD_NAME="generic" -ARC_BOARD_MODEL="Generic ARC board" - -arc_board_detect() { - local board - local model - local compatible - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - model="$( cat /proc/device-tree/model )" - compatible="$( cat /proc/device-tree/compatible )" - - case "$compatible" in - "snps,axs103""snps,arc-sdp") - board="arc-sdp"; - ;; - "snps,hsdk") - board="arc-hsdk"; - ;; - "snps,nsim_hs") - board="arc-nsim"; - ;; - esac - - if [ "$board" != "" ]; then - ARC_BOARD_NAME="$board" - fi - - if [ "$model" != "" ]; then - ARC_BOARD_MODEL="$model" - fi - - echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model - echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL" -} diff --git a/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh b/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh deleted file mode 100644 index c5cd90582..000000000 --- a/target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh +++ /dev/null @@ -1,7 +0,0 @@ -do_arc() { - . /lib/arc.sh - - arc_board_detect -} - -boot_hook_add preinit_main do_arc diff --git a/target/linux/archs38/generic/profiles/00-default.mk b/target/linux/archs38/generic/profiles/00-default.mk index ec9bbbb19..172ad4bcf 100644 --- a/target/linux/archs38/generic/profiles/00-default.mk +++ b/target/linux/archs38/generic/profiles/00-default.mk @@ -7,7 +7,7 @@ define Profile/Default NAME:=Default Profile (all drivers) - PACKAGES:= kmod-usb2 kmod-ath9k-htc wpad-basic + PACKAGES:= kmod-usb2 kmod-ath9k-htc wpad-basic-wolfssl endef define Profile/Default/Description diff --git a/target/linux/at91/image/sam9x.mk b/target/linux/at91/image/sam9x.mk index 8fd6b4506..beff34672 100644 --- a/target/linux/at91/image/sam9x.mk +++ b/target/linux/at91/image/sam9x.mk @@ -173,8 +173,9 @@ define Device/at91-q5xr5 DEVICE_VENDOR := Exegin DEVICE_MODEL := Q5XR5 KERNEL_SIZE := 2048k + DEFAULT := n endef -#TARGET_DEVICES += at91-q5xr5 +TARGET_DEVICES += at91-q5xr5 define Device/wb45n $(Device/evaluation-fit) diff --git a/target/linux/at91/image/sama5d4.mk b/target/linux/at91/image/sama5d4.mk deleted file mode 100644 index e69de29bb..000000000 diff --git a/target/linux/ath25/Makefile b/target/linux/ath25/Makefile index 4fb082edf..f88511246 100644 --- a/target/linux/ath25/Makefile +++ b/target/linux/ath25/Makefile @@ -19,6 +19,6 @@ endef include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += wpad-mini kmod-ath5k swconfig kmod-gpio-button-hotplug +DEFAULT_PACKAGES += wpad-basic-wolfssl kmod-ath5k swconfig kmod-gpio-button-hotplug $(eval $(call BuildTarget)) 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 6b77f393a..235ba4bef 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 @@ -5,7 +5,7 @@ preinit_ip() { 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 - ifconfig eth0 up + ip link set eth0 up vconfig add eth0 1 ifname=eth0.1 else @@ -15,7 +15,8 @@ preinit_ip() { } fi [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { - ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up + ip addr add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $pi_ifname + ip link set $pi_ifname up } } @@ -26,8 +27,8 @@ 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 - ifconfig $pi_ifname down + ip link set $pi_ifname down elif [ -n "$pi_ifname" ]; then - ifconfig $pi_ifname 0.0.0.0 + ip -4 addr flush dev $pi_ifname fi } diff --git a/target/linux/ath25/image/Makefile b/target/linux/ath25/image/Makefile index e1ebb159c..8066ba61a 100644 --- a/target/linux/ath25/image/Makefile +++ b/target/linux/ath25/image/Makefile @@ -99,15 +99,17 @@ define Device/np25g 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 += np25g define Device/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 += wpe53g $(eval $(call BuildImage)) diff --git a/target/linux/ath79/config-4.19 b/target/linux/ath79/config-4.19 index 92af6ba97..c1b15301e 100644 --- a/target/linux/ath79/config-4.19 +++ b/target/linux/ath79/config-4.19 @@ -18,6 +18,7 @@ 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_AT803X_PHY=y CONFIG_ATH79=y CONFIG_ATH79_WDT=y CONFIG_BLK_MQ_PCI=y diff --git a/target/linux/ath79/config-5.4 b/target/linux/ath79/config-5.4 index 449f42bba..f0679933a 100644 --- a/target/linux/ath79/config-5.4 +++ b/target/linux/ath79/config-5.4 @@ -23,6 +23,7 @@ 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_AT803X_PHY=y CONFIG_ATH79=y CONFIG_ATH79_WDT=y CONFIG_BLK_MQ_PCI=y 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 bb6c31da9..f9e94a587 100644 --- a/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts +++ b/target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts @@ -201,7 +201,7 @@ reg = <0x050000 0x610000>; }; - caldata: partition@60000 { + partition@660000 { label = "caldata"; reg = <0x660000 0x010000>; read-only; diff --git a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts index 63b46b9c7..d3e631530 100644 --- a/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts +++ b/target/linux/ath79/dts/ar7161_ubnt_routerstation.dts @@ -5,7 +5,7 @@ / { compatible = "ubnt,routerstation", "qca,ar7161"; - model = "Ubiquiti Networks RouterStation"; + model = "Ubiquiti RouterStation"; }; ð0 { diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index 5382a710f..730c509d7 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -59,6 +59,8 @@ }; ð0 { + status = "okay"; + compatible = "qca,ar7240-eth", "syscon"; pll-data = <0x00110000 0x00001099 0x00991099>; diff --git a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts index a2d3a9943..cd61bdb45 100644 --- a/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts +++ b/target/linux/ath79/dts/ar7240_buffalo_whr-g301n.dts @@ -156,8 +156,6 @@ }; ð0 { - status = "okay"; - mtd-mac-address = <&art 0x120c>; }; 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 537a99b8d..22a1aeb0d 100644 --- a/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts +++ b/target/linux/ath79/dts/ar7240_dlink_dir-615-e4.dts @@ -139,10 +139,6 @@ }; }; -ð0 { - status = "okay"; -}; - ð1 { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts index c231f4721..8ae2a128e 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts +++ b/target/linux/ath79/dts/ar7240_netgear_wnr1000-v2.dts @@ -174,8 +174,6 @@ }; ð0 { - status = "okay"; - mtd-mac-address = <&art 0x0>; }; diff --git a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi index a7e6b49c1..e270dfa5c 100644 --- a/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi +++ b/target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi @@ -106,8 +106,6 @@ }; ð0 { - status = "okay"; - mtd-mac-address = <&art 0x0>; }; diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi index ac5a4d5ee..7ec0469dc 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi @@ -9,6 +9,10 @@ }; }; +ð0 { + compatible = "syscon", "simple-mfd"; +}; + ð1 { mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi index 7621b1d53..5ceada837 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wr.dtsi @@ -30,8 +30,6 @@ }; ð0 { - status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <(-1)>; }; 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 58b35f5c8..73626f1ff 100644 --- a/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts +++ b/target/linux/ath79/dts/ar7240_ubnt_bullet-m-ar7240.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,bullet-m-ar7240", "ubnt,xm", "qca,ar7240"; - model = "Ubiquiti Bullet M XM (AR7240)"; + model = "Ubiquiti Bullet M (XM AR7240)"; }; ð0 { diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index 59fcd05f5..4044cdee0 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -77,6 +77,8 @@ }; ð1 { + status = "okay"; + compatible = "qca,ar7241-eth", "syscon"; pll-data = <0x00110000 0x00001099 0x00991099>; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts index 4d080c82f..b4765d1a1 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2000-v3.dts @@ -183,9 +183,8 @@ }; ð1 { - status = "okay"; - compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; + mtd-mac-address = <&art 0x6>; }; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi index 49b869f71..afd521b67 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -159,9 +159,8 @@ }; ð1 { - status = "okay"; - compatible = "qca,ar7241-eth", "syscon", "simple-mfd"; + mtd-mac-address = <&art 0x6>; }; diff --git a/target/linux/ath79/dts/ar7241_tplink.dtsi b/target/linux/ath79/dts/ar7241_tplink.dtsi index 09a239f67..f83985cc5 100644 --- a/target/linux/ath79/dts/ar7241_tplink.dtsi +++ b/target/linux/ath79/dts/ar7241_tplink.dtsi @@ -103,16 +103,10 @@ }; ð1 { - status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <1>; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; 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 64833bf2c..72913bfa2 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -150,16 +150,10 @@ }; ð1 { - status = "okay"; - mtd-mac-address = <&uboot 0x1fc00>; mtd-mac-address-increment = <1>; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts index dd2421da8..9da1c45b4 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_airrouter.dts @@ -6,7 +6,7 @@ / { compatible = "ubnt,airrouter", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti AirRouter"; + model = "Ubiquiti AirRouter (XM)"; aliases { led-boot = &led_globe; 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 0e2183c27..261ee5435 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_bullet-m-ar7241.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,bullet-m-ar7241", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Bullet M XM (AR7241)"; + model = "Ubiquiti Bullet M (XM AR7241)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts index 005ef27ca..4c4fd19d3 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanobridge-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,nanobridge-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti NanoBridge M"; + model = "Ubiquiti NanoBridge M (XM)"; }; ð1 { 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 60d5a21a2..4ccb1d50a 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanostation-loco-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,nanostation-loco-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Nanostation Loco M"; + model = "Ubiquiti Nanostation Loco M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts b/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts index 82344bb5e..fff4ec704 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_nanostation-m.dts @@ -7,5 +7,5 @@ / { compatible = "ubnt,nanostation-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Nanostation M"; + model = "Ubiquiti Nanostation M (XM)"; }; diff --git a/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts b/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts index d05aca3e6..4bb13e618 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_picostation-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,picostation-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Picostation M"; + model = "Ubiquiti Picostation M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts new file mode 100644 index 000000000..e14bfbfa8 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_ubnt_powerbridge-m.dts @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar7241.dtsi" +#include "ar724x_ubnt_xm.dtsi" +#include "ar724x_ubnt_xm_outdoor.dtsi" + +/ { + compatible = "ubnt,powerbridge-m", "ubnt,xm", "qca,ar7241"; + model = "Ubiquiti PowerBridge M (XM)"; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; diff --git a/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts b/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts index 9e342177e..3e716dec6 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_rocket-m.dts @@ -7,7 +7,7 @@ / { compatible = "ubnt,rocket-m", "ubnt,xm", "qca,ar7241"; - model = "Ubiquiti Rocket M"; + model = "Ubiquiti Rocket M (XM)"; }; ð1 { diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts index 5f12fd581..4bccdd2e4 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi.dts @@ -8,7 +8,7 @@ / { compatible = "ubnt,unifi", "qca,ar7241"; - model = "Ubiquiti UniFi AP"; + model = "Ubiquiti UniFi"; aliases { led-boot = &led_dome_green; @@ -126,7 +126,5 @@ }; ð1 { - status = "okay"; - compatible = "syscon", "simple-mfd"; }; 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 1be4d6183..11de522ae 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -60,19 +60,18 @@ linux,default-trigger = "phy0tpt"; }; }; +}; - dsa { - compatible = "marvell,dsa"; - #address-cells = <1>; - #size-cells = <0>; +&mdio0 { + status = "okay"; - dsa,mii-bus = <&mdio0>; - dsa,ethernet = <ð0>; + switch@0 { + compatible = "marvell,mv88e6060"; + reg = <0>; - switch@0 { + ports { #address-cells = <1>; #size-cells = <0>; - reg = <0>; port@0 { reg = <0>; @@ -102,6 +101,7 @@ port@5 { reg = <5>; label = "cpu"; + ethernet = <ð0>; }; }; }; @@ -145,10 +145,6 @@ }; }; -&mdio0 { - status = "okay"; -}; - ð0 { status = "okay"; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 8e52ae8fd..7d2f74122 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -57,8 +57,6 @@ interrupt-controller; #interrupt-cells = <2>; - - status = "disabled"; }; pinmux: pinmux@18040028 { diff --git a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts index 6984176da..7fe5c8abe 100644 --- a/target/linux/ath79/dts/ar9330_dlink_dir-505.dts +++ b/target/linux/ath79/dts/ar9330_dlink_dir-505.dts @@ -56,8 +56,6 @@ }; &gpio { - status = "okay"; - led_enable { gpio-hog; output-low; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index d81d47722..b8c6959d5 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -67,10 +67,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 8537faa0f..2d7f79ee8 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -55,10 +55,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts index ffb9745e0..f35f1850f 100644 --- a/target/linux/ath79/dts/ar9331_8dev_carambola2.dts +++ b/target/linux/ath79/dts/ar9331_8dev_carambola2.dts @@ -54,10 +54,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts index 971d158fa..d1b49b2c2 100644 --- a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts @@ -73,10 +73,6 @@ compatible = "syscon", "simple-mfd"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_arduino_yun.dts b/target/linux/ath79/dts/ar9331_arduino_yun.dts new file mode 100644 index 000000000..0237fe58b --- /dev/null +++ b/target/linux/ath79/dts/ar9331_arduino_yun.dts @@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + model = "Arduino Yun"; + compatible = "arduino,yun", "qca,ar9331"; + + aliases { + serial0 = &uart; + }; + + chosen { + bootargs = "console=ttyATH0,250000"; + }; + + ahb { + apb { + pinmux_extended: pinmux@18040030 { + compatible = "pinctrl-single"; + reg = <0x18040030 0x4>; + + pinctrl-single,bit-per-mux; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x1>; + #pinctrl-cells = <2>; + + enable_gpio11: pinmux_enable_gpio11 { + pinctrl-single,bits = <0x0 0x200 0x200>; + }; + }; + + pinmux_bootstrap: pinmux@180600ac { + compatible = "pinctrl-single"; + reg = <0x180600ac 0x4>; + + pinctrl-single,bit-per-mux; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x1>; + #pinctrl-cells = <2>; + + enable_gpio26_gpio27: pinmux_enable_gpio26_gpio27 { + pinctrl-single,bits = <0x0 0x40000 0x40000>; + }; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "yun:blue:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + usb { + label = "yun:white:usb"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + trigger-sources = <&hub_port1>; + linux,default-trigger = "usbport"; + }; + }; + + keys { + compatible = "gpio-keys"; + + config { + label = "config"; + linux,code = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_spi_enable { + gpio-export,name = "yun:oe:spi"; + gpio-export,output = <0>; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + + gpio_handshake_enable { + gpio-export,name = "yun:oe:hs"; + gpio-export,output = <0>; + gpios = <&gpio 22 GPIO_ACTIVE_HIGH>; + }; + + gpio_uart_enable { + gpio-export,name = "yun:oe:uart"; + gpio-export,output = <0>; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + }; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &switch_led_disable_pins>; +}; + +&switch_led_disable_pins { + pinctrl-single,bits = <0x0 0x80 0xf8>; +}; + +&pinmux_extended { + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio11>; +}; + +&pinmux_bootstrap { + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio26_gpio27>; +}; + +&usb { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + dr_mode = "host"; + vbus-supply = <®_usb_vbus>; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + #trigger-source-cells = <0>; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf90000>; + }; + + partition@fe0000 { + label = "nvram"; + reg = <0xfe0000 0x10000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index 349c7ffc4..614c31e1e 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -48,10 +48,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_etactica_eg200.dts b/target/linux/ath79/dts/ar9331_etactica_eg200.dts index 079cc8876..3cf72a321 100644 --- a/target/linux/ath79/dts/ar9331_etactica_eg200.dts +++ b/target/linux/ath79/dts/ar9331_etactica_eg200.dts @@ -58,10 +58,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { dr_mode = "host"; status = "okay"; diff --git a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi index 2fa970248..fd6791915 100644 --- a/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi +++ b/target/linux/ath79/dts/ar9331_glinet_64xx.dtsi @@ -65,10 +65,6 @@ mtd-mac-address = <&uboot 0x1fc00>; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts new file mode 100644 index 000000000..e969007fc --- /dev/null +++ b/target/linux/ath79/dts/ar9331_glinet_gl-mifi.dts @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + compatible = "glinet,gl-mifi", "qca,ar9331"; + model = "GL.iNet GL-MiFi"; + + aliases { + serial0 = &uart; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "gl-mifi:green:wlan"; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + lan { + label = "gl-mifi:green:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "gl-mifi:green:wan"; + gpios = <&gpio 27 GPIO_ACTIVE_HIGH>; + }; + + 3g4g { + label = "gl-mifi:green:3g4g"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; + + reg_usb_vbus: reg_usb_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + gpio-export { + compatible = "gpio-export"; + + minipcie { + gpio-export,name = "minipcie"; + gpio-export,output = <0>; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb { + status = "okay"; + + dr_mode = "host"; + vbus-supply = <®_usb_vbus>; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-chipselects = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <33000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts index 8b8e304c9..565c236f6 100644 --- a/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts +++ b/target/linux/ath79/dts/ar9331_pisen_ts-d084.dts @@ -92,10 +92,6 @@ compatible = "syscon", "simple-mfd"; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts index 6fb11545a..6b746bb15 100644 --- a/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts +++ b/target/linux/ath79/dts/ar9331_pisen_wmm003n.dts @@ -101,10 +101,6 @@ compatible = "syscon", "simple-mfd"; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; 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 8f4147b7f..704f7c41a 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts @@ -91,10 +91,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { #address-cells = <1>; #size-cells = <0>; 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 85ab92400..d0a479712 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-mr3040-v2.dts @@ -87,10 +87,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb { #address-cells = <1>; #size-cells = <0>; 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 2bacd0824..c2bc50a50 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 @@ -99,10 +99,6 @@ compatible = "syscon", "simple-mfd"; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi new file mode 100644 index 000000000..ffc98e6e1 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-8m.dtsi @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9331_tplink_tl-wr710n.dtsi" + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + reg = <0x0 0x20000>; + label = "u-boot"; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + reg = <0x20000 0x7d0000>; + label = "firmware"; + }; + + art: partition@7f0000 { + reg = <0x7f0000 0x10000>; + label = "art"; + read-only; + }; + }; + }; +}; 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 49dd11469..634b56d3b 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v1.dts @@ -1,129 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "ar9331.dtsi" +#include "ar9331_tplink_tl-wr710n-8m.dtsi" / { model = "TP-Link TL-WR710N v1"; compatible = "tplink,tl-wr710n-v1", "qca,ar9331"; - - aliases { - serial0 = &uart; - led-boot = &led_system; - led-failsafe = &led_system; - led-running = &led_system; - led-upgrade = &led_system; - label-mac-device = ð0; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 11 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - - leds { - compatible = "gpio-leds"; - - led_system: system { - label = "tl-wr710n:green:system"; - gpios = <&gpio 27 GPIO_ACTIVE_LOW>; - }; - }; - - reg_usb_vbus: regulator { - compatible = "regulator-fixed"; - regulator-name = "usb_vbus"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; -}; - -&spi { - status = "okay"; - num-cs = <1>; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - uboot: partition@0 { - reg = <0x0 0x20000>; - label = "u-boot"; - read-only; - }; - - firmware: partition@20000 { - compatible = "tplink,firmware"; - reg = <0x20000 0x7d0000>; - label = "firmware"; - }; - - art: partition@7f0000 { - reg = <0x7f0000 0x10000>; - label = "art"; - read-only; - }; - }; - }; -}; - -ð0 { - status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; - - gmac-config { - device = <&gmac>; - - switch-phy-addr-swap = <0>; - switch-phy-swap = <0>; - }; -}; - -ð1 { - status = "okay"; - - mtd-mac-address = <&uboot 0x1fc00>; - mtd-mac-address-increment = <(-1)>; -}; - -&gpio { - status = "okay"; -}; - -&uart { - status = "okay"; -}; - -&usb { - dr_mode = "host"; - vbus-supply = <®_usb_vbus>; - status = "okay"; -}; - -&usb_phy { - status = "okay"; -}; - -&wmac { - status = "okay"; - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; }; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts new file mode 100644 index 000000000..48d44000e --- /dev/null +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n-v2.1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9331_tplink_tl-wr710n-8m.dtsi" + +/ { + model = "TP-Link TL-WR710N v2.1"; + compatible = "tplink,tl-wr710n-v2.1", "qca,ar9331"; +}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi new file mode 100644 index 000000000..e37c43f4a --- /dev/null +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr710n.dtsi @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "ar9331.dtsi" + +/ { + aliases { + serial0 = &uart; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "tl-wr710n:green:system"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + }; + + reg_usb_vbus: regulator { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&uboot 0x1fc00>; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <(-1)>; +}; + +&uart { + status = "okay"; +}; + +&usb { + status = "okay"; + + dr_mode = "host"; + vbus-supply = <®_usb_vbus>; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi index 4f11d5d7a..8e36c6851 100644 --- a/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi +++ b/target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi @@ -142,10 +142,6 @@ mtd-mac-address-increment = <(-1)>; }; -&gpio { - status = "okay"; -}; - &uart { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts index 272b0909b..6d780eff1 100644 --- a/target/linux/ath79/dts/ar9341_pcs_cr3000.dts +++ b/target/linux/ath79/dts/ar9341_pcs_cr3000.dts @@ -89,10 +89,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { num-cs = <1>; diff --git a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts index 46b6053cc..40a838f82 100644 --- a/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts +++ b/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts @@ -134,10 +134,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { num-cs = <1>; diff --git a/target/linux/ath79/dts/ar9341_tplink.dtsi b/target/linux/ath79/dts/ar9341_tplink.dtsi index 6bd7c3409..c96dbe191 100644 --- a/target/linux/ath79/dts/ar9341_tplink.dtsi +++ b/target/linux/ath79/dts/ar9341_tplink.dtsi @@ -15,17 +15,6 @@ label-mac-device = &wmac; }; - keys: keys { - compatible = "gpio-keys"; - - rfkill { - label = "WiFi"; - linux,code = ; - gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; - debounce-interval = <60>; - }; - }; - leds: leds { compatible = "gpio-leds"; 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 f86438152..e6cf6ef86 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-mr3420-v2.dts @@ -6,14 +6,23 @@ / { model = "TP-Link TL-MR3420 v2"; compatible = "tplink,tl-mr3420-v2", "qca,ar9341"; -}; -&keys { - reset { - label = "Reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; - debounce-interval = <60>; + keys { + compatible = "gpio-keys"; + + rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + reset { + label = "Reset/WPS"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; }; }; diff --git a/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts b/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts new file mode 100644 index 000000000..4abdd60c3 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wa901nd-v3.dts @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9341_tplink_tl-wa.dtsi" + +/ { + model = "TP-Link TL-WA901ND v3"; + compatible = "tplink,tl-wa901nd-v3", "qca,ar9341"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tp-link:green:wlan"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + qss { + label = "tp-link:green:qss"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_system: system { + label = "tp-link:green:system"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; 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 3577e4994..95a047c6d 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr841-v8.dts @@ -6,14 +6,24 @@ / { model = "TP-Link TL-WR841N/ND v8"; compatible = "tplink,tl-wr841-v8", "qca,ar9341"; -}; -&keys { - reset { - label = "Reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; + keys { + compatible = "gpio-keys"; + + rfkill { + label = "WiFi"; + linux,code = ; + linux,input-type = ; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; }; }; 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 d9b0ee86f..4df0feae9 100644 --- a/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts +++ b/target/linux/ath79/dts/ar9341_tplink_tl-wr842n-v2.dts @@ -7,6 +7,24 @@ model = "TP-Link TL-WR842N/ND v2"; compatible = "tplink,tl-wr842n-v2", "qca,ar9341"; + keys { + compatible = "gpio-keys"; + + rfkill { + label = "WiFi"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + gpio-export { compatible = "gpio-export"; @@ -18,15 +36,6 @@ }; }; -&keys { - reset { - label = "Reset"; - linux,code = ; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; -}; - &leds { usb { label = "tp-link:green:usb"; diff --git a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts index 9ea607926..78567622b 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts +++ b/target/linux/ath79/dts/ar9342_ubnt_lap-120.dts @@ -13,7 +13,6 @@ phy-mask = <4>; phy4: ethernet-phy@4 { - phy-mode = "rgmii"; reg = <4>; }; }; @@ -22,11 +21,11 @@ status = "okay"; /* default for ar934x, except for 1000M and 10M */ - pll-data = <0x06000000 0x00000101 0x00001313>; + pll-data = <0x02000000 0x00000101 0x00001313>; mtd-mac-address = <&art 0x0>; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; phy-handle = <&phy4>; gmac-config { diff --git a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi index 2847d4098..1f2f8e37f 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_wa.dtsi @@ -29,10 +29,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi index cf24aba5a..1d9df2170 100644 --- a/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi +++ b/target/linux/ath79/dts/ar9342_ubnt_xw.dtsi @@ -61,10 +61,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; num-cs = <1>; diff --git a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts index ede248759..347f12fce 100644 --- a/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts +++ b/target/linux/ath79/dts/ar9344_aerohive_hiveap-121.dts @@ -71,8 +71,6 @@ }; &gpio { - status = "okay"; - pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; diff --git a/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts new file mode 100644 index 000000000..4ce280f86 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_compex_wpj344-16m.dts @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9344.dtsi" + +/ { + compatible = "compex,wpj344-16m", "qca,ar9344"; + model = "Compex WPJ344 (16MB flash)"; + + aliases { + label-mac-device = ð0; + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + leds { + compatible = "gpio-leds"; + + led_status: status { + label = "wpj344:green:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + sig1 { + label = "wpj344:red:sig1"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + sig2 { + label = "wpj344:yellow:sig2"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + + sig3 { + label = "wpj344:green:sig3"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + sig4 { + label = "wpj344:green:sig4"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&uart { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + label = "firmware"; + reg = <0x030000 0xfc0000>; + compatible = "denx,uimage"; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "rgmii"; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ + 0x10 0x80000080 /* POWER_ON_STRAP */ + 0x50 0x00000000 /* LED_CTRL0 */ + 0x54 0xc737c737 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x00c30c00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x06000000 0x00000101 0x00001616>; + + mtd-mac-address = <&uboot 0x2e010>; + + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; 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 4f58cd5c3..90702a0a9 100644 --- a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts +++ b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts @@ -65,8 +65,6 @@ }; &gpio { - status = "okay"; - wlan_power { gpio-hog; line-name = "WLAN power"; diff --git a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts index 0f0288147..20ff48cc2 100644 --- a/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts +++ b/target/linux/ath79/dts/ar9344_enterasys_ws-ap3705i.dts @@ -111,10 +111,6 @@ }; }; -&gpio { - status = "okay"; -}; - &wmac { status = "okay"; qca,no-eeprom; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi new file mode 100644 index 000000000..100976e2c --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "ar9344.dtsi" + +/ { + compatible = "mikrotik,routerboard-sxt-5n", "qca,ar9344"; + model = "MikroTik SXT 5N platform"; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + serial0 = &uart; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "mikrotik:green:power"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + rssilow { + label = "mikrotik:green:rssilow"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "mikrotik:green:rssimediumlow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "mikrotik:green:rssimedium"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "mikrotik:green:rssimediumhigh"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "mikrotik:green:rssihigh"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + led_user: user { + label = "mikrotik:green:user"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_nand_power { + gpio-export,name = "sxt5n:power:nand"; + gpio-export,output = <0>; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; +}; + +&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 = "RouterBoot"; + reg = <0x0 0x20000>; + read-only; + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0x0>; + read-only; + }; + + hard_config: hard_config { + read-only; + }; + + bios { + size = <0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0x0>; + read-only; + }; + + soft_config { + }; + }; + }; + }; +}; + +&nand { + status = "okay"; + + nand-ecc-mode = "soft"; + qca,nand-swap-dma; + qca,nand-scan-fixup; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "booter"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "kernel"; + reg = <0x0040000 0x03c0000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x0400000 0x7c00000>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; 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 new file mode 100644 index 000000000..82b78c85b --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_mikrotik_routerboard-sxt-5n.dtsi" + +/ { + compatible = "mikrotik,routerboard-sxt-5nd-r2", "qca,ar9344"; + model = "MikroTik RouterBOARD SXT 5nD r2 (SXT Lite5)"; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi index 9fd428a1b..f2909061d 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/ar9344_netgear_wndr.dtsi @@ -40,7 +40,7 @@ }; }; - leds { + leds: leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -57,16 +57,6 @@ default-state = "keep"; }; - wan_green { - label = "netgear:green:wan"; - gpios = <&gpio 1 GPIO_ACTIVE_LOW>; - }; - - wan_amber { - label = "netgear:amber:wan"; - gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - }; - wlan2g_green { label = "netgear:green:wlan2g"; gpios = <&gpio 11 GPIO_ACTIVE_LOW>; @@ -88,13 +78,6 @@ label = "netgear:amber:wps"; gpios = <&gpio 17 GPIO_ACTIVE_LOW>; }; - - usb_green { - label = "netgear:green:usb"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - trigger-sources = <&hub_port>; - linux,default-trigger = "usbport"; - }; }; ubi-concat { @@ -240,8 +223,6 @@ }; &gpio { - status = "okay"; - lna0 { gpio-hog; line-name = "netgear:ext:lna0"; @@ -274,28 +255,6 @@ qca,no-eeprom; #gpio-cells = <2>; gpio-controller; - - usb_power { - gpio-hog; - line-name = "netgear:power:usb"; - gpios = <0 GPIO_ACTIVE_HIGH>; - output-high; - }; - }; -}; - -&usb_phy { - status = "okay"; -}; - -&usb { - status = "okay"; - #address-cells = <1>; - #size-cells = <0>; - - hub_port: port@1 { - reg = <1>; - #trigger-source-cells = <0>; }; }; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts index 8a38aeab5..a7756f1d4 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr3700-v4.dts @@ -2,6 +2,8 @@ /dts-v1/; #include "ar9344_netgear_wndr.dtsi" +#include "ar9344_netgear_wndr_wan.dtsi" +#include "ar9344_netgear_wndr_usb.dtsi" / { compatible = "netgear,wndr3700-v4", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts index 9b57bb88a..235181d8d 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300.dts @@ -2,6 +2,8 @@ /dts-v1/; #include "ar9344_netgear_wndr.dtsi" +#include "ar9344_netgear_wndr_wan.dtsi" +#include "ar9344_netgear_wndr_usb.dtsi" / { compatible = "netgear,wndr4300", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts index fb90eee55..7643b3c14 100644 --- a/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300sw.dts @@ -2,6 +2,8 @@ /dts-v1/; #include "ar9344_netgear_wndr.dtsi" +#include "ar9344_netgear_wndr_wan.dtsi" +#include "ar9344_netgear_wndr_usb.dtsi" / { compatible = "netgear,wndr4300sw", "qca,ar9344"; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts b/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts new file mode 100644 index 000000000..bed85a387 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr4300tn.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "ar9344_netgear_wndr.dtsi" + +/ { + compatible = "netgear,wndr4300tn", "qca,ar9344"; + model = "Netgear WNDR4300TN"; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi new file mode 100644 index 000000000..e3780632e --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr_usb.dtsi @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +&leds { + usb_green { + label = "netgear:green:usb"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; +}; + +&ath9k { + usb_power { + gpio-hog; + line-name = "netgear:power:usb"; + gpios = <0 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&usb { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi b/target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi new file mode 100644 index 000000000..91c2971f8 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_netgear_wndr_wan.dtsi @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +&leds { + wan_green { + label = "netgear:green:wan"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "netgear:amber:wan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; +}; diff --git a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts index e7186425f..f01ad769d 100644 --- a/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts +++ b/target/linux/ath79/dts/ar9344_ocedo_raccoon.dts @@ -71,10 +71,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_pcs_cap324.dts b/target/linux/ath79/dts/ar9344_pcs_cap324.dts index 50a069cb6..efd9d6262 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cap324.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cap324.dts @@ -78,10 +78,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts index a43ac4e93..3b0716e79 100644 --- a/target/linux/ath79/dts/ar9344_pcs_cr5000.dts +++ b/target/linux/ath79/dts/ar9344_pcs_cr5000.dts @@ -70,10 +70,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9344_qihoo_c301.dts b/target/linux/ath79/dts/ar9344_qihoo_c301.dts index 46d1f4c4c..2b5d920b8 100644 --- a/target/linux/ath79/dts/ar9344_qihoo_c301.dts +++ b/target/linux/ath79/dts/ar9344_qihoo_c301.dts @@ -52,13 +52,12 @@ gpio = <&gpio 18 GPIO_ACTIVE_LOW>; }; - reg_usb_vbus { + usb_vbus: reg_usb_vbus { compatible = "regulator-fixed"; regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high; - regulator-always-on; gpio = <&gpio 19 GPIO_ACTIVE_HIGH>; }; }; @@ -82,8 +81,6 @@ }; &gpio { - status = "okay"; - gpio_ext_lna0 { gpio-hog; gpios = <14 0>; @@ -204,6 +201,7 @@ &usb_phy { status = "okay"; + phy-supply = <&usb_vbus>; }; &pcie { diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi index dc85075bc..fd9f2b48c 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi @@ -99,7 +99,7 @@ qca,ar8327-initvals = < 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ - 0x10 0x80000080 /* POWER_ON_STRIP */ + 0x10 0x80000080 /* POWER_ON_STRAP */ 0x50 0xc737c737 /* LED_CTRL0 */ 0x54 0x00000000 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi index 124f4d50b..489408520 100644 --- a/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi +++ b/target/linux/ath79/dts/ar9344_tplink_tl-wdrxxxx.dtsi @@ -78,7 +78,7 @@ flash@0 { compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <25000000>; + spi-max-frequency = <33000000>; partitions { compatible = "fixed-partitions"; diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts index 48dcf1230..18a52458a 100644 --- a/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts +++ b/target/linux/ath79/dts/ar9344_wd_mynet-n750.dts @@ -69,8 +69,6 @@ }; &gpio { - status = "okay"; - gpio_ext_lna0 { gpio-hog; gpios = <15 0>; @@ -194,7 +192,7 @@ qca,ar8327-initvals = < 0x04 0x07600000 /* PORT0 PAD MODE CTRL */ - 0x10 0x80000080 /* POWER_ON_STRIP */ + 0x10 0x80000080 /* POWER_ON_STRAP */ 0x50 0xc737c737 /* LED_CTRL0 */ 0x54 0x00000000 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts index 57312f6ff..3fb37f2ae 100644 --- a/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts +++ b/target/linux/ath79/dts/ar9344_zbtlink_zbt-wd323.dts @@ -78,8 +78,6 @@ }; &gpio { - status = "okay"; - pinctrl-names = "default"; pinctrl-0 = <&jtag_disable_pins>; }; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 0451960a6..763d1c8af 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -148,24 +148,6 @@ }; }; - nand: nand@1b000200 { - compatible = "qca,ar934x-nand"; - reg = <0x1b000200 0xb8>; - - interrupts = <21>; - interrupt-parent = <&miscintc>; - - resets = <&rst 14>; - reset-names = "nand"; - - nand-ecc-mode = "hw"; - - #address-cells = <1>; - #size-cells = <0>; - - status = "disabled"; - }; - gmac: gmac@18070000 { compatible = "qca,ar9340-gmac"; reg = <0x18070000 0x14>; @@ -195,6 +177,24 @@ status = "disabled"; }; + nand: nand@1b000200 { + compatible = "qca,ar934x-nand"; + reg = <0x1b000200 0xb8>; + + interrupts = <21>; + interrupt-parent = <&miscintc>; + + resets = <&rst 14>; + reset-names = "nand"; + + nand-ecc-mode = "hw"; + + #address-cells = <1>; + #size-cells = <0>; + + status = "disabled"; + }; + spi: spi@1f000000 { compatible = "qca,ar934x-spi"; reg = <0x1f000000 0x1c>; diff --git a/target/linux/ath79/dts/qca9531_8dev_lima.dts b/target/linux/ath79/dts/qca9531_8dev_lima.dts new file mode 100644 index 000000000..c3bac8822 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_8dev_lima.dts @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "8dev,lima", "qca,qca9531"; + model = "8devices Lima"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux-code = "KEY_RESTART"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; + + dr_mode = "host"; +}; + +&usb_phy { + status = "okay"; +}; + +&wdt { + status = "okay"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + /* Winbond W25Q256 SPI flash */ + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <45000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x040000>; + }; + + art: partition@80000 { + label = "art"; + reg = <0x080000 0x040000>; + read-only; + }; + + partition@c0000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0c0000 0xf40000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + mtd-mac-address = <&art 0x6>; + + gmac-config { + device = <&gmac>; + + switch-phy-addr-swap = <1>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts index 433a7e9c5..382011966 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -124,7 +124,9 @@ ð0 { status = "okay"; + phy-handle = <&swphy0>; + mtd-mac-address = <&art 0x1002>; gmac-config { @@ -134,7 +136,6 @@ }; ð1 { - status = "okay"; mtd-mac-address = <&art 0x0>; }; 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 192b7112a..5c83170cc 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e314n-v2.dts @@ -139,12 +139,13 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { - status = "okay"; mtd-mac-address = <&art 0x6>; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts index 74a3554bc..50d602fbb 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e5.dts @@ -124,8 +124,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { @@ -134,6 +136,7 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts index 06c8f0737..5ed63e0b2 100644 --- a/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts +++ b/target/linux/ath79/dts/qca9531_comfast_cf-ew72.dts @@ -115,6 +115,7 @@ status = "okay"; phy-handle = <&swphy4>; + mtd-mac-address = <&art 0x0>; mtd-mac-address-increment = <1>; }; diff --git a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts index 343a02e38..4fb2f8495 100644 --- a/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts +++ b/target/linux/ath79/dts/qca9531_compex_wpj531-16m.dts @@ -105,10 +105,6 @@ }; }; -ð1 { - mtd-mac-address = <&uboot 0x2e018>; -}; - ð0 { status = "okay"; @@ -117,6 +113,10 @@ mtd-mac-address = <&uboot 0x2e010>; }; +ð1 { + mtd-mac-address = <&uboot 0x2e018>; +}; + &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts new file mode 100644 index 000000000..5d6aebf92 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_dlink_dch-g020-a1.dts @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "dlink,dch-g020-a1", "qca,qca9531"; + model = "D-Link DCH-G020 A1"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <1>; + + sda-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + scl-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + + gpio_ext: gpio_ext@38 { + compatible = "nxp,pca9554"; + reg = <0x38 0x1>; + + gpio-controller; + #gpio-cells = <2>; + }; + + rtc@30 { + compatible = "pericom,pt7c43390"; + reg = <0x30 0x8>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + usb_power { + label = "d-link:power:usb"; + gpio-export,name = "d-link:power:usb"; + gpio-export,output = <0>; + gpios = <&gpio_ext 3 GPIO_ACTIVE_LOW>; + }; + + zwave_power { + label = "d-link:power:zwave"; + gpio-export,name = "d-link:power:zwave"; + gpio-export,output = <0>; + gpios = <&gpio_ext 1 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "d-link:green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + status { + label = "d-link:red:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x10000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x10000 0x10000>; + read-only; + }; + + partition@20000 { + label = "mp"; + reg = <0x20000 0x10000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "bootarg"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xe70000>; + compatible = "denx,uimage"; + }; + + partition@ec0000 { + label = "dlink"; + reg = <0xec0000 0x140000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +ð0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts index 242dccdcf..c8bfd2c8b 100644 --- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts +++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts @@ -136,10 +136,6 @@ phy-handle = <&swphy4>; }; -ð1 { - status = "okay"; -}; - &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi index d769225fd..c65f81032 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi @@ -150,8 +150,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts index dcffccf0a..2726d8ea0 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts @@ -132,8 +132,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { @@ -143,5 +145,6 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts new file mode 100644 index 000000000..18769c9e0 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -0,0 +1,140 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "glinet,gl-e750", "qca,qca9531"; + model = "GL.iNet GL-E750"; + + aliases { + label-mac-device = ð0; + }; + + keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + switch { + label = "switch"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_lte_power { + gpio-export,name = "lte_power"; + gpio-export,output = <1>; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <2>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "kernel"; + reg = <0x60000 0x400000>; + }; + + partition@460000 { + label = "reserved"; + reg = <0x460000 0xba0000>; + }; + }; + }; + + flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x8000000>; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts index c845b5465..3582dd4ac 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-x750.dts @@ -121,8 +121,10 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { @@ -132,5 +134,6 @@ &wmac { status = "okay"; + mtd-cal-data = <&art 0x1000>; }; diff --git a/target/linux/ath79/dts/qca9531_telco_t1.dts b/target/linux/ath79/dts/qca9531_telco_t1.dts new file mode 100644 index 000000000..bc2a0c48b --- /dev/null +++ b/target/linux/ath79/dts/qca9531_telco_t1.dts @@ -0,0 +1,144 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "telco,t1", "qca,qca9531"; + model = "Telco T1"; + + aliases { + label-mac-device = ð0; + led-boot = &led_rssi0; + led-failsafe = &led_rssi0; + led-running = &led_rssi0; + led-upgrade = &led_rssi0; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins &pinmux_led_wan_pin>; + + wan { + label = "t1:blue:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "t1:blue:lan"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "t1:blue:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_rssi0: rssi0 { + label = "t1:blue:rssi0"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + rssi1 { + label = "t1:blue:rssi1"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + rssi2 { + label = "t1:blue:rssi2"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0xfd0000>; + }; + + partition@ff0000 { + label = "art-backup"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + mtd-mac-address = <&art 0x6>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&pinmux { + pinmux_led_wan_pin: led_wan_pin { + pinctrl-single,bits = <0x4 0x0 0xff>; + }; +}; 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 3aa6bd136..0937a0b47 100644 --- a/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_archer-d50-v1.dts @@ -146,10 +146,6 @@ }; }; -ð1 { - mtd-mac-address = <&romfile 0xf100>; -}; - ð0 { status = "okay"; @@ -159,6 +155,10 @@ mtd-mac-address-increment = <1>; }; +ð1 { + mtd-mac-address = <&romfile 0xf100>; +}; + &wmac { status = "okay"; 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 be0387830..978ad859f 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-mr3420-v3.dts @@ -173,10 +173,6 @@ }; }; -ð1 { - mtd-mac-address = <&uboot 0x1fc00>; -}; - ð0 { status = "okay"; @@ -186,6 +182,10 @@ mtd-mac-address-increment = <1>; }; +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; +}; + &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9531_yuncore_a770.dts b/target/linux/ath79/dts/qca9531_yuncore_a770.dts index 21283d98d..1ff45e91c 100644 --- a/target/linux/ath79/dts/qca9531_yuncore_a770.dts +++ b/target/linux/ath79/dts/qca9531_yuncore_a770.dts @@ -55,21 +55,6 @@ }; }; -ð0 { - status = "okay"; - - phy-handle = <&swphy4>; - mtd-mac-address = <&art 0x0>; -}; - -ð1 { - mtd-mac-address = <&art 0x6>; -}; - -&pcie0 { - status = "okay"; -}; - &spi { status = "okay"; @@ -115,6 +100,22 @@ status = "okay"; }; +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; +}; + +ð1 { + mtd-mac-address = <&art 0x6>; +}; + +&pcie0 { + status = "okay"; +}; + &wmac { status = "okay"; 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 45e3727da..074363b17 100644 --- a/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts +++ b/target/linux/ath79/dts/qca9533_comfast_cf-e110n-v2.dts @@ -139,13 +139,12 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { - status = "okay"; - mtd-mac-address = <&art 0x1002>; gmac-config { diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts new file mode 100644 index 000000000..3ec36ad9d --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1330-a1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_dlink_dap-13xx.dtsi" + +/ { + compatible = "dlink,dap-1330-a1", "qca,qca9533"; + model = "D-Link DAP-1330 A1"; +}; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts new file mode 100644 index 000000000..3b153740c --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-1365-a1.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_dlink_dap-13xx.dtsi" + +/ { + compatible = "dlink,dap-1365-a1", "qca,qca9533"; + model = "D-Link DAP-1365 A1"; +}; diff --git a/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi new file mode 100644 index 000000000..8823312d0 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_dlink_dap-13xx.dtsi @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca953x.dtsi" + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_status; + led-running = &led_power; + led-upgrade = &led_status; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "d-link:green:power"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status: status { + label = "d-link:red:status"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + rssilow { + label = "d-link:red:rssilow"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "d-link:green:rssimediumlow"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "d-link:green:rssimediumhigh"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "d-link:green:rssihigh"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&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>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x10000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x10000 0x10000>; + read-only; + }; + + partition@20000 { + label = "mp"; + reg = <0x20000 0x10000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "firmware"; + reg = <0x40000 0x7c0000>; + compatible = "denx,uimage"; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi new file mode 100644 index 000000000..8af8601da --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-16m.dtsi @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca953x.dtsi" + +/ { + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&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 = "RouterBoot"; + reg = <0x0 0x20000>; + read-only; + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0x0>; + read-only; + }; + + hard_config: hard_config { + read-only; + }; + + bios { + size = <0x1000>; + read-only; + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0x0>; + read-only; + }; + + soft_config { + label = "soft_config"; + }; + }; + + partition@20000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x020000 0xfe0000>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts new file mode 100644 index 000000000..024ddd980 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-2nd.dts @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9533_mikrotik_routerboard-lhg-hb.dtsi" + +/ { + compatible = "mikrotik,routerboard-lhg-2nd", "qca,qca9533"; + model = "MikroTik RouterBOARD LHG 2nD"; +}; diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi new file mode 100644 index 000000000..32cc6d373 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-lhg-hb.dtsi @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_mikrotik_routerboard-16m.dtsi" + +/ { + compatible = "mikrotik,routerboard-lhg-hb", "qca,qca9533"; + model = "MikroTik RouterBOARD LHG-HB platform"; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-upgrade = &led_user; + led-running = &led_user; + serial0 = &uart; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_wan_pin>; + + power { + label = "mikrotik:blue:power"; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_user: user { + label = "mikrotik:green:user"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "mikrotik:green:lan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "mikrotik:green:wlan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + rssilow { + label = "mikrotik:green:rssilow"; + gpios = <&gpio 9 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "mikrotik:green:rssimediumlow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "mikrotik:green:rssimediumhigh"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + /* The rssihigh LED GPIO 16 is shared with the reset button, so it remains + unregistered here to avoid conflict. + + rssihigh { + label = "mikrotik:green:rssihigh"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + */ + }; +}; + +ð0 { + compatible = "syscon", "simple-mfd"; +}; + +ð1 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + }; +}; + +&pinmux { + led_wan_pin: pinmux_led_wan_pin { + pinctrl-single,bits = <0x4 0x0 0xff>; + }; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts index dd90eb1c7..813430590 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_cpe220-v3.dts @@ -21,8 +21,6 @@ }; ð1 { - status = "okay"; - mtd-mac-address = <&info 0x8>; gmac-config { diff --git a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi index fb805ff66..1180cc46c 100644 --- a/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_cpexxx.dtsi @@ -109,13 +109,6 @@ }; }; -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&info 0x8>; -}; - ð0 { status = "okay"; @@ -123,3 +116,10 @@ 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/qca9533_tplink_tl-wa850re-v2.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts index f2e2dee04..e103b66cb 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wa850re-v2.dts @@ -140,13 +140,6 @@ }; }; -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&config 0x10008>; -}; - ð0 { status = "okay"; @@ -158,3 +151,10 @@ ð1 { compatible = "syscon", "simple-mfd"; }; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&config 0x10008>; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi index df920c842..0fadab9f6 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr802n.dtsi @@ -74,13 +74,6 @@ }; }; -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; - mtd-mac-address = <&uboot 0x1fc00>; -}; - ð0 { status = "okay"; @@ -93,3 +86,10 @@ ð1 { compatible = "syscon", "simple-mfd"; }; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&uboot 0x1fc00>; +}; diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi index ade5dec71..249a3e1ee 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841.dtsi @@ -109,10 +109,6 @@ }; }; -ð1 { - mtd-mac-address = <&uboot 0x1fc00>; -}; - ð0 { status = "okay"; @@ -122,6 +118,10 @@ mtd-mac-address-increment = <1>; }; +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; +}; + &wmac { status = "okay"; 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 497b0cd26..e169d98c8 100644 --- a/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts +++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr842n-v3.dts @@ -150,10 +150,6 @@ }; }; -ð1 { - mtd-mac-address = <&uboot 0x1fc00>; -}; - ð0 { status = "okay"; @@ -163,6 +159,10 @@ mtd-mac-address-increment = <1>; }; +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; +}; + &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts b/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts index ded95f3a1..e266066e2 100644 --- a/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts +++ b/target/linux/ath79/dts/qca9533_ubnt_acb-isp.dts @@ -79,12 +79,13 @@ ð0 { status = "okay"; - mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; }; ð1 { - status = "okay"; mtd-mac-address = <&art 0x6>; gmac-config { diff --git a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi index fcfd82702..3b4b1a57e 100644 --- a/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi +++ b/target/linux/ath79/dts/qca953x_tplink_tl-wr810n.dtsi @@ -91,10 +91,6 @@ }; }; -ð1 { - mtd-mac-address = <&uboot 0x1fc00>; -}; - ð0 { status = "okay"; @@ -104,6 +100,10 @@ mtd-mac-address-increment = <1>; }; +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; +}; + &wmac { status = "okay"; diff --git a/target/linux/ath79/dts/qca9557_8dev_rambutan.dts b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts new file mode 100644 index 000000000..cf1c00c64 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_8dev_rambutan.dts @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca955x.dtsi" + +/ { + compatible = "8dev,rambutan", "qca,qca9557"; + model = "8devices Rambutan"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x300000>; + read-only; + }; + + partition@300000 { + label = "u-boot-env"; + reg = <0x300000 0x200000>; + }; + + art: partition@500000 { + label = "art"; + reg = <0x500000 0x100000>; + read-only; + }; + + partition@600000 { + label = "ubi"; + reg = <0x600000 0x7a00000>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + reset-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; +}; + +&mdio1 { + status = "okay"; + + phy1: ethernet-phy@0 { + reg = <0>; + reset-gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + phy-mode = "sgmii"; + at803x-override-sgmii-link-check; + }; +}; + +ð0 { + status = "okay"; + + mtd-mac-address = <&art 0x0>; + phy-mode = "mii"; + phy-handle = <&phy0>; +}; + +ð1 { + status = "okay"; + + pll-data = <0x17000000 0x101 0x1313>; + phy-handle = <&phy1>; + phy-mode = "sgmii"; + qca955x-sgmii-fixup; + mtd-mac-address = <&art 0x6>; +}; + +&wmac { + status = "okay"; + + gpio-controller; + mtd-cal-data = <&art 0x1000>; +}; + +&pcie0 { + status = "okay"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts new file mode 100644 index 000000000..81fe766fd --- /dev/null +++ b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca955x_zyxel_nbg6x16.dtsi" + +/ { + compatible = "zyxel,nbg6616", "qca,qca9557"; + model = "ZyXEL NBG6616"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "nbg6616:green:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + usb1 { + label = "nbg6616:green:usb1"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port0>; + }; + + usb2 { + label = "nbg6616:green:usb2"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port1>; + }; + + wifi2g { + label = "nbg6616:green:wifi2g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "nbg6616:green:wifi5g"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "nbg6616:green:wps"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio_usb_power { + line-name = "nbg6616:power:usb"; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x030000 0x010000>; + }; + + art: partition@40000 { + label = "art"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "zyxel_rfsd"; + reg = <0x050000 0x060000>; + }; + + partition@b0000 { + label = "romd"; + reg = <0x0b0000 0x060000>; + }; + + partition@110000 { + label = "header"; + reg = <0x110000 0x010000>; + }; + + partition@120000 { + label = "firmware"; + reg = <0x120000 0xee0000>; + compatible = "denx,uimage"; + }; + }; + }; +}; + +&pcie1 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + qca,no-eeprom; + }; +}; diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts new file mode 100644 index 000000000..6d7eeb263 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca955x.dtsi" + +/ { + model = "ALLNET ALL-WAP02860AC"; + compatible = "allnet,all-wap02860ac", "qca,qca9558"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "all-wap02860ac:amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan2g { + label = "all-wap02860ac:blue:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wlan5g { + label = "all-wap02860ac:green:wlan5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "all-wap02860ac:blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x8e000000 0x80000101 0x80001313>; + phy-handle = <&phy5>; + phy-mode = "rgmii-rxid"; + + mtd-mac-address = <&art 0x0>; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +&pll { + clocks = <&extosc>; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + partition@50000 { + label = "custom"; + reg = <0x050000 0x050000>; + read-only; + }; + + partition@a0000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0a0000 0xcd0000>; + }; + + partition@d70000 { + label = "failsafe"; + reg = <0xd70000 0x280000>; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; + qca-no-eeprom; +}; diff --git a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi index 1a93a023a..59926ef44 100644 --- a/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi +++ b/target/linux/ath79/dts/qca9558_comfast_cf-wr650ac.dtsi @@ -51,7 +51,7 @@ qca,ar8327-initvals = < 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x7c 0x0000007e /* PORT0_STATUS */ 0x94 0x0000007e /* PORT6 STATUS */ >; diff --git a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi index 208d6e358..62b947440 100644 --- a/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi +++ b/target/linux/ath79/dts/qca9558_devolo_dvl1xxx.dtsi @@ -44,10 +44,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts index 8a55abd24..3a2ae598f 100644 --- a/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts +++ b/target/linux/ath79/dts/qca9558_librerouter_librerouter-v1.dts @@ -80,10 +80,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; 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 new file mode 100644 index 000000000..8cd0fa750 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-921gs-5hpacd-15s.dts @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9558_mikrotik_routerboard-92x.dtsi" + +/ { + compatible = "mikrotik,routerboard-921gs-5hpacd-15s", "qca,qca9558"; + model = "MikroTik RouterBOARD 921GS-5HPacD-15s"; + + ath10k-leds { + compatible = "gpio-leds"; + + wlan5g { + label = "mikrotik:green:wlan5g"; + gpios = <&ath10k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +&pcie1 { + status = "okay"; + + ath10k: wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; +}; 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 a3f42f87b..92a1772e2 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -1,31 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "qca955x.dtsi" +#include "qca9558_mikrotik_routerboard-92x.dtsi" / { compatible = "mikrotik,routerboard-922uags-5hpacd", "qca,qca9558"; model = "MikroTik RouterBOARD 922UAGS-5HPacD"; - aliases { - led-boot = &led_user; - led-failsafe = &led_user; - led-upgrade = &led_user; - serial0 = &uart; - }; - - leds { - compatible = "gpio-leds"; - - led_user: user { - label = "mikrotik:green:user"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - }; - ath10k-leds { compatible = "gpio-leds"; @@ -36,120 +17,15 @@ }; }; - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 20 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - gpio-export { - compatible = "gpio-export"; - gpio_usb_power { gpio-export,name = "mikrotik:power:usb"; gpio-export,output = <0>; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; - - gpio_nand_power { - gpio-export,name = "mikrotik:power:nand"; - gpio-export,output = <0>; - gpios = <&gpio 23 GPIO_ACTIVE_LOW>; - }; }; }; -&mdio0 { - status = "okay"; - - phy4: ethernet-phy@4 { - reg = <4>; - }; -}; - -ð0 { - status = "okay"; - - phy-handle = <&phy4>; - pll-data = <0x8f000000 0xa0000101 0xa0001313>; - - gmac-config { - device = <&gmac>; - rgmii-enabled = <1>; - }; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <25000000>; - - partitions { - compatible = "mikrotik,routerboot-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "routerboot"; - reg = <0x0 0x0>; - read-only; - }; - - hard_config: hard_config { - read-only; - }; - - bios { - read-only; - }; - - soft_config { - }; - }; - }; -}; - -&nand { - status = "okay"; - - nand-ecc-mode = "soft"; - qca,nand-swap-dma; - qca,nand-scan-fixup; - - partitions { - compatible = "fixed-partitions"; - #size-cells = <1>; - - partition@0 { - label = "booter"; - reg = <0x0000000 0x0040000>; - read-only; - }; - - partition@40000 { - label = "kernel"; - reg = <0x0040000 0x03c0000>; - }; - - partition@400000 { - label = "ubi"; - reg = <0x0400000 0x7c00000>; - }; - }; -}; - -&uart { - status = "okay"; -}; - &pcie0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi new file mode 100644 index 000000000..85dd65f7a --- /dev/null +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-92x.dtsi @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca955x.dtsi" + +/ { + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-upgrade = &led_user; + serial0 = &uart; + }; + + leds { + compatible = "gpio-leds"; + + led_user: user { + label = "mikrotik:green:user"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + gpio_nand_power { + gpio-export,name = "mikrotik:power:nand"; + gpio-export,output = <0>; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy4>; + pll-data = <0x8f000000 0xa0000101 0xa0001313>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "routerboot"; + reg = <0x0 0x0>; + read-only; + }; + + hard_config: hard_config { + read-only; + }; + + bios { + size = <0x1000>; + read-only; + }; + + soft_config { + }; + }; + }; +}; + +&nand { + status = "okay"; + + nand-ecc-mode = "soft"; + qca,nand-swap-dma; + qca,nand-scan-fixup; + + partitions { + compatible = "fixed-partitions"; + #size-cells = <1>; + + partition@0 { + label = "booter"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "kernel"; + reg = <0x0040000 0x03c0000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x0400000 0x7c00000>; + }; + }; +}; + +&uart { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi index 1f3d0b8d7..cd602a2a7 100644 --- a/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_archer-c.dtsi @@ -85,10 +85,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi index 618f0d434..2f753f761 100644 --- a/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_rex5x.dtsi @@ -104,10 +104,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; num-cs = <1>; diff --git a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi index aca5745ff..9c5e2c7d5 100644 --- a/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi +++ b/target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi @@ -76,10 +76,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; @@ -138,7 +134,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xca35ca35 /* LED_CTRL1 */ 0x58 0xc935c935 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts index e23a5991b..6e7faf598 100644 --- a/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts +++ b/target/linux/ath79/dts/qca9558_trendnet_tew-823dru.dts @@ -72,10 +72,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; @@ -174,7 +170,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x7c 0x0000007e /* PORT0_STATUS */ 0x94 0x0000007e /* PORT6 STATUS */ >; diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts index ade9159fc..90328078d 100644 --- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts +++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts @@ -1,10 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT /dts-v1/; -#include -#include - -#include "qca955x.dtsi" +#include "qca955x_zyxel_nbg6x16.dtsi" / { compatible = "zyxel,nbg6716", "qca,qca9558"; @@ -61,59 +58,26 @@ gpios = <&gpio 21 GPIO_ACTIVE_LOW>; }; }; +}; - keys { - compatible = "gpio-keys"; +&keys { + usb1 { + label = "USB1 eject button"; + linux,code = ; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 23 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - wifi { - label = "WiFi button"; - linux,code = ; - linux,input-type = ; - gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; - debounce-interval = <60>; - }; - - usb1 { - label = "USB1 eject button"; - linux,code = ; - gpios = <&gpio 0 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - usb2 { - label = "USB2 eject button"; - linux,code = ; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - wps { - label = "WPS button"; - linux,code = ; - gpios = <&gpio 22 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; + usb2 { + label = "USB2 eject button"; + linux,code = ; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; }; }; -&gpio { - usb_power { - gpio-hog; - gpios = <16 0>; - output-high; - line-name = "nbg6716:power:usb"; - }; -}; - -&uart { - status = "okay"; +&gpio_usb_power { + line-name = "nbg6716:power:usb"; }; &spi { @@ -196,75 +160,6 @@ }; }; -&mdio0 { - status = "okay"; - - phy17: ethernet-phy@11 { - reg = <0x11>; - phy-mode = "rgmii-id"; - }; - - switch0@1f { - compatible = "qca,ar8327"; - reg = <0x1f>; - qca,ar8327-initvals = < - 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ - 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ - 0x50 0xffb7ffb7 /* LED_CTRL0 */ - 0x54 0xffb7ffb7 /* LED_CTRL1 */ - 0x58 0xffb7ffb7 /* LED_CTRL2 */ - 0x5c 0x03ffff00 /* LED_CTRL3 */ - 0x7c 0x0000007e /* PORT0_STATUS */ - 0x94 0x0000007e /* PORT6 STATUS */ - >; - }; -}; - -&mdio1 { - status = "okay"; - - phy1: ethernet-phy@1 { - reg = <1>; - phy-mode = "sgmii"; - }; -}; - - -ð0 { - status = "okay"; - - pll-data = <0xa6000000 0x00000101 0x00001616>; - phy-handle = <&phy17>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -ð1 { - status = "okay"; - - pll-data = <0x03000101 0x00000101 0x00001616>; - phy-handle = <&phy1>; - - fixed-link { - speed = <1000>; - full-duplex; - }; -}; - -&gpio { - status = "okay"; -}; - -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; -}; - &pcie1 { status = "okay"; @@ -274,30 +169,3 @@ qcom,ath10k-calibration-variant = "ZyXEL-NBG6716"; }; }; - -&usb_phy0 { - status = "okay"; -}; - -&usb_phy1 { - status = "okay"; -}; - -&usb0 { - status = "okay"; - - hub_port0: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; - -}; - -&usb1 { - status = "okay"; - - hub_port1: port@1 { - reg = <1>; - #trigger-source-cells = <0>; - }; -}; diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index ff8ac70d7..4883965db 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -182,24 +182,6 @@ }; }; - nand: nand@1b800200 { - compatible = "qca,ar934x-nand"; - reg = <0x1b800200 0xb8>; - - interrupts = <21>; - interrupt-parent = <&miscintc>; - - resets = <&rst 14>; - reset-names = "nand"; - - nand-ecc-mode = "hw"; - - #address-cells = <1>; - #size-cells = <0>; - - status = "disabled"; - }; - gmac: gmac@18070000 { compatible = "qca,qca9550-gmac"; reg = <0x18070000 0x58>; @@ -301,6 +283,24 @@ status = "disabled"; }; + nand: nand@1b800200 { + compatible = "qca,ar934x-nand"; + reg = <0x1b800200 0xb8>; + + interrupts = <21>; + interrupt-parent = <&miscintc>; + + resets = <&rst 14>; + reset-names = "nand"; + + nand-ecc-mode = "hw"; + + #address-cells = <1>; + #size-cells = <0>; + + status = "disabled"; + }; + spi: spi@1f000000 { compatible = "qca,ar934x-spi"; reg = <0x1f000000 0x1c>; diff --git a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi new file mode 100644 index 000000000..dfc6728be --- /dev/null +++ b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca955x.dtsi" + +/ { + keys: keys { + compatible = "gpio-keys"; + + wifi { + label = "WiFi on/off button"; + linux,code = ; + linux,input-type = ; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + wps { + label = "WPS button"; + linux,code = ; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&gpio { + gpio_usb_power: usb_power { + gpio-hog; + gpios = <16 0>; + output-high; + }; +}; + +&uart { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy17: ethernet-phy@11 { + reg = <0x11>; + phy-mode = "rgmii-id"; + }; + + switch0@1f { + compatible = "qca,ar8327"; + reg = <0x1f>; + qca,ar8327-initvals = < + 0x04 0x87600000 /* PORT0 PAD MODE CTRL */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRAP */ + 0x50 0xffb7ffb7 /* LED_CTRL0 */ + 0x54 0xffb7ffb7 /* LED_CTRL1 */ + 0x58 0xffb7ffb7 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6 STATUS */ + >; + }; +}; + +&mdio1 { + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + phy-mode = "sgmii"; + }; +}; + + +ð0 { + status = "okay"; + + pll-data = <0xa6000000 0x00000101 0x00001616>; + phy-handle = <&phy17>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +ð1 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001616>; + phy-handle = <&phy1>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb0 { + status = "okay"; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + +}; + +&usb1 { + status = "okay"; + + hub_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; diff --git a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts index 7c13c3e47..c4a50536b 100644 --- a/target/linux/ath79/dts/qca9561_avm_fritz4020.dts +++ b/target/linux/ath79/dts/qca9561_avm_fritz4020.dts @@ -100,10 +100,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi index 4d1eb6416..aa33d13c8 100644 --- a/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi +++ b/target/linux/ath79/dts/qca9561_tplink_archer-c5x.dtsi @@ -121,10 +121,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts index 5f1748f93..360e9cd41 100644 --- a/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts +++ b/target/linux/ath79/dts/qca9561_xiaomi_mi-router-4q.dts @@ -57,10 +57,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; num-cs = <1>; diff --git a/target/linux/ath79/dts/qca9563_compex_wpj563.dts b/target/linux/ath79/dts/qca9563_compex_wpj563.dts new file mode 100644 index 000000000..ae9dd5c46 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_compex_wpj563.dts @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + model = "Compex WPJ563"; + compatible = "compex,wpj563", "qca,qca9563"; + + aliases { + label-mac-device = ð0; + led-boot = &led_sig4; + led-failsafe = &led_sig4; + led-running = &led_sig4; + led-upgrade = &led_sig4; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + sig1 { + label = "wpj563:green:sig1"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + sig2 { + label = "wpj563:green:sig2"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + sig3 { + label = "wpj563:green:sig4"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + led_sig4: sig4 { + label = "wpj563:green:sig4"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&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>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x030000>; + read-only; + }; + + partition@30000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x030000 0xfc0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + mtd-mac-address = <&uboot 0x2e010>; + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 5e2c614df..0d8063de3 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-842-c.dtsi @@ -109,7 +109,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ 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 b9e413a26..25580b1c9 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dir-859-a1.dts @@ -74,10 +74,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &pcie { status = "okay"; }; @@ -148,7 +144,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ 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 92d1fb9ba..3fe8a35b9 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 @@ -9,8 +9,21 @@ model = "GL.iNet GL-AR750S (NOR/NAND)"; }; -&nor_kernel { - label = "kernel"; +&nor_partitions { + partition@60000 { + label = "kernel"; + reg = <0x060000 0x400000>; + + /* + * U-Boot bootcmd is "bootm 0x9f060000". + * So this might be possible to resize in the future. + */ + }; + + partition@460000 { + label = "nor_reserved"; + reg = <0x460000 0xba0000>; + }; }; &nand_ubi { diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts index bb33abd63..271cef516 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s-nor.dts @@ -9,10 +9,10 @@ model = "GL.iNet GL-AR750S (NOR)"; }; -/delete-node/ &nor_kernel; -/delete-node/ &nor_reserved; - -&nor_firmware { - compatible = "denx,uimage"; - label = "firmware"; +&nor_partitions { + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x060000 0xfa0000>; + }; }; diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi index 6111b968a..f5c64c07e 100644 --- a/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi +++ b/target/linux/ath79/dts/qca9563_glinet_gl-ar750s.dtsi @@ -99,20 +99,7 @@ read-only; }; - nor_firmware: partition@60000 { - label = "nor_firmware"; - reg = <0x060000 0xfa0000>; - }; - - nor_kernel: partition_alt@60000 { - label = "nor_kernel"; - reg = <0x060000 0x400000>; - }; - - nor_reserved: parition_alt@460000 { - label = "nor_reserved"; - reg = <0x460000 0xba0000>; - }; + /* Firmware / Kernel flash type specific */ }; }; diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi index 2c0b0b0d7..111d073aa 100644 --- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi +++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi @@ -187,7 +187,7 @@ qca,ar8327-initvals = < 0x04 0x00000080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts index f12d0c997..802641bbc 100644 --- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts +++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts @@ -51,10 +51,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &pcie { status = "okay"; }; @@ -118,7 +114,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcc35cc35 /* LED_CTRL0 */ 0x54 0xcb37cb37 /* LED_CTRL1 */ 0x58 0x00000000 /* LED_CTRL2 */ diff --git a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts index 6a06f8904..34c95b593 100644 --- a/target/linux/ath79/dts/qca9563_rosinson_wr818.dts +++ b/target/linux/ath79/dts/qca9563_rosinson_wr818.dts @@ -48,10 +48,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; 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 6b40de254..97d36d76d 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c2-v3.dts @@ -145,10 +145,6 @@ }; }; -&gpio { - status = "okay"; -}; - &mdio0 { status = "okay"; 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 4b45fa6da..5c0e2e0f8 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts +++ b/target/linux/ath79/dts/qca9563_tplink_archer-c7-v4.dts @@ -152,10 +152,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; 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 8d28b088d..275f71316 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x6-v2.dtsi @@ -19,10 +19,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &mdio0 { status = "okay"; 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 f5daf98ca..633543e73 100644 --- a/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_archer-x7-v5.dtsi @@ -108,10 +108,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &usb_phy0 { status = "okay"; }; @@ -159,7 +155,7 @@ 0x04 0x80080080 /* PORT0 PAD MODE CTRL */ 0x08 0x00000000 /* PORT5 PAD MODE CTRL */ 0x0c 0x00000000 /* PORT6 PAD MODE CTRL */ - 0x10 0x00000080 /* POWER_ON_STRIP */ + 0x10 0x00000080 /* POWER_ON_STRAP */ 0x7c 0x0000007e /* PORT0_STATUS */ 0x94 0x00000200 /* PORT6_STATUS */ >; diff --git a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi index 9fc30deca..8d20f1375 100644 --- a/target/linux/ath79/dts/qca9563_tplink_re450.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_re450.dtsi @@ -112,10 +112,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts new file mode 100644 index 000000000..0dd14896f --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630-v1.dts @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_tl-wpa8630.dtsi" + +/ { + compatible = "tplink,tl-wpa8630-v1", "qca,qca9563"; + model = "TP-Link TL-WPA8630 v1"; + + aliases { + label-mac-device = ð0; + }; +}; + +&partitions { + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + partition@10000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x010000 0x7d0000>; + }; + + partition@7e0000 { + label = "mib0"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; +}; + +ð0 { + mtd-mac-address = <&uboot 0x0fc00>; +}; + +&wmac { + mtd-mac-address = <&uboot 0x0fc00>; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi new file mode 100644 index 000000000..14602a1c2 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630.dtsi @@ -0,0 +1,139 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "qca956x.dtsi" + +/ { + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + leds { + label = "LED control button"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + pair { + label = "Pair button"; + linux,code = ; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wifi { + label = "WiFi button"; + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "tp-link:green:power"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "tp-link:green:lan"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + + wifi2g { + label = "tp-link:green:wifi2g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "tp-link:green:wifi5g"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + gpio-export { + compatible = "gpio-export"; + + led_control { + gpio-export,name = "tp-link:led:control"; + gpio-export,output = <0>; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions: partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0>; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&phy0>; + phy-mode = "sgmii"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; 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 new file mode 100644 index 000000000..afcb47167 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-eu.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" + +/ { + compatible = "tplink,tl-wpa8630p-v2-eu", "qca,qca9563"; + model = "TP-Link WPA8630P v2 (EU)"; +}; + +&partitions { + mac: partition@630000 { + label = "mac"; + reg = <0x630000 0x010000>; + read-only; + }; + + partition@640000 { + label = "tplink"; + reg = <0x640000 0x1b0000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 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 new file mode 100644 index 000000000..8655283f5 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2-int.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include "qca9563_tplink_tl-wpa8630p-v2.dtsi" + +/ { + compatible = "tplink,tl-wpa8630p-v2-int", "qca,qca9563"; + model = "TP-Link WPA8630P v2 (Int.)"; +}; + +&partitions { + partition@630000 { + label = "tplink"; + reg = <0x630000 0x1b0000>; + read-only; + }; + + mac: partition@7e0000 { + label = "mac"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + art: partition@7f0000 { + label = "art"; + reg = <0x7f0000 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 new file mode 100644 index 000000000..2d3128e03 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wpa8630p-v2.dtsi @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9563_tplink_tl-wpa8630.dtsi" + +/ { + aliases { + label-mac-device = ð0; + }; +}; + +&partitions { + partition@0 { + label = "factory-uboot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + label = "u-boot"; + reg = <0x020000 0x020000>; + read-only; + }; + + partition@40000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x040000 0x5e0000>; + }; + + partition@620000 { + label = "partition-table"; + reg = <0x620000 0x010000>; + read-only; + }; +}; + +ð0 { + mtd-mac-address = <&mac 0x8>; +}; + +&wmac { + mtd-mac-address = <&mac 0x8>; +}; diff --git a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi index eab19fe1f..b84985802 100644 --- a/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi +++ b/target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi @@ -88,10 +88,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &mdio0 { status = "okay"; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts index 7b9fa0701..4ab4197a8 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lite.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-lite", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-LITE"; + model = "Ubiquiti UniFi AC Lite"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts index a1e542ada..3128081b5 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-lr.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-lr", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-LR"; + model = "Ubiquiti UniFi AC LR"; }; 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 9d80217d4..97d976304 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh-pro.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-mesh-pro", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-MESH PRO"; + model = "Ubiquiti UniFi AC Mesh Pro"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts index 6eed56bb6..b3d652bdf 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-mesh.dts @@ -5,5 +5,5 @@ / { compatible = "ubnt,unifiac-mesh", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-MESH"; + model = "Ubiquiti UniFi AC Mesh"; }; diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts index 41449bbfc..48c9e105e 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac-pro.dts @@ -5,7 +5,7 @@ / { compatible = "ubnt,unifiac-pro", "qca,qca9563"; - model = "Ubiquiti UniFi-AC-PRO"; + model = "Ubiquiti UniFi AC Pro"; }; &usb_phy0 { diff --git a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi index 574baae30..e904bb75c 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi +++ b/target/linux/ath79/dts/qca9563_ubnt_unifiac.dtsi @@ -43,10 +43,6 @@ status = "okay"; }; -&gpio { - status = "okay"; -}; - &pcie { status = "okay"; }; diff --git a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi index 657ed3100..81aa8dc93 100644 --- a/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi +++ b/target/linux/ath79/dts/qca9563_yuncore_xd4200.dtsi @@ -31,10 +31,6 @@ phy-handle = <&phy0>; }; -&gpio { - status = "okay"; -}; - &mdio0 { status = "okay"; @@ -46,7 +42,7 @@ qca,ar8327-initvals = < 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ - 0x10 0x81000080 /* POWER_ON_STRIP */ + 0x10 0x81000080 /* POWER_ON_STRAP */ 0x50 0xcf37cf37 /* LED_CTRL0 */ 0x54 0xcf37cf37 /* LED_CTRL1 */ 0x58 0xcf37cf37 /* LED_CTRL2 */ 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 aaa830c6e..32101ed5b 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 @@ -106,7 +106,8 @@ comfast,cf-e560ac) ucidef_set_led_switch "lan3" "LAN3" "$boardname:blue:lan3" "switch0" "0x08" ucidef_set_led_switch "lan4" "LAN4" "$boardname:blue:lan4" "switch0" "0x10" ;; -comfast,cf-ew72) +comfast,cf-ew72|\ +telco,t1) ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x02" ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1" ;; @@ -115,6 +116,13 @@ engenius,ecb1750|\ enterasys,ws-ap3705i) ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0" ;; +compex,wpj344-16m) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "sig1" "SIG1" "wpj344:red:sig1" "wlan0" "85" "100" + ucidef_set_led_rssi "sig2" "SIG2" "wpj344:yellow:sig2" "wlan0" "75" "100" + ucidef_set_led_rssi "sig3" "SIG3" "wpj344:green:sig3" "wlan0" "65" "100" + ucidef_set_led_rssi "sig4" "SIG4" "wpj344:green:sig4" "wlan0" "50" "100" + ;; compex,wpj531-16m) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "sig1" "SIG1" "wpj531:red:sig1" "wlan0" "85" "100" @@ -125,6 +133,14 @@ compex,wpj531-16m) devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "devolo:white:dlan" "eth0.1" "rx" ;; +dlink,dap-1330-a1|\ +dlink,dap-1365-a1) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "d-link:red:rssilow" "wlan0" "1" "25" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "d-link:green:rssimediumlow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "d-link:green:rssimediumhigh" "wlan0" "51" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "d-link:green:rssihigh" "wlan0" "76" "100" + ;; dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; @@ -146,6 +162,10 @@ glinet,gl-ar300m-lite) glinet,gl-ar300m16) ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" ;; +glinet,gl-mifi) + ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02" + ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" + ;; glinet,gl-x750) ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" ;; @@ -277,6 +297,11 @@ tplink,tl-mr6400-v1) ucidef_set_led_netdev "wan" "WAN" "tp-link:white:wan" "eth1" ucidef_set_led_netdev "4g" "4G" "tp-link:white:4g" "usb0" ;; +tplink,tl-wpa8630-v1|\ +tplink,tl-wpa8630p-v2-eu|\ +tplink,tl-wpa8630p-v2-int) + ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x3c" + ;; tplink,tl-wr842n-v2) ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04" @@ -296,6 +321,7 @@ ubnt,nanostation-loco-m-xw|\ ubnt,nanostation-m|\ ubnt,nanostation-m-xw|\ ubnt,picostation-m|\ +ubnt,powerbridge-m|\ ubnt,rocket-m) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "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 d0e73a5d3..f655abe74 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 @@ -11,7 +11,9 @@ ath79_setup_interfaces() case "$board" in adtran,bsap1800-v2|\ adtran,bsap1840|\ + allnet,all-wap02860ac|\ alfa-network,ap121f|\ + arduino,yun|\ aruba,ap-105|\ avm,fritz1750e|\ avm,fritz300e|\ @@ -22,6 +24,8 @@ ath79_setup_interfaces() devolo,dvl1750c|\ devolo,dvl1750i|\ devolo,dvl1750x|\ + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ dlink,dir-505|\ engenius,ecb1750|\ enterasys,ws-ap3705i|\ @@ -60,6 +64,7 @@ ath79_setup_interfaces() ubnt,picostation-m|\ ubnt,powerbeam-5ac-500|\ ubnt,powerbeam-5ac-gen2|\ + ubnt,powerbridge-m|\ ubnt,rocket-m|\ ubnt,unifiac-lite|\ ubnt,unifiac-lr|\ @@ -127,10 +132,16 @@ ath79_setup_interfaces() "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" ;; comfast,cf-wr650ac-v1|\ - comfast,cf-wr650ac-v2) + comfast,cf-wr650ac-v2|\ + zyxel,nbg6616) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" ;; + compex,wpj344-16m|\ + compex,wpj563) + ucidef_add_switch "switch0" \ + "0@eth0" "3:lan" "2:wan" + ;; devolo,dvl1200e|\ devolo,dvl1750e|\ ocedo,ursus) @@ -143,6 +154,10 @@ ath79_setup_interfaces() dlink,dap-2695-a1) ucidef_add_switch "switch0" "0@eth0" "2:lan" "3:wan" "6@eth1" ;; + dlink,dch-g020-a1) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:2" "2:lan:1" + ;; dlink,dir-825-b1) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ @@ -280,6 +295,13 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "2:lan:3" "3:lan:2" ;; + tplink,tl-wpa8630-v1|\ + tplink,tl-wpa8630p-v2-eu|\ + tplink,tl-wpa8630p-v2-int) + # port 5 (internal) is the power-line port + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4" + ;; tplink,tl-wr842n-v2) ucidef_set_interface_wan "eth1" ucidef_add_switch "switch0" \ @@ -353,6 +375,11 @@ ath79_setup_macs() alfa-network,ap121f) label_mac=$(mtd_get_mac_binary art 0x1002) ;; + arduino,yun) + base_mac=$(mtd_get_mac_binary art 0x1002) + lan_mac=$(macaddr_setbit $base_mac 29) + [ $lan_mac = $base_mac ] && lan_mac=$(macaddr_unsetbit $base_mac 29) + ;; avm,fritz1750e|\ avm,fritz450e|\ avm,fritzdvbc) @@ -366,9 +393,19 @@ ath79_setup_macs() lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)")) ;; + compex,wpj344-16m|\ + compex,wpj563) + wan_mac=$(mtd_get_mac_binary u-boot 0x2e018) + ;; devolo,magic-2-wifi) label_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" 3) ;; + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ + dlink,dch-g020-a1) + lan_mac=$(mtd_get_mac_text "mp" 0x1) + label_mac=$lan_mac + ;; dlink,dap-2695-a1) label_mac=$(mtd_get_mac_ascii bdcfg "wlanmac") ;; @@ -488,6 +525,7 @@ ath79_setup_macs() 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) @@ -505,6 +543,9 @@ ath79_setup_macs() wd,mynet-wifi-rangeextender) lan_mac=$(nvram get et0macaddr) ;; + zyxel,nbg6616) + label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches index cc1b8ff41..cf30bb405 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches @@ -25,7 +25,8 @@ adtran,bsap1840) ucidef_add_gpio_switch "wifi0_ext_c" "2.4GHz External Antenna C" "509" "1" ucidef_add_gpio_switch "wifi0_int_c" "2.4GHz Internal Antenna C" "510" ;; -comfast,cf-e5) +comfast,cf-e5|\ +telco,t1) ucidef_add_gpio_switch "lte_power" "LTE Power" "14" "1" ucidef_add_gpio_switch "lte_wakeup" "LTE Wakeup" "11" "1" ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1" 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 3db4d2a99..90752a8f9 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 @@ -9,6 +9,10 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in + 8dev,lima|\ + ubnt,unifi) + caldata_extract "art" 0x1000 0x800 + ;; avm,fritz1750e|\ avm,fritz4020|\ avm,fritz450e|\ @@ -107,12 +111,10 @@ case "$FIRMWARE" in ubnt,nanostation-loco-m|\ ubnt,nanostation-m|\ ubnt,picostation-m|\ + ubnt,powerbridge-m|\ ubnt,rocket-m) caldata_extract "art" 0x1000 0x1000 ;; - ubnt,unifi) - caldata_extract "art" 0x1000 0x800 - ;; wd,mynet-n750) caldata_extract "art" 0x5000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac") 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 9d4306e66..1c93fe332 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 @@ -10,6 +10,11 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in + allnet,all-wap02860ac|\ + glinet,gl-x750) + caldata_extract "art" 0x5000 0x844 + ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) + ;; avm,fritz1750e|\ avm,fritzdvbc) caldata_extract "urlader" 0x198a 0x844 @@ -59,7 +64,8 @@ case "$FIRMWARE" in engenius,epg5000|\ iodata,wn-ac1167dgr|\ iodata,wn-ac1600dgr2|\ - sitecom,wlr-7100) + sitecom,wlr-7100|\ + zyxel,nbg6616) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) ;; @@ -71,10 +77,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1) ;; - glinet,gl-x750) - caldata_extract "art" 0x5000 0x844 - ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) - ;; nec,wg800hp) caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(mtd_get_mac_text board_data 0x880) @@ -128,6 +130,10 @@ case "$FIRMWARE" in caldata_extract "art" 0x5000 0x844 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1) ;; + tplink,tl-wpa8630-v1) + 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) @@ -187,7 +193,9 @@ case "$FIRMWARE" in tplink,archer-c60-v2|\ tplink,archer-c60-v3|\ tplink,archer-c6-v2|\ - tplink,archer-c6-v2-us) + tplink,archer-c6-v2-us|\ + tplink,tl-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) ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index f814bd46a..b592da00e 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -17,6 +17,11 @@ case "$board" in adtran,bsap1840) macaddr_add "$(mtd_get_mac_binary 'Board data' 2)" $(($PHYNBR * 8 + 1)) > /sys${DEVPATH}/macaddress ;; + dlink,dap-1330-a1|\ + dlink,dap-1365-a1|\ + dlink,dch-g020-a1) + mtd_get_mac_text "mp" 0x13 > /sys${DEVPATH}/macaddress + ;; iodata,wn-ac1600dgr) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress @@ -45,4 +50,9 @@ case "$board" in [ "$PHYNBR" -eq 0 ] && \ macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress ;; + zyxel,nbg6616) + # Set mac address for 2.4g device + [ "$PHYNBR" -eq 1 ] && \ + mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress + ;; esac diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration b/target/linux/ath79/generic/base-files/etc/uci-defaults/04_led_migration index 1c7ecba5f..2dcdf7b00 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 @@ -5,9 +5,22 @@ board=$(board_name) boardonly="${board##*,}" case "$board" in +arduino,yun) + migrate_leds "arduino:=yun:" + ;; +dlink,dap-1330-a1) + migrate_leds ":red:power=:red:status" \ + ":red:wifi=:red:rssilow" \ + ":green:wifi=:green:rssimediumlow" \ + ":green:signal1=:green:rssimediumhigh" \ + ":green:signal2=:green:rssihigh" + ;; engenius,epg5000) migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g" ;; +glinet,gl-mifi) + migrate_leds ":net=:3g4g" + ;; tplink,archer-c25-v1|\ tplink,archer-c58-v1|\ tplink,archer-c59-v1|\ @@ -32,6 +45,10 @@ tplink,re355-v1) tplink,re450-v1) migrate_leds "re450:=tp-link:" ;; +tplink,tl-wpa8630-v1) + migrate_leds "^tl-wpa8630:=tp-link:" \ + ':wlan$=:wifi2g' ':wlan5$=:wifi5g' + ;; wd,mynet-n750) migrate_leds "wd:=mynet-n750:" ;; diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh index c5d9cd536..ad7372eb0 100644 --- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -17,6 +17,11 @@ preinit_set_mac_address() { siemens,ws-ap3610) ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr) ;; + zyxel,nbg6616) + ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) + ip link set dev eth0 address $(macaddr_add $ethaddr 2) + ip link set dev eth1 address $(macaddr_add $ethaddr 3) + ;; esac } diff --git a/target/linux/ath79/generic/target.mk b/target/linux/ath79/generic/target.mk index 88346efd2..0624f7957 100644 --- a/target/linux/ath79/generic/target.mk +++ b/target/linux/ath79/generic/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=Generic FEATURES += squashfs -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards. diff --git a/target/linux/ath79/image/common-mikrotik.mk b/target/linux/ath79/image/common-mikrotik.mk index c21800011..9ac89fdcb 100644 --- a/target/linux/ath79/image/common-mikrotik.mk +++ b/target/linux/ath79/image/common-mikrotik.mk @@ -4,3 +4,17 @@ define Device/mikrotik KERNEL := kernel-bin | append-dtb | lzma | loader-kernel KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel endef + +define Device/mikrotik_nor + $(Device/mikrotik) + IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | \ + pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + append-metadata | check-size +endef + +define Device/mikrotik_nand + $(Device/mikrotik) + IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \ + sysupgrade-tar kernel=$$$$@ | append-metadata + DEVICE_PACKAGES := nand-utils +endef diff --git a/target/linux/ath79/image/common-netgear.mk b/target/linux/ath79/image/common-netgear.mk index 51808069e..b41650c6e 100644 --- a/target/linux/ath79/image/common-netgear.mk +++ b/target/linux/ath79/image/common-netgear.mk @@ -33,10 +33,13 @@ define Build/netgear-uImage $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC)) endef -define Device/netgear_ath79 +define Device/netgear_generic DEVICE_VENDOR := NETGEAR KERNEL := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma IMAGES += factory.img + IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ + append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \ check-size IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | \ diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk index 967eb2a7c..7128d853f 100644 --- a/target/linux/ath79/image/generic-tp-link.mk +++ b/target/linux/ath79/image/generic-tp-link.mk @@ -428,7 +428,7 @@ define Device/tplink_tl-mr6400-v1 DEVICE_MODEL := TL-MR6400 DEVICE_VARIANT := v1 TPLINK_HWID := 0x64000001 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial \ + DEVICE_PACKAGES := kmod-usb2 kmod-usb-net-rndis kmod-usb-serial \ kmod-usb-serial-option adb-enablemodem SUPPORTED_DEVICES += tl-mr6400 endef @@ -500,6 +500,39 @@ define Device/tplink_tl-wdr4900-v2 endef TARGET_DEVICES += tplink_tl-wdr4900-v2 +define Device/tplink_tl-wpa8630-v1 + $(Device/tplink-8mlzma) + SOC := qca9563 + DEVICE_MODEL := TL-WPA8630 + DEVICE_VARIANT := v1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + TPLINK_HWID := 0x86300001 + SUPPORTED_DEVICES += tl-wpa8630 +endef +TARGET_DEVICES += tplink_tl-wpa8630-v1 + +define Device/tplink_tl-wpa8630p-v2 + $(Device/tplink-safeloader) + SOC := qca9563 + DEVICE_MODEL := TL-WPA8630P + IMAGE_SIZE := 6016k + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef + +define Device/tplink_tl-wpa8630p-v2-eu + $(Device/tplink_tl-wpa8630p-v2) + DEVICE_VARIANT := v2 (EU) + TPLINK_BOARD_ID := TL-WPA8630P-V2-EU +endef +TARGET_DEVICES += tplink_tl-wpa8630p-v2-eu + +define Device/tplink_tl-wpa8630p-v2-int + $(Device/tplink_tl-wpa8630p-v2) + DEVICE_VARIANT := v2 (Int.) + TPLINK_BOARD_ID := TL-WPA8630P-V2-INT +endef +TARGET_DEVICES += tplink_tl-wpa8630p-v2-int + define Device/tplink_tl-wr1043nd-v1 $(Device/tplink-8m) SOC := ar9132 @@ -592,6 +625,18 @@ define Device/tplink_tl-wr710n-v1 endef TARGET_DEVICES += tplink_tl-wr710n-v1 +define Device/tplink_tl-wr710n-v2.1 + $(Device/tplink-8mlzma) + SOC := ar9331 + DEVICE_MODEL := TL-WR710N + DEVICE_VARIANT := v2.1 + DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-ledtrig-usbport + TPLINK_HWID := 0x07100002 + TPLINK_HWREV := 0x2 + SUPPORTED_DEVICES += tl-wr710n +endef +TARGET_DEVICES += tplink_tl-wr710n-v2.1 + define Device/tplink_tl-wr810n-v1 $(Device/tplink-8mlzma) SOC := qca9531 diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 3f4cc1391..b94518377 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -125,7 +125,7 @@ TARGET_DEVICES += ubnt_airrouter define Device/ubnt_bullet-m-ar7240 $(Device/ubnt-xm) SOC := ar7240 - DEVICE_MODEL := Bullet-M + DEVICE_MODEL := Bullet M DEVICE_VARIANT := XM (AR7240) DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m @@ -135,7 +135,7 @@ TARGET_DEVICES += ubnt_bullet-m-ar7240 define Device/ubnt_bullet-m-ar7241 $(Device/ubnt-xm) SOC := ar7241 - DEVICE_MODEL := Bullet-M + DEVICE_MODEL := Bullet M DEVICE_VARIANT := XM (AR7241) DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m ubnt,bullet-m @@ -144,7 +144,7 @@ TARGET_DEVICES += ubnt_bullet-m-ar7241 define Device/ubnt_bullet-m-xw $(Device/ubnt-xw) - DEVICE_MODEL := Bullet-M + DEVICE_MODEL := Bullet M DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += bullet-m-xw endef @@ -165,8 +165,7 @@ TARGET_DEVICES += ubnt_edgeswitch-8xp define Device/ubnt_lap-120 $(Device/ubnt-wa) - DEVICE_MODEL := LiteAP ac - DEVICE_VARIANT := LAP-120 + DEVICE_MODEL := LiteAP ac (LAP-120) DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct endef TARGET_DEVICES += ubnt_lap-120 @@ -269,17 +268,26 @@ define Device/ubnt_powerbeam-5ac-gen2 endef TARGET_DEVICES += ubnt_powerbeam-5ac-gen2 +define Device/ubnt_powerbridge-m + $(Device/ubnt-xm) + SOC := ar7241 + DEVICE_MODEL := PowerBridge M + DEVICE_PACKAGES += rssileds + SUPPORTED_DEVICES += bullet-m +endef +TARGET_DEVICES += ubnt_powerbridge-m + define Device/ubnt_rocket-m $(Device/ubnt-xm) SOC := ar7241 - DEVICE_MODEL := Rocket-M + DEVICE_MODEL := Rocket M DEVICE_PACKAGES += rssileds SUPPORTED_DEVICES += rocket-m endef TARGET_DEVICES += ubnt_rocket-m define Device/ubnt_routerstation_common - DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \ + DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \ kmod-usb2 fconfig DEVICE_VENDOR := Ubiquiti SOC := ar7161 @@ -328,35 +336,35 @@ endef define Device/ubnt_unifiac-lite $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Lite + DEVICE_MODEL := UniFi AC Lite SUPPORTED_DEVICES += unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-lite define Device/ubnt_unifiac-lr $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-LR + DEVICE_MODEL := UniFi AC LR SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-lr define Device/ubnt_unifiac-mesh $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Mesh + DEVICE_MODEL := UniFi AC Mesh SUPPORTED_DEVICES += unifiac-lite endef TARGET_DEVICES += ubnt_unifiac-mesh define Device/ubnt_unifiac-mesh-pro $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Mesh Pro + DEVICE_MODEL := UniFi AC Mesh Pro SUPPORTED_DEVICES += unifiac-pro endef TARGET_DEVICES += ubnt_unifiac-mesh-pro define Device/ubnt_unifiac-pro $(Device/ubnt_unifiac) - DEVICE_MODEL := UniFi AC-Pro + DEVICE_MODEL := UniFi AC Pro DEVICE_PACKAGES += kmod-usb2 SUPPORTED_DEVICES += unifiac-pro endef diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index f99fcdeda..4327512e1 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -50,6 +50,17 @@ define Build/cybertan-trx -rm $@-empty.bin endef +define Build/mkdapimg2 + $(STAGING_DIR_HOST)/bin/mkdapimg2 \ + -i $@ -o $@.new \ + -s $(DAP_SIGNATURE) \ + -v $(VERSION_DIST)-$(firstword $(subst +, , \ + $(firstword $(subst -, ,$(REVISION))))) \ + -r Default \ + $(if $(1),-k $(1)) + mv $@.new $@ +endef + define Build/mkmylofw_16m $(eval device_id=$(word 1,$(1))) $(eval revision=$(word 2,$(1))) @@ -152,6 +163,16 @@ define Device/8dev_carambola2 endef TARGET_DEVICES += 8dev_carambola2 +define Device/8dev_lima + SOC := qca9531 + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Lima + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 15616k + SUPPORTED_DEVICES += lima +endef +TARGET_DEVICES += 8dev_lima + define Device/adtran_bsap1880 SOC := ar7161 DEVICE_VENDOR := Adtran/Bluesocket @@ -189,6 +210,26 @@ define Device/alfa-network_ap121f endef TARGET_DEVICES += alfa-network_ap121f +define Device/allnet_all-wap02860ac + SOC := qca9558 + DEVICE_VENDOR := ALLNET + DEVICE_MODEL := ALL-WAP02860AC + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 13120k +endef +TARGET_DEVICES += allnet_all-wap02860ac + +define Device/arduino_yun + SOC := ar9331 + DEVICE_VENDOR := Arduino + DEVICE_MODEL := Yun + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 kmod-usb-ledtrig-usbport \ + kmod-usb-storage block-mount -swconfig + IMAGE_SIZE := 15936k + SUPPORTED_DEVICES += arduino-yun +endef +TARGET_DEVICES += arduino_yun + define Device/aruba_ap-105 SOC := ar7161 DEVICE_VENDOR := Aruba @@ -335,7 +376,7 @@ define Device/comfast_cf-e110n-v2 DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E110N DEVICE_VARIANT := v2 - DEVICE_PACKAGES := rssileds kmod-leds-gpio -swconfig -uboot-envtools + DEVICE_PACKAGES := rssileds -swconfig -uboot-envtools IMAGE_SIZE := 16192k endef TARGET_DEVICES += comfast_cf-e110n-v2 @@ -345,7 +386,7 @@ define Device/comfast_cf-e120a-v3 DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E120A DEVICE_VARIANT := v3 - DEVICE_PACKAGES := rssileds kmod-leds-gpio -uboot-envtools + DEVICE_PACKAGES := rssileds -uboot-envtools IMAGE_SIZE := 8000k endef TARGET_DEVICES += comfast_cf-e120a-v3 @@ -355,7 +396,7 @@ define Device/comfast_cf-e130n-v2 DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E130N DEVICE_VARIANT := v2 - DEVICE_PACKAGES := rssileds kmod-leds-gpio -swconfig -uboot-envtools + DEVICE_PACKAGES := rssileds -swconfig -uboot-envtools IMAGE_SIZE := 7936k endef TARGET_DEVICES += comfast_cf-e130n-v2 @@ -364,7 +405,7 @@ define Device/comfast_cf-e313ac SOC := qca9531 DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E313AC - DEVICE_PACKAGES := rssileds kmod-leds-gpio kmod-ath10k-ct-smallbuffers \ + DEVICE_PACKAGES := rssileds kmod-ath10k-ct-smallbuffers \ ath10k-firmware-qca9888-ct -swconfig -uboot-envtools IMAGE_SIZE := 7936k endef @@ -384,8 +425,8 @@ define Device/comfast_cf-e5 SOC := qca9531 DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E5/E7 - DEVICE_PACKAGES := rssileds kmod-leds-gpio kmod-usb2 kmod-usb-net \ - kmod-usb-net-qmi-wwan -swconfig -uboot-envtools + DEVICE_PACKAGES := rssileds kmod-usb2 kmod-usb-net-qmi-wwan -swconfig \ + -uboot-envtools IMAGE_SIZE := 16192k endef TARGET_DEVICES += comfast_cf-e5 @@ -394,8 +435,7 @@ define Device/comfast_cf-e560ac SOC := qca9531 DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E560AC - DEVICE_PACKAGES := kmod-leds-gpio kmod-usb2 kmod-ath10k-ct \ - ath10k-firmware-qca9888-ct + DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct ath10k-firmware-qca9888-ct IMAGE_SIZE := 16128k endef TARGET_DEVICES += comfast_cf-e560ac @@ -441,6 +481,19 @@ define Device/comfast_cf-wr752ac-v1 endef TARGET_DEVICES += comfast_cf-wr752ac-v1 +define Device/compex_wpj344-16m + SOC := ar9344 + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 16128k + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ344 + DEVICE_VARIANT := 16M + SUPPORTED_DEVICES += wpj344 + IMAGES += cpximg-6a08.bin + IMAGE/cpximg-6a08.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x690 3 +endef +TARGET_DEVICES += compex_wpj344-16m + define Device/compex_wpj531-16m SOC := qca9531 DEVICE_PACKAGES := kmod-usb2 @@ -457,6 +510,18 @@ define Device/compex_wpj531-16m endef TARGET_DEVICES += compex_wpj531-16m +define Device/compex_wpj563 + SOC := qca9563 + DEVICE_PACKAGES := kmod-usb2 kmod-usb3 + IMAGE_SIZE := 16128k + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPJ563 + SUPPORTED_DEVICES += wpj563 + IMAGES += cpximg-7a02.bin + IMAGE/cpximg-7a02.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x694 2 +endef +TARGET_DEVICES += compex_wpj563 + define Device/devolo_dvl1200e SOC := qca9558 DEVICE_VENDOR := devolo @@ -520,6 +585,33 @@ define Device/devolo_magic-2-wifi endef TARGET_DEVICES += devolo_magic-2-wifi +define Device/dlink_dap-13xx + SOC := qca9533 + DEVICE_VENDOR := D-Link + DEVICE_PACKAGES += rssileds + IMAGE_SIZE := 7936k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | mkdapimg2 0xE0000 +endef + +define Device/dlink_dap-1330-a1 + $(Device/dlink_dap-13xx) + DEVICE_MODEL := DAP-1330 + DEVICE_VARIANT := A1 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DAP-1330 + SUPPORTED_DEVICES += dap-1330-a1 +endef +TARGET_DEVICES += dlink_dap-1330-a1 + +define Device/dlink_dap-1365-a1 + $(Device/dlink_dap-13xx) + DEVICE_MODEL := DAP-1365 + DEVICE_VARIANT := A1 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DAP-1365 +endef +TARGET_DEVICES += dlink_dap-1365-a1 + define Device/dlink_dap-2695-a1 SOC := qca9558 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct @@ -540,6 +632,20 @@ define Device/dlink_dap-2695-a1 endef TARGET_DEVICES += dlink_dap-2695-a1 +define Device/dlink_dch-g020-a1 + SOC := qca9531 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := DCH-G020 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := kmod-gpio-pca953x kmod-i2c-gpio kmod-usb2 kmod-usb-acm + IMAGES += factory.bin + IMAGE_SIZE := 14784k + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | mkdapimg2 0x20000 + DAP_SIGNATURE := HONEYBEE-FIRMWARE-DCH-G020 +endef +TARGET_DEVICES += dlink_dch-g020-a1 + define Device/dlink_dir-505 SOC := ar9330 DEVICE_VENDOR := D-Link @@ -808,6 +914,16 @@ define Device/glinet_gl-ar750 endef TARGET_DEVICES += glinet_gl-ar750 +define Device/glinet_gl-mifi + SOC := ar9331 + DEVICE_VENDOR := GL.iNET + DEVICE_MODEL := GL-MiFi + DEVICE_PACKAGES := kmod-usb-chipidea2 + IMAGE_SIZE := 16000k + SUPPORTED_DEVICES += gl-mifi +endef +TARGET_DEVICES += glinet_gl-mifi + define Device/glinet_gl-x750 SOC := qca9531 DEVICE_VENDOR := GL.iNet @@ -822,7 +938,7 @@ define Device/iodata_etg3-r DEVICE_VENDOR := I-O DATA DEVICE_MODEL := ETG3-R IMAGE_SIZE := 7680k - DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic + DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic-wolfssl endef TARGET_DEVICES += iodata_etg3-r @@ -882,7 +998,7 @@ define Device/jjplus_ja76pf2 SOC := ar7161 DEVICE_VENDOR := jjPlus DEVICE_MODEL := JA76PF2 - DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-mini -uboot-envtools fconfig + DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig IMAGES := kernel.bin rootfs.bin IMAGE/kernel.bin := append-kernel IMAGE/rootfs.bin := append-rootfs | pad-rootfs @@ -934,6 +1050,7 @@ endef TARGET_DEVICES += nec_wg800hp define Device/netgear_ex6400_ex7300 + $(Device/netgear_generic) SOC := qca9558 NETGEAR_KERNEL_MAGIC := 0x27051956 NETGEAR_BOARD_ID := EX7300series @@ -941,8 +1058,11 @@ define Device/netgear_ex6400_ex7300 IMAGE_SIZE := 15552k IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \ netgear-rootfs | pad-rootfs + IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \ + check-size + IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | \ + check-size DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca99x0-ct - $(Device/netgear_ath79) endef define Device/netgear_ex6400 @@ -958,12 +1078,10 @@ endef TARGET_DEVICES += netgear_ex7300 define Device/netgear_wndr3x00 + $(Device/netgear_generic) SOC := ar7161 - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ - append-rootfs | pad-rootfs DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \ kmod-leds-reset kmod-owl-loader - $(Device/netgear_ath79) endef define Device/netgear_wndr3700 @@ -1039,14 +1157,12 @@ endef TARGET_DEVICES += netgear_wndrmac-v2 define Device/netgear_wnr2200_common + $(Device/netgear_generic) SOC := ar7241 DEVICE_MODEL := WNR2200 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport NETGEAR_KERNEL_MAGIC := 0x32323030 NETGEAR_BOARD_ID := wnr2200 - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ - append-rootfs | pad-rootfs - $(Device/netgear_ath79) endef define Device/netgear_wnr2200-8m @@ -1260,6 +1376,17 @@ define Device/sitecom_wlr-8100 endef TARGET_DEVICES += sitecom_wlr-8100 +define Device/telco_t1 + SOC := qca9531 + DEVICE_VENDOR := Telco + DEVICE_MODEL := T1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option uqmi -swconfig -uboot-envtools + IMAGE_SIZE := 16192k + SUPPORTED_DEVICES += telco_electronics,tel-t1 +endef +TARGET_DEVICES += telco_t1 + define Device/teltonika_rut955 SOC := ar9344 DEVICE_VENDOR := Teltonika @@ -1392,3 +1519,20 @@ define Device/zbtlink_zbt-wd323 kmod-usb-serial kmod-usb-serial-cp210x uqmi endef TARGET_DEVICES += zbtlink_zbt-wd323 + +define Device/zyxel_nbg6616 + SOC := qca9557 + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NBG6616 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-rtc-pcf8563 \ + kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 15232k + RAS_BOARD := NBG6616 + RAS_ROOTFS_SIZE := 14464k + RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)" + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | pad-to 64k | check-size | zyxel-ras-image + SUPPORTED_DEVICES += nbg6616 +endef +TARGET_DEVICES += zyxel_nbg6616 diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index b0bd05a81..3752c891a 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -1,36 +1,54 @@ include ./common-mikrotik.mk define Device/mikrotik_routerboard-493g - $(Device/mikrotik) + $(Device/mikrotik_nand) SOC := ar7161 DEVICE_MODEL := RouterBOARD 493G - IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \ - sysupgrade-tar kernel=$$$$@ | append-metadata - DEVICE_PACKAGES += kmod-usb-ohci kmod-usb2 nand-utils + DEVICE_PACKAGES += kmod-usb-ohci kmod-usb2 SUPPORTED_DEVICES += rb-493g endef TARGET_DEVICES += mikrotik_routerboard-493g +define Device/mikrotik_routerboard-921gs-5hpacd-15s + $(Device/mikrotik_nand) + SOC := qca9558 + DEVICE_MODEL := RouterBOARD 921GS-5HPacD-15s (mANTBox 15s) + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct + SUPPORTED_DEVICES += rb-921gs-5hpacd-r2 +endef +TARGET_DEVICES += mikrotik_routerboard-921gs-5hpacd-15s + define Device/mikrotik_routerboard-922uags-5hpacd - $(Device/mikrotik) + $(Device/mikrotik_nand) SOC := qca9558 DEVICE_MODEL := RouterBOARD 922UAGS-5HPacD - IMAGE/sysupgrade.bin = append-kernel | kernel2minor -s 2048 -e -c | \ - sysupgrade-tar kernel=$$$$@ | append-metadata - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct \ - kmod-usb2 nand-utils + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 SUPPORTED_DEVICES += rb-922uags-5hpacd endef TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd +define Device/mikrotik_routerboard-lhg-2nd + $(Device/mikrotik_nor) + SOC := qca9533 + DEVICE_MODEL := RouterBOARD LHG 2nD (LHG 2) + IMAGE_SIZE := 16256k +endef +TARGET_DEVICES += mikrotik_routerboard-lhg-2nd + +define Device/mikrotik_routerboard-sxt-5nd-r2 + $(Device/mikrotik_nand) + SOC := ar9344 + DEVICE_MODEL := RouterBOARD SXT 5nD r2 (SXT Lite5) + DEVICE_PACKAGES += rssileds kmod-gpio-beeper + SUPPORTED_DEVICES += rb-sxt5n +endef +TARGET_DEVICES += mikrotik_routerboard-sxt-5nd-r2 + define Device/mikrotik_routerboard-wap-g-5hact2hnd - $(Device/mikrotik) + $(Device/mikrotik_nor) SOC := qca9556 DEVICE_MODEL := RouterBOARD wAP G-5HacT2HnD (wAP AC) IMAGE_SIZE := 16256k - IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | \ - pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ - append-metadata | check-size DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct SUPPORTED_DEVICES += rb-wapg-5hact2hnd endef diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index dc06b6537..c7f96eb6d 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -30,6 +30,21 @@ define Build/zyxel-factory fi endef +define Device/8dev_rambutan + SOC := qca9557 + DEVICE_VENDOR := 8devices + DEVICE_MODEL := Rambutan + DEVICE_PACKAGES := kmod-usb2 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 4096k + KERNEL_IN_UBI := 1 + IMAGES := factory.bin sysupgrade.tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata + IMAGE/factory.bin := append-ubi +endef +TARGET_DEVICES += 8dev_rambutan + define Device/aerohive_hiveap-121 SOC := ar9344 DEVICE_VENDOR := Aerohive @@ -102,21 +117,13 @@ define Device/glinet_gl-ar750s-common DEVICE_MODEL := GL-AR750S DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb2 \ kmod-usb-storage block-mount - KERNEL_SIZE := 2048k IMAGE_SIZE := 16000k - PAGESIZE := 2048 - VID_HDR_OFFSET := 2048 endef -# NB: The kernel size is intentionally restricted at this time; see commit message define Device/glinet_gl-ar750s-nor-nand $(Device/glinet_gl-ar750s-common) DEVICE_VARIANT := NOR/NAND - BLOCKSIZE := 128k - GL_UBOOT_UBI_OFFSET := 2048k - IMAGES += factory.img - IMAGE/factory.img := append-kernel | pad-to $$$$(GL_UBOOT_UBI_OFFSET) | \ - append-ubi | check-kernel-size $$$$(GL_UBOOT_UBI_OFFSET) + KERNEL_SIZE := 4096k IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata SUPPORTED_DEVICES += glinet,gl-ar750s-nor endef @@ -130,6 +137,23 @@ define Device/glinet_gl-ar750s-nor endef TARGET_DEVICES += glinet_gl-ar750s-nor +define Device/glinet_gl-e750 + SOC := qca9531 + DEVICE_VENDOR := GL.iNet + DEVICE_MODEL := GL-E750 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9887-ct kmod-usb2 + SUPPORTED_DEVICES += gl-e750 + KERNEL_SIZE := 4096k + IMAGE_SIZE := 131072k + PAGESIZE := 2048 + VID_HDR_OFFSET := 2048 + BLOCKSIZE := 128k + IMAGES += factory.img + IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += glinet_gl-e750 + # fake rootfs is mandatory, pad-offset 129 equals (2 * uimage_header + 0xff) define Device/netgear_ath79_nand DEVICE_VENDOR := NETGEAR @@ -182,6 +206,16 @@ define Device/netgear_wndr4300sw endef TARGET_DEVICES += netgear_wndr4300sw +define Device/netgear_wndr4300tn + SOC := ar9344 + DEVICE_MODEL := WNDR4300TN + NETGEAR_KERNEL_MAGIC := 0x33373033 + NETGEAR_BOARD_ID := WNDR4300TN + NETGEAR_HW_ID := 29763948+0+128+128+2x2+3x3 + $(Device/netgear_ath79_nand) +endef +TARGET_DEVICES += netgear_wndr4300tn + define Device/netgear_wndr4300-v2 SOC := qca9563 DEVICE_MODEL := WNDR4300 diff --git a/target/linux/ath79/image/tiny-netgear.mk b/target/linux/ath79/image/tiny-netgear.mk index 5c83a10e0..8561f91ab 100644 --- a/target/linux/ath79/image/tiny-netgear.mk +++ b/target/linux/ath79/image/tiny-netgear.mk @@ -1,35 +1,34 @@ include ./common-netgear.mk -define Device/netgear_ar7240 - SOC := ar7240 - NETGEAR_KERNEL_MAGIC := 0x32303631 - KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma -d20 | netgear-uImage lzma - IMAGE_SIZE := 3712k - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ - append-rootfs | pad-rootfs - $(Device/netgear_ath79) -endef - define Device/netgear_wnr612-v2 - $(Device/netgear_ar7240) + $(Device/netgear_generic) + SOC := ar7240 DEVICE_MODEL := WNR612 DEVICE_VARIANT := v2 DEVICE_DTS := ar7240_netgear_wnr612-v2 + NETGEAR_KERNEL_MAGIC := 0x32303631 NETGEAR_BOARD_ID := REALWNR612V2 + IMAGE_SIZE := 3712k SUPPORTED_DEVICES += wnr612-v2 + DEFAULT := n endef TARGET_DEVICES += netgear_wnr612-v2 define Device/on_n150r - $(Device/netgear_ar7240) + $(Device/netgear_generic) + SOC := ar7240 DEVICE_VENDOR := On Networks DEVICE_MODEL := N150R + NETGEAR_KERNEL_MAGIC := 0x32303631 NETGEAR_BOARD_ID := N150R + IMAGE_SIZE := 3712k SUPPORTED_DEVICES += n150r + DEFAULT := n endef TARGET_DEVICES += on_n150r define Device/netgear_wnr1000-v2 + $(Device/netgear_generic) SOC := ar7240 DEVICE_MODEL := WNR1000 DEVICE_VARIANT := v2 @@ -37,14 +36,13 @@ define Device/netgear_wnr1000-v2 NETGEAR_BOARD_ID := WNR1000V2 NETGEAR_HW_ID := 29763331+4+32 IMAGE_SIZE := 3712k - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ - append-rootfs | pad-rootfs SUPPORTED_DEVICES += wnr1000-v2 - $(Device/netgear_ath79) + DEFAULT := n endef TARGET_DEVICES += netgear_wnr1000-v2 define Device/netgear_wnr2000-v3 + $(Device/netgear_generic) SOC := ar7241 DEVICE_MODEL := WNR2000 DEVICE_VARIANT := v3 @@ -52,12 +50,10 @@ define Device/netgear_wnr2000-v3 NETGEAR_BOARD_ID := WNR2000V3 NETGEAR_HW_ID := 29763551+04+32 IMAGE_SIZE := 3712k - IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | netgear-squashfs | \ - append-rootfs | pad-rootfs IMAGES += factory-NA.img IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | \ check-size SUPPORTED_DEVICES += wnr2000-v3 - $(Device/netgear_ath79) + DEFAULT := n endef TARGET_DEVICES += netgear_wnr2000-v3 diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk index 0da712c5d..c918c6baa 100644 --- a/target/linux/ath79/image/tiny-tp-link.mk +++ b/target/linux/ath79/image/tiny-tp-link.mk @@ -191,6 +191,16 @@ define Device/tplink_tl-wa901nd-v2 endef TARGET_DEVICES += tplink_tl-wa901nd-v2 +define Device/tplink_tl-wa901nd-v3 + $(Device/tplink-4mlzma) + SOC := ar9341 + DEVICE_MODEL := TL-WA901ND + DEVICE_VARIANT := v3 + TPLINK_HWID := 0x09010003 + SUPPORTED_DEVICES += tl-wa901nd-v3 +endef +TARGET_DEVICES += tplink_tl-wa901nd-v3 + define Device/tplink_tl-wa901nd-v4 $(Device/tplink-4mlzma) SOC := tp9343 diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds new file mode 100644 index 000000000..608583059 --- /dev/null +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds @@ -0,0 +1,26 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) +boardname="${board##*,}" + +case "$board" in +mikrotik,routerboard-lhg-2nd) + ucidef_set_led_netdev "lan" "lan" "mikrotik:green:lan" "eth0" + ;; +mikrotik,routerboard-sxt-5nd-r2) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "rssilow" "sxt5n:green:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "sxt5n:green:rssimediumlow" "wlan0" "20" "100" + ucidef_set_led_rssi "rssimedium" "rssimedium" "sxt5n:green:rssimedium" "wlan0" "40" "100" + ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "sxt5n:green:rssimediumhigh" "wlan0" "60" "100" + ucidef_set_led_rssi "rssihigh" "rssihigh" "sxt5n:green:rssihigh" "wlan0" "80" "100" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 96e0f5610..6bc482255 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -15,7 +15,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch1" \ "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; + mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-922uags-5hpacd|\ + mikrotik,routerboard-lhg-2nd|\ + mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd) ucidef_set_interface_lan "eth0" ;; @@ -34,6 +37,13 @@ ath79_setup_macs() local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)" case "$board" in + mikrotik,routerboard-921gs-5hpacd-15s|\ + mikrotik,routerboard-lhg-2nd|\ + mikrotik,routerboard-sxt-5nd-r2|\ + mikrotik,routerboard-wap-g-5hact2hnd) + label_mac="$mac_base" + lan_mac="$mac_base" + ;; *) label_mac="$mac_base" wan_mac="$mac_base" diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index d16190d80..f2cb1f774 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -4,6 +4,17 @@ . /lib/functions/caldata.sh +caldata_mikrotik_ath9k() { + local offset=$(($1)) + local count=$(($2)) + local macaddr=$3 + + caldata_from_file $wlan_data $offset $count /tmp/$FIRMWARE + ath9k_patch_mac "$macaddr" /tmp/$FIRMWARE + caldata_sysfsload_from_file /tmp/$FIRMWARE 0x0 $count + rm -f /tmp/$FIRMWARE +} + wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data" mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)" @@ -12,11 +23,12 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in + mikrotik,routerboard-lhg-2nd|\ + mikrotik,routerboard-sxt-5nd-r2) + caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +1) + ;; mikrotik,routerboard-wap-g-5hact2hnd) - caldata_from_file $wlan_data 0x1000 0x440 /tmp/$FIRMWARE - ath9k_patch_mac $(macaddr_add "$mac_base" +2) /tmp/$FIRMWARE - caldata_sysfsload_from_file /tmp/$FIRMWARE 0x0 0x440 - rm -f /tmp/$FIRMWARE + caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +2) ;; *) caldata_die "board $board is not supported yet" diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 531c21678..31d4eeedb 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -11,6 +11,7 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in + mikrotik,routerboard-921gs-5hpacd-15s|\ mikrotik,routerboard-wap-g-5hact2hnd) caldata_sysfsload_from_file $wlan_data 0x5000 0x844 ;; diff --git a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh index 8d11cfc0c..5ee549236 100644 --- a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh @@ -32,10 +32,15 @@ platform_do_upgrade() { case "$board" in mikrotik,routerboard-493g|\ - mikrotik,routerboard-922uags-5hpacd) + mikrotik,routerboard-921gs-5hpacd-15s|\ + mikrotik,routerboard-922uags-5hpacd|\ + mikrotik,routerboard-sxt-5nd-r2) platform_do_upgrade_mikrotik_nand "$1" ;; *) + # NOR devices: erase firmware if booted from initramfs + [ -z "$(rootfs_type)" ] && mtd erase firmware + default_do_upgrade "$1" ;; esac diff --git a/target/linux/ath79/mikrotik/target.mk b/target/linux/ath79/mikrotik/target.mk index face016a5..0394f4427 100644 --- a/target/linux/ath79/mikrotik/target.mk +++ b/target/linux/ath79/mikrotik/target.mk @@ -1,7 +1,7 @@ BOARDNAME := MikroTik devices FEATURES += minor nand squashfs -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build firmware images for MikroTik devices based on Qualcomm Atheros diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 84cdfd99b..910df517a 100755 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -8,7 +8,8 @@ ath79_setup_interfaces() local board="$1" case "$board" in - aerohive,hiveap-121) + aerohive,hiveap-121|\ + glinet,gl-e750) ucidef_set_interface_lan "eth0" ;; domywifi,dw33d) @@ -28,6 +29,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" ;; + netgear,wndr4300tn) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; zyxel,nbg6716) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1" diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 355be93ea..cac955905 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -9,9 +9,13 @@ board=$(board_name) case "$FIRMWARE" in "ath9k-eeprom-ahb-18100000.wmac.bin") case $board in + 8dev,rambutan) + caldata_extract "caldata" 0x1000 0x800 + ;; netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ + netgear,wndr4300tn|\ netgear,wndr4300-v2|\ netgear,wndr4500-v3) caldata_extract "caldata" 0x1000 0x440 @@ -26,6 +30,7 @@ case "$FIRMWARE" in netgear,wndr3700-v4|\ netgear,wndr4300|\ netgear,wndr4300sw|\ + netgear,wndr4300tn|\ netgear,wndr4300-v2|\ netgear,wndr4500-v3) caldata_extract "caldata" 0x5000 0x440 diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac index 6c61e5df0..730a5f994 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -10,6 +10,11 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case $board in + glinet,gl-e750) + # Set mac address for 5g device + [ "$PHYNBR" -eq 0 ] && \ + macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress + ;; zyxel,nbg6716) # Set mac address for 2.4g device [ "$PHYNBR" -eq 1 ] && \ diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk index c565c9b2b..a4069d761 100644 --- a/target/linux/ath79/nand/target.mk +++ b/target/linux/ath79/nand/target.mk @@ -2,7 +2,7 @@ BOARDNAME := Generic devices with NAND flash FEATURES += squashfs nand -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Firmware for boards using Qualcomm Atheros, MIPS-based SoCs diff --git a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch index 61695ae55..fc77e6e42 100644 --- a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch @@ -578,7 +578,7 @@ #include --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h -@@ -125,9 +125,9 @@ static inline int IP6_ECN_set_ce(struct +@@ -126,9 +126,9 @@ static inline int IP6_ECN_set_ce(struct if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) return 0; @@ -728,7 +728,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3906,14 +3906,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3907,14 +3907,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/ath79/patches-4.19/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-4.19/921-serial-core-add-support-for-boot-console-with-arbitr.patch new file mode 100644 index 000000000..f726b0520 --- /dev/null +++ b/target/linux/ath79/patches-4.19/921-serial-core-add-support-for-boot-console-with-arbitr.patch @@ -0,0 +1,54 @@ +From 4d3c17975c7814884a721fe693b3adf5c426d759 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 10 Nov 2015 22:18:39 +0100 +Subject: [RFC] serial: core: add support for boot console with arbitrary + baud rates + +The Arduino Yun uses a baud rate of 250000 by default. The serial is +going over the Atmel ATmega and is used to connect to this chip. +Without this patch Linux wants to switch the console to 9600 Baud. + +With this patch Linux will use the configured baud rate and not a +default one specified in uart_register_driver(). + +Signed-off-by: Hauke Mehrtens +[rebased to 4.14, slightly reworded commit message] +Signed-off-by: Sungbo Eo +--- + drivers/tty/serial/serial_core.c | 6 +++++- + include/linux/console.h | 1 + + 2 files changed, 6 insertions(+), 1 deletions(-) + +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -219,6 +219,8 @@ static int uart_port_startup(struct tty_ + if (retval == 0) { + if (uart_console(uport) && uport->cons->cflag) { + tty->termios.c_cflag = uport->cons->cflag; ++ tty->termios.c_ospeed = uport->cons->baud; ++ tty->termios.c_ispeed = uport->cons->baud; + uport->cons->cflag = 0; + } + /* +@@ -2058,8 +2060,10 @@ uart_set_options(struct uart_port *port, + * Allow the setting of the UART parameters with a NULL console + * too: + */ +- if (co) ++ if (co) { + co->cflag = termios.c_cflag; ++ co->baud = baud; ++ } + + return 0; + } +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -153,6 +153,7 @@ struct console { + short flags; + short index; + int cflag; ++ int baud; + void *data; + struct console *next; + }; diff --git a/target/linux/ath79/patches-5.4/0011-MIPS-ath79-select-the-PINCTRL-subsystem.patch b/target/linux/ath79/patches-5.4/0011-MIPS-ath79-select-the-PINCTRL-subsystem.patch index 4ac58d10c..2edd06110 100644 --- a/target/linux/ath79/patches-5.4/0011-MIPS-ath79-select-the-PINCTRL-subsystem.patch +++ b/target/linux/ath79/patches-5.4/0011-MIPS-ath79-select-the-PINCTRL-subsystem.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -295,6 +295,7 @@ config BCM63XX +@@ -296,6 +296,7 @@ config BCM63XX select SYS_HAS_EARLY_PRINTK select SWAP_IO_SPACE select GPIOLIB diff --git a/target/linux/ath79/patches-5.4/0032-MIPS-ath79-sanitize-symbols.patch b/target/linux/ath79/patches-5.4/0032-MIPS-ath79-sanitize-symbols.patch index 382c5e6df..14dddd514 100644 --- a/target/linux/ath79/patches-5.4/0032-MIPS-ath79-sanitize-symbols.patch +++ b/target/linux/ath79/patches-5.4/0032-MIPS-ath79-sanitize-symbols.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -216,6 +216,8 @@ config ATH79 +@@ -217,6 +217,8 @@ config ATH79 select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_MIPS16 select SYS_SUPPORTS_ZBOOT_UART_PROM diff --git a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch index 053b72023..e77289dc5 100644 --- a/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.4/910-unaligned_access_hacks.patch @@ -556,7 +556,7 @@ #include --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h -@@ -139,9 +139,9 @@ static inline int IP6_ECN_set_ce(struct +@@ -140,9 +140,9 @@ static inline int IP6_ECN_set_ce(struct if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph))) return 0; @@ -706,7 +706,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3968,14 +3968,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3971,14 +3971,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch new file mode 100644 index 000000000..dc863a511 --- /dev/null +++ b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch @@ -0,0 +1,54 @@ +From 4d3c17975c7814884a721fe693b3adf5c426d759 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 10 Nov 2015 22:18:39 +0100 +Subject: [RFC] serial: core: add support for boot console with arbitrary + baud rates + +The Arduino Yun uses a baud rate of 250000 by default. The serial is +going over the Atmel ATmega and is used to connect to this chip. +Without this patch Linux wants to switch the console to 9600 Baud. + +With this patch Linux will use the configured baud rate and not a +default one specified in uart_register_driver(). + +Signed-off-by: Hauke Mehrtens +[rebased to 4.14, slightly reworded commit message] +Signed-off-by: Sungbo Eo +--- + drivers/tty/serial/serial_core.c | 6 +++++- + include/linux/console.h | 1 + + 2 files changed, 6 insertions(+), 1 deletions(-) + +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -220,6 +220,8 @@ static int uart_port_startup(struct tty_ + if (retval == 0) { + if (uart_console(uport) && uport->cons->cflag) { + tty->termios.c_cflag = uport->cons->cflag; ++ tty->termios.c_ospeed = uport->cons->baud; ++ tty->termios.c_ispeed = uport->cons->baud; + uport->cons->cflag = 0; + } + /* +@@ -2104,8 +2106,10 @@ uart_set_options(struct uart_port *port, + * Allow the setting of the UART parameters with a NULL console + * too: + */ +- if (co) ++ if (co) { + co->cflag = termios.c_cflag; ++ co->baud = baud; ++ } + + return 0; + } +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -153,6 +153,7 @@ struct console { + short flags; + short index; + int cflag; ++ int baud; + void *data; + struct console *next; + }; diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/01_leds b/target/linux/ath79/tiny/base-files/etc/board.d/01_leds index ec8e2d60c..bc0b15bba 100755 --- a/target/linux/ath79/tiny/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/tiny/base-files/etc/board.d/01_leds @@ -50,6 +50,7 @@ tplink,tl-wa801nd-v4|\ tplink,tl-wa830re-v1|\ tplink,tl-wa860re-v1|\ tplink,tl-wa901nd-v1|\ +tplink,tl-wa901nd-v3|\ tplink,tl-wa901nd-v4|\ tplink,tl-wa901nd-v5) ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network index 87f8d27ec..cbcdbe9a8 100755 --- a/target/linux/ath79/tiny/base-files/etc/board.d/02_network +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -43,6 +43,7 @@ ath79_setup_interfaces() tplink,tl-wa860re-v1|\ tplink,tl-wa901nd-v1|\ tplink,tl-wa901nd-v2|\ + tplink,tl-wa901nd-v3|\ tplink,tl-wa901nd-v4|\ tplink,tl-wa901nd-v5|\ tplink,tl-wr703n|\ diff --git a/target/linux/ath79/tiny/target.mk b/target/linux/ath79/tiny/target.mk index dba57e596..2ee71ea92 100644 --- a/target/linux/ath79/tiny/target.mk +++ b/target/linux/ath79/tiny/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=Devices with small flash FEATURES += squashfs small_flash -DEFAULT_PACKAGES += wpad-mini +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small flash diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile index 2b97593c9..f009b997e 100644 --- a/target/linux/bcm27xx/image/Makefile +++ b/target/linux/bcm27xx/image/Makefile @@ -79,7 +79,7 @@ define Device/rpi DEVICE_PACKAGES := \ cypress-firmware-43430-sdio \ cypress-nvram-43430-sdio-rpi-zero-w \ - kmod-brcmfmac wpad-basic + kmod-brcmfmac wpad-basic-wolfssl endef ifeq ($(SUBTARGET),bcm2708) TARGET_DEVICES += rpi @@ -103,7 +103,7 @@ define Device/rpi-2 cypress-nvram-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ cypress-nvram-43455-sdio-rpi-3b-plus cypress-nvram-43455-sdio-rpi-4b \ - kmod-brcmfmac wpad-basic + kmod-brcmfmac wpad-basic-wolfssl IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip endef @@ -128,7 +128,7 @@ define Device/rpi-3 cypress-nvram-43430-sdio-rpi-3b \ cypress-firmware-43455-sdio \ cypress-nvram-43455-sdio-rpi-3b-plus \ - kmod-brcmfmac wpad-basic + kmod-brcmfmac wpad-basic-wolfssl endef ifeq ($(SUBTARGET),bcm2710) TARGET_DEVICES += rpi-3 @@ -143,7 +143,7 @@ define Device/rpi-4 DEVICE_PACKAGES := \ cypress-firmware-43455-sdio \ cypress-nvram-43455-sdio-rpi-4b \ - kmod-brcmfmac wpad-basic + kmod-brcmfmac wpad-basic-wolfssl IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata IMAGE/factory.img.gz := boot-common | boot-2711 | sdcard-img | gzip endef diff --git a/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch index 16a9bcd22..235503788 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0003-smsx95xx-fix-crimes-against-truesize.patch @@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1957,7 +1961,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1964,7 +1968,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning return 1; } -@@ -1975,7 +1980,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1982,7 +1987,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch b/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch index 7419136f8..0284c9b05 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c -@@ -729,7 +729,7 @@ static int spidev_probe(struct spi_devic +@@ -734,7 +734,7 @@ static int spidev_probe(struct spi_devic * compatible string, it is a Linux implementation thing * rather than a description of the hardware. */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch b/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch index 6799a07d7..f5567bdad 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0030-lan78xx-Enable-LEDs-and-auto-negotiation.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2465,6 +2465,11 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2461,6 +2461,11 @@ static int lan78xx_reset(struct lan78xx_ int ret = 0; unsigned long timeout; u8 sig; @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_LRST_; -@@ -2518,6 +2523,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2514,6 +2519,9 @@ static int lan78xx_reset(struct lan78xx_ ret = lan78xx_read_reg(dev, HW_CFG, &buf); buf |= HW_CFG_MEF_; @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_write_reg(dev, HW_CFG, buf); ret = lan78xx_read_reg(dev, USB_CFG0, &buf); -@@ -2573,6 +2581,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2569,6 +2577,9 @@ static int lan78xx_reset(struct lan78xx_ buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; } } diff --git a/target/linux/bcm27xx/patches-5.4/950-0049-Add-cpufreq-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0049-Add-cpufreq-driver.patch index 655018a4f..3fa7e3d8e 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0049-Add-cpufreq-driver.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0049-Add-cpufreq-driver.patch @@ -18,7 +18,7 @@ Signed-off-by: Dom Cobley --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm -@@ -300,6 +300,15 @@ config ARM_TANGO_CPUFREQ +@@ -301,6 +301,15 @@ config ARM_TANGO_CPUFREQ depends on CPUFREQ_DT && ARCH_TANGO default y diff --git a/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch b/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch index 2d5363756..e4f52577e 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0111-lan78xx-Read-initial-EEE-status-from-DT.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2647,6 +2647,22 @@ static int lan78xx_open(struct net_devic +@@ -2643,6 +2643,22 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch b/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch index be6173c93..894c3ea7c 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0117-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch @@ -21,7 +21,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -429,6 +429,15 @@ static int msg_level = -1; +@@ -425,6 +425,15 @@ static int msg_level = -1; module_param(msg_level, int, 0); MODULE_PARM_DESC(msg_level, "Override default message level"); @@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -2995,8 +3004,14 @@ static int lan78xx_bind(struct lan78xx_n +@@ -2925,8 +2934,14 @@ static int lan78xx_bind(struct lan78xx_n if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; diff --git a/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch b/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch index 998c3a823..4d46461dd 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0118-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2179,6 +2179,22 @@ static int lan78xx_phy_init(struct lan78 +@@ -2175,6 +2175,22 @@ static int lan78xx_phy_init(struct lan78 mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); @@ -39,7 +39,7 @@ Signed-off-by: Phil Elwell if (phydev->mdio.dev.of_node) { u32 reg; int len; -@@ -2656,22 +2672,6 @@ static int lan78xx_open(struct net_devic +@@ -2652,22 +2668,6 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch b/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch index da43a76bf..855a9a7e8 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0132-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch @@ -13,10 +13,9 @@ See: https://github.com/raspberrypi/linux/issues/2447 --- drivers/net/usb/lan78xx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) - --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -438,6 +438,11 @@ static bool enable_tso; +@@ -434,6 +434,11 @@ static bool enable_tso; module_param(enable_tso, bool, 0644); MODULE_PARM_DESC(enable_tso, "Enables TCP segmentation offload"); @@ -28,17 +27,17 @@ See: https://github.com/raspberrypi/linux/issues/2447 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf = kmalloc(sizeof(u32), GFP_KERNEL); -@@ -3819,7 +3824,12 @@ static int lan78xx_probe(struct usb_inte - dev->pipe_intr = usb_rcvintpipe(dev->udev, - dev->ep_intr->desc.bEndpointAddress & - USB_ENDPOINT_NUMBER_MASK); -- period = dev->ep_intr->desc.bInterval; +@@ -3768,7 +3773,12 @@ static int lan78xx_probe(struct usb_inte + netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; + netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); + +- period = ep_intr->desc.bInterval; + if (int_urb_interval_ms <= 0) -+ period = dev->ep_intr->desc.bInterval; ++ period = ep_intr->desc.bInterval; + else + period = int_urb_interval_ms * INT_URB_MICROFRAMES_PER_MS; + + netif_notice(dev, probe, netdev, "int urb period %d\n", period); - maxp = usb_maxpacket(dev->udev, dev->pipe_intr, 0); buf = kmalloc(maxp, GFP_KERNEL); + if (buf) { diff --git a/target/linux/bcm27xx/patches-5.4/950-0138-lan78xx-EEE-support-is-now-a-PHY-property.patch b/target/linux/bcm27xx/patches-5.4/950-0138-lan78xx-EEE-support-is-now-a-PHY-property.patch index 2c3180fa2..2778f40a9 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0138-lan78xx-EEE-support-is-now-a-PHY-property.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0138-lan78xx-EEE-support-is-now-a-PHY-property.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2184,7 +2184,7 @@ static int lan78xx_phy_init(struct lan78 +@@ -2180,7 +2180,7 @@ static int lan78xx_phy_init(struct lan78 mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); diff --git a/target/linux/bcm27xx/patches-5.4/950-0146-lan78xx-use-default-alignment-for-rx-buffers.patch b/target/linux/bcm27xx/patches-5.4/950-0146-lan78xx-use-default-alignment-for-rx-buffers.patch index 8327e4fc3..1c2daad76 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0146-lan78xx-use-default-alignment-for-rx-buffers.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0146-lan78xx-use-default-alignment-for-rx-buffers.patch @@ -12,7 +12,7 @@ in both dwc_otg and in ipv6 processing. --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -3239,7 +3239,7 @@ static int rx_submit(struct lan78xx_net +@@ -3169,7 +3169,7 @@ static int rx_submit(struct lan78xx_net size_t size = dev->rx_urb_size; int ret = 0; diff --git a/target/linux/bcm27xx/patches-5.4/950-0163-staging-vchiq_arm-Fix-platform-device-unregistration.patch b/target/linux/bcm27xx/patches-5.4/950-0163-staging-vchiq_arm-Fix-platform-device-unregistration.patch deleted file mode 100644 index a5300ca30..000000000 --- a/target/linux/bcm27xx/patches-5.4/950-0163-staging-vchiq_arm-Fix-platform-device-unregistration.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7ba7db27d18d141973ad7eaf1f339218d81a31a4 Mon Sep 17 00:00:00 2001 -From: Stefan Wahren -Date: Sat, 13 Oct 2018 20:51:23 +0200 -Subject: [PATCH] staging: vchiq_arm: Fix platform device - unregistration - -In error case platform_device_register_data would return an ERR_PTR -instead of NULL. So we better check this before unregistration. - -Fixes: 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.") -Signed-off-by: Stefan Wahren ---- - drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -3258,7 +3258,8 @@ failed_platform_init: - - static int vchiq_remove(struct platform_device *pdev) - { -- platform_device_unregister(bcm2835_camera); -+ if (!IS_ERR(bcm2835_camera)) -+ platform_device_unregister(bcm2835_camera); - vchiq_debugfs_deinit(); - device_destroy(vchiq_class, vchiq_devid); - cdev_del(&vchiq_cdev); diff --git a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch index ee1e3940b..7a1c2991f 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0214-usb-xhci-Show-that-the-VIA-VL805-supports-LPM.patch @@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -244,6 +244,10 @@ static void xhci_pci_quirks(struct devic +@@ -247,6 +247,10 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; @@ -19,5 +19,5 @@ Signed-off-by: Phil Elwell + xhci->quirks |= XHCI_LPM_SUPPORT; + if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && - pdev->device == 0x1042) + pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) xhci->quirks |= XHCI_BROKEN_STREAMS; diff --git a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch index 6dba6fbc5..83c86f616 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0267-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -245,8 +245,10 @@ static void xhci_pci_quirks(struct devic +@@ -248,8 +248,10 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_BROKEN_STREAMS; if (pdev->vendor == PCI_VENDOR_ID_VIA && @@ -34,7 +34,7 @@ Signed-off-by: Jonathan Bell + } if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && - pdev->device == 0x1042) + pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -527,7 +527,10 @@ void xhci_find_new_dequeue_state(struct 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 26a54c22c..f265beb34 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 -@@ -1234,6 +1237,9 @@ +@@ -1237,6 +1240,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 @@ -53,7 +53,7 @@ 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 }, -@@ -178,6 +179,7 @@ static const struct hid_device_id hid_qu +@@ -179,6 +180,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 }, diff --git a/target/linux/bcm27xx/patches-5.4/950-0335-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch b/target/linux/bcm27xx/patches-5.4/950-0335-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch index 28641fd32..cf8d563c7 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0335-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0335-staging-vchiq_arm-Register-vcsm-cma-as-a-platform-dr.patch @@ -32,8 +32,8 @@ Signed-off-by: Dave Stevenson @@ -3266,6 +3268,7 @@ static int vchiq_remove(struct platform_ { - if (!IS_ERR(bcm2835_camera)) - platform_device_unregister(bcm2835_camera); + platform_device_unregister(bcm2835_audio); + platform_device_unregister(bcm2835_camera); + platform_device_unregister(vcsm_cma); vchiq_debugfs_deinit(); device_destroy(vchiq_class, vchiq_devid); diff --git a/target/linux/bcm27xx/patches-5.4/950-0336-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch b/target/linux/bcm27xx/patches-5.4/950-0336-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch index 016e6c0aa..9e1b777ca 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0336-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0336-staging-vchiq_arm-Register-bcm2835-codec-as-a-platfo.patch @@ -32,8 +32,8 @@ Signed-off-by: Dave Stevenson @@ -3268,6 +3270,7 @@ static int vchiq_remove(struct platform_ { - if (!IS_ERR(bcm2835_camera)) - platform_device_unregister(bcm2835_camera); + platform_device_unregister(bcm2835_audio); + platform_device_unregister(bcm2835_camera); + platform_device_unregister(bcm2835_codec); platform_device_unregister(vcsm_cma); vchiq_debugfs_deinit(); diff --git a/target/linux/bcm27xx/patches-5.4/950-0338-staging-vchiq_arm-Unify-the-unload-handling-of-platf.patch b/target/linux/bcm27xx/patches-5.4/950-0338-staging-vchiq_arm-Unify-the-unload-handling-of-platf.patch deleted file mode 100644 index 9bcd967b8..000000000 --- a/target/linux/bcm27xx/patches-5.4/950-0338-staging-vchiq_arm-Unify-the-unload-handling-of-platf.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 91da858c9327352c17a1f20ec10e78113ed45c82 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Wed, 6 Nov 2019 13:58:18 +0000 -Subject: [PATCH] staging: vchiq_arm: Unify the unload handling of - platform devs - -A helper function vchiq_register_child was added to deal with -adding the platform devices. This returns NULL on failure, and -that is assigned to the struct platform_device. There is -therefore no way for remove to encounter an error pointer, so -checking for IS_ERR() is redundant. - -Signed-off-by: Dave Stevenson ---- - drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -3268,8 +3268,7 @@ failed_platform_init: - - static int vchiq_remove(struct platform_device *pdev) - { -- if (!IS_ERR(bcm2835_camera)) -- platform_device_unregister(bcm2835_camera); -+ platform_device_unregister(bcm2835_camera); - platform_device_unregister(bcm2835_codec); - platform_device_unregister(vcsm_cma); - vchiq_debugfs_deinit(); diff --git a/target/linux/bcm27xx/patches-5.4/950-0428-staging-vchiq_arm-Add-a-matching-unregister-call.patch b/target/linux/bcm27xx/patches-5.4/950-0428-staging-vchiq_arm-Add-a-matching-unregister-call.patch deleted file mode 100644 index 8271b2505..000000000 --- a/target/linux/bcm27xx/patches-5.4/950-0428-staging-vchiq_arm-Add-a-matching-unregister-call.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 79a2c3013a3b2a4304f953a4a55c49c1bc85202b Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 3 Feb 2020 17:33:01 +0000 -Subject: [PATCH] staging: vchiq_arm: Add a matching unregister call - -All the registered children of vchiq have a corresponding call to -platform_device_unregister except bcm2835_audio. Fix that. - -Fixes: 25c7597af20d ("staging: vchiq_arm: Register a platform device for audio") - -Signed-off-by: Phil Elwell ---- - drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c -@@ -3293,6 +3293,7 @@ failed_platform_init: - - static int vchiq_remove(struct platform_device *pdev) - { -+ platform_device_unregister(bcm2835_audio); - platform_device_unregister(bcm2835_camera); - platform_device_unregister(bcm2835_codec); - platform_device_unregister(vcsm_cma); diff --git a/target/linux/bcm27xx/patches-5.4/950-0447-PCI-of-Add-inbound-resource-parsing-to-helpers.patch b/target/linux/bcm27xx/patches-5.4/950-0447-PCI-of-Add-inbound-resource-parsing-to-helpers.patch index 6bdd9d2dc..d7bc3d709 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0447-PCI-of-Add-inbound-resource-parsing-to-helpers.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0447-PCI-of-Add-inbound-resource-parsing-to-helpers.patch @@ -174,7 +174,7 @@ Cc: linux-rockchip@lists.infradead.org return ret; --- a/drivers/pci/controller/pcie-cadence-host.c +++ b/drivers/pci/controller/pcie-cadence-host.c -@@ -211,7 +211,7 @@ static int cdns_pcie_host_init(struct de +@@ -216,7 +216,7 @@ static int cdns_pcie_host_init(struct de int err; /* Parse our PCI ranges and request their resources */ diff --git a/target/linux/bcm27xx/patches-5.4/950-0671-Revert-spi-spidev-Fix-CS-polarity-if-GPIO-descriptor.patch b/target/linux/bcm27xx/patches-5.4/950-0671-Revert-spi-spidev-Fix-CS-polarity-if-GPIO-descriptor.patch index fa01cd853..00bbe9811 100644 --- a/target/linux/bcm27xx/patches-5.4/950-0671-Revert-spi-spidev-Fix-CS-polarity-if-GPIO-descriptor.patch +++ b/target/linux/bcm27xx/patches-5.4/950-0671-Revert-spi-spidev-Fix-CS-polarity-if-GPIO-descriptor.patch @@ -11,7 +11,7 @@ This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28. --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c -@@ -394,7 +394,6 @@ spidev_ioctl(struct file *filp, unsigned +@@ -399,7 +399,6 @@ spidev_ioctl(struct file *filp, unsigned else retval = get_user(tmp, (u32 __user *)arg); if (retval == 0) { @@ -19,7 +19,7 @@ This reverts commit 83b2a8fe43bda0c11981ad6afa5dd0104d78be28. u32 save = spi->mode; if (tmp & ~SPI_MODE_MASK) { -@@ -402,10 +401,6 @@ spidev_ioctl(struct file *filp, unsigned +@@ -407,10 +406,6 @@ spidev_ioctl(struct file *filp, unsigned break; } diff --git a/target/linux/bcm47xx/base-files/etc/board.d/01_network b/target/linux/bcm47xx/base-files/etc/board.d/01_network index 41a2077ea..242055f2a 100755 --- a/target/linux/bcm47xx/base-files/etc/board.d/01_network +++ b/target/linux/bcm47xx/base-files/etc/board.d/01_network @@ -171,6 +171,7 @@ configure_by_model() { "Asus RT-N16"* | \ "Linksys E3000 V1" | \ + "Linksys WRT610N V2" | \ "Netgear WNR3500 V2" | \ "Netgear WNR3500L") ucidef_add_switch "switch0" \ diff --git a/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk b/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk index c3e9d20c1..db0a31d6c 100644 --- a/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk +++ b/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-wl NAME:=Broadcom SoC, all Ethernet, BCM43xx WiFi (wl, proprietary) - PACKAGES:=-wpad-basic kmod-b44 kmod-tg3 kmod-bgmac kmod-brcm-wl wlc nas + PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-tg3 kmod-bgmac kmod-brcm-wl wlc nas endef define Profile/Broadcom-wl/Description diff --git a/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk b/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk index 4497124a2..9c66d5796 100644 --- a/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk +++ b/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-none NAME:=Broadcom SoC, all Ethernet, No WiFi - PACKAGES:=-wpad-basic kmod-b44 kmod-tg3 kmod-bgmac + PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-tg3 kmod-bgmac endef define Profile/Broadcom-none/Description diff --git a/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk b/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk index 79b7c5c00..fe6c2d8f8 100644 --- a/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk +++ b/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-b44-wl NAME:=Broadcom SoC, b44 Ethernet, BCM43xx WiFi (wl, proprietary) - PACKAGES:=-wpad-basic kmod-b44 kmod-brcm-wl wlc nas + PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-brcm-wl wlc nas endef define Profile/Broadcom-b44-wl/Description diff --git a/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk b/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk index 0854b5041..6c409057c 100644 --- a/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk +++ b/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-b44-none NAME:=Broadcom SoC, b44 Ethernet, No WiFi - PACKAGES:=-wpad-basic kmod-b44 + PACKAGES:=-wpad-basic-wolfssl kmod-b44 endef define Profile/Broadcom-b44-none/Description diff --git a/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk b/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk index 6946668c9..20acd75bc 100644 --- a/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk +++ b/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-tg3-wl NAME:=Broadcom SoC, tg3 Ethernet, BCM43xx WiFi (wl, proprietary) - PACKAGES:=-wpad-basic kmod-brcm-wl wlc nas kmod-tg3 + PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl wlc nas kmod-tg3 endef define Profile/Broadcom-tg3-wl/Description diff --git a/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk b/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk index a5a3b4a01..7974279bc 100644 --- a/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk +++ b/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-tg3-none NAME:=Broadcom SoC, tg3 Ethernet, no WiFi - PACKAGES:=-wpad-basic kmod-tg3 + PACKAGES:=-wpad-basic-wolfssl kmod-tg3 endef define Profile/Broadcom-tg3-none/Description diff --git a/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk b/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk index acdc20fb7..bb7e7c2c9 100644 --- a/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk +++ b/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-bgmac-wl NAME:=Broadcom SoC, bgmac Ethernet, BCM43xx WiFi (wl, proprietary) - PACKAGES:=-wpad-basic kmod-bgmac kmod-brcm-wl wlc nas + PACKAGES:=-wpad-basic-wolfssl kmod-bgmac kmod-brcm-wl wlc nas endef define Profile/Broadcom-bgmac-wl/Description diff --git a/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk b/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk index db2d1a264..77299cd50 100644 --- a/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk +++ b/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-bgmac-none NAME:=Broadcom SoC, bgmac Ethernet, No WiFi - PACKAGES:=-wpad-basic kmod-bgmac + PACKAGES:=-wpad-basic-wolfssl kmod-bgmac endef define Profile/Broadcom-bgmac-none/Description diff --git a/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk b/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk index 14ee46f20..90c2688c8 100644 --- a/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk +++ b/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk @@ -7,7 +7,7 @@ define Profile/Ps1208mfg NAME:=Edimax PS-1208MFG - PACKAGES:=-firewall -dropbear -dnsmasq -mtd -ppp -wpad-basic kmod-b44 block-mount kmod-usb-storage kmod-usb2 kmod-usb-ohci -iptables -swconfig kmod-fs-ext4 + PACKAGES:=-firewall -dropbear -dnsmasq -mtd -ppp -wpad-basic-wolfssl kmod-b44 block-mount kmod-usb-storage kmod-usb2 kmod-usb-ohci -iptables -swconfig kmod-fs-ext4 endef define Profile/Ps1208mfg/Description diff --git a/target/linux/bcm47xx/generic/target.mk b/target/linux/bcm47xx/generic/target.mk index 2f93778b0..70397de39 100644 --- a/target/linux/bcm47xx/generic/target.mk +++ b/target/linux/bcm47xx/generic/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=Generic FEATURES+=pcmcia -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build generic firmware for all Broadcom BCM47xx and BCM53xx MIPS diff --git a/target/linux/bcm47xx/image/generic.mk b/target/linux/bcm47xx/image/generic.mk index e5ae95213..61204bf23 100644 --- a/target/linux/bcm47xx/image/generic.mk +++ b/target/linux/bcm47xx/image/generic.mk @@ -3,7 +3,7 @@ ################################################# # BCM4705 with tg3 -define Device/linksys-wrt300n-v1.1 +define Device/linksys_wrt300n-v1.1 DEVICE_MODEL := WRT300N DEVICE_VARIANT := v1.1 DEVICE_PACKAGES := kmod-tg3 kmod-b43 @@ -11,9 +11,9 @@ define Device/linksys-wrt300n-v1.1 DEVICE_ID := EWC2 VERSION := 1.51.2 endef -TARGET_DEVICES += linksys-wrt300n-v1.1 +TARGET_DEVICES += linksys_wrt300n-v1.1 -define Device/linksys-wrt310n-v1 +define Device/linksys_wrt310n-v1 DEVICE_MODEL := WRT310N DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-tg3 kmod-b43 @@ -21,9 +21,9 @@ define Device/linksys-wrt310n-v1 DEVICE_ID := 310N VERSION := 1.0.10 endef -TARGET_DEVICES += linksys-wrt310n-v1 +TARGET_DEVICES += linksys_wrt310n-v1 -define Device/linksys-wrt350n-v1 +define Device/linksys_wrt350n-v1 DEVICE_MODEL := WRT350N DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-tg3 kmod-b43 $(USB2_PACKAGES) @@ -31,9 +31,9 @@ define Device/linksys-wrt350n-v1 DEVICE_ID := EWCG VERSION := 1.04.1 endef -TARGET_DEVICES += linksys-wrt350n-v1 +TARGET_DEVICES += linksys_wrt350n-v1 -define Device/linksys-wrt610n-v1 +define Device/linksys_wrt610n-v1 DEVICE_MODEL := WRT610N DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-tg3 kmod-b43 $(USB2_PACKAGES) @@ -41,10 +41,10 @@ define Device/linksys-wrt610n-v1 DEVICE_ID := 610N VERSION := 1.0.1 endef -TARGET_DEVICES += linksys-wrt610n-v1 +TARGET_DEVICES += linksys_wrt610n-v1 # BCMA SoC with SSB WiFi -define Device/linksys-wrt610n-v2 +define Device/linksys_wrt610n-v2 DEVICE_MODEL := WRT610N DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-bgmac kmod-b43 $(USB2_PACKAGES) @@ -52,9 +52,9 @@ define Device/linksys-wrt610n-v2 DEVICE_ID := 610N VERSION := 2.0.0 endef -TARGET_DEVICES += linksys-wrt610n-v2 +TARGET_DEVICES += linksys_wrt610n-v2 -define Device/linksys-e3000-v1 +define Device/linksys_e3000-v1 DEVICE_MODEL := E3000 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-bgmac kmod-b43 $(USB2_PACKAGES) @@ -62,7 +62,7 @@ define Device/linksys-e3000-v1 DEVICE_ID := 61XN VERSION := 1.0.3 endef -TARGET_DEVICES += linksys-e3000-v1 +TARGET_DEVICES += linksys_e3000-v1 # generic has Ethernet drivers as modules so overwrite standard image define Device/standard diff --git a/target/linux/bcm47xx/image/legacy.mk b/target/linux/bcm47xx/image/legacy.mk index 66d7efd5d..4538813b9 100644 --- a/target/linux/bcm47xx/image/legacy.mk +++ b/target/linux/bcm47xx/image/legacy.mk @@ -2,107 +2,107 @@ # Subtarget legacy ################################################# -define Device/asus-wl-300g +define Device/asus_wl-300g DEVICE_MODEL := WL-300g DEVICE_PACKAGES := kmod-b43 kmod-b43legacy $(Device/asus) PRODUCTID := "WL300g " endef -TARGET_DEVICES += asus-wl-300g +TARGET_DEVICES += asus_wl-300g -define Device/asus-wl-320gp +define Device/asus_wl-320gp DEVICE_MODEL := WL-320gP DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := "WL320gP " endef -TARGET_DEVICES += asus-wl-320gp +TARGET_DEVICES += asus_wl-320gp -define Device/asus-wl-330ge +define Device/asus_wl-330ge DEVICE_MODEL := WL-330gE DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := "WL-330gE " endef -TARGET_DEVICES += asus-wl-330ge +TARGET_DEVICES += asus_wl-330ge -define Device/asus-wl-500gd +define Device/asus_wl-500gd DEVICE_MODEL := WL-500g Deluxe DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := "WL500gx " endef -TARGET_DEVICES += asus-wl-500gd +TARGET_DEVICES += asus_wl-500gd -define Device/asus-wl-500gp-v1 +define Device/asus_wl-500gp-v1 DEVICE_MODEL := WL-500gP DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := "WL500gp " endef -TARGET_DEVICES += asus-wl-500gp-v1 +TARGET_DEVICES += asus_wl-500gp-v1 -define Device/asus-wl-500gp-v2 +define Device/asus_wl-500gp-v2 DEVICE_MODEL := WL-500gP DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := "WL500gpv2 " endef -TARGET_DEVICES += asus-wl-500gp-v2 +TARGET_DEVICES += asus_wl-500gp-v2 -define Device/asus-wl-500w +define Device/asus_wl-500w DEVICE_MODEL := WL-500W DEVICE_PACKAGES := kmod-b43 kmod-usb-uhci kmod-usb2-pci $(Device/asus) PRODUCTID := "WL500W " endef -TARGET_DEVICES += asus-wl-500w +TARGET_DEVICES += asus_wl-500w -define Device/asus-wl-520gu +define Device/asus_wl-520gu DEVICE_MODEL := WL-520gU DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := "WL520gu " endef -TARGET_DEVICES += asus-wl-520gu +TARGET_DEVICES += asus_wl-520gu -define Device/asus-wl-550ge +define Device/asus_wl-550ge DEVICE_MODEL := WL-550gE DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := "WL550gE " endef -TARGET_DEVICES += asus-wl-550ge +TARGET_DEVICES += asus_wl-550ge -define Device/asus-wl-hdd25 +define Device/asus_wl-hdd25 DEVICE_MODEL := WL-HDD25 DEVICE_PACKAGES := kmod-b43 kmod-b43legacy $(USB1_PACKAGES) $(Device/asus) PRODUCTID := "WLHDD " endef -TARGET_DEVICES += asus-wl-hdd25 +TARGET_DEVICES += asus_wl-hdd25 -define Device/dlink-dwl-3150 +define Device/dlink_dwl-3150 DEVICE_VENDOR := D-Link DEVICE_MODEL := DWL-3150 IMAGES := bin IMAGE/bin := append-rootfs | trx-with-loader | tailed-bin BIN_TAIL := BCM-5352-2050-0000000-01 endef -TARGET_DEVICES += dlink-dwl-3150 +TARGET_DEVICES += dlink_dwl-3150 -define Device/edimax-ps1208-mfg +define Device/edimax_ps1208-mfg DEVICE_VENDOR := Edimax DEVICE_MODEL := PS-1208MFg DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) IMAGES := bin IMAGE/bin := append-rootfs | trx-with-loader | edimax-bin endef -TARGET_DEVICES += edimax-ps1208-mfg +TARGET_DEVICES += edimax_ps1208-mfg -define Device/huawei-e970 +define Device/huawei_e970 DEVICE_VENDOR := Huawei DEVICE_MODEL := E970 DEVICE_PACKAGES := kmod-b43 @@ -110,26 +110,26 @@ define Device/huawei-e970 IMAGES := bin IMAGE/bin := append-rootfs | trx-without-loader | huawei-bin endef -TARGET_DEVICES += huawei-e970 +TARGET_DEVICES += huawei_e970 -define Device/linksys-wrt54g3g +define Device/linksys_wrt54g3g DEVICE_MODEL := WRT54G3G DEVICE_PACKAGES := kmod-b43 $(Device/linksys) DEVICE_ID := W54F VERSION := 2.20.1 endef -TARGET_DEVICES += linksys-wrt54g3g +TARGET_DEVICES += linksys_wrt54g3g -define Device/linksys-wrt54g3g-em +define Device/linksys_wrt54g3g-em DEVICE_MODEL := WRT54G3G-EM $(Device/linksys) DEVICE_ID := W3GN VERSION := 2.20.1 endef -TARGET_DEVICES += linksys-wrt54g3g-em +TARGET_DEVICES += linksys_wrt54g3g-em -define Device/linksys-wrt54g3gv2-vf +define Device/linksys_wrt54g3gv2-vf DEVICE_VENDOR := Linksys DEVICE_MODEL := WRT54G3GV2-VF DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -141,18 +141,18 @@ define Device/linksys-wrt54g3gv2-vf VERSION := 3.00.24 SERIAL := 6 endef -TARGET_DEVICES += linksys-wrt54g3gv2-vf +TARGET_DEVICES += linksys_wrt54g3gv2-vf -define Device/linksys-wrt54g +define Device/linksys_wrt54g DEVICE_MODEL := WRT54G DEVICE_PACKAGES := kmod-b43 kmod-b43legacy $(Device/linksys) DEVICE_ID := W54G VERSION := 4.71.1 endef -TARGET_DEVICES += linksys-wrt54g +TARGET_DEVICES += linksys_wrt54g -define Device/linksys-wrt54gs +define Device/linksys_wrt54gs DEVICE_MODEL := WRT54GS DEVICE_VARIANT := v1/v2/v3 DEVICE_ALT0_VENDOR := Linksys @@ -164,9 +164,9 @@ define Device/linksys-wrt54gs DEVICE_ID := W54S VERSION := 4.80.1 endef -TARGET_DEVICES += linksys-wrt54gs +TARGET_DEVICES += linksys_wrt54gs -define Device/linksys-wrt54gs-v4 +define Device/linksys_wrt54gs-v4 DEVICE_MODEL := WRT54GS DEVICE_VARIANT := v4 DEVICE_PACKAGES := kmod-b43 @@ -174,9 +174,9 @@ define Device/linksys-wrt54gs-v4 DEVICE_ID := W54s VERSION := 1.09.1 endef -TARGET_DEVICES += linksys-wrt54gs-v4 +TARGET_DEVICES += linksys_wrt54gs-v4 -define Device/linksys-wrtsl54gs +define Device/linksys_wrtsl54gs DEVICE_MODEL := WRTSL54GS DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/linksys) @@ -184,18 +184,18 @@ define Device/linksys-wrtsl54gs DEVICE_ID := W54U VERSION := 2.08.1 endef -TARGET_DEVICES += linksys-wrtsl54gs +TARGET_DEVICES += linksys_wrtsl54gs -define Device/linksys-wrt150n +define Device/linksys_wrt150n DEVICE_MODEL := WRT150N DEVICE_PACKAGES := kmod-b43 $(Device/linksys) DEVICE_ID := N150 VERSION := 1.51.3 endef -TARGET_DEVICES += linksys-wrt150n +TARGET_DEVICES += linksys_wrt150n -define Device/linksys-wrt160n-v1 +define Device/linksys_wrt160n-v1 DEVICE_MODEL := WRT160N DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -203,9 +203,9 @@ define Device/linksys-wrt160n-v1 DEVICE_ID := N150 VERSION := 1.50.1 endef -TARGET_DEVICES += linksys-wrt160n-v1 +TARGET_DEVICES += linksys_wrt160n-v1 -define Device/linksys-wrt300n-v1 +define Device/linksys_wrt300n-v1 DEVICE_MODEL := WRT300N DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -214,33 +214,33 @@ define Device/linksys-wrt300n-v1 DEVICE_ID := EWCB VERSION := 1.03.6 endef -TARGET_DEVICES += linksys-wrt300n-v1 +TARGET_DEVICES += linksys_wrt300n-v1 -define Device/motorola-wa840g +define Device/motorola_wa840g DEVICE_MODEL := WA840G DEVICE_PACKAGES := kmod-b43 kmod-b43legacy $(Device/motorola) MOTOROLA_DEVICE := 2 endef -TARGET_DEVICES += motorola-wa840g +TARGET_DEVICES += motorola_wa840g -define Device/motorola-we800g +define Device/motorola_we800g DEVICE_MODEL := WE800G DEVICE_PACKAGES := kmod-b43 kmod-b43legacy $(Device/motorola) MOTOROLA_DEVICE := 3 endef -TARGET_DEVICES += motorola-we800g +TARGET_DEVICES += motorola_we800g -define Device/motorola-wr850g +define Device/motorola_wr850g DEVICE_MODEL := WR850G DEVICE_PACKAGES := kmod-b43 kmod-b43legacy $(Device/motorola) MOTOROLA_DEVICE := 1 endef -TARGET_DEVICES += motorola-wr850g +TARGET_DEVICES += motorola_wr850g -define Device/netgear-wgr614-v8 +define Device/netgear_wgr614-v8 DEVICE_MODEL := WGR614 DEVICE_VARIANT := v8 DEVICE_PACKAGES := kmod-b43 @@ -248,9 +248,9 @@ define Device/netgear-wgr614-v8 NETGEAR_BOARD_ID := U12H072T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wgr614-v8 +TARGET_DEVICES += netgear_wgr614-v8 -define Device/netgear-wgt634u +define Device/netgear_wgt634u DEVICE_VENDOR := NETGEAR DEVICE_MODEL := WGT634U DEVICE_PACKAGES := kmod-ath5k $(USB2_PACKAGES) @@ -258,9 +258,9 @@ define Device/netgear-wgt634u IMAGES := bin IMAGE/bin := append-rootfs | trx-with-loader | prepend-with-elf endef -TARGET_DEVICES += netgear-wgt634u +TARGET_DEVICES += netgear_wgt634u -define Device/netgear-wndr3300-v1 +define Device/netgear_wndr3300-v1 DEVICE_MODEL := WNDR3300 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -268,9 +268,9 @@ define Device/netgear-wndr3300-v1 NETGEAR_BOARD_ID := U12H093T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wndr3300-v1 +TARGET_DEVICES += netgear_wndr3300-v1 -define Device/netgear-wnr834b-v2 +define Device/netgear_wnr834b-v2 DEVICE_MODEL := WNR834B DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 @@ -278,15 +278,15 @@ define Device/netgear-wnr834b-v2 NETGEAR_BOARD_ID := U12H081T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr834b-v2 +TARGET_DEVICES += netgear_wnr834b-v2 -define Device/usrobotics-usr5461 +define Device/usrobotics_usr5461 DEVICE_VENDOR := US Robotics DEVICE_MODEL := USR5461 DEVICE_PACKAGES := kmod-b43 $(USB1_PACKAGES) IMAGES := bin IMAGE/bin := append-rootfs | trx-with-loader | usrobotics-bin endef -TARGET_DEVICES += usrobotics-usr5461 +TARGET_DEVICES += usrobotics_usr5461 TARGET_DEVICES += standard standard-noloader-gz diff --git a/target/linux/bcm47xx/image/mips74k.mk b/target/linux/bcm47xx/image/mips74k.mk index 3f4fe5005..53e7b53eb 100644 --- a/target/linux/bcm47xx/image/mips74k.mk +++ b/target/linux/bcm47xx/image/mips74k.mk @@ -2,164 +2,166 @@ # Subtarget mips74k ################################################# -define Device/asus-rt-ac53u +define Device/asus_rt-ac53u DEVICE_MODEL := RT-AC53U DEVICE_PACKAGES := $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-AC53U endef -TARGET_DEVICES += asus-rt-ac53u +TARGET_DEVICES += asus_rt-ac53u -define Device/asus-rt-ac66u +define Device/asus_rt-ac66u DEVICE_MODEL := RT-AC66U DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-AC66U + DEFAULT := n endef -# TARGET_DEVICES += asus-rt-ac66u +TARGET_DEVICES += asus_rt-ac66u -define Device/asus-rt-n10 +define Device/asus_rt-n10 DEVICE_MODEL := RT-N10 DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := "RT-N10 " endef -TARGET_DEVICES += asus-rt-n10 +TARGET_DEVICES += asus_rt-n10 -define Device/asus-rt-n10p +define Device/asus_rt-n10p DEVICE_MODEL := RT-N10P DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := RT-N10P endef -TARGET_DEVICES += asus-rt-n10p +TARGET_DEVICES += asus_rt-n10p -define Device/asus-rt-n10p-v2 +define Device/asus_rt-n10p-v2 DEVICE_MODEL := RT-N10P DEVICE_VARIANT := v2 $(Device/asus) PRODUCTID := RT-N10PV2 endef -TARGET_DEVICES += asus-rt-n10p-v2 +TARGET_DEVICES += asus_rt-n10p-v2 -define Device/asus-rt-n10u +define Device/asus_rt-n10u DEVICE_MODEL := RT-N10U DEVICE_VARIANT := A DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N10U endef -TARGET_DEVICES += asus-rt-n10u +TARGET_DEVICES += asus_rt-n10u -define Device/asus-rt-n10u-b +define Device/asus_rt-n10u-b DEVICE_MODEL := RT-N10U DEVICE_VARIANT := B DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N10U endef -TARGET_DEVICES += asus-rt-n10u-b +TARGET_DEVICES += asus_rt-n10u-b -define Device/asus-rt-n12 +define Device/asus_rt-n12 DEVICE_MODEL := RT-N12 DEVICE_VARIANT := A1 DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := "RT-N12 " endef -TARGET_DEVICES += asus-rt-n12 +TARGET_DEVICES += asus_rt-n12 -define Device/asus-rt-n12-b1 +define Device/asus_rt-n12-b1 DEVICE_MODEL := RT-N12 DEVICE_VARIANT := B1 $(Device/asus) PRODUCTID := RT-N12B1 endef -TARGET_DEVICES += asus-rt-n12-b1 +TARGET_DEVICES += asus_rt-n12-b1 -define Device/asus-rt-n12-c1 +define Device/asus_rt-n12-c1 DEVICE_MODEL := RT-N12 DEVICE_VARIANT := C1 $(Device/asus) PRODUCTID := RT-N12C1 endef -TARGET_DEVICES += asus-rt-n12-c1 +TARGET_DEVICES += asus_rt-n12-c1 -define Device/asus-rt-n12-d1 +define Device/asus_rt-n12-d1 DEVICE_MODEL := RT-N12 DEVICE_VARIANT := D1 $(Device/asus) PRODUCTID := RT-N12D1 endef -TARGET_DEVICES += asus-rt-n12-d1 +TARGET_DEVICES += asus_rt-n12-d1 -define Device/asus-rt-n12hp +define Device/asus_rt-n12hp DEVICE_MODEL := RT-N12HP $(Device/asus) PRODUCTID := RT-N12HP endef -TARGET_DEVICES += asus-rt-n12hp +TARGET_DEVICES += asus_rt-n12hp -define Device/asus-rt-n14uhp +define Device/asus_rt-n14uhp DEVICE_MODEL := RT-N14UHP DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N14UHP endef -TARGET_DEVICES += asus-rt-n14uhp +TARGET_DEVICES += asus_rt-n14uhp -define Device/asus-rt-n15u +define Device/asus_rt-n15u DEVICE_MODEL := RT-N15U DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N15U endef -TARGET_DEVICES += asus-rt-n15u +TARGET_DEVICES += asus_rt-n15u -define Device/asus-rt-n16 +define Device/asus_rt-n16 DEVICE_MODEL := RT-N16 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N16 endef -TARGET_DEVICES += asus-rt-n16 +TARGET_DEVICES += asus_rt-n16 -define Device/asus-rt-n53 +define Device/asus_rt-n53 DEVICE_MODEL := RT-N53 DEVICE_PACKAGES := kmod-b43 $(Device/asus) PRODUCTID := RT-N53 endef -TARGET_DEVICES += asus-rt-n53 +TARGET_DEVICES += asus_rt-n53 -define Device/asus-rt-n66u +define Device/asus_rt-n66u DEVICE_MODEL := RT-N66U DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N66U endef -TARGET_DEVICES += asus-rt-n66u +TARGET_DEVICES += asus_rt-n66u -define Device/asus-rt-n66w +define Device/asus_rt-n66w DEVICE_MODEL := RT-N66W DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/asus) PRODUCTID := RT-N66U endef -TARGET_DEVICES += asus-rt-n66w +TARGET_DEVICES += asus_rt-n66w -define Device/linksys-wrt160n-v3 +define Device/linksys_wrt160n-v3 DEVICE_MODEL := WRT160N DEVICE_VARIANT := v3 DEVICE_PACKAGES := kmod-b43 $(Device/linksys) DEVICE_ID := N150 VERSION := 3.0.3 + DEFAULT := n endef -TARGET_DEVICES += linksys-wrt160n-v3 +TARGET_DEVICES += linksys_wrt160n-v3 -define Device/linksys-wrt310n-v2 +define Device/linksys_wrt310n-v2 DEVICE_MODEL := WRT310N DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 @@ -167,9 +169,9 @@ define Device/linksys-wrt310n-v2 DEVICE_ID := 310N VERSION := 2.0.1 endef -TARGET_DEVICES += linksys-wrt310n-v2 +TARGET_DEVICES += linksys_wrt310n-v2 -define Device/linksys-wrt320n-v1 +define Device/linksys_wrt320n-v1 DEVICE_MODEL := WRT320N DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -177,18 +179,18 @@ define Device/linksys-wrt320n-v1 DEVICE_ID := 320N VERSION := 1.0.5 endef -TARGET_DEVICES += linksys-wrt320n-v1 +TARGET_DEVICES += linksys_wrt320n-v1 -define Device/linksys-e900-v1 +define Device/linksys_e900-v1 DEVICE_MODEL := E900 DEVICE_VARIANT := v1 $(Device/linksys) DEVICE_ID := E900 VERSION := 1.0.4 endef -TARGET_DEVICES += linksys-e900-v1 +TARGET_DEVICES += linksys_e900-v1 -define Device/linksys-e1000 +define Device/linksys_e1000 DEVICE_MODEL := E1000 DEVICE_VARIANT := v1/v2/v2.1 DEVICE_PACKAGES := kmod-b43 @@ -196,36 +198,36 @@ define Device/linksys-e1000 DEVICE_ID := E100 VERSION := 1.1.3 endef -TARGET_DEVICES += linksys-e1000 +TARGET_DEVICES += linksys_e1000 -define Device/linksys-e1200-v1 +define Device/linksys_e1200-v1 DEVICE_MODEL := E1200 DEVICE_VARIANT := v1 $(Device/linksys) DEVICE_ID := E120 VERSION := 1.0.3 endef -TARGET_DEVICES += linksys-e1200-v1 +TARGET_DEVICES += linksys_e1200-v1 -define Device/linksys-e1200-v2 +define Device/linksys_e1200-v2 DEVICE_MODEL := E1200 DEVICE_VARIANT := v2 $(Device/linksys) DEVICE_ID := E122 VERSION := 1.0.4 endef -TARGET_DEVICES += linksys-e1200-v2 +TARGET_DEVICES += linksys_e1200-v2 -define Device/linksys-e1500-v1 +define Device/linksys_e1500-v1 DEVICE_MODEL := E1500 DEVICE_VARIANT := v1 $(Device/linksys) DEVICE_ID := E150 VERSION := 1.0.5 endef -TARGET_DEVICES += linksys-e1500-v1 +TARGET_DEVICES += linksys_e1500-v1 -define Device/linksys-e1550-v1 +define Device/linksys_e1550-v1 DEVICE_MODEL := E1550 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -233,9 +235,9 @@ define Device/linksys-e1550-v1 DEVICE_ID := 1550 VERSION := 1.0.3 endef -TARGET_DEVICES += linksys-e1550-v1 +TARGET_DEVICES += linksys_e1550-v1 -define Device/linksys-e2000-v1 +define Device/linksys_e2000-v1 DEVICE_MODEL := E2000 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -243,9 +245,9 @@ define Device/linksys-e2000-v1 DEVICE_ID := 32XN VERSION := 1.0.4 endef -TARGET_DEVICES += linksys-e2000-v1 +TARGET_DEVICES += linksys_e2000-v1 -define Device/linksys-e2500-v1 +define Device/linksys_e2500-v1 DEVICE_MODEL := E2500 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -253,9 +255,9 @@ define Device/linksys-e2500-v1 DEVICE_ID := E25X VERSION := 1.0.7 endef -TARGET_DEVICES += linksys-e2500-v1 +TARGET_DEVICES += linksys_e2500-v1 -define Device/linksys-e2500-v2 +define Device/linksys_e2500-v2 DEVICE_MODEL := E2500 DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 @@ -263,9 +265,9 @@ define Device/linksys-e2500-v2 DEVICE_ID := E25X VERSION := 2.0.0 endef -TARGET_DEVICES += linksys-e2500-v2 +TARGET_DEVICES += linksys_e2500-v2 -define Device/linksys-e2500-v2.1 +define Device/linksys_e2500-v2.1 DEVICE_MODEL := E2500 DEVICE_VARIANT := v2.1 DEVICE_PACKAGES := kmod-b43 @@ -273,9 +275,9 @@ define Device/linksys-e2500-v2.1 DEVICE_ID := 25RU VERSION := 2.1.0 endef -TARGET_DEVICES += linksys-e2500-v2.1 +TARGET_DEVICES += linksys_e2500-v2.1 -define Device/linksys-e2500-v3 +define Device/linksys_e2500-v3 DEVICE_MODEL := E2500 DEVICE_VARIANT := v3 DEVICE_PACKAGES := kmod-b43 @@ -283,9 +285,9 @@ define Device/linksys-e2500-v3 DEVICE_ID := 25V3 VERSION := 3.0.0 endef -TARGET_DEVICES += linksys-e2500-v3 +TARGET_DEVICES += linksys_e2500-v3 -define Device/linksys-e3200-v1 +define Device/linksys_e3200-v1 DEVICE_MODEL := E3200 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -293,9 +295,9 @@ define Device/linksys-e3200-v1 DEVICE_ID := 3200 VERSION := 1.0.1 endef -TARGET_DEVICES += linksys-e3200-v1 +TARGET_DEVICES += linksys_e3200-v1 -define Device/linksys-e4200-v1 +define Device/linksys_e4200-v1 DEVICE_MODEL := E4200 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -303,9 +305,9 @@ define Device/linksys-e4200-v1 DEVICE_ID := 4200 VERSION := 1.0.5 endef -TARGET_DEVICES += linksys-e4200-v1 +TARGET_DEVICES += linksys_e4200-v1 -define Device/netgear-r6200-v1 +define Device/netgear_r6200-v1 DEVICE_MODEL := R6200 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -313,27 +315,27 @@ define Device/netgear-r6200-v1 NETGEAR_BOARD_ID := U12H192T00_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-r6200-v1 +TARGET_DEVICES += netgear_r6200-v1 -define Device/netgear-wgr614-v10-na +define Device/netgear_wgr614-v10-na DEVICE_MODEL := WGR614 DEVICE_VARIANT := v10 (NA) $(Device/netgear) NETGEAR_BOARD_ID := U12H139T01_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wgr614-v10-na +TARGET_DEVICES += netgear_wgr614-v10-na -define Device/netgear-wgr614-v10 +define Device/netgear_wgr614-v10 DEVICE_MODEL := WGR614 DEVICE_VARIANT := v10 $(Device/netgear) NETGEAR_BOARD_ID := U12H139T01_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wgr614-v10 +TARGET_DEVICES += netgear_wgr614-v10 -define Device/netgear-wn2500rp-v1 +define Device/netgear_wn2500rp-v1 DEVICE_MODEL := WN2500RP DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 @@ -341,17 +343,17 @@ define Device/netgear-wn2500rp-v1 NETGEAR_BOARD_ID := U12H197T00_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wn2500rp-v1 +TARGET_DEVICES += netgear_wn2500rp-v1 -define Device/netgear-wn3000rp +define Device/netgear_wn3000rp DEVICE_MODEL := WN3000RP $(Device/netgear) NETGEAR_BOARD_ID := U12H163T01_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wn3000rp +TARGET_DEVICES += netgear_wn3000rp -define Device/netgear-wndr3400-v1 +define Device/netgear_wndr3400-v1 DEVICE_MODEL := WNDR3400 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -359,9 +361,9 @@ define Device/netgear-wndr3400-v1 NETGEAR_BOARD_ID := U12H155T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wndr3400-v1 +TARGET_DEVICES += netgear_wndr3400-v1 -define Device/netgear-wndr3400-v2 +define Device/netgear_wndr3400-v2 DEVICE_MODEL := WNDR3400 DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -369,9 +371,9 @@ define Device/netgear-wndr3400-v2 NETGEAR_BOARD_ID := U12H187T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wndr3400-v2 +TARGET_DEVICES += netgear_wndr3400-v2 -define Device/netgear-wndr3400-v3 +define Device/netgear_wndr3400-v3 DEVICE_MODEL := WNDR3400 DEVICE_VARIANT := v3 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -379,9 +381,9 @@ define Device/netgear-wndr3400-v3 NETGEAR_BOARD_ID := U12H208T00_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wndr3400-v3 +TARGET_DEVICES += netgear_wndr3400-v3 -define Device/netgear-wndr3700-v3 +define Device/netgear_wndr3700-v3 DEVICE_MODEL := WNDR3700 DEVICE_VARIANT := v3 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -389,19 +391,20 @@ define Device/netgear-wndr3700-v3 NETGEAR_BOARD_ID := U12H194T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wndr3700-v3 +TARGET_DEVICES += netgear_wndr3700-v3 -define Device/netgear-wndr3400-vcna +define Device/netgear_wndr3400-vcna DEVICE_MODEL := WNDR3400 DEVICE_VARIANT := vcna DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H155T01_NETGEAR NETGEAR_REGION := 2 + DEFAULT := n endef -# TARGET_DEVICES += netgear-wndr3400-vcna +TARGET_DEVICES += netgear_wndr3400-vcna -define Device/netgear-wndr4000 +define Device/netgear_wndr4000 DEVICE_MODEL := WNDR4000 DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -409,18 +412,18 @@ define Device/netgear-wndr4000 NETGEAR_BOARD_ID := U12H181T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wndr4000 +TARGET_DEVICES += netgear_wndr4000 -define Device/netgear-wnr1000-v3 +define Device/netgear_wnr1000-v3 DEVICE_MODEL := WNR1000 DEVICE_VARIANT := v3 $(Device/netgear) NETGEAR_BOARD_ID := U12H139T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr1000-v3 +TARGET_DEVICES += netgear_wnr1000-v3 -define Device/netgear-wnr2000v2 +define Device/netgear_wnr2000v2 DEVICE_MODEL := WNR2000 DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 @@ -428,9 +431,9 @@ define Device/netgear-wnr2000v2 NETGEAR_BOARD_ID := U12H114T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr2000v2 +TARGET_DEVICES += netgear_wnr2000v2 -define Device/netgear-wnr3500l-v1-na +define Device/netgear_wnr3500l-v1-na DEVICE_MODEL := WNR3500L DEVICE_VARIANT := v1 (NA) DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -438,9 +441,9 @@ define Device/netgear-wnr3500l-v1-na NETGEAR_BOARD_ID := U12H136T99_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr3500l-v1-na +TARGET_DEVICES += netgear_wnr3500l-v1-na -define Device/netgear-wnr3500l-v1 +define Device/netgear_wnr3500l-v1 DEVICE_MODEL := WNR3500L DEVICE_VARIANT := v1 (ROW) DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -448,9 +451,9 @@ define Device/netgear-wnr3500l-v1 NETGEAR_BOARD_ID := U12H136T99_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wnr3500l-v1 +TARGET_DEVICES += netgear_wnr3500l-v1 -define Device/netgear-wnr3500l-v2 +define Device/netgear_wnr3500l-v2 DEVICE_MODEL := WNR3500L DEVICE_VARIANT := v2 DEVICE_PACKAGES := $(USB2_PACKAGES) @@ -458,18 +461,19 @@ define Device/netgear-wnr3500l-v2 NETGEAR_BOARD_ID := U12H172T00_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wnr3500l-v2 +TARGET_DEVICES += netgear_wnr3500l-v2 -define Device/netgear-wnr3500u +define Device/netgear_wnr3500u DEVICE_MODEL := WNR3500U DEVICE_PACKAGES := $(USB2_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H136T00_NETGEAR NETGEAR_REGION := 2 + DEFAULT := n endef -# TARGET_DEVICES += netgear-wnr3500u +TARGET_DEVICES += netgear_wnr3500u -define Device/netgear-wnr3500-v2 +define Device/netgear_wnr3500-v2 DEVICE_MODEL := WNR3500 DEVICE_VARIANT := v2 DEVICE_PACKAGES := kmod-b43 @@ -477,16 +481,17 @@ define Device/netgear-wnr3500-v2 NETGEAR_BOARD_ID := U12H127T00_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr3500-v2 +TARGET_DEVICES += netgear_wnr3500-v2 -define Device/netgear-wnr3500-v2-vc +define Device/netgear_wnr3500-v2-vc DEVICE_MODEL := WNR3500 DEVICE_VARIANT := v2 (VC) DEVICE_PACKAGES := kmod-b43 $(Device/netgear) NETGEAR_BOARD_ID := U12H127T70_NETGEAR NETGEAR_REGION := 2 + DEFAULT := n endef -# TARGET_DEVICES += netgear-wnr3500-v2-vc +TARGET_DEVICES += netgear_wnr3500-v2-vc TARGET_DEVICES += standard standard-noloader-nodictionarylzma diff --git a/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk b/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk index 6a4c5b039..26bbacf3b 100644 --- a/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk +++ b/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-wl NAME:=Broadcom SoC, all Ethernet, BCM43xx WiFi (wl, proprietary) - PACKAGES:=-wpad-mini kmod-brcm-wl-mini wlc nas + PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl-mini wlc nas endef define Profile/Broadcom-wl/Description diff --git a/target/linux/bcm47xx/legacy/target.mk b/target/linux/bcm47xx/legacy/target.mk index fca612855..e3586a8ad 100644 --- a/target/linux/bcm47xx/legacy/target.mk +++ b/target/linux/bcm47xx/legacy/target.mk @@ -1,7 +1,7 @@ FEATURES += low_mem pcmcia small_flash BOARDNAME:=Legacy (BMIPS3300) -DEFAULT_PACKAGES += wpad-mini +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build firmware for Broadcom BCM47xx and BCM53xx devices with diff --git a/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk b/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk index 66b13bf87..8f60c7ee3 100644 --- a/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk +++ b/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-mips74k-wl NAME:=Broadcom SoC, BCM43xx WiFi (proprietary wl) - PACKAGES:=-wpad-basic kmod-brcm-wl wlc nas + PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl wlc nas endef define Profile/Broadcom-mips74k-wl/Description diff --git a/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk b/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk index cc4668de5..66e9a9f0f 100644 --- a/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk +++ b/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk @@ -7,7 +7,7 @@ define Profile/Broadcom-mips74k-none NAME:=Broadcom SoC, No WiFi - PACKAGES:=-wpad-basic + PACKAGES:=-wpad-basic-wolfssl endef define Profile/Broadcom-mips74k-none/Description diff --git a/target/linux/bcm47xx/mips74k/target.mk b/target/linux/bcm47xx/mips74k/target.mk index 1e2e8436d..ee20982e5 100644 --- a/target/linux/bcm47xx/mips74k/target.mk +++ b/target/linux/bcm47xx/mips74k/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=MIPS 74K CPU_TYPE:=74kc -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad-basic-wolfssl define Target/Description Build firmware for Broadcom BCM47xx and BCM53xx devices with diff --git a/target/linux/bcm53xx/patches-5.4/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-5.4/905-BCM53573-minor-hacks.patch index e3806b4e7..3b0a3323a 100644 --- a/target/linux/bcm53xx/patches-5.4/905-BCM53573-minor-hacks.patch +++ b/target/linux/bcm53xx/patches-5.4/905-BCM53573-minor-hacks.patch @@ -61,7 +61,7 @@ Signed-off-by: Rafał Miłecki #include #include #include -@@ -899,6 +900,16 @@ static void arch_timer_of_configure_rate +@@ -910,6 +911,16 @@ static void arch_timer_of_configure_rate if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) arch_timer_rate = rate; diff --git a/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts b/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts index 639cef3a7..365a4552f 100644 --- a/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts +++ b/target/linux/bcm63xx/dts/bcm6328-nucom-r5010un-v2.dts @@ -94,20 +94,20 @@ #address-cells = <1>; #size-cells = <1>; - cfe@0 { + partition@0 { reg = <0x000000 0x010000>; label = "cfe"; read-only; }; - linux@10000 { - reg = <0x010000 0x7e0000>; + partition@10000 { + reg = <0x010000 0xfe0000>; label = "linux"; compatible = "brcm,bcm963xx-imagetag"; }; - nvram@7f0000 { - reg = <0x7f0000 0x010000>; + partition@ff0000 { + reg = <0xff0000 0x010000>; label = "nvram"; }; }; diff --git a/target/linux/bcm63xx/image/Makefile b/target/linux/bcm63xx/image/Makefile index 90d87f7bd..d8e68862b 100644 --- a/target/linux/bcm63xx/image/Makefile +++ b/target/linux/bcm63xx/image/Makefile @@ -311,12 +311,12 @@ define Device/Default endef DEVICE_VARS += CHIP_ID DEVICE_LOADADDR -ATH5K_PACKAGES := kmod-ath5k wpad-basic -ATH9K_PACKAGES := kmod-ath9k wpad-basic -B43_PACKAGES := kmod-b43 wpad-basic +ATH5K_PACKAGES := kmod-ath5k wpad-basic-wolfssl +ATH9K_PACKAGES := kmod-ath9k wpad-basic-wolfssl +B43_PACKAGES := kmod-b43 wpad-basic-wolfssl BRCMWL_PACKAGES := kmod-brcm-wl nas wlc -RT28_PACKAGES := kmod-rt2800-pci wpad-basic -RT61_PACKAGES := kmod-rt61-pci wpad-basic +RT28_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl +RT61_PACKAGES := kmod-rt61-pci wpad-basic-wolfssl USB1_PACKAGES := kmod-usb-ohci kmod-usb-ledtrig-usbport USB2_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport diff --git a/target/linux/bcm63xx/patches-5.4/021-v5.8-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch b/target/linux/bcm63xx/patches-5.4/021-v5.8-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch index 1df241103..78fa1b39e 100644 --- a/target/linux/bcm63xx/patches-5.4/021-v5.8-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch +++ b/target/linux/bcm63xx/patches-5.4/021-v5.8-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch @@ -40,7 +40,7 @@ Link: https://lore.kernel.org/linux-mtd/20200512075733.745374-3-noltari@gmail.co --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -1003,33 +1003,30 @@ static int brcmnand_hamming_ooblayout_fr +@@ -1004,33 +1004,30 @@ static int brcmnand_hamming_ooblayout_fr struct brcmnand_cfg *cfg = &host->hwcfg; int sas = cfg->spare_area_size << cfg->sector_size_1k; int sectors = cfg->page_size / (512 << cfg->sector_size_1k); diff --git a/target/linux/bcm63xx/patches-5.4/022-v5.8-mtd-rawnand-brcmnand-correctly-verify-erased-pages.patch b/target/linux/bcm63xx/patches-5.4/022-v5.8-mtd-rawnand-brcmnand-correctly-verify-erased-pages.patch deleted file mode 100644 index e8a9f1488..000000000 --- a/target/linux/bcm63xx/patches-5.4/022-v5.8-mtd-rawnand-brcmnand-correctly-verify-erased-pages.patch +++ /dev/null @@ -1,63 +0,0 @@ -From dcb351c03f2fa6a599de1061b174167e03ee312b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Tue, 12 May 2020 10:24:51 +0200 -Subject: [PATCH] mtd: rawnand: brcmnand: correctly verify erased pages -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The current code checks that the whole OOB area is erased. -This is a problem when JFFS2 cleanmarkers are added to the OOB, since it will -fail due to the usable OOB bytes not being 0xff. -Correct this by only checking that data and ECC bytes aren't 0xff. - -Fixes: 02b88eea9f9c ("mtd: brcmnand: Add check for erased page bitflips") -Signed-off-by: Álvaro Fernández Rojas -Signed-off-by: Miquel Raynal -Link: https://lore.kernel.org/linux-mtd/20200512082451.771212-1-noltari@gmail.com ---- - drivers/mtd/nand/raw/brcmnand/brcmnand.c | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -1787,28 +1787,31 @@ static int brcmnand_read_by_pio(struct m - static int brcmstb_nand_verify_erased_page(struct mtd_info *mtd, - struct nand_chip *chip, void *buf, u64 addr) - { -- int i, sas; -- void *oob = chip->oob_poi; -+ struct mtd_oob_region ecc; -+ int i; - int bitflips = 0; - int page = addr >> chip->page_shift; - int ret; -+ void *ecc_bytes; - void *ecc_chunk; - - if (!buf) - buf = nand_get_data_buf(chip); - -- sas = mtd->oobsize / chip->ecc.steps; -- - /* read without ecc for verification */ - ret = chip->ecc.read_page_raw(chip, buf, true, page); - if (ret) - return ret; - -- for (i = 0; i < chip->ecc.steps; i++, oob += sas) { -+ for (i = 0; i < chip->ecc.steps; i++) { - ecc_chunk = buf + chip->ecc.size * i; -- ret = nand_check_erased_ecc_chunk(ecc_chunk, -- chip->ecc.size, -- oob, sas, NULL, 0, -+ -+ mtd_ooblayout_ecc(mtd, i, &ecc); -+ ecc_bytes = chip->oob_poi + ecc.offset; -+ -+ ret = nand_check_erased_ecc_chunk(ecc_chunk, chip->ecc.size, -+ ecc_bytes, ecc.length, -+ NULL, 0, - chip->ecc.strength); - if (ret < 0) - return ret; diff --git a/target/linux/bcm63xx/patches-5.4/024-v5.8-mtd-rawnand-brcmnand-fix-CS0-layout.patch b/target/linux/bcm63xx/patches-5.4/024-v5.8-mtd-rawnand-brcmnand-fix-CS0-layout.patch deleted file mode 100644 index 0eeefe12d..000000000 --- a/target/linux/bcm63xx/patches-5.4/024-v5.8-mtd-rawnand-brcmnand-fix-CS0-layout.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 3d3fb3c5be9ce07fa85d8f67fb3922e4613b955b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= -Date: Fri, 22 May 2020 14:15:21 +0200 -Subject: [PATCH] mtd: rawnand: brcmnand: fix CS0 layout -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Only v3.3-v5.0 have a different CS0 layout. -Controllers before v3.3 use the same layout for every CS. - -Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") -Signed-off-by: Álvaro Fernández Rojas -Acked-by: Florian Fainelli -Signed-off-by: Miquel Raynal -Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-3-noltari@gmail.com ---- - drivers/mtd/nand/raw/brcmnand/brcmnand.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -537,8 +537,9 @@ static int brcmnand_revision_init(struct - } else { - ctrl->cs_offsets = brcmnand_cs_offsets; - -- /* v5.0 and earlier has a different CS0 offset layout */ -- if (ctrl->nand_version <= 0x0500) -+ /* v3.3-5.0 have a different CS0 offset layout */ -+ if (ctrl->nand_version >= 0x0303 && -+ ctrl->nand_version <= 0x0500) - ctrl->cs0_offsets = brcmnand_cs_offsets_cs0; - } - diff --git a/target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch b/target/linux/bcm63xx/patches-5.4/030-v5.9-leds-bcm6328-support-second-hw-blinking-interval.patch similarity index 53% rename from target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch rename to target/linux/bcm63xx/patches-5.4/030-v5.9-leds-bcm6328-support-second-hw-blinking-interval.patch index 6ed26f274..9bf6b0fc8 100644 --- a/target/linux/bcm63xx/patches-5.4/120-leds-bcm6328-support-second-hw-blinking-interval.patch +++ b/target/linux/bcm63xx/patches-5.4/030-v5.9-leds-bcm6328-support-second-hw-blinking-interval.patch @@ -1,37 +1,66 @@ +From e190f57df3c7e7713687905c14e72fbcbd81c5e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Thu, 4 Jun 2020 15:59:05 +0200 +Subject: [PATCH] leds-bcm6328: support second hw blinking interval +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Right now the driver uses only 3 LED modes: +0: On +1: HW Blinking (Interval 1) +3: Off + +However, the controller supports a second HW blinking interval, which results +in 4 possible LED modes: +0: On +1: HW Blinking (Interval 1) +2: HW Blinking (Interval 2) +3: Off + +Signed-off-by: Álvaro Fernández Rojas +Signed-off-by: Pavel Machek +--- + drivers/leds/leds-bcm6328.c | 97 ++++++++++++++++++++++++++++--------- + 1 file changed, 75 insertions(+), 22 deletions(-) + --- a/drivers/leds/leds-bcm6328.c +++ b/drivers/leds/leds-bcm6328.c -@@ -24,12 +24,16 @@ +@@ -24,12 +24,17 @@ #define BCM6328_LED_MAX_COUNT 24 #define BCM6328_LED_DEF_DELAY 500 -+#define BCM6328_LED_INTERVAL_NUM 2 - #define BCM6328_LED_INTERVAL_MS 20 +-#define BCM6328_LED_INTERVAL_MS 20 - #define BCM6328_LED_INTV_MASK 0x3f +-#define BCM6328_LED_INTV_MASK 0x3f -#define BCM6328_LED_FAST_INTV_SHIFT 6 -#define BCM6328_LED_FAST_INTV_MASK (BCM6328_LED_INTV_MASK << \ - BCM6328_LED_FAST_INTV_SHIFT) -+#define BCM6328_LED_INTV1_SHIFT 0 -+#define BCM6328_LED_INTV1_MASK (BCM6328_LED_INTV_MASK << \ -+ BCM6328_LED_INTV1_SHIFT) -+#define BCM6328_LED_INTV2_SHIFT 6 -+#define BCM6328_LED_INTV2_MASK (BCM6328_LED_INTV_MASK << \ -+ BCM6328_LED_INTV2_SHIFT) ++#define BCM6328_LED_BLINK_DELAYS 2 ++#define BCM6328_LED_BLINK_MS 20 ++ ++#define BCM6328_LED_BLINK_MASK 0x3f ++#define BCM6328_LED_BLINK1_SHIFT 0 ++#define BCM6328_LED_BLINK1_MASK (BCM6328_LED_BLINK_MASK << \ ++ BCM6328_LED_BLINK1_SHIFT) ++#define BCM6328_LED_BLINK2_SHIFT 6 ++#define BCM6328_LED_BLINK2_MASK (BCM6328_LED_BLINK_MASK << \ ++ BCM6328_LED_BLINK2_SHIFT) #define BCM6328_SERIAL_LED_EN BIT(12) #define BCM6328_SERIAL_LED_MUX BIT(13) #define BCM6328_SERIAL_LED_CLK_NPOL BIT(14) -@@ -45,8 +49,8 @@ +@@ -45,8 +50,8 @@ #define BCM6328_LED_MODE_MASK 3 #define BCM6328_LED_MODE_ON 0 -#define BCM6328_LED_MODE_FAST 1 -#define BCM6328_LED_MODE_BLINK 2 -+#define BCM6328_LED_MODE_INTV1 1 -+#define BCM6328_LED_MODE_INTV2 2 ++#define BCM6328_LED_MODE_BLINK1 1 ++#define BCM6328_LED_MODE_BLINK2 2 #define BCM6328_LED_MODE_OFF 3 #define BCM6328_LED_SHIFT(X) ((X) << 1) -@@ -127,12 +131,18 @@ static void bcm6328_led_set(struct led_c +@@ -127,12 +132,18 @@ static void bcm6328_led_set(struct led_c unsigned long flags; spin_lock_irqsave(led->lock, flags); @@ -51,7 +80,28 @@ spin_unlock_irqrestore(led->lock, flags); } -@@ -176,20 +186,59 @@ static int bcm6328_blink_set(struct led_ +@@ -140,8 +151,8 @@ static unsigned long bcm6328_blink_delay + { + unsigned long bcm6328_delay; + +- bcm6328_delay = delay + BCM6328_LED_INTERVAL_MS / 2; +- bcm6328_delay = bcm6328_delay / BCM6328_LED_INTERVAL_MS; ++ bcm6328_delay = delay + BCM6328_LED_BLINK_MS / 2; ++ bcm6328_delay = bcm6328_delay / BCM6328_LED_BLINK_MS; + if (bcm6328_delay == 0) + bcm6328_delay = 1; + +@@ -168,28 +179,68 @@ static int bcm6328_blink_set(struct led_ + return -EINVAL; + } + +- if (delay > BCM6328_LED_INTV_MASK) { ++ if (delay > BCM6328_LED_BLINK_MASK) { + dev_dbg(led_cdev->dev, + "fallback to soft blinking (delay > %ums)\n", +- BCM6328_LED_INTV_MASK * BCM6328_LED_INTERVAL_MS); ++ BCM6328_LED_BLINK_MASK * BCM6328_LED_BLINK_MS); + return -EINVAL; } spin_lock_irqsave(led->lock, flags); @@ -62,75 +112,76 @@ + * Check if any of the two configurable HW blinking intervals is + * available: + * 1. No LEDs assigned to the HW blinking interval. -+ * 2. LEDs with the same delay assigned. ++ * 2. Only this LED is assigned to the HW blinking interval. ++ * 3. LEDs with the same delay assigned. + */ + if (led->blink_leds[0] == 0 || + led->blink_leds[0] == BIT(led->pin) || + led->blink_delay[0] == delay) { -+ unsigned long val; -+ + unsigned long val; + +- *(led->blink_leds) |= BIT(led->pin); +- *(led->blink_delay) = delay; + /* Add LED to the first HW blinking interval cache */ + led->blink_leds[0] |= BIT(led->pin); + + /* Remove LED from the second HW blinking interval cache */ + led->blink_leds[1] &= ~BIT(led->pin); -+ -+ /* Cache the LED in the first HW blinking interval delay */ + ++ /* Cache first HW blinking interval delay */ + led->blink_delay[0] = delay; + + /* Update the delay for the first HW blinking interval */ -+ val = bcm6328_led_read(led->mem + BCM6328_REG_INIT); -+ val &= ~BCM6328_LED_INTV1_MASK; -+ val |= (delay << BCM6328_LED_INTV1_SHIFT); -+ bcm6328_led_write(led->mem + BCM6328_REG_INIT, val); -+ + val = bcm6328_led_read(led->mem + BCM6328_REG_INIT); +- val &= ~BCM6328_LED_FAST_INTV_MASK; +- val |= (delay << BCM6328_LED_FAST_INTV_SHIFT); ++ val &= ~BCM6328_LED_BLINK1_MASK; ++ val |= (delay << BCM6328_LED_BLINK1_SHIFT); + bcm6328_led_write(led->mem + BCM6328_REG_INIT, val); + +- bcm6328_led_mode(led, BCM6328_LED_MODE_BLINK); + /* Set the LED to first HW blinking interval */ -+ bcm6328_led_mode(led, BCM6328_LED_MODE_INTV1); ++ bcm6328_led_mode(led, BCM6328_LED_MODE_BLINK1); + + rc = 0; + } else if (led->blink_leds[1] == 0 || + led->blink_leds[1] == BIT(led->pin) || + led->blink_delay[1] == delay) { - unsigned long val; - -- *(led->blink_leds) |= BIT(led->pin); -- *(led->blink_delay) = delay; ++ unsigned long val; ++ + /* Remove LED from the first HW blinking interval */ + led->blink_leds[0] &= ~BIT(led->pin); + + /* Add LED to the second HW blinking interval */ + led->blink_leds[1] |= BIT(led->pin); - -+ /* Cache the LED in the first HW blinking interval delay */ ++ ++ /* Cache second HW blinking interval delay */ + led->blink_delay[1] = delay; + + /* Update the delay for the second HW blinking interval */ - val = bcm6328_led_read(led->mem + BCM6328_REG_INIT); -- val &= ~BCM6328_LED_FAST_INTV_MASK; -- val |= (delay << BCM6328_LED_FAST_INTV_SHIFT); -+ val &= ~BCM6328_LED_INTV2_MASK; -+ val |= (delay << BCM6328_LED_INTV2_SHIFT); - bcm6328_led_write(led->mem + BCM6328_REG_INIT, val); - -- bcm6328_led_mode(led, BCM6328_LED_MODE_BLINK); ++ val = bcm6328_led_read(led->mem + BCM6328_REG_INIT); ++ val &= ~BCM6328_LED_BLINK2_MASK; ++ val |= (delay << BCM6328_LED_BLINK2_SHIFT); ++ bcm6328_led_write(led->mem + BCM6328_REG_INIT, val); ++ + /* Set the LED to second HW blinking interval */ -+ bcm6328_led_mode(led, BCM6328_LED_MODE_INTV2); ++ bcm6328_led_mode(led, BCM6328_LED_MODE_BLINK2); + rc = 0; } else { dev_dbg(led_cdev->dev, -@@ -363,11 +412,13 @@ static int bcm6328_leds_probe(struct pla +@@ -363,11 +414,13 @@ static int bcm6328_leds_probe(struct pla if (!lock) return -ENOMEM; - blink_leds = devm_kzalloc(dev, sizeof(*blink_leds), GFP_KERNEL); -+ blink_leds = devm_kcalloc(dev, BCM6328_LED_INTERVAL_NUM, ++ blink_leds = devm_kcalloc(dev, BCM6328_LED_BLINK_DELAYS, + sizeof(*blink_leds), GFP_KERNEL); if (!blink_leds) return -ENOMEM; - blink_delay = devm_kzalloc(dev, sizeof(*blink_delay), GFP_KERNEL); -+ blink_delay = devm_kcalloc(dev, BCM6328_LED_INTERVAL_NUM, ++ blink_delay = devm_kcalloc(dev, BCM6328_LED_BLINK_DELAYS, + sizeof(*blink_delay), GFP_KERNEL); if (!blink_delay) return -ENOMEM; diff --git a/target/linux/bcm63xx/patches-5.4/031-v5.9-MIPS-BCM63xx-add-endif-comments.patch b/target/linux/bcm63xx/patches-5.4/031-v5.9-MIPS-BCM63xx-add-endif-comments.patch new file mode 100644 index 000000000..bb56363e3 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/031-v5.9-MIPS-BCM63xx-add-endif-comments.patch @@ -0,0 +1,155 @@ +From c425423a075718eac625c78351fa5907d4f3a9de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Mon, 8 Jun 2020 12:18:28 +0200 +Subject: [PATCH] MIPS: BCM63xx: add endif comments +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are plenty of ifdefs in board_bcm963xx.c without endif comments. +Let's make the code easier to follow by adding proper comments. + +Signed-off-by: Álvaro Fernández Rojas +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/bcm63xx/boards/board_bcm963xx.c | 33 +++++++++++------------ + 1 file changed, 15 insertions(+), 18 deletions(-) + +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -67,7 +67,7 @@ static struct board_info __initdata boar + .ephy_reset_gpio = 36, + .ephy_reset_gpio_flags = GPIOF_INIT_HIGH, + }; +-#endif ++#endif /* CONFIG_BCM63XX_CPU_3368 */ + + /* + * known 6328 boards +@@ -115,7 +115,7 @@ static struct board_info __initdata boar + }, + }, + }; +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6328 */ + + /* + * known 6338 boards +@@ -204,7 +204,7 @@ static struct board_info __initdata boar + }, + }, + }; +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6338 */ + + /* + * known 6345 boards +@@ -216,7 +216,7 @@ static struct board_info __initdata boar + + .has_uart0 = 1, + }; +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6345 */ + + /* + * known 6348 boards +@@ -464,7 +464,6 @@ static struct board_info __initdata boar + }, + }; + +- + static struct board_info __initdata board_DV201AMR = { + .name = "DV201AMR", + .expected_cpu_id = 0x6348, +@@ -505,7 +504,7 @@ static struct board_info __initdata boar + + .has_ohci0 = 1, + }; +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6348 */ + + /* + * known 6358 boards +@@ -530,7 +529,6 @@ static struct board_info __initdata boar + .force_duplex_full = 1, + }, + +- + .has_ohci0 = 1, + .has_pccard = 1, + .has_ehci0 = 1, +@@ -654,7 +652,7 @@ static struct board_info __initdata boar + + .has_ohci0 = 1, + }; +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6358 */ + + /* + * all boards +@@ -662,17 +660,17 @@ static struct board_info __initdata boar + static const struct board_info __initconst *bcm963xx_boards[] = { + #ifdef CONFIG_BCM63XX_CPU_3368 + &board_cvg834g, +-#endif ++#endif /* CONFIG_BCM63XX_CPU_3368 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6328 */ + #ifdef CONFIG_BCM63XX_CPU_6338 + &board_96338gw, + &board_96338w, +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6338 */ + #ifdef CONFIG_BCM63XX_CPU_6345 + &board_96345gw2, +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6345 */ + #ifdef CONFIG_BCM63XX_CPU_6348 + &board_96348r, + &board_96348gw, +@@ -682,14 +680,13 @@ static const struct board_info __initcon + &board_DV201AMR, + &board_96348gw_a, + &board_rta1025w_16, +-#endif +- ++#endif /* CONFIG_BCM63XX_CPU_6348 */ + #ifdef CONFIG_BCM63XX_CPU_6358 + &board_96358vw, + &board_96358vw2, + &board_AGPFS0, + &board_DWVS0, +-#endif ++#endif /* CONFIG_BCM63XX_CPU_6358 */ + }; + + /* +@@ -728,7 +725,7 @@ int bcm63xx_get_fallback_sprom(struct ss + return -EINVAL; + } + } +-#endif ++#endif /* CONFIG_SSB_PCIHOST */ + + /* + * return board name for /proc/cpuinfo +@@ -807,7 +804,7 @@ void __init board_prom_init(void) + if (BCMCPU_IS_6348()) + val |= GPIO_MODE_6348_G2_PCI; + } +-#endif ++#endif /* CONFIG_PCI */ + + if (board.has_pccard) { + if (BCMCPU_IS_6348()) +@@ -892,7 +889,7 @@ int __init board_register_devices(void) + &bcm63xx_get_fallback_sprom) < 0) + pr_err("failed to register fallback SPROM\n"); + } +-#endif ++#endif /* CONFIG_SSB_PCIHOST */ + + bcm63xx_spi_register(); + diff --git a/target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch b/target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch new file mode 100644 index 000000000..1daa3e614 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/032-v5.9-MIPS-BCM63xx-improve-CFE-version-detection.patch @@ -0,0 +1,56 @@ +From e27e1cc9d360a347dbd5a398e9df21cfb4e60e3c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Mon, 8 Jun 2020 11:28:35 +0200 +Subject: [PATCH] MIPS: BCM63xx: improve CFE version detection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are some CFE variants that start with 'cfe-vd' instead of 'cfe-v', such +as the one used in the Huawei HG556a: "cfe-vd081.5003". In this case, the CFE +version is stored as is (string vs number bytes). + +Some newer devices have an additional version number, such as the Comtrend +VR-3032u: "1.0.38-112.118-11". + +Finally, print the string as is if the version doesn't start with "cfe-v" or +"cfe-vd", but starts with "cfe-". + +Signed-off-by: Álvaro Fernández Rojas +Signed-off-by: Thomas Bogendoerfer +--- + arch/mips/bcm63xx/boards/board_bcm963xx.c | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -760,11 +760,25 @@ void __init board_prom_init(void) + + /* dump cfe version */ + cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET; +- if (!memcmp(cfe, "cfe-v", 5)) +- snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", +- cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); +- else ++ if (strstarts(cfe, "cfe-")) { ++ if(cfe[4] == 'v') { ++ if(cfe[5] == 'd') ++ snprintf(cfe_version, 11, "%s", ++ (char *) &cfe[5]); ++ else if (cfe[10] > 0) ++ snprintf(cfe_version, sizeof(cfe_version), ++ "%u.%u.%u-%u.%u-%u", cfe[5], cfe[6], ++ cfe[7], cfe[8], cfe[9], cfe[10]); ++ else ++ snprintf(cfe_version, sizeof(cfe_version), ++ "%u.%u.%u-%u.%u", cfe[5], cfe[6], ++ cfe[7], cfe[8], cfe[9]); ++ } else { ++ snprintf(cfe_version, 12, "%s", (char *) &cfe[4]); ++ } ++ } else { + strcpy(cfe_version, "unknown"); ++ } + pr_info("CFE version: %s\n", cfe_version); + + bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET); diff --git a/target/linux/bcm63xx/patches-5.4/033-v5.9-mtd-parsers-bcm63xx-simplify-CFE-detection.patch b/target/linux/bcm63xx/patches-5.4/033-v5.9-mtd-parsers-bcm63xx-simplify-CFE-detection.patch new file mode 100644 index 000000000..ff1f30cb9 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/033-v5.9-mtd-parsers-bcm63xx-simplify-CFE-detection.patch @@ -0,0 +1,78 @@ +From 91e81150d38842b58133ce1a5d70c88e8f1cf7c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= +Date: Mon, 15 Jun 2020 11:17:40 +0200 +Subject: [PATCH] mtd: parsers: bcm63xx: simplify CFE detection +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Instead of trying to parse CFE version string, which is customized by some +vendors, let's just check that "CFE1" was passed on argument 3. + +Signed-off-by: Álvaro Fernández Rojas +Signed-off-by: Jonas Gorski +Reviewed-by: Florian Fainelli +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20200615091740.2958303-1-noltari@gmail.com +--- + drivers/mtd/parsers/bcm63xxpart.c | 32 ++++++++++++------------------- + 1 file changed, 12 insertions(+), 20 deletions(-) + +--- a/drivers/mtd/parsers/bcm63xxpart.c ++++ b/drivers/mtd/parsers/bcm63xxpart.c +@@ -22,6 +22,11 @@ + #include + #include + ++#ifdef CONFIG_MIPS ++#include ++#include ++#endif /* CONFIG_MIPS */ ++ + #define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */ + + #define BCM963XX_CFE_MAGIC_OFFSET 0x4e0 +@@ -32,28 +37,15 @@ + #define STR_NULL_TERMINATE(x) \ + do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0) + +-static int bcm63xx_detect_cfe(struct mtd_info *master) ++static inline int bcm63xx_detect_cfe(void) + { +- char buf[9]; +- int ret; +- size_t retlen; +- +- ret = mtd_read(master, BCM963XX_CFE_VERSION_OFFSET, 5, &retlen, +- (void *)buf); +- buf[retlen] = 0; +- +- if (ret) +- return ret; +- +- if (strncmp("cfe-v", buf, 5) == 0) +- return 0; ++ int ret = 0; + +- /* very old CFE's do not have the cfe-v string, so check for magic */ +- ret = mtd_read(master, BCM963XX_CFE_MAGIC_OFFSET, 8, &retlen, +- (void *)buf); +- buf[retlen] = 0; ++#ifdef CONFIG_MIPS ++ ret = (fw_arg3 == CFE_EPTSEAL); ++#endif /* CONFIG_MIPS */ + +- return strncmp("CFE1CFE1", buf, 8); ++ return ret; + } + + static int bcm63xx_read_nvram(struct mtd_info *master, +@@ -138,7 +130,7 @@ static int bcm63xx_parse_cfe_partitions( + struct bcm963xx_nvram *nvram = NULL; + int ret; + +- if (bcm63xx_detect_cfe(master)) ++ if (!bcm63xx_detect_cfe()) + return -EINVAL; + + nvram = vzalloc(sizeof(*nvram)); diff --git a/target/linux/bcm63xx/patches-5.4/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch b/target/linux/bcm63xx/patches-5.4/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch index 6fc555188..b2fbb68ee 100644 --- a/target/linux/bcm63xx/patches-5.4/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch +++ b/target/linux/bcm63xx/patches-5.4/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch @@ -24,7 +24,7 @@ Signed-off-by: Florian Fainelli #include #include -@@ -881,6 +882,9 @@ int __init board_register_devices(void) +@@ -892,6 +893,9 @@ int __init board_register_devices(void) if (board.has_usbd) bcm63xx_usbd_register(&board.usbd); diff --git a/target/linux/bcm63xx/patches-5.4/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch b/target/linux/bcm63xx/patches-5.4/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch index 3db82bb48..feb99a1cd 100644 --- a/target/linux/bcm63xx/patches-5.4/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch +++ b/target/linux/bcm63xx/patches-5.4/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch @@ -24,7 +24,7 @@ Signed-off-by: Florian Fainelli #include #include #include -@@ -882,6 +883,9 @@ int __init board_register_devices(void) +@@ -893,6 +894,9 @@ int __init board_register_devices(void) if (board.has_usbd) bcm63xx_usbd_register(&board.usbd); diff --git a/target/linux/bcm63xx/patches-5.4/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch b/target/linux/bcm63xx/patches-5.4/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch index 652eb6c9b..a53274a4b 100644 --- a/target/linux/bcm63xx/patches-5.4/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch +++ b/target/linux/bcm63xx/patches-5.4/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch @@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski /* * known 3368 boards */ -@@ -695,52 +683,6 @@ static const struct board_info __initcon +@@ -692,52 +680,6 @@ static const struct board_info __initcon }; /* @@ -100,7 +100,7 @@ Signed-off-by: Jonas Gorski - return -EINVAL; - } -} --#endif +-#endif /* CONFIG_SSB_PCIHOST */ - -/* - * return board name for /proc/cpuinfo @@ -114,7 +114,7 @@ Signed-off-by: Jonas Gorski * early init callback, read nvram data from flash and checksum it */ void __init board_prom_init(void) -@@ -785,137 +727,15 @@ void __init board_prom_init(void) +@@ -796,137 +738,15 @@ void __init board_prom_init(void) if (strncmp(board_name, bcm963xx_boards[i]->name, 16)) continue; /* copy, board desc array is marked initdata */ @@ -144,8 +144,8 @@ Signed-off-by: Jonas Gorski - bcm63xx_pci_enabled = 1; - if (BCMCPU_IS_6348()) - val |= GPIO_MODE_6348_G2_PCI; - } --#endif +- } +-#endif /* CONFIG_PCI */ - - if (board.has_pccard) { - if (BCMCPU_IS_6348()) @@ -235,8 +235,8 @@ Signed-off-by: Jonas Gorski - if (ssb_arch_register_fallback_sprom( - &bcm63xx_get_fallback_sprom) < 0) - pr_err("failed to register fallback SPROM\n"); -- } --#endif + } +-#endif /* CONFIG_SSB_PCIHOST */ - - bcm63xx_spi_register(); - diff --git a/target/linux/bcm63xx/patches-5.4/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch b/target/linux/bcm63xx/patches-5.4/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch index 7f9479b82..3cf3afd49 100644 --- a/target/linux/bcm63xx/patches-5.4/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch +++ b/target/linux/bcm63xx/patches-5.4/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch @@ -17,7 +17,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -727,7 +727,8 @@ void __init board_prom_init(void) +@@ -738,7 +738,8 @@ void __init board_prom_init(void) if (strncmp(board_name, bcm963xx_boards[i]->name, 16)) continue; /* copy, board desc array is marked initdata */ diff --git a/target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch b/target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch deleted file mode 100644 index fe6c6d290..000000000 --- a/target/linux/bcm63xx/patches-5.4/309-cfe_version_mod.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -707,10 +707,20 @@ void __init board_prom_init(void) - - /* dump cfe version */ - cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET; -- if (!memcmp(cfe, "cfe-v", 5)) -- snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", -- cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); -- else -+ if (strstarts(cfe, "cfe-")) { -+ if(cfe[4] == 'v') { -+ if(cfe[5] == 'd') -+ snprintf(cfe_version, 11, "%s", (char *) &cfe[5]); -+ else if (cfe[10] > 0) -+ snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u-%u", -+ cfe[5], cfe[6], cfe[7], cfe[8], cfe[9], cfe[10]); -+ else -+ snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", -+ cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); -+ } else { -+ snprintf(cfe_version, 12, "%s", (char *) &cfe[4]); -+ } -+ } else - strcpy(cfe_version, "unknown"); - pr_info("CFE version: %s\n", cfe_version); - diff --git a/target/linux/bcm63xx/patches-5.4/310-cfe_simplify_detection.patch b/target/linux/bcm63xx/patches-5.4/310-cfe_simplify_detection.patch deleted file mode 100644 index 0e4e759ab..000000000 --- a/target/linux/bcm63xx/patches-5.4/310-cfe_simplify_detection.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h -+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_board.h -@@ -2,6 +2,8 @@ - #ifndef BCM63XX_BOARD_H_ - #define BCM63XX_BOARD_H_ - -+#include -+ - const char *board_get_name(void); - - void board_prom_init(void); -@@ -10,4 +12,8 @@ void board_setup(void); - - int board_register_devices(void); - -+static inline bool bcm63xx_is_cfe_present(void) { -+ return fw_arg3 == 0x43464531; -+} -+ - #endif /* ! BCM63XX_BOARD_H_ */ diff --git a/target/linux/bcm63xx/patches-5.4/311-bcm63xxpart_use_cfedetection.patch b/target/linux/bcm63xx/patches-5.4/311-bcm63xxpart_use_cfedetection.patch deleted file mode 100644 index 19ed994b8..000000000 --- a/target/linux/bcm63xx/patches-5.4/311-bcm63xxpart_use_cfedetection.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- a/drivers/mtd/parsers/bcm63xxpart.c -+++ b/drivers/mtd/parsers/bcm63xxpart.c -@@ -21,6 +21,8 @@ - #include - #include - #include -+ -+#include - - #define BCM963XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */ - -@@ -32,30 +34,6 @@ - #define STR_NULL_TERMINATE(x) \ - do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0) - --static int bcm63xx_detect_cfe(struct mtd_info *master) --{ -- char buf[9]; -- int ret; -- size_t retlen; -- -- ret = mtd_read(master, BCM963XX_CFE_VERSION_OFFSET, 5, &retlen, -- (void *)buf); -- buf[retlen] = 0; -- -- if (ret) -- return ret; -- -- if (strncmp("cfe-v", buf, 5) == 0) -- return 0; -- -- /* very old CFE's do not have the cfe-v string, so check for magic */ -- ret = mtd_read(master, BCM963XX_CFE_MAGIC_OFFSET, 8, &retlen, -- (void *)buf); -- buf[retlen] = 0; -- -- return strncmp("CFE1CFE1", buf, 8); --} -- - static int bcm63xx_read_nvram(struct mtd_info *master, - struct bcm963xx_nvram *nvram) - { -@@ -138,7 +116,7 @@ static int bcm63xx_parse_cfe_partitions( - struct bcm963xx_nvram *nvram = NULL; - int ret; - -- if (bcm63xx_detect_cfe(master)) -+ if (!bcm63xx_is_cfe_present()) - return -EINVAL; - - nvram = vzalloc(sizeof(*nvram)); diff --git a/target/linux/bcm63xx/patches-5.4/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch b/target/linux/bcm63xx/patches-5.4/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch index ec978a031..8f50dd689 100644 --- a/target/linux/bcm63xx/patches-5.4/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch +++ b/target/linux/bcm63xx/patches-5.4/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch @@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -290,6 +290,9 @@ config BCM63XX +@@ -291,6 +291,9 @@ config BCM63XX select SYNC_R4K select DMA_NONCOHERENT select IRQ_MIPS_CPU diff --git a/target/linux/bcm63xx/patches-5.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch b/target/linux/bcm63xx/patches-5.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch index aba4b9415..b1831026d 100644 --- a/target/linux/bcm63xx/patches-5.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch +++ b/target/linux/bcm63xx/patches-5.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch @@ -35,7 +35,7 @@ Signed-off-by: Jonas Gorski source "arch/mips/bcm63xx/boards/Kconfig" --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -697,7 +697,7 @@ void __init board_prom_init(void) +@@ -694,7 +694,7 @@ void __init board_prom_init(void) /* read base address of boot chip select (0) * 6328/6362 do not have MPI but boot from a fixed address */ diff --git a/target/linux/bcm63xx/patches-5.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch b/target/linux/bcm63xx/patches-5.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch index a022f8c5f..c297321b6 100644 --- a/target/linux/bcm63xx/patches-5.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch +++ b/target/linux/bcm63xx/patches-5.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch @@ -35,7 +35,7 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 select SYS_HAS_CPU_BMIPS4350 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -697,7 +697,7 @@ void __init board_prom_init(void) +@@ -694,7 +694,7 @@ void __init board_prom_init(void) /* read base address of boot chip select (0) * 6328/6362 do not have MPI but boot from a fixed address */ diff --git a/target/linux/bcm63xx/patches-5.4/351-set-board-usbh-ports.patch b/target/linux/bcm63xx/patches-5.4/351-set-board-usbh-ports.patch index 531adc9f1..2543ad792 100644 --- a/target/linux/bcm63xx/patches-5.4/351-set-board-usbh-ports.patch +++ b/target/linux/bcm63xx/patches-5.4/351-set-board-usbh-ports.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -576,6 +576,7 @@ static struct board_info __initdata boar +@@ -574,6 +574,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, diff --git a/target/linux/bcm63xx/patches-5.4/354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch b/target/linux/bcm63xx/patches-5.4/354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch index 51908d99d..6301f73bc 100644 --- a/target/linux/bcm63xx/patches-5.4/354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch +++ b/target/linux/bcm63xx/patches-5.4/354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch @@ -35,7 +35,7 @@ Signed-off-by: Jonas Gorski +endmenu --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -686,7 +686,7 @@ static const struct board_info __initcon +@@ -683,7 +683,7 @@ static const struct board_info __initcon /* * early init callback, read nvram data from flash and checksum it */ diff --git a/target/linux/bcm63xx/patches-5.4/358-MIPS-BCM63XX-make-fallback-sprom-optional.patch b/target/linux/bcm63xx/patches-5.4/358-MIPS-BCM63XX-make-fallback-sprom-optional.patch index f540eabef..170578f8b 100644 --- a/target/linux/bcm63xx/patches-5.4/358-MIPS-BCM63XX-make-fallback-sprom-optional.patch +++ b/target/linux/bcm63xx/patches-5.4/358-MIPS-BCM63XX-make-fallback-sprom-optional.patch @@ -74,7 +74,7 @@ Signed-off-by: Jonas Gorski .enet0 = { .has_phy = 1, -@@ -461,6 +468,7 @@ static struct board_info __initdata boar +@@ -460,6 +467,7 @@ static struct board_info __initdata boar .has_uart0 = 1, .has_pci = 1, @@ -82,7 +82,7 @@ Signed-off-by: Jonas Gorski .has_ohci0 = 1, .has_enet0 = 1, -@@ -483,6 +491,7 @@ static struct board_info __initdata boar +@@ -482,6 +490,7 @@ static struct board_info __initdata boar .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, @@ -90,7 +90,7 @@ Signed-off-by: Jonas Gorski .enet0 = { .has_phy = 1, -@@ -509,6 +518,7 @@ static struct board_info __initdata boar +@@ -508,6 +517,7 @@ static struct board_info __initdata boar .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, @@ -98,7 +98,7 @@ Signed-off-by: Jonas Gorski .enet0 = { .has_phy = 1, -@@ -561,6 +571,7 @@ static struct board_info __initdata boar +@@ -559,6 +569,7 @@ static struct board_info __initdata boar .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, @@ -106,7 +106,7 @@ Signed-off-by: Jonas Gorski .enet0 = { .has_phy = 1, -@@ -632,6 +643,7 @@ static struct board_info __initdata boar +@@ -630,6 +641,7 @@ static struct board_info __initdata boar .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, diff --git a/target/linux/bcm63xx/patches-5.4/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch b/target/linux/bcm63xx/patches-5.4/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch index 7069c231d..ba7346ce2 100644 --- a/target/linux/bcm63xx/patches-5.4/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch +++ b/target/linux/bcm63xx/patches-5.4/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch @@ -16,8 +16,8 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -695,6 +695,10 @@ static const struct board_info __initcon - #endif +@@ -692,6 +692,10 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6358 */ }; +static struct of_device_id const bcm963xx_boards_dt[] = { @@ -27,7 +27,7 @@ Signed-off-by: Jonas Gorski /* * early init callback, read nvram data from flash and checksum it */ -@@ -706,6 +710,7 @@ void __init board_bcm963xx_init(void) +@@ -703,6 +707,7 @@ void __init board_bcm963xx_init(void) char *board_name = NULL; u32 val; struct bcm_hcs *hcs; @@ -35,7 +35,7 @@ Signed-off-by: Jonas Gorski /* read base address of boot chip select (0) * 6328/6362 do not have MPI but boot from a fixed address -@@ -745,6 +750,16 @@ void __init board_bcm963xx_init(void) +@@ -746,6 +751,16 @@ void __init board_bcm963xx_init(void) } else { board_name = bcm63xx_nvram_get_name(); } diff --git a/target/linux/bcm63xx/patches-5.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch b/target/linux/bcm63xx/patches-5.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch index c061ec4e6..890f326bf 100644 --- a/target/linux/bcm63xx/patches-5.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch +++ b/target/linux/bcm63xx/patches-5.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch @@ -22,7 +22,7 @@ Signed-off-by: Jonas Gorski - .ephy_reset_gpio_flags = GPIOF_INIT_HIGH, + .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; - #endif + #endif /* CONFIG_BCM63XX_CPU_3368 */ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c diff --git a/target/linux/bcm63xx/patches-5.4/391-MIPS-BCM63XX-do-not-register-uart.patch b/target/linux/bcm63xx/patches-5.4/391-MIPS-BCM63XX-do-not-register-uart.patch index e9d4481d1..bab5bbee6 100644 --- a/target/linux/bcm63xx/patches-5.4/391-MIPS-BCM63XX-do-not-register-uart.patch +++ b/target/linux/bcm63xx/patches-5.4/391-MIPS-BCM63XX-do-not-register-uart.patch @@ -175,7 +175,7 @@ - - .has_uart0 = 1, }; - #endif + #endif /* CONFIG_BCM63XX_CPU_6345 */ @@ -217,7 +209,6 @@ static struct board_info __initdata boar .name = "96348R", @@ -217,7 +217,7 @@ .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, -@@ -466,7 +453,6 @@ static struct board_info __initdata boar +@@ -465,7 +452,6 @@ static struct board_info __initdata boar .name = "DV201AMR", .expected_cpu_id = 0x6348, @@ -225,7 +225,7 @@ .has_pci = 1, .use_fallback_sprom = 1, .has_ohci0 = 1, -@@ -487,7 +473,6 @@ static struct board_info __initdata boar +@@ -486,7 +472,6 @@ static struct board_info __initdata boar .name = "96348GW-A", .expected_cpu_id = 0x6348, @@ -233,7 +233,7 @@ .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, -@@ -514,7 +499,6 @@ static struct board_info __initdata boar +@@ -513,7 +498,6 @@ static struct board_info __initdata boar .name = "96358VW", .expected_cpu_id = 0x6358, @@ -241,7 +241,7 @@ .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, -@@ -567,7 +551,6 @@ static struct board_info __initdata boar +@@ -565,7 +549,6 @@ static struct board_info __initdata boar .name = "96358VW2", .expected_cpu_id = 0x6358, @@ -249,7 +249,7 @@ .has_enet0 = 1, .has_enet1 = 1, .has_pci = 1, -@@ -617,7 +600,6 @@ static struct board_info __initdata boar +@@ -615,7 +598,6 @@ static struct board_info __initdata boar .name = "AGPF-S0", .expected_cpu_id = 0x6358, diff --git a/target/linux/bcm63xx/patches-5.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch b/target/linux/bcm63xx/patches-5.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch index e1394267b..8aaf093df 100644 --- a/target/linux/bcm63xx/patches-5.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch +++ b/target/linux/bcm63xx/patches-5.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch @@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, - }, }; - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ @@ -119,35 +82,6 @@ static struct board_info __initdata boar }, @@ -130,7 +130,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, - }, }; - #endif + #endif /* CONFIG_BCM63XX_CPU_6338 */ @@ -217,36 +122,6 @@ static struct board_info __initdata boar .has_phy = 1, @@ -277,7 +277,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_FAST2404 = { -@@ -518,33 +306,6 @@ static struct board_info __initdata boar +@@ -516,33 +304,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -311,7 +311,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96358vw2 = { -@@ -571,29 +332,6 @@ static struct board_info __initdata boar +@@ -569,29 +330,6 @@ static struct board_info __initdata boar .has_pccard = 1, .has_ehci0 = 1, .num_usbh_ports = 2, diff --git a/target/linux/bcm63xx/patches-5.4/427-boards_probe_switch.patch b/target/linux/bcm63xx/patches-5.4/427-boards_probe_switch.patch index 4b206a259..0c00ff0da 100644 --- a/target/linux/bcm63xx/patches-5.4/427-boards_probe_switch.patch +++ b/target/linux/bcm63xx/patches-5.4/427-boards_probe_switch.patch @@ -63,7 +63,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -252,6 +266,8 @@ static struct board_info __initdata boar +@@ -251,6 +265,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -72,7 +72,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -271,6 +287,8 @@ static struct board_info __initdata boar +@@ -270,6 +286,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -81,7 +81,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -298,6 +316,8 @@ static struct board_info __initdata boar +@@ -297,6 +315,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -90,7 +90,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -323,6 +343,8 @@ static struct board_info __initdata boar +@@ -321,6 +341,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -99,7 +99,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -348,6 +370,8 @@ static struct board_info __initdata boar +@@ -346,6 +368,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -108,7 +108,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -371,6 +395,8 @@ static struct board_info __initdata boar +@@ -369,6 +393,8 @@ static struct board_info __initdata boar }, .enet1 = { diff --git a/target/linux/bcm63xx/patches-5.4/499-allow_better_context_for_board_patches.patch b/target/linux/bcm63xx/patches-5.4/499-allow_better_context_for_board_patches.patch deleted file mode 100644 index dd63183a0..000000000 --- a/target/linux/bcm63xx/patches-5.4/499-allow_better_context_for_board_patches.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -46,7 +46,7 @@ static struct board_info __initdata boar - .ephy_reset_gpio = 36, - .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, - }; --#endif -+#endif /* CONFIG_BCM63XX_CPU_3368 */ - - /* - * known 6328 boards -@@ -65,7 +65,7 @@ static struct board_info __initdata boar - .port_no = 0, - }, - }; --#endif -+#endif /* CONFIG_BCM63XX_CPU_6328 */ - - /* - * known 6338 boards -@@ -98,7 +98,7 @@ static struct board_info __initdata boar - .force_duplex_full = 1, - }, - }; --#endif -+#endif /* CONFIG_BCM63XX_CPU_6338 */ - - /* - * known 6345 boards -@@ -108,7 +108,7 @@ static struct board_info __initdata boar - .name = "96345GW2", - .expected_cpu_id = 0x6345, - }; --#endif -+#endif /* CONFIG_BCM63XX_CPU_6345 */ - - /* - * known 6348 boards -@@ -295,7 +295,7 @@ static struct board_info __initdata boar - - .has_ohci0 = 1, - }; --#endif -+#endif /* CONFIG_BCM63XX_CPU_6348 */ - - /* - * known 6358 boards -@@ -403,7 +403,7 @@ static struct board_info __initdata boar - - .has_ohci0 = 1, - }; --#endif -+#endif /* CONFIG_BCM63XX_CPU_6358 */ - - /* - * all boards diff --git a/target/linux/bcm63xx/patches-5.4/369-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch b/target/linux/bcm63xx/patches-5.4/500-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch similarity index 83% rename from target/linux/bcm63xx/patches-5.4/369-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch rename to target/linux/bcm63xx/patches-5.4/500-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch index 5dd4cbaee..62f872dd3 100644 --- a/target/linux/bcm63xx/patches-5.4/369-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch +++ b/target/linux/bcm63xx/patches-5.4/500-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch @@ -14,24 +14,26 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -696,6 +696,48 @@ static const struct board_info __initcon +@@ -439,6 +439,52 @@ static const struct board_info __initcon }; static struct of_device_id const bcm963xx_boards_dt[] = { +#ifdef CONFIG_OF +#ifdef CONFIG_BCM63XX_CPU_3368 + { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_3368 */ ++#ifdef CONFIG_BCM63XX_CPU_6318 ++#endif /* CONFIG_BCM63XX_CPU_6318 */ +#ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6328 */ +#ifdef CONFIG_BCM63XX_CPU_6338 + { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, + { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6338 */ +#ifdef CONFIG_BCM63XX_CPU_6345 + { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6345 */ +#ifdef CONFIG_BCM63XX_CPU_6348 + { .compatible = "belkin,f5d7633", .data = &board_96348gw_10, }, + { .compatible = "brcm,bcm96348r", .data = &board_96348r, }, @@ -44,7 +46,7 @@ Signed-off-by: Jonas Gorski + { .compatible = "sagem,fast-2404", .data = &board_FAST2404, }, + { .compatible = "tp-link,td-w8900gb", .data = &board_96348gw_11, }, + { .compatible = "usrobotics,usr9108", .data = &board_96348gw_a, }, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6348 */ +#ifdef CONFIG_BCM63XX_CPU_6358 + { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, + { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, @@ -54,11 +56,13 @@ Signed-off-by: Jonas Gorski + { .compatible = "pirelli,a226m", .data = &board_DWVS0, }, + { .compatible = "pirelli,a226m-fwb", .data = &board_DWVS0, }, + { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6358 */ ++#ifdef CONFIG_BCM63XX_CPU_6362 ++#endif /* CONFIG_BCM63XX_CPU_6362 */ +#ifdef CONFIG_BCM63XX_CPU_6368 -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6368 */ +#ifdef CONFIG_BCM63XX_CPU_63268 -+#endif ++#endif /* CONFIG_BCM63XX_CPU_63268 */ +#endif /* CONFIG_OF */ { }, }; diff --git a/target/linux/bcm63xx/patches-5.4/501-board_bcm6318-brcm-bcm96318ref.patch b/target/linux/bcm63xx/patches-5.4/501-board_bcm6318-brcm-bcm96318ref.patch new file mode 100644 index 000000000..0313285ea --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/501-board_bcm6318-brcm-bcm96318ref.patch @@ -0,0 +1,74 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -49,6 +49,53 @@ static struct board_info __initdata boar + #endif /* CONFIG_BCM63XX_CPU_3368 */ + + /* ++ * known 6318 boards ++ */ ++#ifdef CONFIG_BCM63XX_CPU_6318 ++static struct board_info __initdata board_96318ref = { ++ .name = "96318REF", ++ .expected_cpu_id = 0x6318, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_usbd = 1, ++ .usbd = { ++ .use_fullspeed = 0, ++ .port_no = 0, ++ }, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++}; ++#endif /* CONFIG_BCM63XX_CPU_6318 */ ++ ++/* + * known 6328 boards + */ + #ifdef CONFIG_BCM63XX_CPU_6328 +@@ -410,6 +457,9 @@ static const struct board_info __initcon + #ifdef CONFIG_BCM63XX_CPU_3368 + &board_cvg834g, + #endif /* CONFIG_BCM63XX_CPU_3368 */ ++#ifdef CONFIG_BCM63XX_CPU_6318 ++ &board_96318ref, ++#endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, + #endif /* CONFIG_BCM63XX_CPU_6328 */ +@@ -444,6 +494,7 @@ static struct of_device_id const bcm963x + { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, + #endif /* CONFIG_BCM63XX_CPU_3368 */ + #ifdef CONFIG_BCM63XX_CPU_6318 ++ { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/bcm63xx/patches-5.4/502-board_bcm6318-brcm-bcm96318ref-p300.patch b/target/linux/bcm63xx/patches-5.4/502-board_bcm6318-brcm-bcm96318ref-p300.patch new file mode 100644 index 000000000..1796d066a --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/502-board_bcm6318-brcm-bcm96318ref-p300.patch @@ -0,0 +1,67 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -93,6 +93,48 @@ static struct board_info __initdata boar + }, + }, + }; ++ ++static struct board_info __initdata board_96318ref_p300 = { ++ .name = "96318REF_P300", ++ .expected_cpu_id = 0x6318, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_usbd = 1, ++ .usbd = { ++ .use_fullspeed = 0, ++ .port_no = 0, ++ }, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++}; + #endif /* CONFIG_BCM63XX_CPU_6318 */ + + /* +@@ -459,6 +501,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_3368 */ + #ifdef CONFIG_BCM63XX_CPU_6318 + &board_96318ref, ++ &board_96318ref_p300, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, +@@ -495,6 +538,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_3368 */ + #ifdef CONFIG_BCM63XX_CPU_6318 + { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, ++ { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/bcm63xx/patches-5.4/548-board_dsl-2751b_e1.patch b/target/linux/bcm63xx/patches-5.4/503-board_bcm6318-d-link-dsl-275xb-d.patch similarity index 64% rename from target/linux/bcm63xx/patches-5.4/548-board_dsl-2751b_e1.patch rename to target/linux/bcm63xx/patches-5.4/503-board_bcm6318-d-link-dsl-275xb-d.patch index 7eb52ae86..05022aa27 100644 --- a/target/linux/bcm63xx/patches-5.4/548-board_dsl-2751b_e1.patch +++ b/target/linux/bcm63xx/patches-5.4/503-board_bcm6318-d-link-dsl-275xb-d.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -142,6 +142,74 @@ static struct board_info __initdata boar +@@ -135,6 +135,72 @@ static struct board_info __initdata boar }, }, }; @@ -27,67 +27,65 @@ +}; + +static struct board_info __initdata board_dsl_2751b_d1 = { -+ .name = "AW5200B", -+ .expected_cpu_id = 0x6318, ++ .name = "AW5200B", ++ .expected_cpu_id = 0x6318, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ -+ .has_enetsw = 1, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "Port 1", ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43217, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ .board_fixups = dsl2751b_e1_fixups, -+ .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = dsl2751b_e1_fixups, ++ .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), + }, +}; #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -1999,6 +2067,7 @@ static const struct board_info __initcon +@@ -502,6 +568,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, + &board_dsl_2751b_d1, - #endif + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2092,6 +2161,7 @@ static struct of_device_id const bcm963x +@@ -539,6 +606,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, + { .compatible = "d-link,dsl-275xb-d1", .data = &board_dsl_2751b_d1, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 - { .compatible = "adb,a4001n", .data = &board_A4001N, }, + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/bcm63xx/patches-5.4/504-board_bcm6318-sagem-fast-2704n.patch b/target/linux/bcm63xx/patches-5.4/504-board_bcm6318-sagem-fast-2704n.patch new file mode 100644 index 000000000..2bb1f6024 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/504-board_bcm6318-sagem-fast-2704n.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -201,6 +201,49 @@ static struct board_info __initdata boar + .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), + }, + }; ++ ++static struct board_info __initdata board_FAST2704N = { ++ .name = "F@ST2704N", ++ .expected_cpu_id = 0x6318, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; + #endif /* CONFIG_BCM63XX_CPU_6318 */ + + /* +@@ -569,6 +612,7 @@ static const struct board_info __initcon + &board_96318ref, + &board_96318ref_p300, + &board_dsl_2751b_d1, ++ &board_FAST2704N, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, +@@ -607,6 +651,7 @@ static struct of_device_id const bcm963x + { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, + { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, + { .compatible = "d-link,dsl-275xb-d1", .data = &board_dsl_2751b_d1, }, ++ { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/bcm63xx/patches-5.4/560-board_AR-5315u.patch b/target/linux/bcm63xx/patches-5.4/505-board_bcm6318-comtrend-ar-5315u.patch similarity index 65% rename from target/linux/bcm63xx/patches-5.4/560-board_AR-5315u.patch rename to target/linux/bcm63xx/patches-5.4/505-board_bcm6318-comtrend-ar-5315u.patch index e7fe6f69a..dc480f239 100644 --- a/target/linux/bcm63xx/patches-5.4/560-board_AR-5315u.patch +++ b/target/linux/bcm63xx/patches-5.4/505-board_bcm6318-comtrend-ar-5315u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -143,6 +143,67 @@ static struct board_info __initdata boar +@@ -136,6 +136,65 @@ static struct board_info __initdata boar }, }; @@ -19,68 +19,66 @@ +}; + +static struct board_info __initdata board_AR5315u = { -+ .name = "96318A-1441N1", -+ .expected_cpu_id = 0x6318, ++ .name = "96318A-1441N1", ++ .expected_cpu_id = 0x6318, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ -+ .has_enetsw = 1, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "LAN4", ++ .name = "LAN4", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "LAN3", ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "LAN2", ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN2", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "LAN1", ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43217, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ .board_fixups = ar5315u_fixups, -+ .num_board_fixups = ARRAY_SIZE(ar5315u_fixups), ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ar5315u_fixups, ++ .num_board_fixups = ARRAY_SIZE(ar5315u_fixups), + }, +}; + static struct sprom_fixup __initdata dsl2751b_e1_fixups[] = { { .offset = 96, .value = 0x2046 }, { .offset = 97, .value = 0xfe9d }, -@@ -2548,6 +2609,7 @@ static const struct board_info __initcon +@@ -611,6 +670,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, + &board_AR5315u, &board_dsl_2751b_d1, &board_FAST2704N, - #endif -@@ -2653,6 +2715,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6318 */ +@@ -650,6 +710,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, + { .compatible = "comtrend,ar-5315u", .data = &board_AR5315u, }, { .compatible = "d-link,dsl-275xb-d1", .data = &board_dsl_2751b_d1, }, { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6318 */ diff --git a/target/linux/bcm63xx/patches-5.4/520-MIPS-BCM63XX-add-96328avng-reference-board.patch b/target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-96328avng-reference-board.patch similarity index 69% rename from target/linux/bcm63xx/patches-5.4/520-MIPS-BCM63XX-add-96328avng-reference-board.patch rename to target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-96328avng-reference-board.patch index e482b2093..43ad569e1 100644 --- a/target/linux/bcm63xx/patches-5.4/520-MIPS-BCM63XX-add-96328avng-reference-board.patch +++ b/target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-96328avng-reference-board.patch @@ -9,34 +9,33 @@ Subject: [PATCH] MIPS: BCM63XX: add 96328avng reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -64,6 +64,33 @@ static struct board_info __initdata boar +@@ -321,6 +321,32 @@ static struct board_info __initdata boar .use_fullspeed = 0, .port_no = 0, }, + -+ .has_enetsw = 1, -+ ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "Port 1", ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, diff --git a/target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-963281TAN-reference-board.patch b/target/linux/bcm63xx/patches-5.4/522-MIPS-BCM63XX-add-963281TAN-reference-board.patch similarity index 59% rename from target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-963281TAN-reference-board.patch rename to target/linux/bcm63xx/patches-5.4/522-MIPS-BCM63XX-add-963281TAN-reference-board.patch index 522d99976..a6f4a8433 100644 --- a/target/linux/bcm63xx/patches-5.4/521-MIPS-BCM63XX-add-963281TAN-reference-board.patch +++ b/target/linux/bcm63xx/patches-5.4/522-MIPS-BCM63XX-add-963281TAN-reference-board.patch @@ -9,40 +9,39 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -92,6 +92,40 @@ static struct board_info __initdata boar +@@ -348,6 +348,39 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_963281TAN = { -+ .name = "963281TAN", -+ .expected_cpu_id = 0x6328, ++ .name = "963281TAN", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ -+ .has_enetsw = 1, ++ .has_pci = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "Port 1", ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, @@ -50,19 +49,19 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -918,6 +952,7 @@ static const struct board_info __initcon - #endif +@@ -702,6 +735,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, + &board_963281TAN, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -974,6 +1009,7 @@ static struct of_device_id const bcm963x - { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, - #endif +@@ -741,6 +775,7 @@ static struct of_device_id const bcm963x + { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 + { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 diff --git a/target/linux/bcm63xx/patches-5.4/522-board_dsl_274xb_rev_f.patch b/target/linux/bcm63xx/patches-5.4/523-board_bcm6328-d-link-dsl-274xb-f.patch similarity index 64% rename from target/linux/bcm63xx/patches-5.4/522-board_dsl_274xb_rev_f.patch rename to target/linux/bcm63xx/patches-5.4/523-board_bcm6328-d-link-dsl-274xb-f.patch index b91fff069..97f71e115 100644 --- a/target/linux/bcm63xx/patches-5.4/522-board_dsl_274xb_rev_f.patch +++ b/target/linux/bcm63xx/patches-5.4/523-board_bcm6328-d-link-dsl-274xb-f.patch @@ -10,51 +10,50 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -126,6 +126,51 @@ static struct board_info __initdata boar +@@ -381,6 +381,50 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_dsl_274xb_f1 = { -+ .name = "AW4339U", -+ .expected_cpu_id = 0x6328, ++ .name = "AW4339U", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, ++ .has_pci = 1, + -+ .has_caldata = 1, ++ .has_caldata = 1, + .caldata = { + { -+ .vendor = PCI_VENDOR_ID_ATHEROS, -+ .caldata_offset = 0x7d1000, -+ .slot = 0, -+ .led_pin = -1, -+ .led_active_high = 1, ++ .vendor = PCI_VENDOR_ID_ATHEROS, ++ .caldata_offset = 0x7d1000, ++ .slot = 0, ++ .led_pin = -1, ++ .led_active_high = 1, + }, + }, + -+ .has_enetsw = 1, -+ ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "Port 4", ++ .name = "Port 4", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 3", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 2", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 1", + }, + }, + }, @@ -62,19 +61,19 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -953,6 +998,7 @@ static const struct board_info __initcon +@@ -736,6 +780,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, + &board_dsl_274xb_f1, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1011,6 +1057,7 @@ static struct of_device_id const bcm963x +@@ -777,6 +822,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6328 { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/bcm63xx/patches-5.4/524-board_bcm6328-adb-a4001n1.patch b/target/linux/bcm63xx/patches-5.4/524-board_bcm6328-adb-a4001n1.patch new file mode 100644 index 000000000..065f2df16 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/524-board_bcm6328-adb-a4001n1.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -382,6 +382,49 @@ static struct board_info __initdata boar + }, + }; + ++static struct board_info __initdata board_A4001N1 = { ++ .name = "963281T_TEF", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ + static struct board_info __initdata board_dsl_274xb_f1 = { + .name = "AW4339U", + .expected_cpu_id = 0x6328, +@@ -780,6 +823,7 @@ static const struct board_info __initcon + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, + &board_963281TAN, ++ &board_A4001N1, + &board_dsl_274xb_f1, + #endif /* CONFIG_BCM63XX_CPU_6328 */ + #ifdef CONFIG_BCM63XX_CPU_6338 +@@ -820,6 +864,7 @@ static struct of_device_id const bcm963x + { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 ++ { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, + { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/bcm63xx/patches-5.4/529-board_AR-5387un.patch b/target/linux/bcm63xx/patches-5.4/525-board_bcm6328-comtrend-ar-5387un.patch similarity index 68% rename from target/linux/bcm63xx/patches-5.4/529-board_AR-5387un.patch rename to target/linux/bcm63xx/patches-5.4/525-board_bcm6328-comtrend-ar-5387un.patch index f2af2c5b2..99a026f9d 100644 --- a/target/linux/bcm63xx/patches-5.4/529-board_AR-5387un.patch +++ b/target/linux/bcm63xx/patches-5.4/525-board_bcm6328-comtrend-ar-5387un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -93,6 +93,78 @@ static struct board_info __initdata boar +@@ -349,6 +349,78 @@ static struct board_info __initdata boar }, }; @@ -32,66 +32,66 @@ +}; + +static struct board_info __initdata board_AR5387un = { -+ .name = "96328A-1441N1", -+ .expected_cpu_id = 0x6328, ++ .name = "96328A-1441N1", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43225, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ .board_fixups = ar5387un_fixups, -+ .num_board_fixups = ARRAY_SIZE(ar5387un_fixups), ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ar5387un_fixups, ++ .num_board_fixups = ARRAY_SIZE(ar5387un_fixups), + }, +}; + static struct board_info __initdata board_963281TAN = { - .name = "963281TAN", - .expected_cpu_id = 0x6328, -@@ -1151,6 +1223,7 @@ static const struct board_info __initcon - #endif + .name = "963281TAN", + .expected_cpu_id = 0x6328, +@@ -822,6 +894,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, + &board_AR5387un, &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, -@@ -1221,6 +1294,7 @@ static struct of_device_id const bcm963x +@@ -867,6 +940,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 diff --git a/target/linux/bcm63xx/patches-5.4/530-board_AR-5381u.patch b/target/linux/bcm63xx/patches-5.4/526-board_bcm6328-comtrend-ar-5381u.patch similarity index 61% rename from target/linux/bcm63xx/patches-5.4/530-board_AR-5381u.patch rename to target/linux/bcm63xx/patches-5.4/526-board_bcm6328-comtrend-ar-5381u.patch index dc8efed32..8ed555490 100644 --- a/target/linux/bcm63xx/patches-5.4/530-board_AR-5381u.patch +++ b/target/linux/bcm63xx/patches-5.4/526-board_bcm6328-comtrend-ar-5381u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -93,6 +93,60 @@ static struct board_info __initdata boar +@@ -349,6 +349,60 @@ static struct board_info __initdata boar }, }; @@ -14,66 +14,66 @@ +}; + +static struct board_info __initdata board_AR5381u = { -+ .name = "96328A-1241N", -+ .expected_cpu_id = 0x6328, ++ .name = "96328A-1241N", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43225, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ .board_fixups = ar5381u_fixups, -+ .num_board_fixups = ARRAY_SIZE(ar5381u_fixups), ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ar5381u_fixups, ++ .num_board_fixups = ARRAY_SIZE(ar5381u_fixups), + }, +}; + static struct sprom_fixup __initdata ar5387un_fixups[] = { { .offset = 2, .value = 0x05bb }, { .offset = 65, .value = 0x1204 }, -@@ -1223,6 +1277,7 @@ static const struct board_info __initcon - #endif +@@ -894,6 +948,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, + &board_AR5381u, &board_AR5387un, &board_963281TAN, &board_A4001N1, -@@ -1294,6 +1349,7 @@ static struct of_device_id const bcm963x +@@ -940,6 +995,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, + { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ diff --git a/target/linux/bcm63xx/patches-5.4/526-board_nb6.patch b/target/linux/bcm63xx/patches-5.4/526-board_nb6.patch deleted file mode 100644 index b4de7cb07..000000000 --- a/target/linux/bcm63xx/patches-5.4/526-board_nb6.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -966,6 +966,32 @@ static struct board_info __initdata boar - }; - #endif /* CONFIG_BCM63XX_CPU_6358 */ - -+#ifdef CONFIG_BCM63XX_CPU_6362 -+static struct board_info __initdata board_nb6 = { -+ .name = "NB6", -+ .expected_cpu_id = 0x6362, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, -+ -+ .has_enetsw = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [4] = { -+ .used = 1, -+ .phy_id = 0xff, -+ .bypass_link = 1, -+ .force_speed = 1000, -+ .force_duplex_full = 1, -+ .name = "RGMII", -+ }, -+ }, -+ }, -+}; -+#endif /* CONFIG_BCM63XX_CPU_6362 */ -+ - /* - * known 6368 boards - */ -@@ -1115,6 +1141,10 @@ static const struct board_info __initcon - &board_DVAG3810BN, - #endif - -+#ifdef CONFIG_BCM63XX_CPU_6362 -+ &board_nb6, -+#endif -+ - #ifdef CONFIG_BCM63XX_CPU_6368 - &board_96368mvwg, - &board_96368mvngr, -@@ -1183,6 +1213,9 @@ static struct of_device_id const bcm963x - { .compatible = "t-com,speedport-w-303v", .data = &board_spw303v, }, - { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, - #endif -+#ifdef CONFIG_BCM63XX_CPU_6362 -+ { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, -+#endif - #ifdef CONFIG_BCM63XX_CPU_6368 - { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, - { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/bcm63xx/patches-5.4/534-board_fast2704.patch b/target/linux/bcm63xx/patches-5.4/527-board_bcm6328-sagem-fast-2704-v2.patch similarity index 67% rename from target/linux/bcm63xx/patches-5.4/534-board_fast2704.patch rename to target/linux/bcm63xx/patches-5.4/527-board_bcm6328-sagem-fast-2704-v2.patch index 358e97480..4828c8e50 100644 --- a/target/linux/bcm63xx/patches-5.4/534-board_fast2704.patch +++ b/target/linux/bcm63xx/patches-5.4/527-board_bcm6328-sagem-fast-2704-v2.patch @@ -12,43 +12,42 @@ Signed-off-by: Marcin Jurkowski --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -341,6 +341,43 @@ static struct board_info __initdata boar +@@ -594,6 +594,42 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_FAST2704V2 = { -+ .name = "F@ST2704V2", -+ .expected_cpu_id = 0x6328, ++ .name = "F@ST2704V2", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .has_usbd = 1, -+ -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .has_usbd = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "Port 1", ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, @@ -56,19 +55,19 @@ Signed-off-by: Marcin Jurkowski #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1402,6 +1439,7 @@ static const struct board_info __initcon +@@ -953,6 +989,7 @@ static const struct board_info __initcon &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, + &board_FAST2704V2, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1477,6 +1515,7 @@ static struct of_device_id const bcm963x +@@ -998,6 +1035,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, + { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/bcm63xx/patches-5.4/528-board_A4001N1.patch b/target/linux/bcm63xx/patches-5.4/528-board_A4001N1.patch deleted file mode 100644 index 0cecd9cb6..000000000 --- a/target/linux/bcm63xx/patches-5.4/528-board_A4001N1.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -127,6 +127,49 @@ static struct board_info __initdata boar - }, - }; - -+static struct board_info __initdata board_A4001N1 = { -+ .name = "963281T_TEF", -+ .expected_cpu_id = 0x6328, -+ -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ .has_enetsw = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", -+ }, -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", -+ }, -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", -+ }, -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", -+ }, -+ }, -+ }, -+ -+ .fallback_sprom = { -+ .type = SPROM_BCM43225, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ }, -+}; -+ - static struct board_info __initdata board_dsl_274xb_f1 = { - .name = "AW4339U", - .expected_cpu_id = 0x6328, -@@ -1109,6 +1152,7 @@ static const struct board_info __initcon - #ifdef CONFIG_BCM63XX_CPU_6328 - &board_96328avng, - &board_963281TAN, -+ &board_A4001N1, - &board_dsl_274xb_f1, - #endif - #ifdef CONFIG_BCM63XX_CPU_6338 -@@ -1174,6 +1218,7 @@ static struct of_device_id const bcm963x - { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6328 -+ { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, - { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, - { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, - { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/bcm63xx/patches-5.4/528-board_bcm6328-adb-a4001n.patch b/target/linux/bcm63xx/patches-5.4/528-board_bcm6328-adb-a4001n.patch new file mode 100644 index 000000000..da2200652 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/528-board_bcm6328-adb-a4001n.patch @@ -0,0 +1,68 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -508,6 +508,49 @@ static struct board_info __initdata boar + }, + }; + ++static struct board_info __initdata board_A4001N = { ++ .name = "96328dg2x2", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", ++ }, ++ }, ++ }, ++ ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ }, ++}; ++ + static struct board_info __initdata board_A4001N1 = { + .name = "963281T_TEF", + .expected_cpu_id = 0x6328, +@@ -987,6 +1030,7 @@ static const struct board_info __initcon + &board_AR5381u, + &board_AR5387un, + &board_963281TAN, ++ &board_A4001N, + &board_A4001N1, + &board_dsl_274xb_f1, + &board_FAST2704V2, +@@ -1029,6 +1073,7 @@ static struct of_device_id const bcm963x + { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, + #endif /* CONFIG_BCM63XX_CPU_6318 */ + #ifdef CONFIG_BCM63XX_CPU_6328 ++ { .compatible = "adb,a4001n", .data = &board_A4001N, }, + { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, + { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, + { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/bcm63xx/patches-5.4/554-board_R5010UNv2.patch b/target/linux/bcm63xx/patches-5.4/529-board_bcm6328-nucom-r5010un-v2.patch similarity index 54% rename from target/linux/bcm63xx/patches-5.4/554-board_R5010UNv2.patch rename to target/linux/bcm63xx/patches-5.4/529-board_bcm6328-nucom-r5010un-v2.patch index 8c9cc3944..4f63f23cd 100644 --- a/target/linux/bcm63xx/patches-5.4/554-board_R5010UNv2.patch +++ b/target/linux/bcm63xx/patches-5.4/529-board_bcm6328-nucom-r5010un-v2.patch @@ -1,69 +1,69 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -623,6 +623,50 @@ static struct board_info __initdata boar +@@ -673,6 +673,50 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_R5010UNV2 = { -+ .name = "96328ang", -+ .expected_cpu_id = 0x6328, ++ .name = "96328ang", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43217, -+ .pci_bus = 1, -+ .pci_dev = 0, ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, + }, +}; + #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -2266,6 +2310,7 @@ static const struct board_info __initcon +@@ -1034,6 +1078,7 @@ static const struct board_info __initcon &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, + &board_R5010UNV2, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -2364,6 +2409,7 @@ static struct of_device_id const bcm963x +@@ -1080,6 +1125,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, + { .compatible = "nucom,r5010un-v2", .data = &board_R5010UNV2, }, { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 diff --git a/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch b/target/linux/bcm63xx/patches-5.4/530-board_bcm6328-sercomm-ad1018.patch similarity index 68% rename from target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch rename to target/linux/bcm63xx/patches-5.4/530-board_bcm6328-sercomm-ad1018.patch index b50954a15..409f3d8e2 100644 --- a/target/linux/bcm63xx/patches-5.4/561-board_AD1018.patch +++ b/target/linux/bcm63xx/patches-5.4/530-board_bcm6328-sercomm-ad1018.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -357,6 +357,73 @@ static struct board_info __initdata boar +@@ -349,6 +349,71 @@ static struct board_info __initdata boar }, }; @@ -25,69 +25,67 @@ +}; + +static struct board_info __initdata board_AD1018 = { -+ .name = "96328avngr", -+ .expected_cpu_id = 0x6328, ++ .name = "96328avngr", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "FIBRE", ++ .used = 1, ++ .phy_id = 1, ++ .name = "FIBRE", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "LAN3", ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "LAN2", ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN2", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "LAN1", ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43217, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ .board_fixups = ad1018_fixups, -+ .num_board_fixups = ARRAY_SIZE(ad1018_fixups), ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ad1018_fixups, ++ .num_board_fixups = ARRAY_SIZE(ad1018_fixups), + }, +}; + static struct sprom_fixup __initdata ar5381u_fixups[] = { { .offset = 97, .value = 0xfee5 }, { .offset = 98, .value = 0x157c }, -@@ -2615,6 +2682,7 @@ static const struct board_info __initcon - #endif +@@ -1071,6 +1136,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6318 */ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, + &board_AD1018, &board_AR5381u, &board_AR5387un, &board_963281TAN, -@@ -2729,6 +2797,8 @@ static struct of_device_id const bcm963x +@@ -1127,6 +1193,8 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-274xb-f1", .data = &board_dsl_274xb_f1, }, { .compatible = "nucom,r5010un-v2", .data = &board_R5010UNV2, }, { .compatible = "sagem,fast-2704-v2", .data = &board_FAST2704V2, }, + { .compatible = "sercomm,ad1018", .data = &board_AD1018, }, + { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6328 */ #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch b/target/linux/bcm63xx/patches-5.4/531-board-bcm6328-adb-pdg-a4001n-a-000-1a1-ax.patch similarity index 56% rename from target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch rename to target/linux/bcm63xx/patches-5.4/531-board-bcm6328-adb-pdg-a4001n-a-000-1a1-ax.patch index 3976527b3..3b08649bb 100644 --- a/target/linux/bcm63xx/patches-5.4/567-board-adb_pdg-a4001n-a-000-1a1-ax.patch +++ b/target/linux/bcm63xx/patches-5.4/531-board-bcm6328-adb-pdg-a4001n-a-000-1a1-ax.patch @@ -1,56 +1,56 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -627,6 +627,49 @@ static struct board_info __initdata boar +@@ -616,6 +616,49 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_PDG_A4001N_A_000_1A1_AX = { -+ .name = "96328avng", -+ .expected_cpu_id = 0x6328, ++ .name = "96328avng", ++ .expected_cpu_id = 0x6328, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43225, -+ .pci_bus = 1, -+ .pci_dev = 0, ++ .type = SPROM_BCM43225, ++ .pci_bus = 1, ++ .pci_dev = 0, + }, +}; + static struct board_info __initdata board_A4001N1 = { - .name = "963281T_TEF", - .expected_cpu_id = 0x6328, -@@ -2849,6 +2892,7 @@ static const struct board_info __initcon + .name = "963281T_TEF", + .expected_cpu_id = 0x6328, +@@ -1141,6 +1184,7 @@ static const struct board_info __initcon &board_AR5387un, &board_963281TAN, &board_A4001N, @@ -58,7 +58,7 @@ &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, -@@ -2957,6 +3001,7 @@ static struct of_device_id const bcm963x +@@ -1186,6 +1230,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6328 { .compatible = "adb,a4001n", .data = &board_A4001N, }, { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, diff --git a/target/linux/bcm63xx/patches-5.4/531-board_rta770bw.patch b/target/linux/bcm63xx/patches-5.4/531-board_rta770bw.patch deleted file mode 100644 index d56df5562..000000000 --- a/target/linux/bcm63xx/patches-5.4/531-board_rta770bw.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -411,6 +411,20 @@ static struct board_info __initdata boar - .name = "96345GW2", - .expected_cpu_id = 0x6345, - }; -+ -+static struct board_info __initdata board_rta770bw = { -+ .name = "RTA770BW", -+ .expected_cpu_id = 0x6345, -+ -+ .has_enet0 = 1, -+ -+ .enet0 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, -+}; - #endif /* CONFIG_BCM63XX_CPU_6345 */ - - /* -@@ -1291,6 +1305,7 @@ static const struct board_info __initcon - #endif - #ifdef CONFIG_BCM63XX_CPU_6345 - &board_96345gw2, -+ &board_rta770bw, - #endif - #ifdef CONFIG_BCM63XX_CPU_6348 - &board_96348r, -@@ -1361,6 +1376,7 @@ static struct of_device_id const bcm963x - #endif - #ifdef CONFIG_BCM63XX_CPU_6345 - { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, -+ { .compatible = "dynalink,rta770bw", .data = &board_rta770bw, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6348 - { .compatible = "belkin,f5d7633", .data = &board_96348gw_10, }, diff --git a/target/linux/bcm63xx/patches-5.4/533-board_rta770w.patch b/target/linux/bcm63xx/patches-5.4/533-board_rta770w.patch deleted file mode 100644 index c78e59efd..000000000 --- a/target/linux/bcm63xx/patches-5.4/533-board_rta770w.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -426,6 +426,25 @@ static struct board_info __initdata boar - .force_duplex_full = 1, - }, - }; -+ -+// Actually this board is the very same as the rta770bw, -+// where the additional 'b' within the name just -+// just indicates 'Annex B'. The ADSL Modem itself is able -+// to handle both Annex A as well as Annex B - -+// the loaded firmware makes the only difference -+static struct board_info __initdata board_rta770w = { -+ .name = "RTA770W", -+ .expected_cpu_id = 0x6345, -+ -+ .has_enet0 = 1, -+ -+ .enet0 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, -+}; - #endif /* CONFIG_BCM63XX_CPU_6345 */ - - /* -@@ -1393,6 +1412,7 @@ static const struct board_info __initcon - #ifdef CONFIG_BCM63XX_CPU_6345 - &board_96345gw2, - &board_rta770bw, -+ &board_rta770w, - #endif - #ifdef CONFIG_BCM63XX_CPU_6348 - &board_96348r, -@@ -1467,6 +1487,7 @@ static struct of_device_id const bcm963x - #ifdef CONFIG_BCM63XX_CPU_6345 - { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, - { .compatible = "dynalink,rta770bw", .data = &board_rta770bw, }, -+ { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6348 - { .compatible = "belkin,f5d7633", .data = &board_96348gw_10, }, diff --git a/target/linux/bcm63xx/patches-5.4/536-board_96318ref.patch b/target/linux/bcm63xx/patches-5.4/536-board_96318ref.patch deleted file mode 100644 index c9c532d30..000000000 --- a/target/linux/bcm63xx/patches-5.4/536-board_96318ref.patch +++ /dev/null @@ -1,78 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -50,6 +50,55 @@ static struct board_info __initdata boar - #endif /* CONFIG_BCM63XX_CPU_3368 */ - - /* -+ * known 6318 boards -+ */ -+#ifdef CONFIG_BCM63XX_CPU_6318 -+static struct board_info __initdata board_96318ref = { -+ .name = "96318REF", -+ .expected_cpu_id = 0x6318, -+ -+ .has_pci = 1, -+ -+ .has_usbd = 1, -+ -+ .usbd = { -+ .use_fullspeed = 0, -+ .port_no = 0, -+ }, -+ -+ .has_enetsw = 1, -+ -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", -+ }, -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", -+ }, -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", -+ }, -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", -+ }, -+ }, -+ }, -+}; -+#endif /* CONFIG_BCM63XX_CPU_6318 */ -+ -+/* - * known 6328 boards - */ - #ifdef CONFIG_BCM63XX_CPU_6328 -@@ -1467,6 +1516,9 @@ static const struct board_info __initcon - #ifdef CONFIG_BCM63XX_CPU_3368 - &board_cvg834g, - #endif -+#ifdef CONFIG_BCM63XX_CPU_6318 -+ &board_96318ref, -+#endif - #ifdef CONFIG_BCM63XX_CPU_6328 - &board_96328avng, - &board_AR5381u, -@@ -1544,6 +1596,9 @@ static struct of_device_id const bcm963x - #ifdef CONFIG_BCM63XX_CPU_3368 - { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, - #endif -+#ifdef CONFIG_BCM63XX_CPU_6318 -+ { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, -+#endif - #ifdef CONFIG_BCM63XX_CPU_6328 - { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, - { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, diff --git a/target/linux/bcm63xx/patches-5.4/537-board_96318ref_p300.patch b/target/linux/bcm63xx/patches-5.4/537-board_96318ref_p300.patch deleted file mode 100644 index f4ff4fd69..000000000 --- a/target/linux/bcm63xx/patches-5.4/537-board_96318ref_p300.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -96,6 +96,50 @@ static struct board_info __initdata boar - }, - }, - }; -+ -+static struct board_info __initdata board_96318ref_p300 = { -+ .name = "96318REF_P300", -+ .expected_cpu_id = 0x6318, -+ -+ .has_pci = 1, -+ -+ .has_usbd = 1, -+ -+ .usbd = { -+ .use_fullspeed = 0, -+ .port_no = 0, -+ }, -+ -+ .has_enetsw = 1, -+ -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", -+ }, -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", -+ }, -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", -+ }, -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", -+ }, -+ }, -+ }, -+}; - #endif /* CONFIG_BCM63XX_CPU_6318 */ - - /* -@@ -1518,6 +1562,7 @@ static const struct board_info __initcon - #endif - #ifdef CONFIG_BCM63XX_CPU_6318 - &board_96318ref, -+ &board_96318ref_p300, - #endif - #ifdef CONFIG_BCM63XX_CPU_6328 - &board_96328avng, -@@ -1598,6 +1643,7 @@ static struct of_device_id const bcm963x - #endif - #ifdef CONFIG_BCM63XX_CPU_6318 - { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, -+ { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6328 - { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, diff --git a/target/linux/bcm63xx/patches-5.4/538-board_bcm963269bhr.patch b/target/linux/bcm63xx/patches-5.4/538-board_bcm963269bhr.patch deleted file mode 100644 index d5af2f0d1..000000000 --- a/target/linux/bcm63xx/patches-5.4/538-board_bcm963269bhr.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1554,6 +1554,50 @@ static struct board_info __initdata boar - #endif /* CONFIG_BCM63XX_CPU_6368 */ - - /* -+ * known 63268/63269 boards -+ */ -+#ifdef CONFIG_BCM63XX_CPU_63268 -+static struct board_info __initdata board_963269bhr = { -+ .name = "963269BHR", -+ .expected_cpu_id = 0x63268, -+ -+ .has_pci = 1, -+ -+ .has_ehci0 = 1, -+ -+ .has_enetsw = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", -+ }, -+ -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", -+ }, -+ -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", -+ }, -+ -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", -+ }, -+ }, -+ }, -+}; -+#endif /* CONFIG_BCM63XX_CPU_63268 */ -+ -+/* - * all boards - */ - static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1634,6 +1678,9 @@ static const struct board_info __initcon - &board_96368mvwg, - &board_96368mvngr, - #endif -+#ifdef CONFIG_BCM63XX_CPU_63268 -+ &board_963269bhr, -+#endif - }; - - static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1721,6 +1768,7 @@ static struct of_device_id const bcm963x - { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 -+ { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, - #endif - #endif /* CONFIG_OF */ - { }, diff --git a/target/linux/bcm63xx/patches-5.4/540-board_vw6339gu.patch b/target/linux/bcm63xx/patches-5.4/540-board_vw6339gu.patch deleted file mode 100644 index da9000ac3..000000000 --- a/target/linux/bcm63xx/patches-5.4/540-board_vw6339gu.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1610,6 +1610,53 @@ static struct board_info __initdata boar - }, - }, - }; -+ -+static struct board_info __initdata board_vw6339gu = { -+ .name = "VW6339GU", -+ .expected_cpu_id = 0x63268, -+ -+ .has_ehci0 = 1, -+ .has_ohci0 = 1, -+ .num_usbh_ports = 1, -+ -+ .has_enetsw = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "LAN2", -+ }, -+ -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "LAN3", -+ }, -+ -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "LAN4", -+ }, -+ -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "LAN1", -+ }, -+ -+ [4] = { -+ .used = 1, -+ .phy_id = 7, -+ .name = "WAN", -+ .mii_override = 1, -+ .timing_sel = 1, -+ }, -+ }, -+ }, -+}; - #endif /* CONFIG_BCM63XX_CPU_63268 */ - - /* -@@ -1696,6 +1743,7 @@ static const struct board_info __initcon - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 - &board_963269bhr, -+ &board_vw6339gu, - #endif - }; - -@@ -1786,6 +1834,7 @@ static struct of_device_id const bcm963x - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 - { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, -+ { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, - #endif - #endif /* CONFIG_OF */ - { }, diff --git a/target/linux/bcm63xx/patches-5.4/502-board-96338W2_E7T.patch b/target/linux/bcm63xx/patches-5.4/541-board-bcm6338-d-link-dsl-2640u.patch similarity index 63% rename from target/linux/bcm63xx/patches-5.4/502-board-96338W2_E7T.patch rename to target/linux/bcm63xx/patches-5.4/541-board-bcm6338-d-link-dsl-2640u.patch index 69cc716e1..2c6a4950b 100644 --- a/target/linux/bcm63xx/patches-5.4/502-board-96338W2_E7T.patch +++ b/target/linux/bcm63xx/patches-5.4/541-board-bcm6338-d-link-dsl-2640u.patch @@ -1,39 +1,38 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -98,6 +98,20 @@ static struct board_info __initdata boar +@@ -858,6 +858,19 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; + +static struct board_info __initdata board_96338w2_e7t = { -+ .name = "96338W2_E7T", -+ .expected_cpu_id = 0x6338, -+ -+ .has_enet0 = 1, ++ .name = "96338W2_E7T", ++ .expected_cpu_id = 0x6338, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -487,6 +501,7 @@ static const struct board_info __initcon +@@ -1193,6 +1206,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, + &board_96338w2_e7t, - #endif + #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -524,6 +539,7 @@ static struct of_device_id const bcm963x +@@ -1244,6 +1258,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, + { .compatible = "d-link,dsl-2640u", .data = &board_96338w2_e7t, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/541-board_963268gu_p300.patch b/target/linux/bcm63xx/patches-5.4/541-board_963268gu_p300.patch deleted file mode 100644 index 2cd09b69e..000000000 --- a/target/linux/bcm63xx/patches-5.4/541-board_963268gu_p300.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1572,6 +1572,72 @@ static struct board_info __initdata boar - * known 63268/63269 boards - */ - #ifdef CONFIG_BCM63XX_CPU_63268 -+static struct board_info __initdata board_963268bu_p300 = { -+ .name = "963268BU_P300", -+ .expected_cpu_id = 0x63268, -+ -+ .has_ehci0 = 1, -+ .has_ohci0 = 1, -+ .num_usbh_ports = 1, -+ -+ .has_usbd = 1, -+ -+ .usbd = { -+ .use_fullspeed = 0, -+ .port_no = 0, -+ }, -+ -+ .has_enetsw = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 17, -+ .name = "FE1", -+ }, -+ -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "GbE2", -+ }, -+ -+ [4] = { -+ .used = 1, -+ .phy_id = 0, -+ .name = "GbE3", -+ .mii_override = 1, -+ .timing_sel = 1, -+ }, -+ -+ [5] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "GbE1", -+ .mii_override = 1, -+ .timing_sel = 1, -+ }, -+ -+ [6] = { -+ .used = 1, -+ .phy_id = 24, -+ .name = "GbE4", -+ .mii_override = 1, -+ .timing_sel = 1, -+ }, -+ -+ [7] = { -+ .used = 1, -+ .phy_id = 25, -+ .name = "GbE5", -+ .mii_override = 1, -+ .timing_sel = 1, -+ }, -+ }, -+ }, -+}; -+ - static struct board_info __initdata board_963269bhr = { - .name = "963269BHR", - .expected_cpu_id = 0x63268, -@@ -1742,6 +1808,7 @@ static const struct board_info __initcon - &board_96368mvngr, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 -+ &board_963268bu_p300, - &board_963269bhr, - &board_vw6339gu, - #endif -@@ -1833,6 +1900,7 @@ static struct of_device_id const bcm963x - { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 -+ { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, - { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, - { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, - #endif diff --git a/target/linux/bcm63xx/patches-5.4/509-board_rta1320_16m.patch b/target/linux/bcm63xx/patches-5.4/542-board_bcm6338-dynalink-rta1320.patch similarity index 60% rename from target/linux/bcm63xx/patches-5.4/509-board_rta1320_16m.patch rename to target/linux/bcm63xx/patches-5.4/542-board_bcm6338-dynalink-rta1320.patch index cfe55552f..d3b048a6a 100644 --- a/target/linux/bcm63xx/patches-5.4/509-board_rta1320_16m.patch +++ b/target/linux/bcm63xx/patches-5.4/542-board_bcm6338-dynalink-rta1320.patch @@ -1,39 +1,38 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -112,6 +112,20 @@ static struct board_info __initdata boar - .force_duplex_full = 1, +@@ -871,6 +871,19 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; + +static struct board_info __initdata board_rta1320_16m = { -+ .name = "RTA1320_16M", -+ .expected_cpu_id = 0x6338, -+ -+ .has_enet0 = 1, ++ .name = "RTA1320_16M", ++ .expected_cpu_id = 0x6338, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -660,6 +674,7 @@ static const struct board_info __initcon +@@ -1207,6 +1220,7 @@ static const struct board_info __initcon &board_96338gw, &board_96338w, &board_96338w2_e7t, + &board_rta1320_16m, - #endif + #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -704,6 +719,7 @@ static struct of_device_id const bcm963x +@@ -1258,6 +1272,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, + { .compatible = "dynalink,rta1320", .data = &board_rta1320_16m, }, { .compatible = "d-link,dsl-2640u", .data = &board_96338w2_e7t, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6338 */ #ifdef CONFIG_BCM63XX_CPU_6345 diff --git a/target/linux/bcm63xx/patches-5.4/547-board_A4001N.patch b/target/linux/bcm63xx/patches-5.4/547-board_A4001N.patch deleted file mode 100644 index 1992e0c6d..000000000 --- a/target/linux/bcm63xx/patches-5.4/547-board_A4001N.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -349,6 +349,49 @@ static struct board_info __initdata boar - }, - }; - -+static struct board_info __initdata board_A4001N = { -+ .name = "96328dg2x2", -+ .expected_cpu_id = 0x6328, -+ -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ .has_enetsw = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", -+ }, -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", -+ }, -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", -+ }, -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", -+ }, -+ }, -+ }, -+ -+ .fallback_sprom = { -+ .type = SPROM_BCM43225, -+ .pci_bus = 1, -+ .pci_dev = 0, -+ }, -+}; -+ - static struct board_info __initdata board_A4001N1 = { - .name = "963281T_TEF", - .expected_cpu_id = 0x6328, -@@ -1962,6 +2005,7 @@ static const struct board_info __initcon - &board_AR5381u, - &board_AR5387un, - &board_963281TAN, -+ &board_A4001N, - &board_A4001N1, - &board_dsl_274xb_f1, - &board_FAST2704V2, -@@ -2050,6 +2094,7 @@ static struct of_device_id const bcm963x - { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6328 -+ { .compatible = "adb,a4001n", .data = &board_A4001N, }, - { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, - { .compatible = "brcm,bcm963281tan", .data = &board_963281TAN, }, - { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/bcm63xx/patches-5.4/551-board_bcm6345-dynalink-rta770bw-rta770w.patch b/target/linux/bcm63xx/patches-5.4/551-board_bcm6345-dynalink-rta770bw-rta770w.patch new file mode 100644 index 000000000..225c75492 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/551-board_bcm6345-dynalink-rta770bw-rta770w.patch @@ -0,0 +1,39 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -894,6 +894,19 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, + }; ++ ++static struct board_info __initdata board_rta770w = { ++ .name = "RTA770BW", ++ .expected_cpu_id = 0x6345, ++ ++ .has_enet0 = 1, ++ .enet0 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, ++}; + #endif /* CONFIG_BCM63XX_CPU_6345 */ + + /* +@@ -1224,6 +1237,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6338 */ + #ifdef CONFIG_BCM63XX_CPU_6345 + &board_96345gw2, ++ &board_rta770w, + #endif /* CONFIG_BCM63XX_CPU_6345 */ + #ifdef CONFIG_BCM63XX_CPU_6348 + &board_96348r, +@@ -1277,6 +1291,8 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6338 */ + #ifdef CONFIG_BCM63XX_CPU_6345 + { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, ++ { .compatible = "dynalink,rta770bw", .data = &board_rta770w, }, ++ { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, + #endif /* CONFIG_BCM63XX_CPU_6345 */ + #ifdef CONFIG_BCM63XX_CPU_6348 + { .compatible = "belkin,f5d7633", .data = &board_96348gw_10, }, diff --git a/target/linux/bcm63xx/patches-5.4/552-board_fast2704n.patch b/target/linux/bcm63xx/patches-5.4/552-board_fast2704n.patch deleted file mode 100644 index 59f57bc8d..000000000 --- a/target/linux/bcm63xx/patches-5.4/552-board_fast2704n.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -210,6 +210,45 @@ static struct board_info __initdata boar - .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), - }, - }; -+ -+static struct board_info __initdata board_FAST2704N = { -+ .name = "F@ST2704N", -+ .expected_cpu_id = 0x6318, -+ -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ -+ .has_enetsw = 1, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 1, -+ -+ .enetsw = { -+ .used_ports = { -+ [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", -+ }, -+ [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", -+ }, -+ [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", -+ }, -+ [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", -+ }, -+ }, -+ }, -+}; - #endif /* CONFIG_BCM63XX_CPU_6318 */ - - /* -@@ -2163,6 +2202,7 @@ static const struct board_info __initcon - &board_96318ref, - &board_96318ref_p300, - &board_dsl_2751b_d1, -+ &board_FAST2704N, - #endif - #ifdef CONFIG_BCM63XX_CPU_6328 - &board_96328avng, -@@ -2260,6 +2300,7 @@ static struct of_device_id const bcm963x - { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, - { .compatible = "brcm,bcm96318ref-p300", .data = &board_96318ref_p300, }, - { .compatible = "d-link,dsl-275xb-d1", .data = &board_dsl_2751b_d1, }, -+ { .compatible = "sagem,fast-2704n", .data = &board_FAST2704N, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6328 - { .compatible = "adb,a4001n", .data = &board_A4001N, }, diff --git a/target/linux/bcm63xx/patches-5.4/500-board-D4PW.patch b/target/linux/bcm63xx/patches-5.4/561-board-bcm6348-D4PW.patch similarity index 67% rename from target/linux/bcm63xx/patches-5.4/500-board-D4PW.patch rename to target/linux/bcm63xx/patches-5.4/561-board-bcm6348-D4PW.patch index 456b2a446..62e8f381c 100644 --- a/target/linux/bcm63xx/patches-5.4/500-board-D4PW.patch +++ b/target/linux/bcm63xx/patches-5.4/561-board-bcm6348-D4PW.patch @@ -1,36 +1,36 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -295,6 +295,21 @@ static struct board_info __initdata boar +@@ -1093,6 +1093,21 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; + +static struct board_info __initdata board_96348_D4PW = { -+ .name = "D-4P-W", -+ .expected_cpu_id = 0x6348, ++ .name = "D-4P-W", ++ .expected_cpu_id = 0x6348, + -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pci = 1, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -431,6 +446,7 @@ static const struct board_info __initcon +@@ -1248,6 +1263,7 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, + &board_96348_D4PW, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -462,6 +478,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1300,6 +1316,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/bcm63xx/patches-5.4/505-board_spw500v.patch b/target/linux/bcm63xx/patches-5.4/562-board_bcm6348-t-com-speedport-w-500v.patch similarity index 62% rename from target/linux/bcm63xx/patches-5.4/505-board_spw500v.patch rename to target/linux/bcm63xx/patches-5.4/562-board_bcm6348-t-com-speedport-w-500v.patch index f5ca73d7e..a20047d3d 100644 --- a/target/linux/bcm63xx/patches-5.4/505-board_spw500v.patch +++ b/target/linux/bcm63xx/patches-5.4/562-board_bcm6348-t-com-speedport-w-500v.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -324,6 +324,36 @@ static struct board_info __initdata boar - .force_duplex_full = 1, +@@ -1108,6 +1108,36 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; + @@ -14,42 +14,42 @@ +}; + +static struct board_info __initdata board_spw500v = { -+ .name = "SPW500V", -+ .expected_cpu_id = 0x6348, ++ .name = "SPW500V", ++ .expected_cpu_id = 0x6348, + -+ .has_enet0 = 1, -+ .has_pci = 1, -+ .use_fallback_sprom = 1, ++ .has_pci = 1, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = spw500v_fixups, -+ .num_board_fixups = ARRAY_SIZE(spw500v_fixups), ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = spw500v_fixups, ++ .num_board_fixups = ARRAY_SIZE(spw500v_fixups), + }, +}; #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -551,6 +581,7 @@ static const struct board_info __initcon +@@ -1264,6 +1294,7 @@ static const struct board_info __initcon &board_96348gw_a, &board_rta1025w_16, &board_96348_D4PW, + &board_spw500v, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -592,6 +623,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1321,6 +1352,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gt-pn", .data = &board_96348gw_10, }, { .compatible = "sagem,fast-2404", .data = &board_FAST2404, }, + { .compatible = "t-com,speedport-w-500v", .data = &board_spw500v, }, { .compatible = "tp-link,td-w8900gb", .data = &board_96348gw_11, }, { .compatible = "usrobotics,usr9108", .data = &board_96348gw_a, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6348 */ diff --git a/target/linux/bcm63xx/patches-5.4/506-board_gw6200_gw6000.patch b/target/linux/bcm63xx/patches-5.4/563-board_bcm6348-tecom-gw6000-gw6200.patch similarity index 63% rename from target/linux/bcm63xx/patches-5.4/506-board_gw6200_gw6000.patch rename to target/linux/bcm63xx/patches-5.4/563-board_bcm6348-tecom-gw6000-gw6200.patch index 77948d19f..3d9c00080 100644 --- a/target/linux/bcm63xx/patches-5.4/506-board_gw6200_gw6000.patch +++ b/target/linux/bcm63xx/patches-5.4/563-board_bcm6348-tecom-gw6000-gw6200.patch @@ -1,55 +1,53 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -217,6 +217,48 @@ static struct board_info __initdata boar +@@ -1002,6 +1002,46 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; +static struct board_info __initdata board_gw6200 = { -+ .name = "GW6200", -+ .expected_cpu_id = 0x6348, -+ -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, -+ -+ .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, -+ }, -+ .enet1 = { -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, ++ .name = "GW6200", ++ .expected_cpu_id = 0x6348, + ++ .has_pci = 1, + .has_ohci0 = 1, ++ ++ .has_enet0 = 1, ++ .enet0 = { ++ .has_phy = 1, ++ .use_internal_phy = 1, ++ }, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, +}; + +static struct board_info __initdata board_gw6000 = { -+ .name = "GW6000", -+ .expected_cpu_id = 0x6348, -+ -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, -+ -+ .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, -+ }, -+ .enet1 = { -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, ++ .name = "GW6000", ++ .expected_cpu_id = 0x6348, + ++ .has_pci = 1, + .has_ohci0 = 1, ++ ++ .has_enet0 = 1, ++ .enet0 = { ++ .has_phy = 1, ++ .use_internal_phy = 1, ++ }, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, +}; -+ -+ + static struct board_info __initdata board_FAST2404 = { .name = "F@ST2404", .expected_cpu_id = 0x6348, -@@ -574,6 +616,8 @@ static const struct board_info __initcon +@@ -1287,6 +1327,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, &board_96348gw, @@ -58,7 +56,7 @@ &board_96348gw_10, &board_96348gw_11, &board_FAST2404, -@@ -624,6 +668,8 @@ static struct of_device_id const bcm963x +@@ -1353,6 +1395,8 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gt-pn", .data = &board_96348gw_10, }, { .compatible = "sagem,fast-2404", .data = &board_FAST2404, }, { .compatible = "t-com,speedport-w-500v", .data = &board_spw500v, }, @@ -66,4 +64,4 @@ + { .compatible = "tecom,gw6200", .data = &board_gw6200, }, { .compatible = "tp-link,td-w8900gb", .data = &board_96348gw_11, }, { .compatible = "usrobotics,usr9108", .data = &board_96348gw_a, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6348 */ diff --git a/target/linux/bcm63xx/patches-5.4/507-board-MAGIC.patch b/target/linux/bcm63xx/patches-5.4/564-board-bcm6348-telsey-magic.patch similarity index 56% rename from target/linux/bcm63xx/patches-5.4/507-board-MAGIC.patch rename to target/linux/bcm63xx/patches-5.4/564-board-bcm6348-telsey-magic.patch index 3a88e0100..ba9ee0b4d 100644 --- a/target/linux/bcm63xx/patches-5.4/507-board-MAGIC.patch +++ b/target/linux/bcm63xx/patches-5.4/564-board-bcm6348-telsey-magic.patch @@ -1,50 +1,49 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -396,6 +396,31 @@ static struct board_info __initdata boar - .num_board_fixups = ARRAY_SIZE(spw500v_fixups), +@@ -1178,6 +1178,30 @@ static struct board_info __initdata boar + .num_board_fixups = ARRAY_SIZE(spw500v_fixups), }, }; + +static struct board_info __initdata board_96348sv = { -+ .name = "MAGIC", -+ .expected_cpu_id = 0x6348, ++ .name = "MAGIC", ++ .expected_cpu_id = 0x6348, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pccard = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, ++ ++ .has_enet1 = 1, + .enet1 = { + /* it has BP_ENET_EXTERNAL_PHY */ -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, -+ -+ .has_ohci0 = 1, -+ .has_pccard = 1, -+ .has_ehci0 = 1, +}; #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -626,6 +651,7 @@ static const struct board_info __initcon +@@ -1337,6 +1361,7 @@ static const struct board_info __initcon &board_rta1025w_16, &board_96348_D4PW, &board_spw500v, + &board_96348sv, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -670,6 +696,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1397,6 +1422,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,speedport-w-500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, + { .compatible = "telsey,magic", .data = &board_96348sv, }, { .compatible = "tp-link,td-w8900gb", .data = &board_96348gw_11, }, { .compatible = "usrobotics,usr9108", .data = &board_96348gw_a, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6348 */ diff --git a/target/linux/bcm63xx/patches-5.4/511-board_V2500V.patch b/target/linux/bcm63xx/patches-5.4/565-board_bcm6348-bt-voyager-2500v-bb.patch similarity index 74% rename from target/linux/bcm63xx/patches-5.4/511-board_V2500V.patch rename to target/linux/bcm63xx/patches-5.4/565-board_bcm6348-bt-voyager-2500v-bb.patch index 47590af6e..6536e1779 100644 --- a/target/linux/bcm63xx/patches-5.4/511-board_V2500V.patch +++ b/target/linux/bcm63xx/patches-5.4/565-board_bcm6348-bt-voyager-2500v-bb.patch @@ -1,41 +1,42 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -435,6 +435,26 @@ static struct board_info __initdata boar - .has_pccard = 1, - .has_ehci0 = 1, +@@ -1202,6 +1202,27 @@ static struct board_info __initdata boar + .force_duplex_full = 1, + }, }; + +static struct board_info __initdata board_V2500V_BB = { -+ .name = "V2500V_BB", -+ .expected_cpu_id = 0x6348, ++ .name = "V2500V_BB", ++ .expected_cpu_id = 0x6348, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pci = 1, + -+ .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, -+ }, -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_enet0 = 1, ++ .enet0 = { ++ .has_phy = 1, ++ .use_internal_phy = 1, ++ }, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -707,6 +727,7 @@ static const struct board_info __initcon +@@ -1362,6 +1383,7 @@ static const struct board_info __initcon &board_96348_D4PW, &board_spw500v, &board_96348sv, + &board_V2500V_BB, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -746,6 +767,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1414,6 +1436,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, @@ -43,7 +44,7 @@ { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, }, { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, -@@ -805,6 +827,22 @@ void __init board_bcm963xx_init(void) +@@ -1469,6 +1492,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); diff --git a/target/linux/bcm63xx/patches-5.4/512-board_BTV2110.patch b/target/linux/bcm63xx/patches-5.4/566-board_bcm6348-bt-voyager-2110.patch similarity index 69% rename from target/linux/bcm63xx/patches-5.4/512-board_BTV2110.patch rename to target/linux/bcm63xx/patches-5.4/566-board_bcm6348-bt-voyager-2110.patch index 4c14ea441..c51b28854 100644 --- a/target/linux/bcm63xx/patches-5.4/512-board_BTV2110.patch +++ b/target/linux/bcm63xx/patches-5.4/566-board_bcm6348-bt-voyager-2110.patch @@ -1,39 +1,37 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -208,6 +208,24 @@ static struct board_info __initdata boar +@@ -979,6 +979,22 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; -+ +/* BT Voyager 2110 */ +static struct board_info __initdata board_V2110 = { -+ .name = "V2110", -+ .expected_cpu_id = 0x6348, ++ .name = "V2110", ++ .expected_cpu_id = 0x6348, + -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pci = 1, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; -+ + static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -728,6 +746,7 @@ static const struct board_info __initcon +@@ -1384,6 +1400,7 @@ static const struct board_info __initcon &board_spw500v, &board_96348sv, &board_V2500V_BB, + &board_V2110, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -767,6 +786,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1436,6 +1453,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/bcm63xx/patches-5.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch b/target/linux/bcm63xx/patches-5.4/567-MIPS-BCM63XX-add-inventel-Livebox-support.patch similarity index 91% rename from target/linux/bcm63xx/patches-5.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch rename to target/linux/bcm63xx/patches-5.4/567-MIPS-BCM63XX-add-inventel-Livebox-support.patch index 24815782d..0035cee7e 100644 --- a/target/linux/bcm63xx/patches-5.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch +++ b/target/linux/bcm63xx/patches-5.4/567-MIPS-BCM63XX-add-inventel-Livebox-support.patch @@ -58,10 +58,10 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support #endif /* __BOARD_COMMON_H */ --- /dev/null +++ b/arch/mips/bcm63xx/boards/board_livebox.c -@@ -0,0 +1,155 @@ +@@ -0,0 +1,153 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public -+ * License. See the file "COPYING" in the main directory of this archive ++ * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2008 Florian Fainelli @@ -90,28 +90,26 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support + */ +#ifdef CONFIG_BCM63XX_CPU_6348 +static struct board_info __initdata board_livebox_blue5g = { -+ .name = "Livebox-blue-5g", -+ .expected_cpu_id = 0x6348, ++ .name = "Livebox-blue-5g", ++ .expected_cpu_id = 0x6348, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pccard = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .ephy_reset_gpio = 6, ++ .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 31, ++ .has_phy = 1, ++ .phy_id = 31, + }, -+ -+ .ephy_reset_gpio = 6, -+ .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, -+ -+ .has_ohci0 = 1, -+ .has_pccard = 1, +}; +#endif + @@ -121,7 +119,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support +static const struct board_info __initdata *bcm963xx_boards[] = { +#ifdef CONFIG_BCM63XX_CPU_6348 + &board_livebox_blue5g -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6348 */ +}; + +static struct of_device_id const livebox_boards_dt[] = { @@ -155,7 +153,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support + printk(KERN_ERR PFX "unable to fetch mac address\n"); + return -ENODEV; + } -+ mac_addr_used++; ++ mac_addr_used++; + + return 0; +} diff --git a/target/linux/bcm63xx/patches-5.4/514-board_ct536_ct5621.patch b/target/linux/bcm63xx/patches-5.4/568-board_bcm6348-comtrend-ct-536plus-ct-5621.patch similarity index 66% rename from target/linux/bcm63xx/patches-5.4/514-board_ct536_ct5621.patch rename to target/linux/bcm63xx/patches-5.4/568-board_bcm6348-comtrend-ct-536plus-ct-5621.patch index acb533d0e..c815e66f1 100644 --- a/target/linux/bcm63xx/patches-5.4/514-board_ct536_ct5621.patch +++ b/target/linux/bcm63xx/patches-5.4/568-board_bcm6348-comtrend-ct-536plus-ct-5621.patch @@ -1,48 +1,45 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -226,6 +226,33 @@ static struct board_info __initdata boar +@@ -995,6 +995,30 @@ static struct board_info __initdata boar + }, }; - +static struct board_info __initdata board_ct536_ct5621 = { -+ .name = "CT536_CT5621", -+ .expected_cpu_id = 0x6348, ++ .name = "CT536_CT5621", ++ .expected_cpu_id = 0x6348, + -+ .has_enet0 = 0, -+ .has_enet1 = 1, -+ .has_pci = 1, -+ .use_fallback_sprom = 1, ++ .has_pccard = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, + -+ .has_ohci0 = 1, -+ .has_pccard = 1, -+ .has_ehci0 = 1, -+ ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; + static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -747,6 +774,7 @@ static const struct board_info __initcon +@@ -1401,6 +1425,7 @@ static const struct board_info __initcon &board_96348sv, &board_V2500V_BB, &board_V2110, + &board_ct536_ct5621, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -788,6 +816,8 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1455,6 +1480,8 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, { .compatible = "bt,voyager-2110", .data = &board_V2110, }, { .compatible = "bt,voyager-2500v-bb", .data = &board_V2500V_BB, }, diff --git a/target/linux/bcm63xx/patches-5.4/516-board_96348A-122.patch b/target/linux/bcm63xx/patches-5.4/569-board_bcm6348-comtrend-ct-5365.patch similarity index 65% rename from target/linux/bcm63xx/patches-5.4/516-board_96348A-122.patch rename to target/linux/bcm63xx/patches-5.4/569-board_bcm6348-comtrend-ct-5365.patch index a6de00d36..7dbfb825f 100644 --- a/target/linux/bcm63xx/patches-5.4/516-board_96348A-122.patch +++ b/target/linux/bcm63xx/patches-5.4/569-board_bcm6348-comtrend-ct-5365.patch @@ -1,45 +1,44 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -253,6 +253,30 @@ static struct board_info __initdata boar +@@ -1019,6 +1019,29 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_96348A_122 = { -+ .name = "96348A-122", -+ .expected_cpu_id = 0x6348, -+ -+ .has_enet1 = 1, -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, ++ .name = "96348A-122", ++ .expected_cpu_id = 0x6348, + ++ .has_pci = 1, + .has_ohci0 = 1, + ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, ++ ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; + static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -776,6 +800,7 @@ static const struct board_info __initcon +@@ -1426,6 +1449,7 @@ static const struct board_info __initcon &board_V2500V_BB, &board_V2110, &board_ct536_ct5621, + &board_96348A_122, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -818,6 +843,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1481,6 +1505,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,voyager-2110", .data = &board_V2110, }, { .compatible = "bt,voyager-2500v-bb", .data = &board_V2500V_BB, }, { .compatible = "comtrend,ct-536plus", .data = &board_ct536_ct5621, }, diff --git a/target/linux/bcm63xx/patches-5.4/517_board_CPVA502plus.patch b/target/linux/bcm63xx/patches-5.4/570-board_bcm6348-telsey-cpva502plus.patch similarity index 58% rename from target/linux/bcm63xx/patches-5.4/517_board_CPVA502plus.patch rename to target/linux/bcm63xx/patches-5.4/570-board_bcm6348-telsey-cpva502plus.patch index 25e7f9ff0..dc028609b 100644 --- a/target/linux/bcm63xx/patches-5.4/517_board_CPVA502plus.patch +++ b/target/linux/bcm63xx/patches-5.4/570-board_bcm6348-telsey-cpva502plus.patch @@ -1,48 +1,49 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -225,6 +225,33 @@ static struct board_info __initdata boar +@@ -995,6 +995,34 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_CPVA502plus = { -+ .name = "CPVA502+", -+ .expected_cpu_id = 0x6348, ++ .name = "CPVA502+", ++ .expected_cpu_id = 0x6348, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, -+ .use_fallback_sprom = 1, ++ .has_pci = 1, ++ .ephy_reset_gpio = 4, ++ .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, ++ ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, ++ .has_phy = 1, ++ .phy_id = 0, + }, + -+ .ephy_reset_gpio = 4, -+ .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, -+ ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; - ++ static struct board_info __initdata board_ct536_ct5621 = { - .name = "CT536_CT5621", -@@ -801,6 +828,7 @@ static const struct board_info __initcon + .name = "CT536_CT5621", + .expected_cpu_id = 0x6348, +@@ -1450,6 +1478,7 @@ static const struct board_info __initcon &board_V2110, &board_ct536_ct5621, &board_96348A_122, + &board_CPVA502plus, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -853,6 +881,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1515,6 +1544,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,speedport-w-500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/bcm63xx/patches-5.4/523-board_96348w3.patch b/target/linux/bcm63xx/patches-5.4/571-board_bcm6348-netgear-dg834g-v4.patch similarity index 64% rename from target/linux/bcm63xx/patches-5.4/523-board_96348w3.patch rename to target/linux/bcm63xx/patches-5.4/571-board_bcm6348-netgear-dg834g-v4.patch index 3a27db85c..d68f69057 100644 --- a/target/linux/bcm63xx/patches-5.4/523-board_96348w3.patch +++ b/target/linux/bcm63xx/patches-5.4/571-board_bcm6348-netgear-dg834g-v4.patch @@ -1,39 +1,38 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -568,6 +568,24 @@ static struct board_info __initdata boar +@@ -1225,6 +1225,23 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; +/* NetGear DG834G v4 */ +static struct board_info __initdata board_96348W3 = { -+ .name = "96348W3", -+ .expected_cpu_id = 0x6348, ++ .name = "96348W3", ++ .expected_cpu_id = 0x6348, + -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, -+ -+ .has_ohci0 = 1, +}; + static struct board_info __initdata board_96348_D4PW = { - .name = "D-4P-W", - .expected_cpu_id = 0x6348, -@@ -1028,6 +1046,7 @@ static const struct board_info __initcon + .name = "D-4P-W", + .expected_cpu_id = 0x6348, +@@ -1479,6 +1496,7 @@ static const struct board_info __initcon &board_ct536_ct5621, &board_96348A_122, &board_CPVA502plus, + &board_96348W3, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1083,6 +1102,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1540,6 +1558,7 @@ static struct of_device_id const bcm963x { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gt-pn", .data = &board_96348gw_10, }, diff --git a/target/linux/bcm63xx/patches-5.4/527-board_fast2604.patch b/target/linux/bcm63xx/patches-5.4/572-board_bcm6348-sagem-fast-2604.patch similarity index 69% rename from target/linux/bcm63xx/patches-5.4/527-board_fast2604.patch rename to target/linux/bcm63xx/patches-5.4/572-board_bcm6348-sagem-fast-2604.patch index 9e42c40b5..21b10da89 100644 --- a/target/linux/bcm63xx/patches-5.4/527-board_fast2604.patch +++ b/target/linux/bcm63xx/patches-5.4/572-board_bcm6348-sagem-fast-2604.patch @@ -1,29 +1,29 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -501,6 +501,22 @@ static struct board_info __initdata boar +@@ -1159,6 +1159,22 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; +static struct board_info __initdata board_FAST2604 = { -+ .name = "F@ST2604", -+ .expected_cpu_id = 0x6348, ++ .name = "F@ST2604", ++ .expected_cpu_id = 0x6348, + -+ .has_pci = 1, -+ .has_ohci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, + -+ .has_enet1 = 1, ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; + static struct board_info __initdata board_rta1025w_16 = { .name = "RTA1025W_16", .expected_cpu_id = 0x6348, -@@ -1112,6 +1128,7 @@ static const struct board_info __initcon +@@ -1485,6 +1501,7 @@ static const struct board_info __initcon &board_96348gw_10, &board_96348gw_11, &board_FAST2404, @@ -31,7 +31,7 @@ &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, -@@ -1187,6 +1204,7 @@ static struct of_device_id const bcm963x +@@ -1560,6 +1577,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gt-pn", .data = &board_96348gw_10, }, { .compatible = "netgear,dg834g-v4", .data = &board_96348W3, }, { .compatible = "sagem,fast-2404", .data = &board_FAST2404, }, diff --git a/target/linux/bcm63xx/patches-5.4/539-board_AR1004G.patch b/target/linux/bcm63xx/patches-5.4/573-board_bcm6348-asmax-ar-1004g.patch similarity index 67% rename from target/linux/bcm63xx/patches-5.4/539-board_AR1004G.patch rename to target/linux/bcm63xx/patches-5.4/573-board_bcm6348-asmax-ar-1004g.patch index 85521b44b..a1eeee3b2 100644 --- a/target/linux/bcm63xx/patches-5.4/539-board_AR1004G.patch +++ b/target/linux/bcm63xx/patches-5.4/573-board_bcm6348-asmax-ar-1004g.patch @@ -8,39 +8,39 @@ Signed-off-by: Adrian Feliks --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -647,6 +647,21 @@ static struct board_info __initdata boar +@@ -979,6 +979,21 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; +static struct board_info __initdata board_96348gw_10_AR1004G = { -+ .name = "AR1004G", -+ .expected_cpu_id = 0x6348, ++ .name = "AR1004G", ++ .expected_cpu_id = 0x6348, + -+ .has_enet1 = 1, -+ .has_pci = 1, -+ ++ .has_pci = 1, ++ ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; + - /* BT Voyager 2110 */ static struct board_info __initdata board_V2110 = { -@@ -1649,6 +1664,7 @@ static const struct board_info __initcon + .name = "V2110", +@@ -1514,6 +1529,7 @@ static const struct board_info __initcon &board_96348A_122, &board_CPVA502plus, &board_96348W3, + &board_96348gw_10_AR1004G, - #endif - + #endif /* CONFIG_BCM63XX_CPU_6348 */ #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1713,6 +1729,7 @@ static struct of_device_id const bcm963x + &board_96358vw, +@@ -1561,6 +1577,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6345 */ #ifdef CONFIG_BCM63XX_CPU_6348 + { .compatible = "asmax,ar-1004g", .data = &board_96348gw_10_AR1004G, }, { .compatible = "belkin,f5d7633", .data = &board_96348gw_10, }, diff --git a/target/linux/bcm63xx/patches-5.4/515-board_DWV-S0_fixes.patch b/target/linux/bcm63xx/patches-5.4/601-board-bcm6358-DWV-S0_fixes.patch similarity index 59% rename from target/linux/bcm63xx/patches-5.4/515-board_DWV-S0_fixes.patch rename to target/linux/bcm63xx/patches-5.4/601-board-bcm6358-DWV-S0_fixes.patch index 9ccb29bdd..fa35102aa 100644 --- a/target/linux/bcm63xx/patches-5.4/515-board_DWV-S0_fixes.patch +++ b/target/linux/bcm63xx/patches-5.4/601-board-bcm6358-DWV-S0_fixes.patch @@ -1,10 +1,10 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -626,6 +626,7 @@ static struct board_info __initdata boar +@@ -1468,6 +1468,7 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, + .has_ehci0 = 1, }; + #endif /* CONFIG_BCM63XX_CPU_6358 */ - /* D-Link DSL-274xB revison C2/C3 */ diff --git a/target/linux/bcm63xx/patches-5.4/501-board-NB4.patch b/target/linux/bcm63xx/patches-5.4/602-board-bcm6358-sfr-neufbox-4.patch similarity index 51% rename from target/linux/bcm63xx/patches-5.4/501-board-NB4.patch rename to target/linux/bcm63xx/patches-5.4/602-board-bcm6358-sfr-neufbox-4.patch index 41c8a7e86..bb5ce6f84 100644 --- a/target/linux/bcm63xx/patches-5.4/501-board-NB4.patch +++ b/target/linux/bcm63xx/patches-5.4/602-board-bcm6358-sfr-neufbox-4.patch @@ -1,81 +1,77 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -418,6 +418,60 @@ static struct board_info __initdata boar - +@@ -1470,6 +1470,56 @@ static struct board_info __initdata boar .has_ohci0 = 1, + .has_ehci0 = 1, }; + +static struct board_info __initdata board_nb4_ser_r0 = { -+ .name = "NB4-SER-r0", -+ .expected_cpu_id = 0x6358, ++ .name = "NB4-SER-r0", ++ .expected_cpu_id = 0x6358, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, -+ -+ .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, -+ }, -+ -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, -+ -+ -+ .has_ohci0 = 1, + .has_pccard = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, + .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .num_usbh_ports = 2, ++ ++ .has_enet0 = 1, ++ .enet0 = { ++ .has_phy = 1, ++ .use_internal_phy = 1, ++ }, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, +}; + +static struct board_info __initdata board_nb4_fxc_r1 = { -+ .name = "NB4-FXC-r1", -+ .expected_cpu_id = 0x6358, ++ .name = "NB4-FXC-r1", ++ .expected_cpu_id = 0x6358, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, -+ -+ .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, -+ }, -+ -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, -+ -+ -+ .has_ohci0 = 1, + .has_pccard = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, + .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .num_usbh_ports = 2, ++ ++ .has_enet0 = 1, ++ .enet0 = { ++ .has_phy = 1, ++ .use_internal_phy = 1, ++ }, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, +}; #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -454,6 +508,8 @@ static const struct board_info __initcon +@@ -1537,6 +1587,8 @@ static const struct board_info __initcon &board_96358vw2, &board_AGPFS0, &board_DWVS0, + &board_nb4_ser_r0, + &board_nb4_fxc_r1, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -495,6 +551,8 @@ static struct of_device_id const bcm963x +@@ -1613,6 +1665,8 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,a226m", .data = &board_DWVS0, }, { .compatible = "pirelli,a226m-fwb", .data = &board_DWVS0, }, { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, + { .compatible = "sfr,neufbox-4-sercomm-r0", .data = &board_nb4_ser_r0, }, + { .compatible = "sfr,neufbox-4-foxconn-r1", .data = &board_nb4_fxc_r1, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6368 - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ + #ifdef CONFIG_BCM63XX_CPU_6362 + #endif /* CONFIG_BCM63XX_CPU_6362 */ diff --git a/target/linux/bcm63xx/patches-5.4/503-board-CPVA642.patch b/target/linux/bcm63xx/patches-5.4/603-board-bcm6358-telsey-cpva642.patch similarity index 60% rename from target/linux/bcm63xx/patches-5.4/503-board-CPVA642.patch rename to target/linux/bcm63xx/patches-5.4/603-board-bcm6358-telsey-cpva642.patch index 9e3c4e008..be860fa72 100644 --- a/target/linux/bcm63xx/patches-5.4/503-board-CPVA642.patch +++ b/target/linux/bcm63xx/patches-5.4/603-board-bcm6358-telsey-cpva642.patch @@ -1,32 +1,30 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -385,6 +385,25 @@ static struct board_info __initdata boar +@@ -1422,6 +1422,23 @@ static struct board_info __initdata boar .num_usbh_ports = 2, }; +static struct board_info __initdata board_CPVA642 = { -+ .name = "CPVA642", -+ .expected_cpu_id = 0x6358, -+ -+ .has_enet1 = 1, -+ .has_pci = 1, -+ -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, ++ .name = "CPVA642", ++ .expected_cpu_id = 0x6358, + ++ .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, -+}; + ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, ++}; + static struct board_info __initdata board_AGPFS0 = { .name = "AGPF-S0", .expected_cpu_id = 0x6358, -@@ -522,6 +541,7 @@ static const struct board_info __initcon +@@ -1586,6 +1603,7 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -34,11 +32,11 @@ &board_DWVS0, &board_nb4_ser_r0, &board_nb4_fxc_r1, -@@ -569,6 +589,7 @@ static struct of_device_id const bcm963x +@@ -1667,6 +1685,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,neufbox-4-sercomm-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,neufbox-4-foxconn-r1", .data = &board_nb4_fxc_r1, }, + { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6368 - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ + #ifdef CONFIG_BCM63XX_CPU_6362 + #endif /* CONFIG_BCM63XX_CPU_6362 */ diff --git a/target/linux/bcm63xx/patches-5.4/504-board_dsl_274xb_rev_c.patch b/target/linux/bcm63xx/patches-5.4/604-board_bcm6358-d-link-dsl-274xb-c.patch similarity index 64% rename from target/linux/bcm63xx/patches-5.4/504-board_dsl_274xb_rev_c.patch rename to target/linux/bcm63xx/patches-5.4/604-board_bcm6358-d-link-dsl-274xb-c.patch index e78832ecb..3fb9940e7 100644 --- a/target/linux/bcm63xx/patches-5.4/504-board_dsl_274xb_rev_c.patch +++ b/target/linux/bcm63xx/patches-5.4/604-board_bcm6358-d-link-dsl-274xb-c.patch @@ -1,37 +1,37 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -452,6 +452,22 @@ static struct board_info __initdata boar - .has_ohci0 = 1, +@@ -1488,6 +1488,22 @@ static struct board_info __initdata boar + .has_ehci0 = 1, }; +/* D-Link DSL-274xB revison C2/C3 */ +static struct board_info __initdata board_dsl_274xb_rev_c = { -+ .name = "AW4139", -+ .expected_cpu_id = 0x6358, ++ .name = "AW4139", ++ .expected_cpu_id = 0x6358, + -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pci = 1, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; + static struct board_info __initdata board_nb4_ser_r0 = { - .name = "NB4-SER-r0", - .expected_cpu_id = 0x6358, -@@ -543,6 +559,7 @@ static const struct board_info __initcon + .name = "NB4-SER-r0", + .expected_cpu_id = 0x6358, +@@ -1605,6 +1621,7 @@ static const struct board_info __initcon &board_AGPFS0, &board_CPVA642, &board_DWVS0, + &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, - #endif -@@ -582,6 +599,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6358 */ +@@ -1678,6 +1695,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/508-board_hw553.patch b/target/linux/bcm63xx/patches-5.4/605-board_bcm6358-huawei-echolife-hg553.patch similarity index 57% rename from target/linux/bcm63xx/patches-5.4/508-board_hw553.patch rename to target/linux/bcm63xx/patches-5.4/605-board_bcm6358-huawei-echolife-hg553.patch index e6e94f71f..e5eb2ff8e 100644 --- a/target/linux/bcm63xx/patches-5.4/508-board_hw553.patch +++ b/target/linux/bcm63xx/patches-5.4/605-board_bcm6358-huawei-echolife-hg553.patch @@ -1,47 +1,46 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -618,6 +618,32 @@ static struct board_info __initdata boar - .has_ehci0 = 1, - .num_usbh_ports = 2, +@@ -1553,6 +1553,31 @@ static struct board_info __initdata boar + .force_duplex_full = 1, + }, }; + +static struct board_info __initdata board_HW553 = { -+ .name = "HW553", -+ .expected_cpu_id = 0x6358, -+ -+ .has_enet1 = 1, -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, ++ .name = "HW553", ++ .expected_cpu_id = 0x6358, + ++ .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .num_usbh_ports = 2, + ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, ++ ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -663,6 +689,7 @@ static const struct board_info __initcon +@@ -1624,6 +1649,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, + &board_HW553, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -706,6 +733,7 @@ static struct of_device_id const bcm963x +@@ -1697,6 +1723,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/510-board_spw303v.patch b/target/linux/bcm63xx/patches-5.4/606-board_bcm6358-t-com-speedport-w-303v.patch similarity index 61% rename from target/linux/bcm63xx/patches-5.4/510-board_spw303v.patch rename to target/linux/bcm63xx/patches-5.4/606-board_bcm6358-t-com-speedport-w-303v.patch index 69432c94d..114e55a14 100644 --- a/target/linux/bcm63xx/patches-5.4/510-board_spw303v.patch +++ b/target/linux/bcm63xx/patches-5.4/606-board_bcm6358-t-com-speedport-w-303v.patch @@ -1,39 +1,39 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -658,6 +658,20 @@ static struct board_info __initdata boar - .pci_dev = 1, +@@ -1578,6 +1578,20 @@ static struct board_info __initdata boar + .pci_dev = 1, }, }; + + /* T-Home Speedport W 303V Typ B */ +static struct board_info __initdata board_spw303v = { -+ .name = "96358-502V", -+ .expected_cpu_id = 0x6358, ++ .name = "96358-502V", ++ .expected_cpu_id = 0x6358, + -+ .has_enet0 = 1, -+ .has_pci = 1, ++ .has_pci = 1, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, +}; #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -705,6 +719,7 @@ static const struct board_info __initcon +@@ -1650,6 +1664,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_HW553, + &board_spw303v, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ }; -@@ -756,6 +771,7 @@ static struct of_device_id const bcm963x +@@ -1730,6 +1745,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,neufbox-4-sercomm-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,neufbox-4-foxconn-r1", .data = &board_nb4_fxc_r1, }, + { .compatible = "t-com,speedport-w-303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, - #endif - #ifdef CONFIG_BCM63XX_CPU_6368 + #endif /* CONFIG_BCM63XX_CPU_6358 */ + #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/bcm63xx/patches-5.4/524-board_CT6373-1.patch b/target/linux/bcm63xx/patches-5.4/607-board_bcm6358-comtrend-ct-6373.patch similarity index 57% rename from target/linux/bcm63xx/patches-5.4/524-board_CT6373-1.patch rename to target/linux/bcm63xx/patches-5.4/607-board_bcm6358-comtrend-ct-6373.patch index 0cfcc173f..4c0ff7906 100644 --- a/target/linux/bcm63xx/patches-5.4/524-board_CT6373-1.patch +++ b/target/linux/bcm63xx/patches-5.4/607-board_bcm6358-comtrend-ct-6373.patch @@ -1,45 +1,45 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -874,6 +874,30 @@ static struct board_info __initdata boar - .num_usbh_ports = 2, +@@ -1554,6 +1554,30 @@ static struct board_info __initdata boar + }, }; +static struct board_info __initdata board_ct6373_1 = { -+ .name = "CT6373-1", -+ .expected_cpu_id = 0x6358, ++ .name = "CT6373-1", ++ .expected_cpu_id = 0x6358, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enet1 = 1, ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; + static struct board_info __initdata board_HW553 = { - .name = "HW553", - .expected_cpu_id = 0x6358, -@@ -1058,6 +1082,7 @@ static const struct board_info __initcon + .name = "HW553", + .expected_cpu_id = 0x6358, +@@ -1663,6 +1687,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, + &board_ct6373_1, &board_HW553, &board_spw303v, - #endif -@@ -1116,6 +1141,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6358 */ +@@ -1736,6 +1761,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/525-board_dva-g3810bn-tl-1.patch b/target/linux/bcm63xx/patches-5.4/608-board_bcm6358-d-link-dva-g3810bn-tl.patch similarity index 59% rename from target/linux/bcm63xx/patches-5.4/525-board_dva-g3810bn-tl-1.patch rename to target/linux/bcm63xx/patches-5.4/608-board_bcm6358-d-link-dva-g3810bn-tl.patch index 45e8717be..a106ab844 100644 --- a/target/linux/bcm63xx/patches-5.4/525-board_dva-g3810bn-tl-1.patch +++ b/target/linux/bcm63xx/patches-5.4/608-board_bcm6358-d-link-dva-g3810bn-tl.patch @@ -1,48 +1,46 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -937,6 +937,33 @@ static struct board_info __initdata boar - .use_internal_phy = 1, +@@ -1616,6 +1616,31 @@ static struct board_info __initdata boar + .use_internal_phy = 1, }, }; + +/* D-Link DVA-G3810BN/TL */ +static struct board_info __initdata board_DVAG3810BN = { -+ .name = "DVAG3810BN", -+ .expected_cpu_id = 0x6358, ++ .name = "DVAG3810BN", ++ .expected_cpu_id = 0x6358, + -+ .has_enet0 = 1, -+ .has_enet1 = 1, -+ .has_pci = 1, ++ .has_pccard = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, + ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, -+ -+ -+ .has_ohci0 = 1, -+ .has_pccard = 1, -+ .has_ehci0 = 1, +}; #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1085,6 +1112,7 @@ static const struct board_info __initcon +@@ -1690,6 +1715,7 @@ static const struct board_info __initcon &board_ct6373_1, &board_HW553, &board_spw303v, + &board_DVAG3810BN, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ + }; - #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1144,6 +1172,7 @@ static struct of_device_id const bcm963x +@@ -1764,6 +1790,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ct-6373", .data = &board_ct6373_1, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/bcm63xx/patches-5.4/532-board_hw556.patch b/target/linux/bcm63xx/patches-5.4/609-board_bcm6358-huawei-echolife-hg556.patch similarity index 50% rename from target/linux/bcm63xx/patches-5.4/532-board_hw556.patch rename to target/linux/bcm63xx/patches-5.4/609-board_bcm6358-huawei-echolife-hg556.patch index cf55255cd..d05e6ca98 100644 --- a/target/linux/bcm63xx/patches-5.4/532-board_hw556.patch +++ b/target/linux/bcm63xx/patches-5.4/609-board_bcm6358-huawei-echolife-hg556.patch @@ -8,100 +8,102 @@ #include #include #include -@@ -1123,6 +1124,92 @@ static struct board_info __initdata boar +@@ -1603,6 +1604,94 @@ static struct board_info __initdata boar }, }; -+static struct board_info __initdata board_HW556_C = { -+ .name = "HW556_C", -+ .expected_cpu_id = 0x6358, -+ -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, -+ -+ .has_caldata = 1, -+ .caldata = { -+ { -+ .vendor = PCI_VENDOR_ID_RALINK, -+ .caldata_offset = 0xeffe00, -+ .slot = 1, -+ .eeprom = "rt2x00.eeprom", -+ }, -+ }, -+ -+ .has_enet1 = 1, -+ .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, -+ }, -+}; +static struct board_info __initdata board_HW556_A = { -+ .name = "HW556_A", -+ .expected_cpu_id = 0x6358, ++ .name = "HW556_A", ++ .expected_cpu_id = 0x6358, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_caldata = 1, ++ .has_caldata = 1, + .caldata = { + { -+ .vendor = PCI_VENDOR_ID_ATHEROS, -+ .caldata_offset = 0xf7e000, -+ .slot = 1, -+ .endian_check = 1, -+ .led_pin = 2, -+ .led_active_high = 1, ++ .vendor = PCI_VENDOR_ID_ATHEROS, ++ .caldata_offset = 0xf7e000, ++ .slot = 1, ++ .endian_check = 1, ++ .led_pin = 2, ++ .led_active_high = 1, + }, + }, + -+ .has_enet1 = 1, ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; ++ +static struct board_info __initdata board_HW556_B = { -+ .name = "HW556_B", -+ .expected_cpu_id = 0x6358, ++ .name = "HW556_B", ++ .expected_cpu_id = 0x6358, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_caldata = 1, ++ .has_caldata = 1, + .caldata = { + { -+ .vendor = PCI_VENDOR_ID_ATHEROS, -+ .caldata_offset = 0xefe000, -+ .slot = 1, -+ .endian_check = 1, -+ .led_pin = 2, -+ .led_active_high = 1, ++ .vendor = PCI_VENDOR_ID_ATHEROS, ++ .caldata_offset = 0xefe000, ++ .slot = 1, ++ .endian_check = 1, ++ .led_pin = 2, ++ .led_active_high = 1, + }, + }, + -+ .has_enet1 = 1, ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, ++ }, ++}; ++ ++static struct board_info __initdata board_HW556_C = { ++ .name = "HW556_C", ++ .expected_cpu_id = 0x6358, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, ++ ++ .has_caldata = 1, ++ .caldata = { ++ { ++ .vendor = PCI_VENDOR_ID_RALINK, ++ .caldata_offset = 0xeffe00, ++ .slot = 1, ++ .eeprom = "rt2x00.eeprom", ++ }, ++ }, ++ ++ .has_enet1 = 1, ++ .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, +}; + /* T-Home Speedport W 303V Typ B */ static struct board_info __initdata board_spw303v = { - .name = "96358-502V", -@@ -1341,6 +1428,9 @@ static const struct board_info __initcon + .name = "96358-502V", +@@ -1714,6 +1803,9 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_ct6373_1, &board_HW553, @@ -110,8 +112,8 @@ + &board_HW556_C, &board_spw303v, &board_DVAG3810BN, - #endif -@@ -1413,6 +1503,9 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6358 */ +@@ -1792,6 +1884,9 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn-tl", .data = &board_DVAG3810BN, }, { .compatible = "huawei,echolife-hg553", .data = &board_HW553, }, diff --git a/target/linux/bcm63xx/patches-5.4/546-board_hw520.patch b/target/linux/bcm63xx/patches-5.4/610-board_bcm6359-huawei-echolife-hg520v.patch similarity index 58% rename from target/linux/bcm63xx/patches-5.4/546-board_hw520.patch rename to target/linux/bcm63xx/patches-5.4/610-board_bcm6359-huawei-echolife-hg520v.patch index aaf662a76..ff31e2973 100644 --- a/target/linux/bcm63xx/patches-5.4/546-board_hw520.patch +++ b/target/linux/bcm63xx/patches-5.4/610-board_bcm6359-huawei-echolife-hg520v.patch @@ -1,43 +1,43 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1264,6 +1264,36 @@ static struct board_info __initdata boar +@@ -1579,6 +1579,36 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_HW520 = { -+ .name = "HW6358GW_B", -+ .expected_cpu_id = 0x6358, ++ .name = "HW6358GW_B", ++ .expected_cpu_id = 0x6358, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enet0 = 1, ++ .has_enet0 = 1, + .enet0 = { -+ .has_phy = 1, -+ .use_internal_phy = 1, ++ .has_phy = 1, ++ .use_internal_phy = 1, + }, + -+ .has_enet1 = 1, ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; + static struct board_info __initdata board_HW553 = { - .name = "HW553", - .expected_cpu_id = 0x6358, -@@ -1981,6 +2011,7 @@ static const struct board_info __initcon + .name = "HW553", + .expected_cpu_id = 0x6358, +@@ -1802,6 +1832,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -45,7 +45,7 @@ &board_HW553, &board_HW556_A, &board_HW556_B, -@@ -2073,6 +2104,7 @@ static struct of_device_id const bcm963x +@@ -1883,6 +1914,7 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn-tl", .data = &board_DVAG3810BN, }, diff --git a/target/linux/bcm63xx/patches-5.4/550-board_homehub2a.patch b/target/linux/bcm63xx/patches-5.4/611-board_bcm6358-bt-home-hub-2-a.patch similarity index 51% rename from target/linux/bcm63xx/patches-5.4/550-board_homehub2a.patch rename to target/linux/bcm63xx/patches-5.4/611-board_bcm6358-bt-home-hub-2-a.patch index 267143cf9..b7caeb417 100644 --- a/target/linux/bcm63xx/patches-5.4/550-board_homehub2a.patch +++ b/target/linux/bcm63xx/patches-5.4/611-board_bcm6358-bt-home-hub-2-a.patch @@ -1,38 +1,38 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1375,6 +1375,31 @@ static struct board_info __initdata boar +@@ -1579,6 +1579,31 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_homehub2a = { -+ .name = "HOMEHUB2A", -+ .expected_cpu_id = 0x6358, ++ .name = "HOMEHUB2A", ++ .expected_cpu_id = 0x6358, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_enet1 = 1, ++ .has_enet1 = 1, + .enet1 = { -+ .has_phy = 1, -+ .phy_id = 0, -+ .force_speed_100 = 1, -+ .force_duplex_full = 1, ++ .has_phy = 1, ++ .phy_id = 0, ++ .force_speed_100 = 1, ++ .force_duplex_full = 1, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4322, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4322, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; + static struct board_info __initdata board_HW520 = { - .name = "HW6358GW_B", - .expected_cpu_id = 0x6358, -@@ -2148,6 +2173,7 @@ static const struct board_info __initcon + .name = "HW6358GW_B", + .expected_cpu_id = 0x6358, +@@ -1832,6 +1857,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -40,11 +40,11 @@ &board_HW520, &board_HW553, &board_HW556_A, -@@ -2257,6 +2283,7 @@ static struct of_device_id const bcm963x +@@ -1927,6 +1953,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-4-foxconn-r1", .data = &board_nb4_fxc_r1, }, { .compatible = "t-com,speedport-w-303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, + { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 - { .compatible = "sagem,fast-2504n", .data = &board_fast2504n, }, + #endif /* CONFIG_BCM63XX_CPU_6362 */ diff --git a/target/linux/bcm63xx/patches-5.4/631-board_bcm6361-sfr-neufbox-6.patch b/target/linux/bcm63xx/patches-5.4/631-board_bcm6361-sfr-neufbox-6.patch new file mode 100644 index 000000000..79e9efb2b --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/631-board_bcm6361-sfr-neufbox-6.patch @@ -0,0 +1,52 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -1787,6 +1787,31 @@ static struct board_info __initdata boar + }; + #endif /* CONFIG_BCM63XX_CPU_6358 */ + ++#ifdef CONFIG_BCM63XX_CPU_6362 ++static struct board_info __initdata board_nb6 = { ++ .name = "NB6", ++ .expected_cpu_id = 0x6362, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [4] = { ++ .used = 1, ++ .phy_id = 0xff, ++ .bypass_link = 1, ++ .force_speed = 1000, ++ .force_duplex_full = 1, ++ .name = "RGMII", ++ }, ++ }, ++ }, ++}; ++#endif /* CONFIG_BCM63XX_CPU_6362 */ ++ + /* + * all boards + */ +@@ -1866,6 +1891,9 @@ static const struct board_info __initcon + &board_spw303v, + &board_DVAG3810BN, + #endif /* CONFIG_BCM63XX_CPU_6358 */ ++#ifdef CONFIG_BCM63XX_CPU_6362 ++ &board_nb6, ++#endif /* CONFIG_BCM63XX_CPU_6362 */ + }; + + static struct of_device_id const bcm963xx_boards_dt[] = { +@@ -1956,6 +1984,7 @@ static struct of_device_id const bcm963x + { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, + #endif /* CONFIG_BCM63XX_CPU_6358 */ + #ifdef CONFIG_BCM63XX_CPU_6362 ++ { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, + #endif /* CONFIG_BCM63XX_CPU_6362 */ + #ifdef CONFIG_BCM63XX_CPU_6368 + #endif /* CONFIG_BCM63XX_CPU_6368 */ diff --git a/target/linux/bcm63xx/patches-5.4/535-board_fast2504n.patch b/target/linux/bcm63xx/patches-5.4/632-board_bcm6362-sagem-fast-2504n.patch similarity index 53% rename from target/linux/bcm63xx/patches-5.4/535-board_fast2504n.patch rename to target/linux/bcm63xx/patches-5.4/632-board_bcm6362-sagem-fast-2504n.patch index ff0440772..3bb3ad423 100644 --- a/target/linux/bcm63xx/patches-5.4/535-board_fast2504n.patch +++ b/target/linux/bcm63xx/patches-5.4/632-board_bcm6362-sagem-fast-2504n.patch @@ -6,41 +6,37 @@ Signed-off-by: Max Staudt --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1332,6 +1332,41 @@ static struct board_info __initdata boar +@@ -1810,6 +1810,37 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_fast2504n = { -+ .name = "F@ST2504n", -+ .expected_cpu_id = 0x6362, -+ -+ .has_enetsw = 1, ++ .name = "F@ST2504n", ++ .expected_cpu_id = 0x6362, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", + }, -+ + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, -+ + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, -+ + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, + }, + }, @@ -48,19 +44,19 @@ Signed-off-by: Max Staudt #endif /* CONFIG_BCM63XX_CPU_6362 */ /* -@@ -1495,6 +1530,7 @@ static const struct board_info __initcon - +@@ -1893,6 +1924,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 &board_nb6, + &board_fast2504n, - #endif + #endif /* CONFIG_BCM63XX_CPU_6362 */ + }; - #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1576,6 +1612,7 @@ static struct of_device_id const bcm963x - { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, - #endif +@@ -1984,6 +2016,7 @@ static struct of_device_id const bcm963x + { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, + #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 + { .compatible = "sagem,fast-2504n", .data = &board_fast2504n, }, { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch b/target/linux/bcm63xx/patches-5.4/633-board-bcm6362-netgear-dgnd3700-v2.patch similarity index 55% rename from target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch rename to target/linux/bcm63xx/patches-5.4/633-board-bcm6362-netgear-dgnd3700-v2.patch index 2a39c733e..17beb1415 100644 --- a/target/linux/bcm63xx/patches-5.4/564-board-DGND3700v2.patch +++ b/target/linux/bcm63xx/patches-5.4/633-board-bcm6362-netgear-dgnd3700-v2.patch @@ -1,50 +1,49 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1820,6 +1820,31 @@ static struct board_info __initdata boar +@@ -1811,6 +1811,30 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_dgnd3700v2 = { -+ .name = "96362ADVN2xh", -+ .expected_cpu_id = 0x6362, ++ .name = "96362ADVN2xh", ++ .expected_cpu_id = 0x6362, + -+ .has_pci = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, -+ -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [4] = { -+ .used = 1, -+ .phy_id = 0xff, ++ .used = 1, ++ .phy_id = 0xff, + .bypass_link = 1, + .force_speed = 1000, + .force_duplex_full = 1, -+ .name = "RGMII", ++ .name = "RGMII", + }, + }, + }, +}; + static struct board_info __initdata board_fast2504n = { - .name = "F@ST2504n", - .expected_cpu_id = 0x6362, -@@ -2830,6 +2855,7 @@ static const struct board_info __initcon - + .name = "F@ST2504n", + .expected_cpu_id = 0x6362, +@@ -1924,6 +1948,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 &board_nb6, + &board_dgnd3700v2, &board_fast2504n, - #endif - -@@ -2945,6 +2971,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6362 */ + }; +@@ -2016,6 +2041,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 + { .compatible = "netgear,dgnd3700-v2", .data = &board_dgnd3700v2, }, { .compatible = "sagem,fast-2504n", .data = &board_fast2504n, }, { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6362 */ diff --git a/target/linux/bcm63xx/patches-5.4/566-board-HG253s-v2.patch b/target/linux/bcm63xx/patches-5.4/634-board-bcm6362-huawei-hg253s-v2.patch similarity index 79% rename from target/linux/bcm63xx/patches-5.4/566-board-HG253s-v2.patch rename to target/linux/bcm63xx/patches-5.4/634-board-bcm6362-huawei-hg253s-v2.patch index cbcd2ade9..db36cf2ff 100644 --- a/target/linux/bcm63xx/patches-5.4/566-board-HG253s-v2.patch +++ b/target/linux/bcm63xx/patches-5.4/634-board-bcm6362-huawei-hg253s-v2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1879,6 +1879,37 @@ static struct board_info __initdata boar +@@ -1865,6 +1865,37 @@ static struct board_info __initdata boar }, }, }; @@ -9,8 +9,8 @@ + .name = "hg253s", + .expected_cpu_id = 0x6362, + -+ .has_ehci0 = 1, + .has_ohci0 = 1, ++ .has_ehci0 = 1, + .num_usbh_ports = 1, + + .has_enetsw = 1, @@ -28,7 +28,7 @@ + + [5] = { + .used = 1, -+ .phy_id = 24, ++ .phy_id = 24, + .timing_sel = 1, + .name = "WAN", + }, @@ -38,17 +38,17 @@ #endif /* CONFIG_BCM63XX_CPU_6362 */ /* -@@ -2882,6 +2913,7 @@ static const struct board_info __initcon +@@ -1950,6 +1981,7 @@ static const struct board_info __initcon &board_nb6, &board_dgnd3700v2, &board_fast2504n, + &board_hg253s_v2, - #endif + #endif /* CONFIG_BCM63XX_CPU_6362 */ + }; - #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -2997,6 +3029,7 @@ static struct of_device_id const bcm963x +@@ -2041,6 +2073,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,home-hub-2-a", .data = &board_homehub2a, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6358 */ #ifdef CONFIG_BCM63XX_CPU_6362 + { .compatible = "huawei,hg253s-v2", .data = &board_hg253s_v2, }, { .compatible = "netgear,dgnd3700-v2", .data = &board_dgnd3700v2, }, diff --git a/target/linux/bcm63xx/patches-5.4/518-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/bcm63xx/patches-5.4/651-bcm63xx-add-support-for-96368MVWG-board.patch similarity index 68% rename from target/linux/bcm63xx/patches-5.4/518-bcm63xx-add-support-for-96368MVWG-board.patch rename to target/linux/bcm63xx/patches-5.4/651-bcm63xx-add-support-for-96368MVWG-board.patch index 17087b36a..948d473f5 100644 --- a/target/linux/bcm63xx/patches-5.4/518-bcm63xx-add-support-for-96368MVWG-board.patch +++ b/target/linux/bcm63xx/patches-5.4/651-bcm63xx-add-support-for-96368MVWG-board.patch @@ -10,58 +10,52 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -792,6 +792,58 @@ static struct board_info __initdata boar - #endif /* CONFIG_BCM63XX_CPU_6358 */ +@@ -1899,6 +1899,52 @@ static struct board_info __initdata boar + #endif /* CONFIG_BCM63XX_CPU_6362 */ /* + * known 6368 boards + */ +#ifdef CONFIG_BCM63XX_CPU_6368 +static struct board_info __initdata board_96368mvwg = { -+ .name = "96368MVWG", -+ .expected_cpu_id = 0x6368, ++ .name = "96368MVWG", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ -+ .has_usbd = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + ++ .has_usbd = 1, + .usbd = { -+ .use_fullspeed = 0, -+ .port_no = 0, ++ .use_fullspeed = 0, ++ .port_no = 0, + }, + -+ .has_enetsw = 1, -+ ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port1", + }, -+ + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port2", + }, -+ + [4] = { -+ .used = 1, -+ .phy_id = 0x12, -+ .name = "port0", ++ .used = 1, ++ .phy_id = 0x12, ++ .name = "port0", + }, -+ + [5] = { -+ .used = 1, -+ .phy_id = 0x11, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 0x11, ++ .name = "port3", + }, + }, + }, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, +}; +#endif /* CONFIG_BCM63XX_CPU_6368 */ + @@ -69,25 +63,24 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -843,6 +895,10 @@ static const struct board_info __initcon - &board_HW553, - &board_spw303v, - #endif -+ +@@ -1983,6 +2029,9 @@ static const struct board_info __initcon + &board_fast2504n, + &board_hg253s_v2, + #endif /* CONFIG_BCM63XX_CPU_6362 */ +#ifdef CONFIG_BCM63XX_CPU_6368 + &board_96368mvwg, -+#endif ++#endif /* CONFIG_BCM63XX_CPU_6368 */ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -903,6 +959,7 @@ static struct of_device_id const bcm963x - { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, - #endif +@@ -2079,6 +2128,7 @@ static struct of_device_id const bcm963x + { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 + { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 - #endif + #endif /* CONFIG_BCM63XX_CPU_63268 */ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c @@ -81,12 +81,25 @@ void __init board_early_setup(const stru diff --git a/target/linux/bcm63xx/patches-5.4/519-bcm63xx-add-support-for-96368MVNgr-board.patch b/target/linux/bcm63xx/patches-5.4/652-bcm63xx-add-support-for-96368MVNgr-board.patch similarity index 57% rename from target/linux/bcm63xx/patches-5.4/519-bcm63xx-add-support-for-96368MVNgr-board.patch rename to target/linux/bcm63xx/patches-5.4/652-bcm63xx-add-support-for-96368MVNgr-board.patch index 03bda96df..663304d08 100644 --- a/target/linux/bcm63xx/patches-5.4/519-bcm63xx-add-support-for-96368MVNgr-board.patch +++ b/target/linux/bcm63xx/patches-5.4/652-bcm63xx-add-support-for-96368MVNgr-board.patch @@ -9,65 +9,61 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -841,6 +841,45 @@ static struct board_info __initdata boar - .has_ohci0 = 1, - .has_ehci0 = 1, +@@ -1942,6 +1942,41 @@ static struct board_info __initdata boar + }, + }, }; + +static struct board_info __initdata board_96368mvngr = { -+ .name = "96368MVNgr", -+ .expected_cpu_id = 0x6368, ++ .name = "96368MVNgr", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, -+ + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, -+ + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, -+ + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, -+ -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, +}; #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -898,6 +937,7 @@ static const struct board_info __initcon - +@@ -2031,6 +2066,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, + &board_96368mvngr, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ }; -@@ -959,6 +999,7 @@ static struct of_device_id const bcm963x - { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, - #endif +@@ -2128,6 +2164,7 @@ static struct of_device_id const bcm963x + { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 + { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/542-board_WAP-5813n.patch b/target/linux/bcm63xx/patches-5.4/653-board_bcm6369-comtrend-wap-5813n.patch similarity index 65% rename from target/linux/bcm63xx/patches-5.4/542-board_WAP-5813n.patch rename to target/linux/bcm63xx/patches-5.4/653-board_bcm6369-comtrend-wap-5813n.patch index c08c2c0fc..0386dc830 100644 --- a/target/linux/bcm63xx/patches-5.4/542-board_WAP-5813n.patch +++ b/target/linux/bcm63xx/patches-5.4/653-board_bcm6369-comtrend-wap-5813n.patch @@ -9,9 +9,9 @@ #include #include #include -@@ -1566,6 +1568,47 @@ static struct board_info __initdata boar - .has_ohci0 = 1, - .has_ehci0 = 1, +@@ -1977,6 +1979,47 @@ static struct board_info __initdata boar + }, + }, }; + +static struct sprom_fixup __initdata wap5813n_fixups[] = { @@ -24,15 +24,14 @@ +}; + +static struct board_info __initdata board_WAP5813n = { -+ .name = "96369R-1231N", -+ .expected_cpu_id = 0x6368, ++ .name = "96369R-1231N", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [4] = { @@ -46,30 +45,31 @@ + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43222, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = wap5813n_fixups, -+ .num_board_fixups = ARRAY_SIZE(wap5813n_fixups), ++ .type = SPROM_BCM43222, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = wap5813n_fixups, ++ .num_board_fixups = ARRAY_SIZE(wap5813n_fixups), + }, +}; #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1806,6 +1849,7 @@ static const struct board_info __initcon +@@ -2067,6 +2110,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, + &board_WAP5813n, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 - &board_963268bu_p300, -@@ -1898,6 +1942,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6368 */ + }; + +@@ -2166,6 +2210,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, + { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 - { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, + #endif /* CONFIG_BCM63XX_CPU_63268 */ diff --git a/target/linux/bcm63xx/patches-5.4/543-board_VR-3025u.patch b/target/linux/bcm63xx/patches-5.4/654-board_bcm6368-comtrend-vr-3025u.patch similarity index 59% rename from target/linux/bcm63xx/patches-5.4/543-board_VR-3025u.patch rename to target/linux/bcm63xx/patches-5.4/654-board_bcm6368-comtrend-vr-3025u.patch index b92f03204..777259439 100644 --- a/target/linux/bcm63xx/patches-5.4/543-board_VR-3025u.patch +++ b/target/linux/bcm63xx/patches-5.4/654-board_bcm6368-comtrend-vr-3025u.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1569,6 +1569,59 @@ static struct board_info __initdata boar - .has_ehci0 = 1, +@@ -1980,6 +1980,59 @@ static struct board_info __initdata boar + }, }; +static struct sprom_fixup __initdata vr3025u_fixups[] = { @@ -14,65 +14,65 @@ +}; + +static struct board_info __initdata board_VR3025u = { -+ .name = "96368M-1541N", -+ .expected_cpu_id = 0x6368, ++ .name = "96368M-1541N", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43222, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = vr3025u_fixups, -+ .num_board_fixups = ARRAY_SIZE(vr3025u_fixups), ++ .type = SPROM_BCM43222, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = vr3025u_fixups, ++ .num_board_fixups = ARRAY_SIZE(vr3025u_fixups), + }, +}; + static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -1849,6 +1902,7 @@ static const struct board_info __initcon +@@ -2110,6 +2163,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, + &board_VR3025u, &board_WAP5813n, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -1942,6 +1996,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6368 */ + }; +@@ -2210,6 +2264,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, + { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/544-board_VR-3025un.patch b/target/linux/bcm63xx/patches-5.4/655-board_bcm6368-comtrend-vr-3025un.patch similarity index 60% rename from target/linux/bcm63xx/patches-5.4/544-board_VR-3025un.patch rename to target/linux/bcm63xx/patches-5.4/655-board_bcm6368-comtrend-vr-3025un.patch index ec0e13db5..82c088784 100644 --- a/target/linux/bcm63xx/patches-5.4/544-board_VR-3025un.patch +++ b/target/linux/bcm63xx/patches-5.4/655-board_bcm6368-comtrend-vr-3025un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1622,6 +1622,59 @@ static struct board_info __initdata boar +@@ -2033,6 +2033,59 @@ static struct board_info __initdata boar }, }; @@ -14,65 +14,65 @@ +}; + +static struct board_info __initdata board_VR3025un = { -+ .name = "96368M-1341N", -+ .expected_cpu_id = 0x6368, ++ .name = "96368M-1341N", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43222, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = vr3025un_fixups, -+ .num_board_fixups = ARRAY_SIZE(vr3025un_fixups), ++ .type = SPROM_BCM43222, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = vr3025un_fixups, ++ .num_board_fixups = ARRAY_SIZE(vr3025un_fixups), + }, +}; + static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -1903,6 +1956,7 @@ static const struct board_info __initcon +@@ -2164,6 +2217,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_VR3025u, + &board_VR3025un, &board_WAP5813n, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -1997,6 +2051,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6368 */ + }; +@@ -2265,6 +2319,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, + { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/545-board_P870HW-51a_v2.patch b/target/linux/bcm63xx/patches-5.4/656-board_bcm6368-zyxel-p870hw-51a-v2.patch similarity index 52% rename from target/linux/bcm63xx/patches-5.4/545-board_P870HW-51a_v2.patch rename to target/linux/bcm63xx/patches-5.4/656-board_bcm6368-zyxel-p870hw-51a-v2.patch index 6b60a3fa8..0c2c2b9c8 100644 --- a/target/linux/bcm63xx/patches-5.4/545-board_P870HW-51a_v2.patch +++ b/target/linux/bcm63xx/patches-5.4/656-board_bcm6368-zyxel-p870hw-51a-v2.patch @@ -1,55 +1,55 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1578,6 +1578,48 @@ static struct sprom_fixup __initdata vr3 +@@ -1989,6 +1989,48 @@ static struct sprom_fixup __initdata vr3 { .offset = 115, .value = 0xfad9 }, }; +static struct board_info __initdata board_P870HW51A_V2 = { -+ .name = "P870HW-51a_v2", -+ .expected_cpu_id = 0x6368, ++ .name = "P870HW-51a_v2", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4318, -+ .pci_bus = 0, -+ .pci_dev = 1, ++ .type = SPROM_BCM4318, ++ .pci_bus = 0, ++ .pci_dev = 1, + }, +}; + static struct board_info __initdata board_VR3025u = { - .name = "96368M-1541N", - .expected_cpu_id = 0x6368, -@@ -1955,6 +1997,7 @@ static const struct board_info __initcon + .name = "96368M-1541N", + .expected_cpu_id = 0x6368, +@@ -2216,6 +2258,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -57,11 +57,11 @@ &board_VR3025u, &board_VR3025un, &board_WAP5813n, -@@ -2053,6 +2096,7 @@ static struct of_device_id const bcm963x +@@ -2321,6 +2364,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, + { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 - { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, + #endif /* CONFIG_BCM63XX_CPU_63268 */ diff --git a/target/linux/bcm63xx/patches-5.4/549-board_DGND3700v1_3800B.patch b/target/linux/bcm63xx/patches-5.4/657-board_bcm6368-netgear-dgnd3700-v1.patch similarity index 69% rename from target/linux/bcm63xx/patches-5.4/549-board_DGND3700v1_3800B.patch rename to target/linux/bcm63xx/patches-5.4/657-board_bcm6368-netgear-dgnd3700-v1.patch index 936aab115..47a19afbf 100644 --- a/target/linux/bcm63xx/patches-5.4/549-board_DGND3700v1_3800B.patch +++ b/target/linux/bcm63xx/patches-5.4/657-board_bcm6368-netgear-dgnd3700-v1.patch @@ -1,28 +1,28 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1710,6 +1710,30 @@ static struct board_info __initdata boar - .has_ehci0 = 1, +@@ -1980,6 +1980,30 @@ static struct board_info __initdata boar + }, }; +static struct board_info __initdata board_DGND3700v1_3800B = { -+ .name = "DGND3700v1_3800B", -+ .expected_cpu_id = 0x6368, ++ .name = "DGND3700v1_3800B", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [5] = { -+ .used = 1, -+ .phy_id = 0xff, ++ .used = 1, ++ .phy_id = 0xff, + .bypass_link = 1, + .force_speed = 1000, + .force_duplex_full = 1, -+ .name = "RGMII", ++ .name = "RGMII", + }, + }, + }, @@ -31,7 +31,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2141,6 +2165,7 @@ static const struct board_info __initcon +@@ -2258,6 +2282,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -39,11 +39,11 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2243,6 +2268,7 @@ static struct of_device_id const bcm963x +@@ -2364,6 +2389,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, + { .compatible = "netgear,dgnd3700-v1", .data = &board_DGND3700v1_3800B, }, { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/551-board_HG655b.patch b/target/linux/bcm63xx/patches-5.4/658-board_bcm6368-huawei-echolife-hg655b.patch similarity index 58% rename from target/linux/bcm63xx/patches-5.4/551-board_HG655b.patch rename to target/linux/bcm63xx/patches-5.4/658-board_bcm6368-huawei-echolife-hg655b.patch index d1b865134..c1ad040cb 100644 --- a/target/linux/bcm63xx/patches-5.4/551-board_HG655b.patch +++ b/target/linux/bcm63xx/patches-5.4/658-board_bcm6368-huawei-echolife-hg655b.patch @@ -1,50 +1,50 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1759,6 +1759,52 @@ static struct board_info __initdata boar +@@ -2004,6 +2004,52 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_HG655b = { -+ .name = "HW65x", -+ .expected_cpu_id = 0x6368, ++ .name = "HW65x", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_caldata = 1, ++ .has_caldata = 1, + .caldata = { + { -+ .vendor = PCI_VENDOR_ID_RALINK, -+ .caldata_offset = 0x7c0000, -+ .slot = 1, -+ .eeprom = "rt2x00.eeprom", ++ .vendor = PCI_VENDOR_ID_RALINK, ++ .caldata_offset = 0x7c0000, ++ .slot = 1, ++ .eeprom = "rt2x00.eeprom", + }, + }, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, @@ -53,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2192,6 +2238,7 @@ static const struct board_info __initcon +@@ -2283,6 +2329,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -61,11 +61,11 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2295,6 +2342,7 @@ static struct of_device_id const bcm963x +@@ -2389,6 +2436,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, + { .compatible = "huawei,echolife-hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700-v1", .data = &board_DGND3700v1_3800B, }, { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ diff --git a/target/linux/bcm63xx/patches-5.4/553-board_VR-3026e.patch b/target/linux/bcm63xx/patches-5.4/659-board_bcm6368-comtrend-vr-3026e.patch similarity index 62% rename from target/linux/bcm63xx/patches-5.4/553-board_VR-3026e.patch rename to target/linux/bcm63xx/patches-5.4/659-board_bcm6368-comtrend-vr-3026e.patch index 1455b748c..4be53d10a 100644 --- a/target/linux/bcm63xx/patches-5.4/553-board_VR-3026e.patch +++ b/target/linux/bcm63xx/patches-5.4/659-board_bcm6368-comtrend-vr-3026e.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1992,6 +1992,59 @@ static struct board_info __initdata boar +@@ -2198,6 +2198,59 @@ static struct board_info __initdata boar }, }; @@ -14,61 +14,61 @@ +}; + +static struct board_info __initdata board_VR3026e = { -+ .name = "96368MT-1341N1", -+ .expected_cpu_id = 0x6368, ++ .name = "96368MT-1341N1", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43222, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = vr3026e_fixups, -+ .num_board_fixups = ARRAY_SIZE(vr3026e_fixups), ++ .type = SPROM_BCM43222, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = vr3026e_fixups, ++ .num_board_fixups = ARRAY_SIZE(vr3026e_fixups), + }, +}; + static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2282,6 +2335,7 @@ static const struct board_info __initcon +@@ -2333,6 +2386,7 @@ static const struct board_info __initcon &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, + &board_VR3026e, &board_WAP5813n, - #endif - #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2382,6 +2436,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6368 */ + }; +@@ -2435,6 +2489,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, diff --git a/target/linux/bcm63xx/patches-5.4/555-board_HG622.patch b/target/linux/bcm63xx/patches-5.4/660-board_bcm6368-huawei-echolife-hg622.patch similarity index 59% rename from target/linux/bcm63xx/patches-5.4/555-board_HG622.patch rename to target/linux/bcm63xx/patches-5.4/660-board_bcm6368-huawei-echolife-hg622.patch index 31c83972c..c025a45ee 100644 --- a/target/linux/bcm63xx/patches-5.4/555-board_HG622.patch +++ b/target/linux/bcm63xx/patches-5.4/660-board_bcm6368-huawei-echolife-hg622.patch @@ -1,50 +1,50 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1888,6 +1888,52 @@ static struct board_info __initdata boar +@@ -2050,6 +2050,52 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_HG622 = { -+ .name = "96368MVWG_hg622", -+ .expected_cpu_id = 0x6368, ++ .name = "96368MVWG_hg622", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_caldata = 1, ++ .has_caldata = 1, + .caldata = { + { -+ .vendor = PCI_VENDOR_ID_RALINK, -+ .caldata_offset = 0xfa0000, -+ .slot = 1, -+ .eeprom = "rt2x00.eeprom", ++ .vendor = PCI_VENDOR_ID_RALINK, ++ .caldata_offset = 0xfa0000, ++ .slot = 1, ++ .eeprom = "rt2x00.eeprom", + }, + }, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, @@ -53,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2376,6 +2422,7 @@ static const struct board_info __initcon +@@ -2382,6 +2428,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -61,7 +61,7 @@ &board_HG655b, &board_P870HW51A_V2, &board_VR3025u, -@@ -2484,6 +2531,7 @@ static struct of_device_id const bcm963x +@@ -2491,6 +2538,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/bcm63xx/patches-5.4/556-board_EVG2000.patch b/target/linux/bcm63xx/patches-5.4/661-board_bcm6369-netgear-evg2000.patch similarity index 64% rename from target/linux/bcm63xx/patches-5.4/556-board_EVG2000.patch rename to target/linux/bcm63xx/patches-5.4/661-board_bcm6369-netgear-evg2000.patch index 6981b2ae1..b33cb3a1c 100644 --- a/target/linux/bcm63xx/patches-5.4/556-board_EVG2000.patch +++ b/target/linux/bcm63xx/patches-5.4/661-board_bcm6369-netgear-evg2000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1842,6 +1842,42 @@ static struct board_info __initdata boar +@@ -2004,6 +2004,43 @@ static struct board_info __initdata boar }, }; @@ -9,15 +9,15 @@ +}; + +static struct board_info __initdata board_EVG2000 = { -+ .name = "96369PVG", -+ .expected_cpu_id = 0x6368, ++ .name = "96369PVG", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [5] = { @@ -30,20 +30,21 @@ + }, + }, + }, -+ .use_fallback_sprom = 1, ++ ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM4322, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = EVG2000_fixups, -+ .num_board_fixups = ARRAY_SIZE(EVG2000_fixups), ++ .type = SPROM_BCM4322, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = EVG2000_fixups, ++ .num_board_fixups = ARRAY_SIZE(EVG2000_fixups), + }, +}; + static struct board_info __initdata board_HG655b = { - .name = "HW65x", - .expected_cpu_id = 0x6368, -@@ -2422,6 +2458,7 @@ static const struct board_info __initcon + .name = "HW65x", + .expected_cpu_id = 0x6368, +@@ -2428,6 +2465,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -51,11 +52,11 @@ &board_HG622, &board_HG655b, &board_P870HW51A_V2, -@@ -2534,6 +2571,7 @@ static struct of_device_id const bcm963x +@@ -2541,6 +2579,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,echolife-hg622", .data = &board_HG622, }, { .compatible = "huawei,echolife-hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700-v1", .data = &board_DGND3700v1_3800B, }, + { .compatible = "netgear,evg2000", .data = &board_EVG2000, }, { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/557-board_AV4202N.patch b/target/linux/bcm63xx/patches-5.4/662-board_bcm6368-adb-av4202n.patch similarity index 53% rename from target/linux/bcm63xx/patches-5.4/557-board_AV4202N.patch rename to target/linux/bcm63xx/patches-5.4/662-board_bcm6368-adb-av4202n.patch index fbf58fe33..5f224e5bd 100644 --- a/target/linux/bcm63xx/patches-5.4/557-board_AV4202N.patch +++ b/target/linux/bcm63xx/patches-5.4/662-board_bcm6368-adb-av4202n.patch @@ -1,68 +1,66 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1732,6 +1732,51 @@ static struct board_info __initdata boar +@@ -1904,6 +1904,49 @@ static struct board_info __initdata boar * known 6368 boards */ #ifdef CONFIG_BCM63XX_CPU_6368 +static struct board_info __initdata board_AV4202N = { -+ .name = "96368_Swiss_S1", -+ .expected_cpu_id = 0x6368, ++ .name = "96368_Swiss_S1", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "port1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", + }, -+ + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "port2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", + }, -+ + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "port3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", + }, -+ + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "port4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", + }, + }, + }, -+ .use_fallback_sprom = 1, -+ .fallback_sprom = { -+ .pci_bus = 0, -+ .pci_dev = 1, -+ }, + ++ .use_fallback_sprom = 1, ++ .fallback_sprom = { ++ .type = SPROM_BCM4322, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ }, +}; + static struct board_info __initdata board_96368mvwg = { - .name = "96368MVWG", - .expected_cpu_id = 0x6368, -@@ -2455,6 +2500,7 @@ static const struct board_info __initcon - #endif - + .name = "96368MVWG", + .expected_cpu_id = 0x6368, +@@ -2462,6 +2505,7 @@ static const struct board_info __initcon + &board_hg253s_v2, + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 + &board_AV4202N, &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, -@@ -2562,6 +2608,7 @@ static struct of_device_id const bcm963x +@@ -2570,6 +2614,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 + { .compatible = "adb,av4202n", .data = &board_AV4202N, }, { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, diff --git a/target/linux/bcm63xx/patches-5.4/558-board_VH4032N.patch b/target/linux/bcm63xx/patches-5.4/663-board_bcm6368-observa-vh4032n.patch similarity index 81% rename from target/linux/bcm63xx/patches-5.4/558-board_VH4032N.patch rename to target/linux/bcm63xx/patches-5.4/663-board_bcm6368-observa-vh4032n.patch index b89ac7fd4..d2b0a44c2 100644 --- a/target/linux/bcm63xx/patches-5.4/558-board_VH4032N.patch +++ b/target/linux/bcm63xx/patches-5.4/663-board_bcm6368-observa-vh4032n.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2216,6 +2216,106 @@ static struct board_info __initdata boar +@@ -2377,6 +2377,106 @@ static struct board_info __initdata boar }, }; @@ -60,54 +60,54 @@ +}; + +static struct board_info __initdata board_VH4032N = { -+ .name = "VH4032N", -+ .expected_cpu_id = 0x6368, ++ .name = "VH4032N", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .use_fallback_sprom = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, -+ .num_usbh_ports = 2, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, ++ .used = 1, + .phy_id = 1, -+ .name = "LAN4", ++ .name = "LAN4", + }, + [1] = { -+ .used = 1, ++ .used = 1, + .phy_id = 2, -+ .name = "LAN3", ++ .name = "LAN3", + }, + [2] = { -+ .used = 1, ++ .used = 1, + .phy_id = 3, -+ .name = "LAN2", ++ .name = "LAN2", + }, + [3] = { -+ .used = 1, ++ .used = 1, + .phy_id = 4, -+ .name = "LAN1", ++ .name = "LAN1", + }, + }, + }, + ++ .use_fallback_sprom = 1, + .fallback_sprom = { -+ .type = SPROM_BCM43222, -+ .pci_bus = 0, -+ .pci_dev = 1, -+ .board_fixups = vh4032n_fixups, -+ .num_board_fixups = ARRAY_SIZE(vh4032n_fixups), ++ .type = SPROM_BCM43222, ++ .pci_bus = 0, ++ .pci_dev = 1, ++ .board_fixups = vh4032n_fixups, ++ .num_board_fixups = ARRAY_SIZE(vh4032n_fixups), + }, +}; + static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2508,6 +2608,7 @@ static const struct board_info __initcon +@@ -2513,6 +2613,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -115,11 +115,11 @@ &board_VR3025u, &board_VR3025un, &board_VR3026e, -@@ -2619,6 +2720,7 @@ static struct of_device_id const bcm963x +@@ -2625,6 +2726,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,echolife-hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700-v1", .data = &board_DGND3700v1_3800B, }, { .compatible = "netgear,evg2000", .data = &board_EVG2000, }, + { .compatible = "observa,vh4032n", .data = &board_VH4032N, }, { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6368 */ #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/bcm63xx/patches-5.4/559-board_R1000H.patch b/target/linux/bcm63xx/patches-5.4/664-board_bcm6368-actiontec-r1000h.patch similarity index 65% rename from target/linux/bcm63xx/patches-5.4/559-board_R1000H.patch rename to target/linux/bcm63xx/patches-5.4/664-board_bcm6368-actiontec-r1000h.patch index 9c42c6ea8..716a6e030 100644 --- a/target/linux/bcm63xx/patches-5.4/559-board_R1000H.patch +++ b/target/linux/bcm63xx/patches-5.4/664-board_bcm6368-actiontec-r1000h.patch @@ -1,36 +1,36 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2066,6 +2066,29 @@ static struct board_info __initdata boar +@@ -2227,6 +2227,29 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_R1000H = { -+ .name = "R1000H", -+ .expected_cpu_id = 0x6368, ++ .name = "R1000H", ++ .expected_cpu_id = 0x6368, + -+ .has_pci = 1, -+ .has_ohci0 = 1, -+ .has_ehci0 = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [5] = { -+ .used = 1, -+ .phy_id = 0xff, ++ .used = 1, ++ .phy_id = 0xff, + .bypass_link = 1, + .force_speed = 1000, + .force_duplex_full = 1, -+ .name = "RGMII", ++ .name = "RGMII", + }, + }, + }, +}; + static struct board_info __initdata board_VR3025u = { - .name = "96368M-1541N", - .expected_cpu_id = 0x6368, -@@ -2608,6 +2631,7 @@ static const struct board_info __initcon + .name = "96368M-1541N", + .expected_cpu_id = 0x6368, +@@ -2613,6 +2636,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -38,9 +38,9 @@ &board_VH4032N, &board_VR3025u, &board_VR3025un, -@@ -2709,6 +2733,7 @@ static struct of_device_id const bcm963x +@@ -2715,6 +2739,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,neufbox-6-sercomm-r0", .data = &board_nb6, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_6362 */ #ifdef CONFIG_BCM63XX_CPU_6368 + { .compatible = "actiontec,r1000h", .data = &board_R1000H, }, { .compatible = "adb,av4202n", .data = &board_AV4202N, }, diff --git a/target/linux/bcm63xx/patches-5.4/681-board_bcm63269-brcm-bcm963269bhr.patch b/target/linux/bcm63xx/patches-5.4/681-board_bcm63269-brcm-bcm963269bhr.patch new file mode 100644 index 000000000..a06423411 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/681-board_bcm63269-brcm-bcm963269bhr.patch @@ -0,0 +1,67 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2543,6 +2543,46 @@ static struct board_info __initdata boar + #endif /* CONFIG_BCM63XX_CPU_6368 */ + + /* ++ * known 63268/63269 boards ++ */ ++#ifdef CONFIG_BCM63XX_CPU_63268 ++static struct board_info __initdata board_963269bhr = { ++ .name = "963269BHR", ++ .expected_cpu_id = 0x63268, ++ ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "port1", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "port2", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "port3", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "port4", ++ }, ++ }, ++ }, ++}; ++#endif /* CONFIG_BCM63XX_CPU_63268 */ ++ ++/* + * all boards + */ + static const struct board_info __initconst *bcm963xx_boards[] = { +@@ -2643,6 +2683,9 @@ static const struct board_info __initcon + &board_VR3026e, + &board_WAP5813n, + #endif /* CONFIG_BCM63XX_CPU_6368 */ ++#ifdef CONFIG_BCM63XX_CPU_63268 ++ &board_963269bhr, ++#endif /* CONFIG_BCM63XX_CPU_63268 */ + }; + + static struct of_device_id const bcm963xx_boards_dt[] = { +@@ -2755,6 +2798,7 @@ static struct of_device_id const bcm963x + { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, + #endif /* CONFIG_BCM63XX_CPU_6368 */ + #ifdef CONFIG_BCM63XX_CPU_63268 ++ { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, + #endif /* CONFIG_BCM63XX_CPU_63268 */ + #endif /* CONFIG_OF */ + { }, diff --git a/target/linux/bcm63xx/patches-5.4/682-board_bcm63268-inteno-vg50.patch b/target/linux/bcm63xx/patches-5.4/682-board_bcm63268-inteno-vg50.patch new file mode 100644 index 000000000..1275af5c2 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/682-board_bcm63268-inteno-vg50.patch @@ -0,0 +1,67 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2580,6 +2580,48 @@ static struct board_info __initdata boar + }, + }, + }; ++ ++static struct board_info __initdata board_vw6339gu = { ++ .name = "VW6339GU", ++ .expected_cpu_id = 0x63268, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "LAN2", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN4", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", ++ }, ++ [4] = { ++ .used = 1, ++ .phy_id = 7, ++ .name = "WAN", ++ .mii_override = 1, ++ .timing_sel = 1, ++ }, ++ }, ++ }, ++}; + #endif /* CONFIG_BCM63XX_CPU_63268 */ + + /* +@@ -2685,6 +2727,7 @@ static const struct board_info __initcon + #endif /* CONFIG_BCM63XX_CPU_6368 */ + #ifdef CONFIG_BCM63XX_CPU_63268 + &board_963269bhr, ++ &board_vw6339gu, + #endif /* CONFIG_BCM63XX_CPU_63268 */ + }; + +@@ -2799,6 +2842,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_6368 */ + #ifdef CONFIG_BCM63XX_CPU_63268 + { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, ++ { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, + #endif /* CONFIG_BCM63XX_CPU_63268 */ + #endif /* CONFIG_OF */ + { }, diff --git a/target/linux/bcm63xx/patches-5.4/683-board_bcm63268-brcm-bcm963268bu-p300.patch b/target/linux/bcm63xx/patches-5.4/683-board_bcm63268-brcm-bcm963268bu-p300.patch new file mode 100644 index 000000000..c75d7a477 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/683-board_bcm63268-brcm-bcm963268bu-p300.patch @@ -0,0 +1,84 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -2546,6 +2546,65 @@ static struct board_info __initdata boar + * known 63268/63269 boards + */ + #ifdef CONFIG_BCM63XX_CPU_63268 ++static struct board_info __initdata board_963268bu_p300 = { ++ .name = "963268BU_P300", ++ .expected_cpu_id = 0x63268, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_usbd = 1, ++ .usbd = { ++ .use_fullspeed = 0, ++ .port_no = 0, ++ }, ++ ++ .has_enetsw = 1, ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 17, ++ .name = "FE1", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "GbE2", ++ }, ++ [4] = { ++ .used = 1, ++ .phy_id = 0, ++ .name = "GbE3", ++ .mii_override = 1, ++ .timing_sel = 1, ++ }, ++ [5] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "GbE1", ++ .mii_override = 1, ++ .timing_sel = 1, ++ }, ++ [6] = { ++ .used = 1, ++ .phy_id = 24, ++ .name = "GbE4", ++ .mii_override = 1, ++ .timing_sel = 1, ++ }, ++ [7] = { ++ .used = 1, ++ .phy_id = 25, ++ .name = "GbE5", ++ .mii_override = 1, ++ .timing_sel = 1, ++ }, ++ }, ++ }, ++}; ++ + static struct board_info __initdata board_963269bhr = { + .name = "963269BHR", + .expected_cpu_id = 0x63268, +@@ -2726,6 +2785,7 @@ static const struct board_info __initcon + &board_WAP5813n, + #endif /* CONFIG_BCM63XX_CPU_6368 */ + #ifdef CONFIG_BCM63XX_CPU_63268 ++ &board_963268bu_p300, + &board_963269bhr, + &board_vw6339gu, + #endif /* CONFIG_BCM63XX_CPU_63268 */ +@@ -2841,6 +2901,7 @@ static struct of_device_id const bcm963x + { .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, }, + #endif /* CONFIG_BCM63XX_CPU_6368 */ + #ifdef CONFIG_BCM63XX_CPU_63268 ++ { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, + { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, + { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, + #endif /* CONFIG_BCM63XX_CPU_63268 */ diff --git a/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch b/target/linux/bcm63xx/patches-5.4/684-board_bcm63168-sky-sr102.patch similarity index 53% rename from target/linux/bcm63xx/patches-5.4/562-board_sr102.patch rename to target/linux/bcm63xx/patches-5.4/684-board_bcm63168-sky-sr102.patch index 8bae6c378..7f1fb58a3 100644 --- a/target/linux/bcm63xx/patches-5.4/562-board_sr102.patch +++ b/target/linux/bcm63xx/patches-5.4/684-board_bcm63168-sky-sr102.patch @@ -1,68 +1,61 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2664,6 +2664,49 @@ static struct board_info __initdata boar +@@ -2681,6 +2681,42 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_BSKYB_63168 = { -+ .name = "BSKYB_63168", -+ .expected_cpu_id = 0x63268, ++ .name = "BSKYB_63168", ++ .expected_cpu_id = 0x63268, + -+ .has_pci = 1, -+ .use_fallback_sprom = 0, -+ -+ .has_ehci0 = 1, -+ .has_ohci0 = 1, -+ .num_usbh_ports = 2, -+ -+ .has_enetsw = 1, ++ .has_pci = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "Port 1", ++ .used = 1, ++ .phy_id = 1, ++ .name = "Port 1", + }, -+ + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "Port 2", ++ .used = 1, ++ .phy_id = 2, ++ .name = "Port 2", + }, -+ + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "Port 3", ++ .used = 1, ++ .phy_id = 3, ++ .name = "Port 3", + }, -+ + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "Port 4", ++ .used = 1, ++ .phy_id = 4, ++ .name = "Port 4", + }, -+ + }, + }, +}; #endif /* CONFIG_BCM63XX_CPU_63268 */ /* -@@ -2772,6 +2815,7 @@ static const struct board_info __initcon +@@ -2788,6 +2824,7 @@ static const struct board_info __initcon &board_963268bu_p300, &board_963269bhr, &board_vw6339gu, + &board_BSKYB_63168, - #endif + #endif /* CONFIG_BCM63XX_CPU_63268 */ }; -@@ -2885,6 +2929,7 @@ static struct of_device_id const bcm963x +@@ -2904,6 +2941,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, + { .compatible = "sky,sr102", .data = &board_BSKYB_63168, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_63268 */ #endif /* CONFIG_OF */ { }, diff --git a/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch b/target/linux/bcm63xx/patches-5.4/685-board-bcm63168-comtrend-vr-3032u.patch similarity index 55% rename from target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch rename to target/linux/bcm63xx/patches-5.4/685-board-bcm63168-comtrend-vr-3032u.patch index 925b15041..af4c5388c 100644 --- a/target/linux/bcm63xx/patches-5.4/563-board-VR-3032u.patch +++ b/target/linux/bcm63xx/patches-5.4/685-board-bcm63168-comtrend-vr-3032u.patch @@ -1,63 +1,60 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2618,6 +2618,44 @@ static struct board_info __initdata boar +@@ -2640,6 +2640,41 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_VR3032u = { -+ .name = "963168M-1841N1", -+ .expected_cpu_id = 0x63268, ++ .name = "963168M-1841N1", ++ .expected_cpu_id = 0x63268, + -+ .has_ehci0 = 1, -+ .has_ohci0 = 1, -+ .num_usbh_ports = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [0] = { -+ .used = 1, -+ .phy_id = 1, -+ .name = "LAN2", ++ .used = 1, ++ .phy_id = 1, ++ .name = "LAN2", + }, -+ + [1] = { -+ .used = 1, -+ .phy_id = 2, -+ .name = "LAN3", ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", + }, -+ + [2] = { -+ .used = 1, -+ .phy_id = 3, -+ .name = "LAN4", ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN4", + }, -+ + [3] = { -+ .used = 1, -+ .phy_id = 4, -+ .name = "LAN1", ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", + }, + }, + }, +}; + static struct board_info __initdata board_vw6339gu = { - .name = "VW6339GU", - .expected_cpu_id = 0x63268, -@@ -2814,6 +2852,7 @@ static const struct board_info __initcon + .name = "VW6339GU", + .expected_cpu_id = 0x63268, +@@ -2823,6 +2858,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_63268 &board_963268bu_p300, &board_963269bhr, + &board_VR3032u, &board_vw6339gu, &board_BSKYB_63168, - #endif -@@ -2928,6 +2967,7 @@ static struct of_device_id const bcm963x + #endif /* CONFIG_BCM63XX_CPU_63268 */ +@@ -2940,6 +2976,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, + { .compatible = "comtrend,vr-3032u", .data = &board_VR3032u, }, { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, { .compatible = "sky,sr102", .data = &board_BSKYB_63168, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_63268 */ diff --git a/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch b/target/linux/bcm63xx/patches-5.4/686-board-bcm63169-comtrend-vg-8050.patch similarity index 72% rename from target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch rename to target/linux/bcm63xx/patches-5.4/686-board-bcm63169-comtrend-vg-8050.patch index 7d39125ce..b55b4d370 100644 --- a/target/linux/bcm63xx/patches-5.4/565-board-VG-8050.patch +++ b/target/linux/bcm63xx/patches-5.4/686-board-bcm63169-comtrend-vg-8050.patch @@ -1,18 +1,18 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2643,6 +2643,31 @@ static struct board_info __initdata boar +@@ -2640,6 +2640,31 @@ static struct board_info __initdata boar }, }; +static struct board_info __initdata board_VG8050 = { -+ .name = "963169P-1861N5", -+ .expected_cpu_id = 0x63268, ++ .name = "963169P-1861N5", ++ .expected_cpu_id = 0x63268, + -+ .has_ehci0 = 1, -+ .has_ohci0 = 1, -+ .num_usbh_ports = 2, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 2, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [6] = { @@ -30,9 +30,9 @@ +}; + static struct board_info __initdata board_VR3032u = { - .name = "963168M-1841N1", - .expected_cpu_id = 0x63268, -@@ -2878,6 +2903,7 @@ static const struct board_info __initcon + .name = "963168M-1841N1", + .expected_cpu_id = 0x63268, +@@ -2858,6 +2883,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_63268 &board_963268bu_p300, &board_963269bhr, @@ -40,7 +40,7 @@ &board_VR3032u, &board_vw6339gu, &board_BSKYB_63168, -@@ -2994,6 +3020,7 @@ static struct of_device_id const bcm963x +@@ -2976,6 +3002,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963268bu-p300", .data = &board_963268bu_p300, }, { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, diff --git a/target/linux/bcm63xx/patches-5.4/568-board-H500s.patch b/target/linux/bcm63xx/patches-5.4/687-board-bcm63167-sercomm-h500-s.patch similarity index 69% rename from target/linux/bcm63xx/patches-5.4/568-board-H500s.patch rename to target/linux/bcm63xx/patches-5.4/687-board-bcm63167-sercomm-h500-s.patch index eaa28a977..5bcb50672 100644 --- a/target/linux/bcm63xx/patches-5.4/568-board-H500s.patch +++ b/target/linux/bcm63xx/patches-5.4/687-board-bcm63167-sercomm-h500-s.patch @@ -1,27 +1,26 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2869,6 +2869,37 @@ static struct board_info __initdata boar +@@ -2777,6 +2777,36 @@ static struct board_info __initdata boar }, }, }; + +static struct board_info __initdata board_H500s = { -+ .name = "BXK00C-1.6", -+ .expected_cpu_id = 0x63268, ++ .name = "BXK00C-1.6", ++ .expected_cpu_id = 0x63268, + -+ .has_ehci0 = 1, -+ .has_ohci0 = 1, -+ .num_usbh_ports = 1, ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, + -+ .has_enetsw = 1, ++ .has_enetsw = 1, + .enetsw = { + .used_ports = { + [3] = { -+ .used = 1, ++ .used = 1, + .phy_id = 12, -+ .name = "WAN", ++ .name = "WAN", + }, -+ + [4] = { + .used = 1, + .phy_id = 0, @@ -38,20 +37,20 @@ #endif /* CONFIG_BCM63XX_CPU_63268 */ /* -@@ -2983,6 +3014,7 @@ static const struct board_info __initcon +@@ -2887,6 +2917,7 @@ static const struct board_info __initcon &board_VR3032u, &board_vw6339gu, &board_BSKYB_63168, + &board_H500s, - #endif + #endif /* CONFIG_BCM63XX_CPU_63268 */ }; -@@ -3101,6 +3133,8 @@ static struct of_device_id const bcm963x +@@ -3005,6 +3036,8 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vg-8050", .data = &board_VG8050, }, { .compatible = "comtrend,vr-3032u", .data = &board_VR3032u, }, { .compatible = "inteno,vg50", .data = &board_vw6339gu, }, + { .compatible = "sercomm,h500-s-lowi", .data = &board_H500s, }, + { .compatible = "sercomm,h500-s-vfes", .data = &board_H500s, }, { .compatible = "sky,sr102", .data = &board_BSKYB_63168, }, - #endif + #endif /* CONFIG_BCM63XX_CPU_63268 */ #endif /* CONFIG_OF */ diff --git a/target/linux/bcm63xx/profiles/default.mk b/target/linux/bcm63xx/profiles/default.mk index 95cd67c46..2df9d062f 100644 --- a/target/linux/bcm63xx/profiles/default.mk +++ b/target/linux/bcm63xx/profiles/default.mk @@ -7,7 +7,7 @@ define Profile/Default NAME:=Default Profile - PACKAGES:=kmod-b43 wpad-basic + PACKAGES:=kmod-b43 wpad-basic-wolfssl PRIORITY:=1 endef diff --git a/target/linux/cns3xxx/Makefile b/target/linux/cns3xxx/Makefile index 4df77967b..04df322b6 100644 --- a/target/linux/cns3xxx/Makefile +++ b/target/linux/cns3xxx/Makefile @@ -23,6 +23,6 @@ include $(INCLUDE_DIR)/target.mk KERNELNAME:=zImage -DEFAULT_PACKAGES += kmod-ath9k kmod-usb2 wpad-basic +DEFAULT_PACKAGES += kmod-ath9k kmod-usb2 wpad-basic-wolfssl $(eval $(call BuildTarget)) diff --git a/target/linux/gemini/image/dns313_gen_hdd_img.sh b/target/linux/gemini/image/dns313_gen_hdd_img.sh index 813852232..d302ca634 100755 --- a/target/linux/gemini/image/dns313_gen_hdd_img.sh +++ b/target/linux/gemini/image/dns313_gen_hdd_img.sh @@ -15,14 +15,20 @@ ROOTFSSIZE="$5" head=4 sect=63 -# Create two empty partitions followed by the boot partition with -# the ./boot/zImage and then the rootfs partition. -set $(ptgen -o $OUTPUT -h $head -s $sect -t 83 -n -p 0 -p 0 -p ${BOOTFSSIZE}M -p ${ROOTFSSIZE}M) +# Create one empty partitions followed by the swap partition, then the +# boot partition with the ./boot/zImage and then the rootfs partition. +# The swap partition with type 82 is 128 MB since the DNS-313 has 64 MB of +# memory so we assign twice of that as swap. +# The boot partition must always be the third partition. +# The user should use the first (blank) partition for user data storage, +# this will typically be named /dev/sda1 +set $(ptgen -o $OUTPUT -h $head -s $sect -n -t 83 -p 0 -t 82 -p 128M -t 83 -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M) -BOOTOFFSET="$(($1 / 512))" -BOOTSIZE="$(($2 / 512))" -ROOTFSOFFSET="$(($3 / 512))" -ROOTFSSIZE="$(($4 / 512))" +# Swapoffset and swapsize will be $1 and $2 +BOOTOFFSET="$(($3 / 512))" +BOOTSIZE="$(($4 / 512))" +ROOTFSOFFSET="$(($5 / 512))" +ROOTFSSIZE="$(($6 / 512))" dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch index a098c4416..4f6f5d2cf 100644 --- a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -65,7 +65,7 @@ Cc: Kir Kolyshkin * Before updating sk_refcnt, we must commit prior changes to memory --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -1697,7 +1697,7 @@ u32 tcp_tso_autosize(const struct sock * +@@ -1699,7 +1699,7 @@ u32 tcp_tso_autosize(const struct sock * { u32 bytes, segs; @@ -74,7 +74,7 @@ Cc: Kir Kolyshkin sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); /* Goal is to send at least one packet per ms, -@@ -2215,7 +2215,7 @@ static bool tcp_small_queue_check(struct +@@ -2217,7 +2217,7 @@ static bool tcp_small_queue_check(struct { unsigned int limit; diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index 2e08e514b..0e6aa87f9 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -1987,7 +1987,8 @@ static const struct usb_device_id option +@@ -1990,7 +1990,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, diff --git a/target/linux/generic/backport-4.14/950-tty-serial-exar-generalize-rs485-setup.patch b/target/linux/generic/backport-4.14/950-tty-serial-exar-generalize-rs485-setup.patch index 353dc1494..c4c4cfcb7 100644 --- a/target/linux/generic/backport-4.14/950-tty-serial-exar-generalize-rs485-setup.patch +++ b/target/linux/generic/backport-4.14/950-tty-serial-exar-generalize-rs485-setup.patch @@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c -@@ -283,8 +283,32 @@ static int xr17v35x_register_gpio(struct +@@ -293,8 +293,32 @@ static int xr17v35x_register_gpio(struct return 0; } @@ -52,7 +52,7 @@ Signed-off-by: Greg Kroah-Hartman }; static int iot2040_rs485_config(struct uart_port *port, -@@ -317,19 +341,7 @@ static int iot2040_rs485_config(struct u +@@ -327,19 +351,7 @@ static int iot2040_rs485_config(struct u value |= mode; writeb(value, p + UART_EXAR_MPIOLVL_7_0); diff --git a/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch b/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch index a680402f2..cf7687b45 100644 --- a/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch +++ b/target/linux/generic/backport-4.19/380-v5.3-net-sched-Introduce-act_ctinfo-action.patch @@ -336,13 +336,13 @@ Signed-off-by: Kevin Darbyshire-Bryant + action = READ_ONCE(ca->tcf_action); + + wlen = skb_network_offset(skb); -+ if (tc_skb_protocol(skb) == htons(ETH_P_IP)) { ++ if (skb_protocol(skb, true) == htons(ETH_P_IP)) { + wlen += sizeof(struct iphdr); + if (!pskb_may_pull(skb, wlen)) + goto out; + + proto = NFPROTO_IPV4; -+ } else if (tc_skb_protocol(skb) == htons(ETH_P_IPV6)) { ++ } else if (skb_protocol(skb, true) == htons(ETH_P_IPV6)) { + wlen += sizeof(struct ipv6hdr); + if (!pskb_may_pull(skb, wlen)) + goto out; diff --git a/target/linux/generic/backport-4.19/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch b/target/linux/generic/backport-4.19/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch index 12962135d..a4981acde 100644 --- a/target/linux/generic/backport-4.19/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch +++ b/target/linux/generic/backport-4.19/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch @@ -67,7 +67,7 @@ Signed-off-by: Kevin Darbyshire-Bryant + bool rev = !skb->_nfct, upd = false; + __be32 ip; - if (tc_skb_protocol(skb) != htons(ETH_P_IP)) + if (skb_protocol(skb, true) != htons(ETH_P_IP)) - return; + return false; diff --git a/target/linux/generic/backport-4.19/711-v5.3-net-sfp-add-mandatory-attach-detach-methods-for-sfp-.patch b/target/linux/generic/backport-4.19/711-v5.3-net-sfp-add-mandatory-attach-detach-methods-for-sfp-.patch index 74dc39fa7..0600da2fa 100644 --- a/target/linux/generic/backport-4.19/711-v5.3-net-sfp-add-mandatory-attach-detach-methods-for-sfp-.patch +++ b/target/linux/generic/backport-4.19/711-v5.3-net-sfp-add-mandatory-attach-detach-methods-for-sfp-.patch @@ -51,7 +51,7 @@ Signed-off-by: Russell King .link_down = phylink_sfp_link_down, --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -350,7 +350,7 @@ static int sfp_register_bus(struct sfp_b +@@ -425,7 +425,7 @@ static int sfp_register_bus(struct sfp_b bus->socket_ops->attach(bus->sfp); if (bus->started) bus->socket_ops->start(bus->sfp); @@ -60,7 +60,7 @@ Signed-off-by: Russell King bus->registered = true; return 0; } -@@ -359,8 +359,8 @@ static void sfp_unregister_bus(struct sf +@@ -434,8 +434,8 @@ static void sfp_unregister_bus(struct sf { const struct sfp_upstream_ops *ops = bus->upstream_ops; diff --git a/target/linux/generic/backport-4.19/712-v5.3-net-sfp-remove-sfp-bus-use-of-netdevs.patch b/target/linux/generic/backport-4.19/712-v5.3-net-sfp-remove-sfp-bus-use-of-netdevs.patch index 8f0c37e09..e68cc381d 100644 --- a/target/linux/generic/backport-4.19/712-v5.3-net-sfp-remove-sfp-bus-use-of-netdevs.patch +++ b/target/linux/generic/backport-4.19/712-v5.3-net-sfp-remove-sfp-bus-use-of-netdevs.patch @@ -30,7 +30,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -23,7 +23,6 @@ struct sfp_bus { +@@ -30,7 +30,6 @@ struct sfp_bus { const struct sfp_upstream_ops *upstream_ops; void *upstream; @@ -38,7 +38,7 @@ Signed-off-by: Russell King struct phy_device *phydev; bool registered; -@@ -442,13 +441,11 @@ static void sfp_upstream_clear(struct sf +@@ -517,13 +516,11 @@ static void sfp_upstream_clear(struct sf { bus->upstream_ops = NULL; bus->upstream = NULL; @@ -52,7 +52,7 @@ Signed-off-by: Russell King * @upstream: the upstream private data * @ops: the upstream's &struct sfp_upstream_ops * -@@ -459,7 +456,7 @@ static void sfp_upstream_clear(struct sf +@@ -534,7 +531,7 @@ static void sfp_upstream_clear(struct sf * On error, returns %NULL. */ struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode, @@ -61,7 +61,7 @@ Signed-off-by: Russell King const struct sfp_upstream_ops *ops) { struct sfp_bus *bus = sfp_bus_get(fwnode); -@@ -469,7 +466,6 @@ struct sfp_bus *sfp_register_upstream(st +@@ -544,7 +541,6 @@ struct sfp_bus *sfp_register_upstream(st rtnl_lock(); bus->upstream_ops = ops; bus->upstream = upstream; @@ -69,7 +69,7 @@ Signed-off-by: Russell King if (bus->sfp) { ret = sfp_register_bus(bus); -@@ -591,7 +587,7 @@ struct sfp_bus *sfp_register_socket(stru +@@ -670,7 +666,7 @@ struct sfp_bus *sfp_register_socket(stru bus->sfp = sfp; bus->socket_ops = ops; @@ -78,7 +78,7 @@ Signed-off-by: Russell King ret = sfp_register_bus(bus); if (ret) sfp_socket_clear(bus); -@@ -611,7 +607,7 @@ EXPORT_SYMBOL_GPL(sfp_register_socket); +@@ -690,7 +686,7 @@ EXPORT_SYMBOL_GPL(sfp_register_socket); void sfp_unregister_socket(struct sfp_bus *bus) { rtnl_lock(); diff --git a/target/linux/generic/backport-4.19/716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch b/target/linux/generic/backport-4.19/716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch index 27ab78f3e..bc16e8f1c 100644 --- a/target/linux/generic/backport-4.19/716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch +++ b/target/linux/generic/backport-4.19/716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch @@ -59,7 +59,7 @@ Signed-off-by: Russell King #include #include -@@ -444,45 +445,63 @@ static void sfp_upstream_clear(struct sf +@@ -519,45 +520,63 @@ static void sfp_upstream_clear(struct sf } /** diff --git a/target/linux/generic/backport-4.19/717-v5.5-net-sfp-rework-upstream-interface.patch b/target/linux/generic/backport-4.19/717-v5.5-net-sfp-rework-upstream-interface.patch index f7dd187c1..a901b15aa 100644 --- a/target/linux/generic/backport-4.19/717-v5.5-net-sfp-rework-upstream-interface.patch +++ b/target/linux/generic/backport-4.19/717-v5.5-net-sfp-rework-upstream-interface.patch @@ -53,7 +53,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -328,10 +328,19 @@ static void sfp_bus_release(struct kref +@@ -403,10 +403,19 @@ static void sfp_bus_release(struct kref kfree(bus); } @@ -75,7 +75,7 @@ Signed-off-by: Russell King static int sfp_register_bus(struct sfp_bus *bus) { -@@ -347,11 +356,11 @@ static int sfp_register_bus(struct sfp_b +@@ -422,11 +431,11 @@ static int sfp_register_bus(struct sfp_b return ret; } } @@ -88,7 +88,7 @@ Signed-off-by: Russell King return 0; } -@@ -445,13 +454,12 @@ static void sfp_upstream_clear(struct sf +@@ -520,13 +529,12 @@ static void sfp_upstream_clear(struct sf } /** @@ -106,7 +106,7 @@ Signed-off-by: Russell King * * Returns: on success, a pointer to the sfp_bus structure, * %NULL if no SFP is specified, -@@ -461,9 +469,7 @@ static void sfp_upstream_clear(struct sf +@@ -536,9 +544,7 @@ static void sfp_upstream_clear(struct sf * %-ENOMEM if we failed to allocate the bus. * an error from the upstream's connect_phy() method. */ @@ -117,7 +117,7 @@ Signed-off-by: Russell King { struct fwnode_reference_args ref; struct sfp_bus *bus; -@@ -481,7 +487,39 @@ struct sfp_bus *sfp_register_upstream_no +@@ -556,7 +562,39 @@ struct sfp_bus *sfp_register_upstream_no if (!bus) return ERR_PTR(-ENOMEM); @@ -157,7 +157,7 @@ Signed-off-by: Russell King bus->upstream_ops = ops; bus->upstream = upstream; -@@ -494,33 +532,33 @@ struct sfp_bus *sfp_register_upstream_no +@@ -569,33 +607,33 @@ struct sfp_bus *sfp_register_upstream_no } rtnl_unlock(); diff --git a/target/linux/generic/backport-4.19/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch b/target/linux/generic/backport-4.19/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch index 59d2ce588..7bfff60f2 100644 --- a/target/linux/generic/backport-4.19/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch +++ b/target/linux/generic/backport-4.19/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch @@ -16,7 +16,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -330,7 +330,7 @@ static void sfp_bus_release(struct kref +@@ -405,7 +405,7 @@ static void sfp_bus_release(struct kref /** * sfp_bus_put() - put a reference on the &struct sfp_bus diff --git a/target/linux/generic/backport-4.19/742-v5.5-net-sfp-add-support-for-module-quirks.patch b/target/linux/generic/backport-4.19/742-v5.5-net-sfp-add-support-for-module-quirks.patch deleted file mode 100644 index 5068bd468..000000000 --- a/target/linux/generic/backport-4.19/742-v5.5-net-sfp-add-support-for-module-quirks.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 8df5dd55cef48c0769379e04dbc085a899b106d4 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Fri, 8 Mar 2019 14:02:25 +0000 -Subject: [PATCH 640/660] net: sfp: add support for module quirks - -Add support for applying module quirks to the list of supported -ethtool link modes. - -Signed-off-by: Russell King ---- - drivers/net/phy/sfp-bus.c | 54 +++++++++++++++++++++++++++++++++++++++ - 1 file changed, 54 insertions(+) - ---- a/drivers/net/phy/sfp-bus.c -+++ b/drivers/net/phy/sfp-bus.c -@@ -9,6 +9,12 @@ - - #include "sfp.h" - -+struct sfp_quirk { -+ const char *vendor; -+ const char *part; -+ void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes); -+}; -+ - /** - * struct sfp_bus - internal representation of a sfp bus - */ -@@ -21,6 +27,7 @@ struct sfp_bus { - const struct sfp_socket_ops *socket_ops; - struct device *sfp_dev; - struct sfp *sfp; -+ const struct sfp_quirk *sfp_quirk; - - const struct sfp_upstream_ops *upstream_ops; - void *upstream; -@@ -30,6 +37,46 @@ struct sfp_bus { - bool started; - }; - -+static const struct sfp_quirk sfp_quirks[] = { -+}; -+ -+static size_t sfp_strlen(const char *str, size_t maxlen) -+{ -+ size_t size, i; -+ -+ /* Trailing characters should be filled with space chars */ -+ for (i = 0, size = 0; i < maxlen; i++) -+ if (str[i] != ' ') -+ size = i + 1; -+ -+ return size; -+} -+ -+static bool sfp_match(const char *qs, const char *str, size_t len) -+{ -+ if (!qs) -+ return true; -+ if (strlen(qs) != len) -+ return false; -+ return !strncmp(qs, str, len); -+} -+ -+static const struct sfp_quirk *sfp_lookup_quirk(const struct sfp_eeprom_id *id) -+{ -+ const struct sfp_quirk *q; -+ unsigned int i; -+ size_t vs, ps; -+ -+ vs = sfp_strlen(id->base.vendor_name, ARRAY_SIZE(id->base.vendor_name)); -+ ps = sfp_strlen(id->base.vendor_pn, ARRAY_SIZE(id->base.vendor_pn)); -+ -+ for (i = 0, q = sfp_quirks; i < ARRAY_SIZE(sfp_quirks); i++, q++) -+ if (sfp_match(q->vendor, id->base.vendor_name, vs) && -+ sfp_match(q->part, id->base.vendor_pn, ps)) -+ return q; -+ -+ return NULL; -+} - /** - * sfp_parse_port() - Parse the EEPROM base ID, setting the port type - * @bus: a pointer to the &struct sfp_bus structure for the sfp module -@@ -233,6 +280,9 @@ void sfp_parse_support(struct sfp_bus *b - phylink_set(modes, 1000baseX_Full); - } - -+ if (bus->sfp_quirk) -+ bus->sfp_quirk->modes(id, modes); -+ - bitmap_or(support, support, modes, __ETHTOOL_LINK_MODE_MASK_NBITS); - - phylink_set(support, Autoneg); -@@ -609,6 +659,8 @@ int sfp_module_insert(struct sfp_bus *bu - const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus); - int ret = 0; - -+ bus->sfp_quirk = sfp_lookup_quirk(id); -+ - if (ops && ops->module_insert) - ret = ops->module_insert(bus->upstream, id); - -@@ -622,6 +674,8 @@ void sfp_module_remove(struct sfp_bus *b - - if (ops && ops->module_remove) - ops->module_remove(bus->upstream); -+ -+ bus->sfp_quirk = NULL; - } - EXPORT_SYMBOL_GPL(sfp_module_remove); - diff --git a/target/linux/generic/backport-4.19/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch b/target/linux/generic/backport-4.19/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch deleted file mode 100644 index 10c34881d..000000000 --- a/target/linux/generic/backport-4.19/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch +++ /dev/null @@ -1,52 +0,0 @@ -From ecaa542cfed078dbc356dadff0bad4b6a8e704a0 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Fri, 17 May 2019 10:14:45 +0100 -Subject: [PATCH 641/660] net: sfp: add some quirks for GPON modules - -Marc Micalizzi reports that Huawei MA5671A and Alcatel/Lucent G-010S-P -modules are capable of 2500base-X, but incorrectly report their -capabilities in the EEPROM. It seems rather common that GPON modules -mis-report. - -Let's fix these modules by adding some quirks. - -Signed-off-by: Russell King ---- - drivers/net/phy/sfp-bus.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - ---- a/drivers/net/phy/sfp-bus.c -+++ b/drivers/net/phy/sfp-bus.c -@@ -37,7 +37,32 @@ struct sfp_bus { - bool started; - }; - -+static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, -+ unsigned long *modes) -+{ -+ phylink_set(modes, 2500baseX_Full); -+} -+ - static const struct sfp_quirk sfp_quirks[] = { -+ { -+ // Alcatel Lucent G-010S-P can operate at 2500base-X, but -+ // incorrectly report 2500MBd NRZ in their EEPROM -+ .vendor = "ALCATELLUCENT", -+ .part = "G010SP", -+ .modes = sfp_quirk_2500basex, -+ }, { -+ // Alcatel Lucent G-010S-A can operate at 2500base-X, but -+ // report 3.2GBd NRZ in their EEPROM -+ .vendor = "ALCATELLUCENT", -+ .part = "3FE46541AA", -+ .modes = sfp_quirk_2500basex, -+ }, { -+ // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd -+ // NRZ in their EEPROM -+ .vendor = "HUAWEI", -+ .part = "MA5671A", -+ .modes = sfp_quirk_2500basex, -+ }, - }; - - static size_t sfp_strlen(const char *str, size_t maxlen) diff --git a/target/linux/generic/backport-5.4/041-genirq-affinity-Make-affinity-setting-if-activated-o.patch b/target/linux/generic/backport-5.4/041-genirq-affinity-Make-affinity-setting-if-activated-o.patch new file mode 100644 index 000000000..cf4f6e1e2 --- /dev/null +++ b/target/linux/generic/backport-5.4/041-genirq-affinity-Make-affinity-setting-if-activated-o.patch @@ -0,0 +1,129 @@ +From: Thomas Gleixner +Date: Fri, 24 Jul 2020 22:44:41 +0200 +Subject: [PATCH] genirq/affinity: Make affinity setting if activated opt-in + +commit f0c7baca180046824e07fc5f1326e83a8fd150c7 upstream. + +John reported that on a RK3288 system the perf per CPU interrupts are all +affine to CPU0 and provided the analysis: + + "It looks like what happens is that because the interrupts are not per-CPU + in the hardware, armpmu_request_irq() calls irq_force_affinity() while + the interrupt is deactivated and then request_irq() with IRQF_PERCPU | + IRQF_NOBALANCING. + + Now when irq_startup() runs with IRQ_STARTUP_NORMAL, it calls + irq_setup_affinity() which returns early because IRQF_PERCPU and + IRQF_NOBALANCING are set, leaving the interrupt on its original CPU." + +This was broken by the recent commit which blocked interrupt affinity +setting in hardware before activation of the interrupt. While this works in +general, it does not work for this particular case. As contrary to the +initial analysis not all interrupt chip drivers implement an activate +callback, the safe cure is to make the deferred interrupt affinity setting +at activation time opt-in. + +Implement the necessary core logic and make the two irqchip implementations +for which this is required opt-in. In hindsight this would have been the +right thing to do, but ... + +Fixes: baedb87d1b53 ("genirq/affinity: Handle affinity setting on inactive interrupts correctly") +Reported-by: John Keeping +Signed-off-by: Thomas Gleixner +Tested-by: Marc Zyngier +Acked-by: Marc Zyngier +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/87blk4tzgm.fsf@nanos.tec.linutronix.de +Signed-off-by: Greg Kroah-Hartman +--- + +--- a/arch/x86/kernel/apic/vector.c ++++ b/arch/x86/kernel/apic/vector.c +@@ -554,6 +554,10 @@ static int x86_vector_alloc_irqs(struct + irqd->chip_data = apicd; + irqd->hwirq = virq + i; + irqd_set_single_target(irqd); ++ ++ /* Don't invoke affinity setter on deactivated interrupts */ ++ irqd_set_affinity_on_activate(irqd); ++ + /* + * Legacy vectors are already assigned when the IOAPIC + * takes them over. They stay on the same vector. This is +--- a/drivers/irqchip/irq-gic-v3-its.c ++++ b/drivers/irqchip/irq-gic-v3-its.c +@@ -2581,6 +2581,7 @@ static int its_irq_domain_alloc(struct i + msi_alloc_info_t *info = args; + struct its_device *its_dev = info->scratchpad[0].ptr; + struct its_node *its = its_dev->its; ++ struct irq_data *irqd; + irq_hw_number_t hwirq; + int err; + int i; +@@ -2600,7 +2601,9 @@ static int its_irq_domain_alloc(struct i + + irq_domain_set_hwirq_and_chip(domain, virq + i, + hwirq + i, &its_irq_chip, its_dev); +- irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i))); ++ irqd = irq_get_irq_data(virq + i); ++ irqd_set_single_target(irqd); ++ irqd_set_affinity_on_activate(irqd); + pr_debug("ID:%d pID:%d vID:%d\n", + (int)(hwirq + i - its_dev->event_map.lpi_base), + (int)(hwirq + i), virq + i); +--- a/include/linux/irq.h ++++ b/include/linux/irq.h +@@ -211,6 +211,8 @@ struct irq_data { + * IRQD_CAN_RESERVE - Can use reservation mode + * IRQD_MSI_NOMASK_QUIRK - Non-maskable MSI quirk for affinity change + * required ++ * IRQD_AFFINITY_ON_ACTIVATE - Affinity is set on activation. Don't call ++ * irq_chip::irq_set_affinity() when deactivated. + */ + enum { + IRQD_TRIGGER_MASK = 0xf, +@@ -234,6 +236,7 @@ enum { + IRQD_DEFAULT_TRIGGER_SET = (1 << 25), + IRQD_CAN_RESERVE = (1 << 26), + IRQD_MSI_NOMASK_QUIRK = (1 << 27), ++ IRQD_AFFINITY_ON_ACTIVATE = (1 << 29), + }; + + #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) +@@ -408,6 +411,16 @@ static inline bool irqd_msi_nomask_quirk + return __irqd_to_state(d) & IRQD_MSI_NOMASK_QUIRK; + } + ++static inline void irqd_set_affinity_on_activate(struct irq_data *d) ++{ ++ __irqd_to_state(d) |= IRQD_AFFINITY_ON_ACTIVATE; ++} ++ ++static inline bool irqd_affinity_on_activate(struct irq_data *d) ++{ ++ return __irqd_to_state(d) & IRQD_AFFINITY_ON_ACTIVATE; ++} ++ + #undef __irqd_to_state + + static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) +--- a/kernel/irq/manage.c ++++ b/kernel/irq/manage.c +@@ -281,12 +281,16 @@ static bool irq_set_affinity_deactivated + struct irq_desc *desc = irq_data_to_desc(data); + + /* ++ * Handle irq chips which can handle affinity only in activated ++ * state correctly ++ * + * If the interrupt is not yet activated, just store the affinity + * mask and do not call the chip driver at all. On activation the + * driver has to make sure anyway that the interrupt is in a + * useable state so startup works. + */ +- if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) || irqd_is_activated(data)) ++ if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) || ++ irqd_is_activated(data) || !irqd_affinity_on_activate(data)) + return false; + + cpumask_copy(desc->irq_common_data.affinity, mask); diff --git a/target/linux/generic/backport-5.4/070-v5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch b/target/linux/generic/backport-5.4/070-v5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch new file mode 100644 index 000000000..027d0253a --- /dev/null +++ b/target/linux/generic/backport-5.4/070-v5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch @@ -0,0 +1,1650 @@ +From 36366e367ee93ced84fddb8fae6675e12985f5a4 Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Thu, 5 Dec 2019 10:23:18 -0800 +Subject: [PATCH] MIPS: BPF: Restore MIPS32 cBPF JIT + +Commit 716850ab104d ("MIPS: eBPF: Initial eBPF support for MIPS32 +architecture.") enabled our eBPF JIT for MIPS32 kernels, whereas it has +previously only been availailable for MIPS64. It was my understanding at +the time that the BPF test suite was passing & JITing a comparable +number of tests to our cBPF JIT [1], but it turns out that was not the +case. + +The eBPF JIT has a number of problems on MIPS32: + +- Most notably various code paths still result in emission of MIPS64 + instructions which will cause reserved instruction exceptions & kernel + panics when run on MIPS32 CPUs. + +- The eBPF JIT doesn't account for differences between the O32 ABI used + by MIPS32 kernels versus the N64 ABI used by MIPS64 kernels. Notably + arguments beyond the first 4 are passed on the stack in O32, and this + is entirely unhandled when JITing a BPF_CALL instruction. Stack space + must be reserved for arguments even if they all fit in registers, and + the callee is free to assume that stack space has been reserved for + its use - with the eBPF JIT this is not the case, so calling any + function can result in clobbering values on the stack & unpredictable + behaviour. Function arguments in eBPF are always 64-bit values which + is also entirely unhandled - the JIT still uses a single (32-bit) + register per argument. As a result all function arguments are always + passed incorrectly when JITing a BPF_CALL instruction, leading to + kernel crashes or strange behavior. + +- The JIT attempts to bail our on use of ALU64 instructions or 64-bit + memory access instructions. The code doing this at the start of + build_one_insn() incorrectly checks whether BPF_OP() equals BPF_DW, + when it should really be checking BPF_SIZE() & only doing so when + BPF_CLASS() is one of BPF_{LD,LDX,ST,STX}. This results in false + positives that cause more bailouts than intended, and that in turns + hides some of the problems described above. + +- The kernel's cBPF->eBPF translation makes heavy use of 64-bit eBPF + instructions that the MIPS32 eBPF JIT bails out on, leading to most + cBPF programs not being JITed at all. + +Until these problems are resolved, revert the removal of the cBPF JIT +performed by commit 716850ab104d ("MIPS: eBPF: Initial eBPF support for +MIPS32 architecture."). Together with commit f8fffebdea75 ("MIPS: BPF: +Disable MIPS32 eBPF JIT") this restores MIPS32 BPF JIT behavior back to +the same state it was prior to the introduction of the broken eBPF JIT +support. + +[1] https://lore.kernel.org/linux-mips/MWHPR2201MB13583388481F01A422CE7D66D4410@MWHPR2201MB1358.namprd22.prod.outlook.com/ + +Signed-off-by: Paul Burton +Fixes: 716850ab104d ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.") +Cc: Daniel Borkmann +Cc: Hassan Naveed +Cc: Tony Ambardar +Cc: bpf@vger.kernel.org +Cc: netdev@vger.kernel.org +Cc: linux-mips@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +--- + arch/mips/Kconfig | 1 + + arch/mips/net/Makefile | 1 + + arch/mips/net/bpf_jit.c | 1270 +++++++++++++++++++++++++++++++++++ + arch/mips/net/bpf_jit_asm.S | 285 ++++++++ + 4 files changed, 1557 insertions(+) + create mode 100644 arch/mips/net/bpf_jit.c + create mode 100644 arch/mips/net/bpf_jit_asm.S + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -46,6 +46,7 @@ config MIPS + select HAVE_ARCH_TRACEHOOK + select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES + select HAVE_ASM_MODVERSIONS ++ select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS + select HAVE_EBPF_JIT if 64BIT && !CPU_MICROMIPS && TARGET_ISA_REV >= 2 + select HAVE_CONTEXT_TRACKING + select HAVE_COPY_THREAD_TLS +--- a/arch/mips/net/Makefile ++++ b/arch/mips/net/Makefile +@@ -1,4 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0-only + # MIPS networking code + ++obj-$(CONFIG_MIPS_CBPF_JIT) += bpf_jit.o bpf_jit_asm.o + obj-$(CONFIG_MIPS_EBPF_JIT) += ebpf_jit.o +--- /dev/null ++++ b/arch/mips/net/bpf_jit.c +@@ -0,0 +1,1270 @@ ++/* ++ * Just-In-Time compiler for BPF filters on MIPS ++ * ++ * Copyright (c) 2014 Imagination Technologies Ltd. ++ * Author: Markos Chandras ++ * ++ * 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. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "bpf_jit.h" ++ ++/* ABI ++ * r_skb_hl SKB header length ++ * r_data SKB data pointer ++ * r_off Offset ++ * r_A BPF register A ++ * r_X BPF register X ++ * r_skb *skb ++ * r_M *scratch memory ++ * r_skb_len SKB length ++ * ++ * On entry (*bpf_func)(*skb, *filter) ++ * a0 = MIPS_R_A0 = skb; ++ * a1 = MIPS_R_A1 = filter; ++ * ++ * Stack ++ * ... ++ * M[15] ++ * M[14] ++ * M[13] ++ * ... ++ * M[0] <-- r_M ++ * saved reg k-1 ++ * saved reg k-2 ++ * ... ++ * saved reg 0 <-- r_sp ++ * ++ * ++ * Packet layout ++ * ++ * <--------------------- len ------------------------> ++ * <--skb-len(r_skb_hl)-->< ----- skb->data_len ------> ++ * ---------------------------------------------------- ++ * | skb->data | ++ * ---------------------------------------------------- ++ */ ++ ++#define ptr typeof(unsigned long) ++ ++#define SCRATCH_OFF(k) (4 * (k)) ++ ++/* JIT flags */ ++#define SEEN_CALL (1 << BPF_MEMWORDS) ++#define SEEN_SREG_SFT (BPF_MEMWORDS + 1) ++#define SEEN_SREG_BASE (1 << SEEN_SREG_SFT) ++#define SEEN_SREG(x) (SEEN_SREG_BASE << (x)) ++#define SEEN_OFF SEEN_SREG(2) ++#define SEEN_A SEEN_SREG(3) ++#define SEEN_X SEEN_SREG(4) ++#define SEEN_SKB SEEN_SREG(5) ++#define SEEN_MEM SEEN_SREG(6) ++/* SEEN_SK_DATA also implies skb_hl an skb_len */ ++#define SEEN_SKB_DATA (SEEN_SREG(7) | SEEN_SREG(1) | SEEN_SREG(0)) ++ ++/* Arguments used by JIT */ ++#define ARGS_USED_BY_JIT 2 /* only applicable to 64-bit */ ++ ++#define SBIT(x) (1 << (x)) /* Signed version of BIT() */ ++ ++/** ++ * struct jit_ctx - JIT context ++ * @skf: The sk_filter ++ * @prologue_bytes: Number of bytes for prologue ++ * @idx: Instruction index ++ * @flags: JIT flags ++ * @offsets: Instruction offsets ++ * @target: Memory location for the compiled filter ++ */ ++struct jit_ctx { ++ const struct bpf_prog *skf; ++ unsigned int prologue_bytes; ++ u32 idx; ++ u32 flags; ++ u32 *offsets; ++ u32 *target; ++}; ++ ++ ++static inline int optimize_div(u32 *k) ++{ ++ /* power of 2 divides can be implemented with right shift */ ++ if (!(*k & (*k-1))) { ++ *k = ilog2(*k); ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static inline void emit_jit_reg_move(ptr dst, ptr src, struct jit_ctx *ctx); ++ ++/* Simply emit the instruction if the JIT memory space has been allocated */ ++#define emit_instr(ctx, func, ...) \ ++do { \ ++ if ((ctx)->target != NULL) { \ ++ u32 *p = &(ctx)->target[ctx->idx]; \ ++ uasm_i_##func(&p, ##__VA_ARGS__); \ ++ } \ ++ (ctx)->idx++; \ ++} while (0) ++ ++/* ++ * Similar to emit_instr but it must be used when we need to emit ++ * 32-bit or 64-bit instructions ++ */ ++#define emit_long_instr(ctx, func, ...) \ ++do { \ ++ if ((ctx)->target != NULL) { \ ++ u32 *p = &(ctx)->target[ctx->idx]; \ ++ UASM_i_##func(&p, ##__VA_ARGS__); \ ++ } \ ++ (ctx)->idx++; \ ++} while (0) ++ ++/* Determine if immediate is within the 16-bit signed range */ ++static inline bool is_range16(s32 imm) ++{ ++ return !(imm >= SBIT(15) || imm < -SBIT(15)); ++} ++ ++static inline void emit_addu(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, addu, dst, src1, src2); ++} ++ ++static inline void emit_nop(struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, nop); ++} ++ ++/* Load a u32 immediate to a register */ ++static inline void emit_load_imm(unsigned int dst, u32 imm, struct jit_ctx *ctx) ++{ ++ if (ctx->target != NULL) { ++ /* addiu can only handle s16 */ ++ if (!is_range16(imm)) { ++ u32 *p = &ctx->target[ctx->idx]; ++ uasm_i_lui(&p, r_tmp_imm, (s32)imm >> 16); ++ p = &ctx->target[ctx->idx + 1]; ++ uasm_i_ori(&p, dst, r_tmp_imm, imm & 0xffff); ++ } else { ++ u32 *p = &ctx->target[ctx->idx]; ++ uasm_i_addiu(&p, dst, r_zero, imm); ++ } ++ } ++ ctx->idx++; ++ ++ if (!is_range16(imm)) ++ ctx->idx++; ++} ++ ++static inline void emit_or(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, or, dst, src1, src2); ++} ++ ++static inline void emit_ori(unsigned int dst, unsigned src, u32 imm, ++ struct jit_ctx *ctx) ++{ ++ if (imm >= BIT(16)) { ++ emit_load_imm(r_tmp, imm, ctx); ++ emit_or(dst, src, r_tmp, ctx); ++ } else { ++ emit_instr(ctx, ori, dst, src, imm); ++ } ++} ++ ++static inline void emit_daddiu(unsigned int dst, unsigned int src, ++ int imm, struct jit_ctx *ctx) ++{ ++ /* ++ * Only used for stack, so the imm is relatively small ++ * and it fits in 15-bits ++ */ ++ emit_instr(ctx, daddiu, dst, src, imm); ++} ++ ++static inline void emit_addiu(unsigned int dst, unsigned int src, ++ u32 imm, struct jit_ctx *ctx) ++{ ++ if (!is_range16(imm)) { ++ emit_load_imm(r_tmp, imm, ctx); ++ emit_addu(dst, r_tmp, src, ctx); ++ } else { ++ emit_instr(ctx, addiu, dst, src, imm); ++ } ++} ++ ++static inline void emit_and(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, and, dst, src1, src2); ++} ++ ++static inline void emit_andi(unsigned int dst, unsigned int src, ++ u32 imm, struct jit_ctx *ctx) ++{ ++ /* If imm does not fit in u16 then load it to register */ ++ if (imm >= BIT(16)) { ++ emit_load_imm(r_tmp, imm, ctx); ++ emit_and(dst, src, r_tmp, ctx); ++ } else { ++ emit_instr(ctx, andi, dst, src, imm); ++ } ++} ++ ++static inline void emit_xor(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, xor, dst, src1, src2); ++} ++ ++static inline void emit_xori(ptr dst, ptr src, u32 imm, struct jit_ctx *ctx) ++{ ++ /* If imm does not fit in u16 then load it to register */ ++ if (imm >= BIT(16)) { ++ emit_load_imm(r_tmp, imm, ctx); ++ emit_xor(dst, src, r_tmp, ctx); ++ } else { ++ emit_instr(ctx, xori, dst, src, imm); ++ } ++} ++ ++static inline void emit_stack_offset(int offset, struct jit_ctx *ctx) ++{ ++ emit_long_instr(ctx, ADDIU, r_sp, r_sp, offset); ++} ++ ++static inline void emit_subu(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, subu, dst, src1, src2); ++} ++ ++static inline void emit_neg(unsigned int reg, struct jit_ctx *ctx) ++{ ++ emit_subu(reg, r_zero, reg, ctx); ++} ++ ++static inline void emit_sllv(unsigned int dst, unsigned int src, ++ unsigned int sa, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, sllv, dst, src, sa); ++} ++ ++static inline void emit_sll(unsigned int dst, unsigned int src, ++ unsigned int sa, struct jit_ctx *ctx) ++{ ++ /* sa is 5-bits long */ ++ if (sa >= BIT(5)) ++ /* Shifting >= 32 results in zero */ ++ emit_jit_reg_move(dst, r_zero, ctx); ++ else ++ emit_instr(ctx, sll, dst, src, sa); ++} ++ ++static inline void emit_srlv(unsigned int dst, unsigned int src, ++ unsigned int sa, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, srlv, dst, src, sa); ++} ++ ++static inline void emit_srl(unsigned int dst, unsigned int src, ++ unsigned int sa, struct jit_ctx *ctx) ++{ ++ /* sa is 5-bits long */ ++ if (sa >= BIT(5)) ++ /* Shifting >= 32 results in zero */ ++ emit_jit_reg_move(dst, r_zero, ctx); ++ else ++ emit_instr(ctx, srl, dst, src, sa); ++} ++ ++static inline void emit_slt(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, slt, dst, src1, src2); ++} ++ ++static inline void emit_sltu(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, sltu, dst, src1, src2); ++} ++ ++static inline void emit_sltiu(unsigned dst, unsigned int src, ++ unsigned int imm, struct jit_ctx *ctx) ++{ ++ /* 16 bit immediate */ ++ if (!is_range16((s32)imm)) { ++ emit_load_imm(r_tmp, imm, ctx); ++ emit_sltu(dst, src, r_tmp, ctx); ++ } else { ++ emit_instr(ctx, sltiu, dst, src, imm); ++ } ++ ++} ++ ++/* Store register on the stack */ ++static inline void emit_store_stack_reg(ptr reg, ptr base, ++ unsigned int offset, ++ struct jit_ctx *ctx) ++{ ++ emit_long_instr(ctx, SW, reg, offset, base); ++} ++ ++static inline void emit_store(ptr reg, ptr base, unsigned int offset, ++ struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, sw, reg, offset, base); ++} ++ ++static inline void emit_load_stack_reg(ptr reg, ptr base, ++ unsigned int offset, ++ struct jit_ctx *ctx) ++{ ++ emit_long_instr(ctx, LW, reg, offset, base); ++} ++ ++static inline void emit_load(unsigned int reg, unsigned int base, ++ unsigned int offset, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, lw, reg, offset, base); ++} ++ ++static inline void emit_load_byte(unsigned int reg, unsigned int base, ++ unsigned int offset, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, lb, reg, offset, base); ++} ++ ++static inline void emit_half_load(unsigned int reg, unsigned int base, ++ unsigned int offset, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, lh, reg, offset, base); ++} ++ ++static inline void emit_half_load_unsigned(unsigned int reg, unsigned int base, ++ unsigned int offset, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, lhu, reg, offset, base); ++} ++ ++static inline void emit_mul(unsigned int dst, unsigned int src1, ++ unsigned int src2, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, mul, dst, src1, src2); ++} ++ ++static inline void emit_div(unsigned int dst, unsigned int src, ++ struct jit_ctx *ctx) ++{ ++ if (ctx->target != NULL) { ++ u32 *p = &ctx->target[ctx->idx]; ++ uasm_i_divu(&p, dst, src); ++ p = &ctx->target[ctx->idx + 1]; ++ uasm_i_mflo(&p, dst); ++ } ++ ctx->idx += 2; /* 2 insts */ ++} ++ ++static inline void emit_mod(unsigned int dst, unsigned int src, ++ struct jit_ctx *ctx) ++{ ++ if (ctx->target != NULL) { ++ u32 *p = &ctx->target[ctx->idx]; ++ uasm_i_divu(&p, dst, src); ++ p = &ctx->target[ctx->idx + 1]; ++ uasm_i_mfhi(&p, dst); ++ } ++ ctx->idx += 2; /* 2 insts */ ++} ++ ++static inline void emit_dsll(unsigned int dst, unsigned int src, ++ unsigned int sa, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, dsll, dst, src, sa); ++} ++ ++static inline void emit_dsrl32(unsigned int dst, unsigned int src, ++ unsigned int sa, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, dsrl32, dst, src, sa); ++} ++ ++static inline void emit_wsbh(unsigned int dst, unsigned int src, ++ struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, wsbh, dst, src); ++} ++ ++/* load pointer to register */ ++static inline void emit_load_ptr(unsigned int dst, unsigned int src, ++ int imm, struct jit_ctx *ctx) ++{ ++ /* src contains the base addr of the 32/64-pointer */ ++ emit_long_instr(ctx, LW, dst, imm, src); ++} ++ ++/* load a function pointer to register */ ++static inline void emit_load_func(unsigned int reg, ptr imm, ++ struct jit_ctx *ctx) ++{ ++ if (IS_ENABLED(CONFIG_64BIT)) { ++ /* At this point imm is always 64-bit */ ++ emit_load_imm(r_tmp, (u64)imm >> 32, ctx); ++ emit_dsll(r_tmp_imm, r_tmp, 16, ctx); /* left shift by 16 */ ++ emit_ori(r_tmp, r_tmp_imm, (imm >> 16) & 0xffff, ctx); ++ emit_dsll(r_tmp_imm, r_tmp, 16, ctx); /* left shift by 16 */ ++ emit_ori(reg, r_tmp_imm, imm & 0xffff, ctx); ++ } else { ++ emit_load_imm(reg, imm, ctx); ++ } ++} ++ ++/* Move to real MIPS register */ ++static inline void emit_reg_move(ptr dst, ptr src, struct jit_ctx *ctx) ++{ ++ emit_long_instr(ctx, ADDU, dst, src, r_zero); ++} ++ ++/* Move to JIT (32-bit) register */ ++static inline void emit_jit_reg_move(ptr dst, ptr src, struct jit_ctx *ctx) ++{ ++ emit_addu(dst, src, r_zero, ctx); ++} ++ ++/* Compute the immediate value for PC-relative branches. */ ++static inline u32 b_imm(unsigned int tgt, struct jit_ctx *ctx) ++{ ++ if (ctx->target == NULL) ++ return 0; ++ ++ /* ++ * We want a pc-relative branch. We only do forward branches ++ * so tgt is always after pc. tgt is the instruction offset ++ * we want to jump to. ++ ++ * Branch on MIPS: ++ * I: target_offset <- sign_extend(offset) ++ * I+1: PC += target_offset (delay slot) ++ * ++ * ctx->idx currently points to the branch instruction ++ * but the offset is added to the delay slot so we need ++ * to subtract 4. ++ */ ++ return ctx->offsets[tgt] - ++ (ctx->idx * 4 - ctx->prologue_bytes) - 4; ++} ++ ++static inline void emit_bcond(int cond, unsigned int reg1, unsigned int reg2, ++ unsigned int imm, struct jit_ctx *ctx) ++{ ++ if (ctx->target != NULL) { ++ u32 *p = &ctx->target[ctx->idx]; ++ ++ switch (cond) { ++ case MIPS_COND_EQ: ++ uasm_i_beq(&p, reg1, reg2, imm); ++ break; ++ case MIPS_COND_NE: ++ uasm_i_bne(&p, reg1, reg2, imm); ++ break; ++ case MIPS_COND_ALL: ++ uasm_i_b(&p, imm); ++ break; ++ default: ++ pr_warn("%s: Unhandled branch conditional: %d\n", ++ __func__, cond); ++ } ++ } ++ ctx->idx++; ++} ++ ++static inline void emit_b(unsigned int imm, struct jit_ctx *ctx) ++{ ++ emit_bcond(MIPS_COND_ALL, r_zero, r_zero, imm, ctx); ++} ++ ++static inline void emit_jalr(unsigned int link, unsigned int reg, ++ struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, jalr, link, reg); ++} ++ ++static inline void emit_jr(unsigned int reg, struct jit_ctx *ctx) ++{ ++ emit_instr(ctx, jr, reg); ++} ++ ++static inline u16 align_sp(unsigned int num) ++{ ++ /* Double word alignment for 32-bit, quadword for 64-bit */ ++ unsigned int align = IS_ENABLED(CONFIG_64BIT) ? 16 : 8; ++ num = (num + (align - 1)) & -align; ++ return num; ++} ++ ++static void save_bpf_jit_regs(struct jit_ctx *ctx, unsigned offset) ++{ ++ int i = 0, real_off = 0; ++ u32 sflags, tmp_flags; ++ ++ /* Adjust the stack pointer */ ++ if (offset) ++ emit_stack_offset(-align_sp(offset), ctx); ++ ++ tmp_flags = sflags = ctx->flags >> SEEN_SREG_SFT; ++ /* sflags is essentially a bitmap */ ++ while (tmp_flags) { ++ if ((sflags >> i) & 0x1) { ++ emit_store_stack_reg(MIPS_R_S0 + i, r_sp, real_off, ++ ctx); ++ real_off += SZREG; ++ } ++ i++; ++ tmp_flags >>= 1; ++ } ++ ++ /* save return address */ ++ if (ctx->flags & SEEN_CALL) { ++ emit_store_stack_reg(r_ra, r_sp, real_off, ctx); ++ real_off += SZREG; ++ } ++ ++ /* Setup r_M leaving the alignment gap if necessary */ ++ if (ctx->flags & SEEN_MEM) { ++ if (real_off % (SZREG * 2)) ++ real_off += SZREG; ++ emit_long_instr(ctx, ADDIU, r_M, r_sp, real_off); ++ } ++} ++ ++static void restore_bpf_jit_regs(struct jit_ctx *ctx, ++ unsigned int offset) ++{ ++ int i, real_off = 0; ++ u32 sflags, tmp_flags; ++ ++ tmp_flags = sflags = ctx->flags >> SEEN_SREG_SFT; ++ /* sflags is a bitmap */ ++ i = 0; ++ while (tmp_flags) { ++ if ((sflags >> i) & 0x1) { ++ emit_load_stack_reg(MIPS_R_S0 + i, r_sp, real_off, ++ ctx); ++ real_off += SZREG; ++ } ++ i++; ++ tmp_flags >>= 1; ++ } ++ ++ /* restore return address */ ++ if (ctx->flags & SEEN_CALL) ++ emit_load_stack_reg(r_ra, r_sp, real_off, ctx); ++ ++ /* Restore the sp and discard the scrach memory */ ++ if (offset) ++ emit_stack_offset(align_sp(offset), ctx); ++} ++ ++static unsigned int get_stack_depth(struct jit_ctx *ctx) ++{ ++ int sp_off = 0; ++ ++ ++ /* How may s* regs do we need to preserved? */ ++ sp_off += hweight32(ctx->flags >> SEEN_SREG_SFT) * SZREG; ++ ++ if (ctx->flags & SEEN_MEM) ++ sp_off += 4 * BPF_MEMWORDS; /* BPF_MEMWORDS are 32-bit */ ++ ++ if (ctx->flags & SEEN_CALL) ++ sp_off += SZREG; /* Space for our ra register */ ++ ++ return sp_off; ++} ++ ++static void build_prologue(struct jit_ctx *ctx) ++{ ++ int sp_off; ++ ++ /* Calculate the total offset for the stack pointer */ ++ sp_off = get_stack_depth(ctx); ++ save_bpf_jit_regs(ctx, sp_off); ++ ++ if (ctx->flags & SEEN_SKB) ++ emit_reg_move(r_skb, MIPS_R_A0, ctx); ++ ++ if (ctx->flags & SEEN_SKB_DATA) { ++ /* Load packet length */ ++ emit_load(r_skb_len, r_skb, offsetof(struct sk_buff, len), ++ ctx); ++ emit_load(r_tmp, r_skb, offsetof(struct sk_buff, data_len), ++ ctx); ++ /* Load the data pointer */ ++ emit_load_ptr(r_skb_data, r_skb, ++ offsetof(struct sk_buff, data), ctx); ++ /* Load the header length */ ++ emit_subu(r_skb_hl, r_skb_len, r_tmp, ctx); ++ } ++ ++ if (ctx->flags & SEEN_X) ++ emit_jit_reg_move(r_X, r_zero, ctx); ++ ++ /* ++ * Do not leak kernel data to userspace, we only need to clear ++ * r_A if it is ever used. In fact if it is never used, we ++ * will not save/restore it, so clearing it in this case would ++ * corrupt the state of the caller. ++ */ ++ if (bpf_needs_clear_a(&ctx->skf->insns[0]) && ++ (ctx->flags & SEEN_A)) ++ emit_jit_reg_move(r_A, r_zero, ctx); ++} ++ ++static void build_epilogue(struct jit_ctx *ctx) ++{ ++ unsigned int sp_off; ++ ++ /* Calculate the total offset for the stack pointer */ ++ ++ sp_off = get_stack_depth(ctx); ++ restore_bpf_jit_regs(ctx, sp_off); ++ ++ /* Return */ ++ emit_jr(r_ra, ctx); ++ emit_nop(ctx); ++} ++ ++#define CHOOSE_LOAD_FUNC(K, func) \ ++ ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative : func) : \ ++ func##_positive) ++ ++static int build_body(struct jit_ctx *ctx) ++{ ++ const struct bpf_prog *prog = ctx->skf; ++ const struct sock_filter *inst; ++ unsigned int i, off, condt; ++ u32 k, b_off __maybe_unused; ++ u8 (*sk_load_func)(unsigned long *skb, int offset); ++ ++ for (i = 0; i < prog->len; i++) { ++ u16 code; ++ ++ inst = &(prog->insns[i]); ++ pr_debug("%s: code->0x%02x, jt->0x%x, jf->0x%x, k->0x%x\n", ++ __func__, inst->code, inst->jt, inst->jf, inst->k); ++ k = inst->k; ++ code = bpf_anc_helper(inst); ++ ++ if (ctx->target == NULL) ++ ctx->offsets[i] = ctx->idx * 4; ++ ++ switch (code) { ++ case BPF_LD | BPF_IMM: ++ /* A <- k ==> li r_A, k */ ++ ctx->flags |= SEEN_A; ++ emit_load_imm(r_A, k, ctx); ++ break; ++ case BPF_LD | BPF_W | BPF_LEN: ++ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4); ++ /* A <- len ==> lw r_A, offset(skb) */ ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ off = offsetof(struct sk_buff, len); ++ emit_load(r_A, r_skb, off, ctx); ++ break; ++ case BPF_LD | BPF_MEM: ++ /* A <- M[k] ==> lw r_A, offset(M) */ ++ ctx->flags |= SEEN_MEM | SEEN_A; ++ emit_load(r_A, r_M, SCRATCH_OFF(k), ctx); ++ break; ++ case BPF_LD | BPF_W | BPF_ABS: ++ /* A <- P[k:4] */ ++ sk_load_func = CHOOSE_LOAD_FUNC(k, sk_load_word); ++ goto load; ++ case BPF_LD | BPF_H | BPF_ABS: ++ /* A <- P[k:2] */ ++ sk_load_func = CHOOSE_LOAD_FUNC(k, sk_load_half); ++ goto load; ++ case BPF_LD | BPF_B | BPF_ABS: ++ /* A <- P[k:1] */ ++ sk_load_func = CHOOSE_LOAD_FUNC(k, sk_load_byte); ++load: ++ emit_load_imm(r_off, k, ctx); ++load_common: ++ ctx->flags |= SEEN_CALL | SEEN_OFF | ++ SEEN_SKB | SEEN_A | SEEN_SKB_DATA; ++ ++ emit_load_func(r_s0, (ptr)sk_load_func, ctx); ++ emit_reg_move(MIPS_R_A0, r_skb, ctx); ++ emit_jalr(MIPS_R_RA, r_s0, ctx); ++ /* Load second argument to delay slot */ ++ emit_reg_move(MIPS_R_A1, r_off, ctx); ++ /* Check the error value */ ++ emit_bcond(MIPS_COND_EQ, r_ret, 0, b_imm(i + 1, ctx), ++ ctx); ++ /* Load return register on DS for failures */ ++ emit_reg_move(r_ret, r_zero, ctx); ++ /* Return with error */ ++ emit_b(b_imm(prog->len, ctx), ctx); ++ emit_nop(ctx); ++ break; ++ case BPF_LD | BPF_W | BPF_IND: ++ /* A <- P[X + k:4] */ ++ sk_load_func = sk_load_word; ++ goto load_ind; ++ case BPF_LD | BPF_H | BPF_IND: ++ /* A <- P[X + k:2] */ ++ sk_load_func = sk_load_half; ++ goto load_ind; ++ case BPF_LD | BPF_B | BPF_IND: ++ /* A <- P[X + k:1] */ ++ sk_load_func = sk_load_byte; ++load_ind: ++ ctx->flags |= SEEN_OFF | SEEN_X; ++ emit_addiu(r_off, r_X, k, ctx); ++ goto load_common; ++ case BPF_LDX | BPF_IMM: ++ /* X <- k */ ++ ctx->flags |= SEEN_X; ++ emit_load_imm(r_X, k, ctx); ++ break; ++ case BPF_LDX | BPF_MEM: ++ /* X <- M[k] */ ++ ctx->flags |= SEEN_X | SEEN_MEM; ++ emit_load(r_X, r_M, SCRATCH_OFF(k), ctx); ++ break; ++ case BPF_LDX | BPF_W | BPF_LEN: ++ /* X <- len */ ++ ctx->flags |= SEEN_X | SEEN_SKB; ++ off = offsetof(struct sk_buff, len); ++ emit_load(r_X, r_skb, off, ctx); ++ break; ++ case BPF_LDX | BPF_B | BPF_MSH: ++ /* X <- 4 * (P[k:1] & 0xf) */ ++ ctx->flags |= SEEN_X | SEEN_CALL | SEEN_SKB; ++ /* Load offset to a1 */ ++ emit_load_func(r_s0, (ptr)sk_load_byte, ctx); ++ /* ++ * This may emit two instructions so it may not fit ++ * in the delay slot. So use a0 in the delay slot. ++ */ ++ emit_load_imm(MIPS_R_A1, k, ctx); ++ emit_jalr(MIPS_R_RA, r_s0, ctx); ++ emit_reg_move(MIPS_R_A0, r_skb, ctx); /* delay slot */ ++ /* Check the error value */ ++ emit_bcond(MIPS_COND_NE, r_ret, 0, ++ b_imm(prog->len, ctx), ctx); ++ emit_reg_move(r_ret, r_zero, ctx); ++ /* We are good */ ++ /* X <- P[1:K] & 0xf */ ++ emit_andi(r_X, r_A, 0xf, ctx); ++ /* X << 2 */ ++ emit_b(b_imm(i + 1, ctx), ctx); ++ emit_sll(r_X, r_X, 2, ctx); /* delay slot */ ++ break; ++ case BPF_ST: ++ /* M[k] <- A */ ++ ctx->flags |= SEEN_MEM | SEEN_A; ++ emit_store(r_A, r_M, SCRATCH_OFF(k), ctx); ++ break; ++ case BPF_STX: ++ /* M[k] <- X */ ++ ctx->flags |= SEEN_MEM | SEEN_X; ++ emit_store(r_X, r_M, SCRATCH_OFF(k), ctx); ++ break; ++ case BPF_ALU | BPF_ADD | BPF_K: ++ /* A += K */ ++ ctx->flags |= SEEN_A; ++ emit_addiu(r_A, r_A, k, ctx); ++ break; ++ case BPF_ALU | BPF_ADD | BPF_X: ++ /* A += X */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_addu(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_SUB | BPF_K: ++ /* A -= K */ ++ ctx->flags |= SEEN_A; ++ emit_addiu(r_A, r_A, -k, ctx); ++ break; ++ case BPF_ALU | BPF_SUB | BPF_X: ++ /* A -= X */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_subu(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_MUL | BPF_K: ++ /* A *= K */ ++ /* Load K to scratch register before MUL */ ++ ctx->flags |= SEEN_A; ++ emit_load_imm(r_s0, k, ctx); ++ emit_mul(r_A, r_A, r_s0, ctx); ++ break; ++ case BPF_ALU | BPF_MUL | BPF_X: ++ /* A *= X */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_mul(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_DIV | BPF_K: ++ /* A /= k */ ++ if (k == 1) ++ break; ++ if (optimize_div(&k)) { ++ ctx->flags |= SEEN_A; ++ emit_srl(r_A, r_A, k, ctx); ++ break; ++ } ++ ctx->flags |= SEEN_A; ++ emit_load_imm(r_s0, k, ctx); ++ emit_div(r_A, r_s0, ctx); ++ break; ++ case BPF_ALU | BPF_MOD | BPF_K: ++ /* A %= k */ ++ if (k == 1) { ++ ctx->flags |= SEEN_A; ++ emit_jit_reg_move(r_A, r_zero, ctx); ++ } else { ++ ctx->flags |= SEEN_A; ++ emit_load_imm(r_s0, k, ctx); ++ emit_mod(r_A, r_s0, ctx); ++ } ++ break; ++ case BPF_ALU | BPF_DIV | BPF_X: ++ /* A /= X */ ++ ctx->flags |= SEEN_X | SEEN_A; ++ /* Check if r_X is zero */ ++ emit_bcond(MIPS_COND_EQ, r_X, r_zero, ++ b_imm(prog->len, ctx), ctx); ++ emit_load_imm(r_ret, 0, ctx); /* delay slot */ ++ emit_div(r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_MOD | BPF_X: ++ /* A %= X */ ++ ctx->flags |= SEEN_X | SEEN_A; ++ /* Check if r_X is zero */ ++ emit_bcond(MIPS_COND_EQ, r_X, r_zero, ++ b_imm(prog->len, ctx), ctx); ++ emit_load_imm(r_ret, 0, ctx); /* delay slot */ ++ emit_mod(r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_OR | BPF_K: ++ /* A |= K */ ++ ctx->flags |= SEEN_A; ++ emit_ori(r_A, r_A, k, ctx); ++ break; ++ case BPF_ALU | BPF_OR | BPF_X: ++ /* A |= X */ ++ ctx->flags |= SEEN_A; ++ emit_ori(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_XOR | BPF_K: ++ /* A ^= k */ ++ ctx->flags |= SEEN_A; ++ emit_xori(r_A, r_A, k, ctx); ++ break; ++ case BPF_ANC | SKF_AD_ALU_XOR_X: ++ case BPF_ALU | BPF_XOR | BPF_X: ++ /* A ^= X */ ++ ctx->flags |= SEEN_A; ++ emit_xor(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_AND | BPF_K: ++ /* A &= K */ ++ ctx->flags |= SEEN_A; ++ emit_andi(r_A, r_A, k, ctx); ++ break; ++ case BPF_ALU | BPF_AND | BPF_X: ++ /* A &= X */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_and(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_LSH | BPF_K: ++ /* A <<= K */ ++ ctx->flags |= SEEN_A; ++ emit_sll(r_A, r_A, k, ctx); ++ break; ++ case BPF_ALU | BPF_LSH | BPF_X: ++ /* A <<= X */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_sllv(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_RSH | BPF_K: ++ /* A >>= K */ ++ ctx->flags |= SEEN_A; ++ emit_srl(r_A, r_A, k, ctx); ++ break; ++ case BPF_ALU | BPF_RSH | BPF_X: ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_srlv(r_A, r_A, r_X, ctx); ++ break; ++ case BPF_ALU | BPF_NEG: ++ /* A = -A */ ++ ctx->flags |= SEEN_A; ++ emit_neg(r_A, ctx); ++ break; ++ case BPF_JMP | BPF_JA: ++ /* pc += K */ ++ emit_b(b_imm(i + k + 1, ctx), ctx); ++ emit_nop(ctx); ++ break; ++ case BPF_JMP | BPF_JEQ | BPF_K: ++ /* pc += ( A == K ) ? pc->jt : pc->jf */ ++ condt = MIPS_COND_EQ | MIPS_COND_K; ++ goto jmp_cmp; ++ case BPF_JMP | BPF_JEQ | BPF_X: ++ ctx->flags |= SEEN_X; ++ /* pc += ( A == X ) ? pc->jt : pc->jf */ ++ condt = MIPS_COND_EQ | MIPS_COND_X; ++ goto jmp_cmp; ++ case BPF_JMP | BPF_JGE | BPF_K: ++ /* pc += ( A >= K ) ? pc->jt : pc->jf */ ++ condt = MIPS_COND_GE | MIPS_COND_K; ++ goto jmp_cmp; ++ case BPF_JMP | BPF_JGE | BPF_X: ++ ctx->flags |= SEEN_X; ++ /* pc += ( A >= X ) ? pc->jt : pc->jf */ ++ condt = MIPS_COND_GE | MIPS_COND_X; ++ goto jmp_cmp; ++ case BPF_JMP | BPF_JGT | BPF_K: ++ /* pc += ( A > K ) ? pc->jt : pc->jf */ ++ condt = MIPS_COND_GT | MIPS_COND_K; ++ goto jmp_cmp; ++ case BPF_JMP | BPF_JGT | BPF_X: ++ ctx->flags |= SEEN_X; ++ /* pc += ( A > X ) ? pc->jt : pc->jf */ ++ condt = MIPS_COND_GT | MIPS_COND_X; ++jmp_cmp: ++ /* Greater or Equal */ ++ if ((condt & MIPS_COND_GE) || ++ (condt & MIPS_COND_GT)) { ++ if (condt & MIPS_COND_K) { /* K */ ++ ctx->flags |= SEEN_A; ++ emit_sltiu(r_s0, r_A, k, ctx); ++ } else { /* X */ ++ ctx->flags |= SEEN_A | ++ SEEN_X; ++ emit_sltu(r_s0, r_A, r_X, ctx); ++ } ++ /* A < (K|X) ? r_scrach = 1 */ ++ b_off = b_imm(i + inst->jf + 1, ctx); ++ emit_bcond(MIPS_COND_NE, r_s0, r_zero, b_off, ++ ctx); ++ emit_nop(ctx); ++ /* A > (K|X) ? scratch = 0 */ ++ if (condt & MIPS_COND_GT) { ++ /* Checking for equality */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ if (condt & MIPS_COND_K) ++ emit_load_imm(r_s0, k, ctx); ++ else ++ emit_jit_reg_move(r_s0, r_X, ++ ctx); ++ b_off = b_imm(i + inst->jf + 1, ctx); ++ emit_bcond(MIPS_COND_EQ, r_A, r_s0, ++ b_off, ctx); ++ emit_nop(ctx); ++ /* Finally, A > K|X */ ++ b_off = b_imm(i + inst->jt + 1, ctx); ++ emit_b(b_off, ctx); ++ emit_nop(ctx); ++ } else { ++ /* A >= (K|X) so jump */ ++ b_off = b_imm(i + inst->jt + 1, ctx); ++ emit_b(b_off, ctx); ++ emit_nop(ctx); ++ } ++ } else { ++ /* A == K|X */ ++ if (condt & MIPS_COND_K) { /* K */ ++ ctx->flags |= SEEN_A; ++ emit_load_imm(r_s0, k, ctx); ++ /* jump true */ ++ b_off = b_imm(i + inst->jt + 1, ctx); ++ emit_bcond(MIPS_COND_EQ, r_A, r_s0, ++ b_off, ctx); ++ emit_nop(ctx); ++ /* jump false */ ++ b_off = b_imm(i + inst->jf + 1, ++ ctx); ++ emit_bcond(MIPS_COND_NE, r_A, r_s0, ++ b_off, ctx); ++ emit_nop(ctx); ++ } else { /* X */ ++ /* jump true */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ b_off = b_imm(i + inst->jt + 1, ++ ctx); ++ emit_bcond(MIPS_COND_EQ, r_A, r_X, ++ b_off, ctx); ++ emit_nop(ctx); ++ /* jump false */ ++ b_off = b_imm(i + inst->jf + 1, ctx); ++ emit_bcond(MIPS_COND_NE, r_A, r_X, ++ b_off, ctx); ++ emit_nop(ctx); ++ } ++ } ++ break; ++ case BPF_JMP | BPF_JSET | BPF_K: ++ ctx->flags |= SEEN_A; ++ /* pc += (A & K) ? pc -> jt : pc -> jf */ ++ emit_load_imm(r_s1, k, ctx); ++ emit_and(r_s0, r_A, r_s1, ctx); ++ /* jump true */ ++ b_off = b_imm(i + inst->jt + 1, ctx); ++ emit_bcond(MIPS_COND_NE, r_s0, r_zero, b_off, ctx); ++ emit_nop(ctx); ++ /* jump false */ ++ b_off = b_imm(i + inst->jf + 1, ctx); ++ emit_b(b_off, ctx); ++ emit_nop(ctx); ++ break; ++ case BPF_JMP | BPF_JSET | BPF_X: ++ ctx->flags |= SEEN_X | SEEN_A; ++ /* pc += (A & X) ? pc -> jt : pc -> jf */ ++ emit_and(r_s0, r_A, r_X, ctx); ++ /* jump true */ ++ b_off = b_imm(i + inst->jt + 1, ctx); ++ emit_bcond(MIPS_COND_NE, r_s0, r_zero, b_off, ctx); ++ emit_nop(ctx); ++ /* jump false */ ++ b_off = b_imm(i + inst->jf + 1, ctx); ++ emit_b(b_off, ctx); ++ emit_nop(ctx); ++ break; ++ case BPF_RET | BPF_A: ++ ctx->flags |= SEEN_A; ++ if (i != prog->len - 1) ++ /* ++ * If this is not the last instruction ++ * then jump to the epilogue ++ */ ++ emit_b(b_imm(prog->len, ctx), ctx); ++ emit_reg_move(r_ret, r_A, ctx); /* delay slot */ ++ break; ++ case BPF_RET | BPF_K: ++ /* ++ * It can emit two instructions so it does not fit on ++ * the delay slot. ++ */ ++ emit_load_imm(r_ret, k, ctx); ++ if (i != prog->len - 1) { ++ /* ++ * If this is not the last instruction ++ * then jump to the epilogue ++ */ ++ emit_b(b_imm(prog->len, ctx), ctx); ++ emit_nop(ctx); ++ } ++ break; ++ case BPF_MISC | BPF_TAX: ++ /* X = A */ ++ ctx->flags |= SEEN_X | SEEN_A; ++ emit_jit_reg_move(r_X, r_A, ctx); ++ break; ++ case BPF_MISC | BPF_TXA: ++ /* A = X */ ++ ctx->flags |= SEEN_A | SEEN_X; ++ emit_jit_reg_move(r_A, r_X, ctx); ++ break; ++ /* AUX */ ++ case BPF_ANC | SKF_AD_PROTOCOL: ++ /* A = ntohs(skb->protocol */ ++ ctx->flags |= SEEN_SKB | SEEN_OFF | SEEN_A; ++ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, ++ protocol) != 2); ++ off = offsetof(struct sk_buff, protocol); ++ emit_half_load(r_A, r_skb, off, ctx); ++#ifdef CONFIG_CPU_LITTLE_ENDIAN ++ /* This needs little endian fixup */ ++ if (cpu_has_wsbh) { ++ /* R2 and later have the wsbh instruction */ ++ emit_wsbh(r_A, r_A, ctx); ++ } else { ++ /* Get first byte */ ++ emit_andi(r_tmp_imm, r_A, 0xff, ctx); ++ /* Shift it */ ++ emit_sll(r_tmp, r_tmp_imm, 8, ctx); ++ /* Get second byte */ ++ emit_srl(r_tmp_imm, r_A, 8, ctx); ++ emit_andi(r_tmp_imm, r_tmp_imm, 0xff, ctx); ++ /* Put everyting together in r_A */ ++ emit_or(r_A, r_tmp, r_tmp_imm, ctx); ++ } ++#endif ++ break; ++ case BPF_ANC | SKF_AD_CPU: ++ ctx->flags |= SEEN_A | SEEN_OFF; ++ /* A = current_thread_info()->cpu */ ++ BUILD_BUG_ON(FIELD_SIZEOF(struct thread_info, ++ cpu) != 4); ++ off = offsetof(struct thread_info, cpu); ++ /* $28/gp points to the thread_info struct */ ++ emit_load(r_A, 28, off, ctx); ++ break; ++ case BPF_ANC | SKF_AD_IFINDEX: ++ /* A = skb->dev->ifindex */ ++ case BPF_ANC | SKF_AD_HATYPE: ++ /* A = skb->dev->type */ ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ off = offsetof(struct sk_buff, dev); ++ /* Load *dev pointer */ ++ emit_load_ptr(r_s0, r_skb, off, ctx); ++ /* error (0) in the delay slot */ ++ emit_bcond(MIPS_COND_EQ, r_s0, r_zero, ++ b_imm(prog->len, ctx), ctx); ++ emit_reg_move(r_ret, r_zero, ctx); ++ if (code == (BPF_ANC | SKF_AD_IFINDEX)) { ++ BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, ifindex) != 4); ++ off = offsetof(struct net_device, ifindex); ++ emit_load(r_A, r_s0, off, ctx); ++ } else { /* (code == (BPF_ANC | SKF_AD_HATYPE) */ ++ BUILD_BUG_ON(FIELD_SIZEOF(struct net_device, type) != 2); ++ off = offsetof(struct net_device, type); ++ emit_half_load_unsigned(r_A, r_s0, off, ctx); ++ } ++ break; ++ case BPF_ANC | SKF_AD_MARK: ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, mark) != 4); ++ off = offsetof(struct sk_buff, mark); ++ emit_load(r_A, r_skb, off, ctx); ++ break; ++ case BPF_ANC | SKF_AD_RXHASH: ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4); ++ off = offsetof(struct sk_buff, hash); ++ emit_load(r_A, r_skb, off, ctx); ++ break; ++ case BPF_ANC | SKF_AD_VLAN_TAG: ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, ++ vlan_tci) != 2); ++ off = offsetof(struct sk_buff, vlan_tci); ++ emit_half_load_unsigned(r_A, r_skb, off, ctx); ++ break; ++ case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT: ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ emit_load_byte(r_A, r_skb, PKT_VLAN_PRESENT_OFFSET(), ctx); ++ if (PKT_VLAN_PRESENT_BIT) ++ emit_srl(r_A, r_A, PKT_VLAN_PRESENT_BIT, ctx); ++ if (PKT_VLAN_PRESENT_BIT < 7) ++ emit_andi(r_A, r_A, 1, ctx); ++ break; ++ case BPF_ANC | SKF_AD_PKTTYPE: ++ ctx->flags |= SEEN_SKB; ++ ++ emit_load_byte(r_tmp, r_skb, PKT_TYPE_OFFSET(), ctx); ++ /* Keep only the last 3 bits */ ++ emit_andi(r_A, r_tmp, PKT_TYPE_MAX, ctx); ++#ifdef __BIG_ENDIAN_BITFIELD ++ /* Get the actual packet type to the lower 3 bits */ ++ emit_srl(r_A, r_A, 5, ctx); ++#endif ++ break; ++ case BPF_ANC | SKF_AD_QUEUE: ++ ctx->flags |= SEEN_SKB | SEEN_A; ++ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, ++ queue_mapping) != 2); ++ BUILD_BUG_ON(offsetof(struct sk_buff, ++ queue_mapping) > 0xff); ++ off = offsetof(struct sk_buff, queue_mapping); ++ emit_half_load_unsigned(r_A, r_skb, off, ctx); ++ break; ++ default: ++ pr_debug("%s: Unhandled opcode: 0x%02x\n", __FILE__, ++ inst->code); ++ return -1; ++ } ++ } ++ ++ /* compute offsets only during the first pass */ ++ if (ctx->target == NULL) ++ ctx->offsets[i] = ctx->idx * 4; ++ ++ return 0; ++} ++ ++void bpf_jit_compile(struct bpf_prog *fp) ++{ ++ struct jit_ctx ctx; ++ unsigned int alloc_size, tmp_idx; ++ ++ if (!bpf_jit_enable) ++ return; ++ ++ memset(&ctx, 0, sizeof(ctx)); ++ ++ ctx.offsets = kcalloc(fp->len + 1, sizeof(*ctx.offsets), GFP_KERNEL); ++ if (ctx.offsets == NULL) ++ return; ++ ++ ctx.skf = fp; ++ ++ if (build_body(&ctx)) ++ goto out; ++ ++ tmp_idx = ctx.idx; ++ build_prologue(&ctx); ++ ctx.prologue_bytes = (ctx.idx - tmp_idx) * 4; ++ /* just to complete the ctx.idx count */ ++ build_epilogue(&ctx); ++ ++ alloc_size = 4 * ctx.idx; ++ ctx.target = module_alloc(alloc_size); ++ if (ctx.target == NULL) ++ goto out; ++ ++ /* Clean it */ ++ memset(ctx.target, 0, alloc_size); ++ ++ ctx.idx = 0; ++ ++ /* Generate the actual JIT code */ ++ build_prologue(&ctx); ++ build_body(&ctx); ++ build_epilogue(&ctx); ++ ++ /* Update the icache */ ++ flush_icache_range((ptr)ctx.target, (ptr)(ctx.target + ctx.idx)); ++ ++ if (bpf_jit_enable > 1) ++ /* Dump JIT code */ ++ bpf_jit_dump(fp->len, alloc_size, 2, ctx.target); ++ ++ fp->bpf_func = (void *)ctx.target; ++ fp->jited = 1; ++ ++out: ++ kfree(ctx.offsets); ++} ++ ++void bpf_jit_free(struct bpf_prog *fp) ++{ ++ if (fp->jited) ++ module_memfree(fp->bpf_func); ++ ++ bpf_prog_unlock_free(fp); ++} +--- /dev/null ++++ b/arch/mips/net/bpf_jit_asm.S +@@ -0,0 +1,285 @@ ++/* ++ * bpf_jib_asm.S: Packet/header access helper functions for MIPS/MIPS64 BPF ++ * compiler. ++ * ++ * Copyright (C) 2015 Imagination Technologies Ltd. ++ * Author: Markos Chandras ++ * ++ * 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. ++ */ ++ ++#include ++#include ++#include ++#include "bpf_jit.h" ++ ++/* ABI ++ * ++ * r_skb_hl skb header length ++ * r_skb_data skb data ++ * r_off(a1) offset register ++ * r_A BPF register A ++ * r_X PF register X ++ * r_skb(a0) *skb ++ * r_M *scratch memory ++ * r_skb_le skb length ++ * r_s0 Scratch register 0 ++ * r_s1 Scratch register 1 ++ * ++ * On entry: ++ * a0: *skb ++ * a1: offset (imm or imm + X) ++ * ++ * All non-BPF-ABI registers are free for use. On return, we only ++ * care about r_ret. The BPF-ABI registers are assumed to remain ++ * unmodified during the entire filter operation. ++ */ ++ ++#define skb a0 ++#define offset a1 ++#define SKF_LL_OFF (-0x200000) /* Can't include linux/filter.h in assembly */ ++ ++ /* We know better :) so prevent assembler reordering etc */ ++ .set noreorder ++ ++#define is_offset_negative(TYPE) \ ++ /* If offset is negative we have more work to do */ \ ++ slti t0, offset, 0; \ ++ bgtz t0, bpf_slow_path_##TYPE##_neg; \ ++ /* Be careful what follows in DS. */ ++ ++#define is_offset_in_header(SIZE, TYPE) \ ++ /* Reading from header? */ \ ++ addiu $r_s0, $r_skb_hl, -SIZE; \ ++ slt t0, $r_s0, offset; \ ++ bgtz t0, bpf_slow_path_##TYPE; \ ++ ++LEAF(sk_load_word) ++ is_offset_negative(word) ++FEXPORT(sk_load_word_positive) ++ is_offset_in_header(4, word) ++ /* Offset within header boundaries */ ++ PTR_ADDU t1, $r_skb_data, offset ++ .set reorder ++ lw $r_A, 0(t1) ++ .set noreorder ++#ifdef CONFIG_CPU_LITTLE_ENDIAN ++# if MIPS_ISA_REV >= 2 ++ wsbh t0, $r_A ++ rotr $r_A, t0, 16 ++# else ++ sll t0, $r_A, 24 ++ srl t1, $r_A, 24 ++ srl t2, $r_A, 8 ++ or t0, t0, t1 ++ andi t2, t2, 0xff00 ++ andi t1, $r_A, 0xff00 ++ or t0, t0, t2 ++ sll t1, t1, 8 ++ or $r_A, t0, t1 ++# endif ++#endif ++ jr $r_ra ++ move $r_ret, zero ++ END(sk_load_word) ++ ++LEAF(sk_load_half) ++ is_offset_negative(half) ++FEXPORT(sk_load_half_positive) ++ is_offset_in_header(2, half) ++ /* Offset within header boundaries */ ++ PTR_ADDU t1, $r_skb_data, offset ++ lhu $r_A, 0(t1) ++#ifdef CONFIG_CPU_LITTLE_ENDIAN ++# if MIPS_ISA_REV >= 2 ++ wsbh $r_A, $r_A ++# else ++ sll t0, $r_A, 8 ++ srl t1, $r_A, 8 ++ andi t0, t0, 0xff00 ++ or $r_A, t0, t1 ++# endif ++#endif ++ jr $r_ra ++ move $r_ret, zero ++ END(sk_load_half) ++ ++LEAF(sk_load_byte) ++ is_offset_negative(byte) ++FEXPORT(sk_load_byte_positive) ++ is_offset_in_header(1, byte) ++ /* Offset within header boundaries */ ++ PTR_ADDU t1, $r_skb_data, offset ++ lbu $r_A, 0(t1) ++ jr $r_ra ++ move $r_ret, zero ++ END(sk_load_byte) ++ ++/* ++ * call skb_copy_bits: ++ * (prototype in linux/skbuff.h) ++ * ++ * int skb_copy_bits(sk_buff *skb, int offset, void *to, int len) ++ * ++ * o32 mandates we leave 4 spaces for argument registers in case ++ * the callee needs to use them. Even though we don't care about ++ * the argument registers ourselves, we need to allocate that space ++ * to remain ABI compliant since the callee may want to use that space. ++ * We also allocate 2 more spaces for $r_ra and our return register (*to). ++ * ++ * n64 is a bit different. The *caller* will allocate the space to preserve ++ * the arguments. So in 64-bit kernels, we allocate the 4-arg space for no ++ * good reason but it does not matter that much really. ++ * ++ * (void *to) is returned in r_s0 ++ * ++ */ ++#ifdef CONFIG_CPU_LITTLE_ENDIAN ++#define DS_OFFSET(SIZE) (4 * SZREG) ++#else ++#define DS_OFFSET(SIZE) ((4 * SZREG) + (4 - SIZE)) ++#endif ++#define bpf_slow_path_common(SIZE) \ ++ /* Quick check. Are we within reasonable boundaries? */ \ ++ LONG_ADDIU $r_s1, $r_skb_len, -SIZE; \ ++ sltu $r_s0, offset, $r_s1; \ ++ beqz $r_s0, fault; \ ++ /* Load 4th argument in DS */ \ ++ LONG_ADDIU a3, zero, SIZE; \ ++ PTR_ADDIU $r_sp, $r_sp, -(6 * SZREG); \ ++ PTR_LA t0, skb_copy_bits; \ ++ PTR_S $r_ra, (5 * SZREG)($r_sp); \ ++ /* Assign low slot to a2 */ \ ++ PTR_ADDIU a2, $r_sp, DS_OFFSET(SIZE); \ ++ jalr t0; \ ++ /* Reset our destination slot (DS but it's ok) */ \ ++ INT_S zero, (4 * SZREG)($r_sp); \ ++ /* \ ++ * skb_copy_bits returns 0 on success and -EFAULT \ ++ * on error. Our data live in a2. Do not bother with \ ++ * our data if an error has been returned. \ ++ */ \ ++ /* Restore our frame */ \ ++ PTR_L $r_ra, (5 * SZREG)($r_sp); \ ++ INT_L $r_s0, (4 * SZREG)($r_sp); \ ++ bltz v0, fault; \ ++ PTR_ADDIU $r_sp, $r_sp, 6 * SZREG; \ ++ move $r_ret, zero; \ ++ ++NESTED(bpf_slow_path_word, (6 * SZREG), $r_sp) ++ bpf_slow_path_common(4) ++#ifdef CONFIG_CPU_LITTLE_ENDIAN ++# if MIPS_ISA_REV >= 2 ++ wsbh t0, $r_s0 ++ jr $r_ra ++ rotr $r_A, t0, 16 ++# else ++ sll t0, $r_s0, 24 ++ srl t1, $r_s0, 24 ++ srl t2, $r_s0, 8 ++ or t0, t0, t1 ++ andi t2, t2, 0xff00 ++ andi t1, $r_s0, 0xff00 ++ or t0, t0, t2 ++ sll t1, t1, 8 ++ jr $r_ra ++ or $r_A, t0, t1 ++# endif ++#else ++ jr $r_ra ++ move $r_A, $r_s0 ++#endif ++ ++ END(bpf_slow_path_word) ++ ++NESTED(bpf_slow_path_half, (6 * SZREG), $r_sp) ++ bpf_slow_path_common(2) ++#ifdef CONFIG_CPU_LITTLE_ENDIAN ++# if MIPS_ISA_REV >= 2 ++ jr $r_ra ++ wsbh $r_A, $r_s0 ++# else ++ sll t0, $r_s0, 8 ++ andi t1, $r_s0, 0xff00 ++ andi t0, t0, 0xff00 ++ srl t1, t1, 8 ++ jr $r_ra ++ or $r_A, t0, t1 ++# endif ++#else ++ jr $r_ra ++ move $r_A, $r_s0 ++#endif ++ ++ END(bpf_slow_path_half) ++ ++NESTED(bpf_slow_path_byte, (6 * SZREG), $r_sp) ++ bpf_slow_path_common(1) ++ jr $r_ra ++ move $r_A, $r_s0 ++ ++ END(bpf_slow_path_byte) ++ ++/* ++ * Negative entry points ++ */ ++ .macro bpf_is_end_of_data ++ li t0, SKF_LL_OFF ++ /* Reading link layer data? */ ++ slt t1, offset, t0 ++ bgtz t1, fault ++ /* Be careful what follows in DS. */ ++ .endm ++/* ++ * call skb_copy_bits: ++ * (prototype in linux/filter.h) ++ * ++ * void *bpf_internal_load_pointer_neg_helper(const struct sk_buff *skb, ++ * int k, unsigned int size) ++ * ++ * see above (bpf_slow_path_common) for ABI restrictions ++ */ ++#define bpf_negative_common(SIZE) \ ++ PTR_ADDIU $r_sp, $r_sp, -(6 * SZREG); \ ++ PTR_LA t0, bpf_internal_load_pointer_neg_helper; \ ++ PTR_S $r_ra, (5 * SZREG)($r_sp); \ ++ jalr t0; \ ++ li a2, SIZE; \ ++ PTR_L $r_ra, (5 * SZREG)($r_sp); \ ++ /* Check return pointer */ \ ++ beqz v0, fault; \ ++ PTR_ADDIU $r_sp, $r_sp, 6 * SZREG; \ ++ /* Preserve our pointer */ \ ++ move $r_s0, v0; \ ++ /* Set return value */ \ ++ move $r_ret, zero; \ ++ ++bpf_slow_path_word_neg: ++ bpf_is_end_of_data ++NESTED(sk_load_word_negative, (6 * SZREG), $r_sp) ++ bpf_negative_common(4) ++ jr $r_ra ++ lw $r_A, 0($r_s0) ++ END(sk_load_word_negative) ++ ++bpf_slow_path_half_neg: ++ bpf_is_end_of_data ++NESTED(sk_load_half_negative, (6 * SZREG), $r_sp) ++ bpf_negative_common(2) ++ jr $r_ra ++ lhu $r_A, 0($r_s0) ++ END(sk_load_half_negative) ++ ++bpf_slow_path_byte_neg: ++ bpf_is_end_of_data ++NESTED(sk_load_byte_negative, (6 * SZREG), $r_sp) ++ bpf_negative_common(1) ++ jr $r_ra ++ lbu $r_A, 0($r_s0) ++ END(sk_load_byte_negative) ++ ++fault: ++ jr $r_ra ++ addiu $r_ret, zero, 1 diff --git a/target/linux/generic/backport-5.4/310-v5.6-mips-vdso-fix-jalr-t9-crash-in-vdso-code.patch b/target/linux/generic/backport-5.4/310-v5.6-mips-vdso-fix-jalr-t9-crash-in-vdso-code.patch new file mode 100644 index 000000000..25c87a326 --- /dev/null +++ b/target/linux/generic/backport-5.4/310-v5.6-mips-vdso-fix-jalr-t9-crash-in-vdso-code.patch @@ -0,0 +1,54 @@ +From d3f703c4359ff06619b2322b91f69710453e6b6d Mon Sep 17 00:00:00 2001 +From: Victor Kamensky +Date: Tue, 11 Feb 2020 11:24:33 -0800 +Subject: [PATCH] mips: vdso: fix 'jalr t9' crash in vdso code + +Observed that when kernel is built with Yocto mips64-poky-linux-gcc, +and mips64-poky-linux-gnun32-gcc toolchain, resulting vdso contains +'jalr t9' instructions in its code and since in vdso case nobody +sets GOT table code crashes when instruction reached. On other hand +observed that when kernel is built mips-poky-linux-gcc toolchain, the +same 'jalr t9' instruction are replaced with PC relative function +calls using 'bal' instructions. + +The difference boils down to -mrelax-pic-calls and -mexplicit-relocs +gcc options that gets different default values depending on gcc +target triplets and corresponding binutils. -mrelax-pic-calls got +enabled by default only in mips-poky-linux-gcc case. MIPS binutils +ld relies on R_MIPS_JALR relocation to convert 'jalr t9' into 'bal' +and such relocation is generated only if -mrelax-pic-calls option +is on. + +Please note 'jalr t9' conversion to 'bal' can happen only to static +functions. These static PIC calls use mips local GOT entries that +are supposed to be filled with start of DSO value by run-time linker +(missing in VDSO case) and they do not have dynamic relocations. +Global mips GOT entries must have dynamic relocations and they should +be prevented by cmd_vdso_check Makefile rule. + +Solution call out -mrelax-pic-calls and -mexplicit-relocs options +explicitly while compiling MIPS vdso code. That would get correct +and consistent between different toolchains behaviour. + +Reported-by: Bruce Ashfield +Signed-off-by: Victor Kamensky +Signed-off-by: Paul Burton +Cc: linux-mips@vger.kernel.org +Cc: Ralf Baechle +Cc: James Hogan +Cc: Vincenzo Frascino +Cc: richard.purdie@linuxfoundation.org +--- + arch/mips/vdso/Makefile | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/mips/vdso/Makefile ++++ b/arch/mips/vdso/Makefile +@@ -29,6 +29,7 @@ endif + cflags-vdso := $(ccflags-vdso) \ + $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ + -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \ ++ -mrelax-pic-calls -mexplicit-relocs \ + -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \ + $(call cc-option, -fno-asynchronous-unwind-tables) \ + $(call cc-option, -fno-stack-protector) diff --git a/target/linux/generic/backport-5.4/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch b/target/linux/generic/backport-5.4/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch index 12962135d..a4981acde 100644 --- a/target/linux/generic/backport-5.4/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch +++ b/target/linux/generic/backport-5.4/395-v5.8-net-sch_cake-Take-advantage-of-skb-hash-where-appropriate.patch @@ -67,7 +67,7 @@ Signed-off-by: Kevin Darbyshire-Bryant + bool rev = !skb->_nfct, upd = false; + __be32 ip; - if (tc_skb_protocol(skb) != htons(ETH_P_IP)) + if (skb_protocol(skb, true) != htons(ETH_P_IP)) - return; + return false; 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.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch index 858c584c0..92fe22487 100644 --- 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.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch @@ -59,7 +59,7 @@ Signed-off-by: Russell King #include #include -@@ -445,45 +446,63 @@ static void sfp_upstream_clear(struct sf +@@ -520,45 +521,63 @@ static void sfp_upstream_clear(struct sf } /** diff --git a/target/linux/generic/backport-5.4/717-v5.5-net-sfp-rework-upstream-interface.patch b/target/linux/generic/backport-5.4/717-v5.5-net-sfp-rework-upstream-interface.patch index f3454851b..9175f2557 100644 --- a/target/linux/generic/backport-5.4/717-v5.5-net-sfp-rework-upstream-interface.patch +++ b/target/linux/generic/backport-5.4/717-v5.5-net-sfp-rework-upstream-interface.patch @@ -53,7 +53,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -329,10 +329,19 @@ static void sfp_bus_release(struct kref +@@ -404,10 +404,19 @@ static void sfp_bus_release(struct kref kfree(bus); } @@ -75,7 +75,7 @@ Signed-off-by: Russell King static int sfp_register_bus(struct sfp_bus *bus) { -@@ -348,11 +357,11 @@ static int sfp_register_bus(struct sfp_b +@@ -423,11 +432,11 @@ static int sfp_register_bus(struct sfp_b return ret; } } @@ -88,7 +88,7 @@ Signed-off-by: Russell King return 0; } -@@ -446,13 +455,12 @@ static void sfp_upstream_clear(struct sf +@@ -521,13 +530,12 @@ static void sfp_upstream_clear(struct sf } /** @@ -106,7 +106,7 @@ Signed-off-by: Russell King * * Returns: on success, a pointer to the sfp_bus structure, * %NULL if no SFP is specified, -@@ -462,9 +470,7 @@ static void sfp_upstream_clear(struct sf +@@ -537,9 +545,7 @@ static void sfp_upstream_clear(struct sf * %-ENOMEM if we failed to allocate the bus. * an error from the upstream's connect_phy() method. */ @@ -117,7 +117,7 @@ Signed-off-by: Russell King { struct fwnode_reference_args ref; struct sfp_bus *bus; -@@ -482,7 +488,39 @@ struct sfp_bus *sfp_register_upstream_no +@@ -557,7 +563,39 @@ struct sfp_bus *sfp_register_upstream_no if (!bus) return ERR_PTR(-ENOMEM); @@ -157,7 +157,7 @@ Signed-off-by: Russell King bus->upstream_ops = ops; bus->upstream = upstream; -@@ -495,33 +533,33 @@ struct sfp_bus *sfp_register_upstream_no +@@ -570,33 +608,33 @@ struct sfp_bus *sfp_register_upstream_no } rtnl_unlock(); diff --git a/target/linux/generic/backport-5.4/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch b/target/linux/generic/backport-5.4/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch index 13dc5216f..c7bfd8a30 100644 --- a/target/linux/generic/backport-5.4/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch +++ b/target/linux/generic/backport-5.4/718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch @@ -16,7 +16,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/sfp-bus.c +++ b/drivers/net/phy/sfp-bus.c -@@ -331,7 +331,7 @@ static void sfp_bus_release(struct kref +@@ -406,7 +406,7 @@ static void sfp_bus_release(struct kref /** * sfp_bus_put() - put a reference on the &struct sfp_bus diff --git a/target/linux/generic/backport-5.4/742-v5.5-net-sfp-add-support-for-module-quirks.patch b/target/linux/generic/backport-5.4/742-v5.5-net-sfp-add-support-for-module-quirks.patch deleted file mode 100644 index 46c56a655..000000000 --- a/target/linux/generic/backport-5.4/742-v5.5-net-sfp-add-support-for-module-quirks.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 8df5dd55cef48c0769379e04dbc085a899b106d4 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Fri, 8 Mar 2019 14:02:25 +0000 -Subject: [PATCH 640/660] net: sfp: add support for module quirks - -Add support for applying module quirks to the list of supported -ethtool link modes. - -Signed-off-by: Russell King ---- - drivers/net/phy/sfp-bus.c | 54 +++++++++++++++++++++++++++++++++++++++ - 1 file changed, 54 insertions(+) - ---- a/drivers/net/phy/sfp-bus.c -+++ b/drivers/net/phy/sfp-bus.c -@@ -10,6 +10,12 @@ - - #include "sfp.h" - -+struct sfp_quirk { -+ const char *vendor; -+ const char *part; -+ void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes); -+}; -+ - /** - * struct sfp_bus - internal representation of a sfp bus - */ -@@ -22,6 +28,7 @@ struct sfp_bus { - const struct sfp_socket_ops *socket_ops; - struct device *sfp_dev; - struct sfp *sfp; -+ const struct sfp_quirk *sfp_quirk; - - const struct sfp_upstream_ops *upstream_ops; - void *upstream; -@@ -31,6 +38,46 @@ struct sfp_bus { - bool started; - }; - -+static const struct sfp_quirk sfp_quirks[] = { -+}; -+ -+static size_t sfp_strlen(const char *str, size_t maxlen) -+{ -+ size_t size, i; -+ -+ /* Trailing characters should be filled with space chars */ -+ for (i = 0, size = 0; i < maxlen; i++) -+ if (str[i] != ' ') -+ size = i + 1; -+ -+ return size; -+} -+ -+static bool sfp_match(const char *qs, const char *str, size_t len) -+{ -+ if (!qs) -+ return true; -+ if (strlen(qs) != len) -+ return false; -+ return !strncmp(qs, str, len); -+} -+ -+static const struct sfp_quirk *sfp_lookup_quirk(const struct sfp_eeprom_id *id) -+{ -+ const struct sfp_quirk *q; -+ unsigned int i; -+ size_t vs, ps; -+ -+ vs = sfp_strlen(id->base.vendor_name, ARRAY_SIZE(id->base.vendor_name)); -+ ps = sfp_strlen(id->base.vendor_pn, ARRAY_SIZE(id->base.vendor_pn)); -+ -+ for (i = 0, q = sfp_quirks; i < ARRAY_SIZE(sfp_quirks); i++, q++) -+ if (sfp_match(q->vendor, id->base.vendor_name, vs) && -+ sfp_match(q->part, id->base.vendor_pn, ps)) -+ return q; -+ -+ return NULL; -+} - /** - * sfp_parse_port() - Parse the EEPROM base ID, setting the port type - * @bus: a pointer to the &struct sfp_bus structure for the sfp module -@@ -234,6 +281,9 @@ void sfp_parse_support(struct sfp_bus *b - phylink_set(modes, 1000baseX_Full); - } - -+ if (bus->sfp_quirk) -+ bus->sfp_quirk->modes(id, modes); -+ - bitmap_or(support, support, modes, __ETHTOOL_LINK_MODE_MASK_NBITS); - - phylink_set(support, Autoneg); -@@ -610,6 +660,8 @@ int sfp_module_insert(struct sfp_bus *bu - const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus); - int ret = 0; - -+ bus->sfp_quirk = sfp_lookup_quirk(id); -+ - if (ops && ops->module_insert) - ret = ops->module_insert(bus->upstream, id); - -@@ -623,6 +675,8 @@ void sfp_module_remove(struct sfp_bus *b - - if (ops && ops->module_remove) - ops->module_remove(bus->upstream); -+ -+ bus->sfp_quirk = NULL; - } - EXPORT_SYMBOL_GPL(sfp_module_remove); - diff --git a/target/linux/generic/backport-5.4/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch b/target/linux/generic/backport-5.4/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch deleted file mode 100644 index 0b085ff09..000000000 --- a/target/linux/generic/backport-5.4/743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch +++ /dev/null @@ -1,52 +0,0 @@ -From ecaa542cfed078dbc356dadff0bad4b6a8e704a0 Mon Sep 17 00:00:00 2001 -From: Russell King -Date: Fri, 17 May 2019 10:14:45 +0100 -Subject: [PATCH 641/660] net: sfp: add some quirks for GPON modules - -Marc Micalizzi reports that Huawei MA5671A and Alcatel/Lucent G-010S-P -modules are capable of 2500base-X, but incorrectly report their -capabilities in the EEPROM. It seems rather common that GPON modules -mis-report. - -Let's fix these modules by adding some quirks. - -Signed-off-by: Russell King ---- - drivers/net/phy/sfp-bus.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - ---- a/drivers/net/phy/sfp-bus.c -+++ b/drivers/net/phy/sfp-bus.c -@@ -38,7 +38,32 @@ struct sfp_bus { - bool started; - }; - -+static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, -+ unsigned long *modes) -+{ -+ phylink_set(modes, 2500baseX_Full); -+} -+ - static const struct sfp_quirk sfp_quirks[] = { -+ { -+ // Alcatel Lucent G-010S-P can operate at 2500base-X, but -+ // incorrectly report 2500MBd NRZ in their EEPROM -+ .vendor = "ALCATELLUCENT", -+ .part = "G010SP", -+ .modes = sfp_quirk_2500basex, -+ }, { -+ // Alcatel Lucent G-010S-A can operate at 2500base-X, but -+ // report 3.2GBd NRZ in their EEPROM -+ .vendor = "ALCATELLUCENT", -+ .part = "3FE46541AA", -+ .modes = sfp_quirk_2500basex, -+ }, { -+ // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd -+ // NRZ in their EEPROM -+ .vendor = "HUAWEI", -+ .part = "MA5671A", -+ .modes = sfp_quirk_2500basex, -+ }, - }; - - static size_t sfp_strlen(const char *str, size_t maxlen) diff --git a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch index 23c9bddf0..e3346c12b 100644 --- a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4921,6 +4921,80 @@ static int mv88e6xxx_port_mdb_del(struct +@@ -4920,6 +4920,80 @@ static int mv88e6xxx_port_mdb_del(struct return err; } @@ -106,7 +106,7 @@ Signed-off-by: David S. Miller static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, bool unicast, bool multicast) { -@@ -4975,6 +5049,8 @@ static const struct dsa_switch_ops mv88e +@@ -4974,6 +5048,8 @@ static const struct dsa_switch_ops mv88e .port_mdb_prepare = mv88e6xxx_port_mdb_prepare, .port_mdb_add = mv88e6xxx_port_mdb_add, .port_mdb_del = mv88e6xxx_port_mdb_del, diff --git a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch index d9d5a5fd7..ce1222735 100644 --- a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch +++ b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4988,7 +4988,7 @@ static void mv88e6xxx_port_mirror_del(st +@@ -4987,7 +4987,7 @@ static void mv88e6xxx_port_mirror_del(st if (chip->info->ops->set_egress_port(chip, direction, dsa_upstream_port(ds, diff --git a/target/linux/generic/backport-5.4/801-v5.6-leds-populate-the-device-s-of_node.patch b/target/linux/generic/backport-5.4/801-v5.6-leds-populate-the-device-s-of_node.patch index 4136bc4e1..5c3b58c43 100644 --- a/target/linux/generic/backport-5.4/801-v5.6-leds-populate-the-device-s-of_node.patch +++ b/target/linux/generic/backport-5.4/801-v5.6-leds-populate-the-device-s-of_node.patch @@ -22,7 +22,7 @@ Signed-off-by: Pavel Machek #include "leds.h" static struct class *leds_class; -@@ -276,8 +277,10 @@ int led_classdev_register_ext(struct dev +@@ -277,8 +278,10 @@ int led_classdev_register_ext(struct dev mutex_unlock(&led_cdev->led_access); return PTR_ERR(led_cdev->dev); } diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 047921b3b..97d9b8c9e 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -1016,6 +1016,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_EFI is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_GPIO is not set @@ -1757,6 +1758,7 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set # CONFIG_HUGETLB_PAGE is not set +# CONFIG_HUGETLBFS is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set # CONFIG_HWLAT_TRACER is not set @@ -4343,6 +4345,7 @@ CONFIG_SERIAL_EARLYCON=y # CONFIG_SG_POOL is not set # CONFIG_SG_SPLIT is not set CONFIG_SHMEM=y +# CONFIG_SHORTCUT_FE is not set # CONFIG_SH_ETH is not set # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set @@ -5157,7 +5160,6 @@ CONFIG_TTY=y # CONFIG_UACCESS_WITH_MEMCPY is not set # CONFIG_UBIFS_ATIME_SUPPORT is not set # CONFIG_UBIFS_FS_ENCRYPTION is not set -CONFIG_UBIFS_FS_FORMAT4=y # CONFIG_UBIFS_FS_SECURITY is not set # CONFIG_UBSAN is not set # CONFIG_UCB1400_CORE is not set diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index 172af013d..6ae79172f 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -1073,6 +1073,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_EFI is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_GPIO is not set @@ -1868,6 +1869,7 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set # CONFIG_HUGETLB_PAGE is not set +# CONFIG_HUGETLBFS is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set # CONFIG_HWLAT_TRACER is not set @@ -4560,6 +4562,7 @@ CONFIG_SERIAL_EARLYCON=y # CONFIG_SG_POOL is not set # CONFIG_SG_SPLIT is not set CONFIG_SHMEM=y +# CONFIG_SHORTCUT_FE is not set # CONFIG_SH_ETH is not set # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set @@ -5430,7 +5433,6 @@ CONFIG_TTY=y # CONFIG_UACCESS_WITH_MEMCPY is not set # CONFIG_UBIFS_ATIME_SUPPORT is not set # CONFIG_UBIFS_FS_ENCRYPTION is not set -CONFIG_UBIFS_FS_FORMAT4=y # CONFIG_UBIFS_FS_SECURITY is not set # CONFIG_UBIFS_FS_XATTR is not set # CONFIG_UBSAN is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 7f4456615..d09dde24e 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -1146,6 +1146,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_EFI is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_GPIO is not set @@ -2005,8 +2006,8 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTC_PASIC3 is not set # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set -# CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set +# CONFIG_HUGETLBFS is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set # CONFIG_HWLAT_TRACER is not set @@ -2350,6 +2351,7 @@ CONFIG_INPUT_MISC=y # CONFIG_INV_MPU6050_IIO is not set # CONFIG_INV_MPU6050_SPI is not set # CONFIG_IOMMU_SUPPORT is not set +# CONFIG_IONIC is not set # CONFIG_IOSCHED_BFQ is not set # CONFIG_IOSCHED_CFQ is not set CONFIG_IOSCHED_DEADLINE=y @@ -3636,8 +3638,8 @@ CONFIG_NFS_V3=y # CONFIG_NFT_XFRM is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_BRIDGE is not set +# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -4220,6 +4222,7 @@ CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 # CONFIG_RD_LZO is not set # CONFIG_RD_XZ is not set # CONFIG_READABLE_ASM is not set +# CONFIG_READ_ONLY_THP_FOR_FS is not set # CONFIG_REALTEK_PHY is not set # CONFIG_REDWOOD is not set # CONFIG_REED_SOLOMON_TEST is not set @@ -4854,8 +4857,8 @@ CONFIG_SERIAL_EARLYCON=y # CONFIG_SG_POOL is not set # CONFIG_SG_SPLIT is not set CONFIG_SHMEM=y -# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set # CONFIG_SHORTCUT_FE is not set +# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set # CONFIG_SH_ETH is not set # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set @@ -5794,7 +5797,6 @@ CONFIG_TTY=y # CONFIG_UBIFS_ATIME_SUPPORT is not set # CONFIG_UBIFS_FS_AUTHENTICATION is not set # CONFIG_UBIFS_FS_ENCRYPTION is not set -CONFIG_UBIFS_FS_FORMAT4=y # CONFIG_UBIFS_FS_SECURITY is not set # CONFIG_UBIFS_FS_XATTR is not set # CONFIG_UBSAN is not set diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index 4cbfa4d23..dce52ce0e 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -553,15 +553,15 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, t = ar8327_get_pad_cfg(pdata->pad6_cfg); ar8xxx_write(priv, AR8327_REG_PAD6_MODE, t); - pos = ar8xxx_read(priv, AR8327_REG_POWER_ON_STRIP); + pos = ar8xxx_read(priv, AR8327_REG_POWER_ON_STRAP); new_pos = pos; led_cfg = pdata->led_cfg; if (led_cfg) { if (led_cfg->open_drain) - new_pos |= AR8327_POWER_ON_STRIP_LED_OPEN_EN; + new_pos |= AR8327_POWER_ON_STRAP_LED_OPEN_EN; else - new_pos &= ~AR8327_POWER_ON_STRIP_LED_OPEN_EN; + new_pos &= ~AR8327_POWER_ON_STRAP_LED_OPEN_EN; ar8xxx_write(priv, AR8327_REG_LED_CTRL0, led_cfg->led_ctrl0); ar8xxx_write(priv, AR8327_REG_LED_CTRL1, led_cfg->led_ctrl1); @@ -569,7 +569,7 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, ar8xxx_write(priv, AR8327_REG_LED_CTRL3, led_cfg->led_ctrl3); if (new_pos != pos) - new_pos |= AR8327_POWER_ON_STRIP_POWER_ON_SEL; + new_pos |= AR8327_POWER_ON_STRAP_POWER_ON_SEL; } if (pdata->sgmii_cfg) { @@ -586,12 +586,12 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, ar8xxx_write(priv, AR8327_REG_SGMII_CTRL, t); if (pdata->sgmii_cfg->serdes_aen) - new_pos &= ~AR8327_POWER_ON_STRIP_SERDES_AEN; + new_pos &= ~AR8327_POWER_ON_STRAP_SERDES_AEN; else - new_pos |= AR8327_POWER_ON_STRIP_SERDES_AEN; + new_pos |= AR8327_POWER_ON_STRAP_SERDES_AEN; } - ar8xxx_write(priv, AR8327_REG_POWER_ON_STRIP, new_pos); + ar8xxx_write(priv, AR8327_REG_POWER_ON_STRAP, new_pos); if (pdata->leds && pdata->num_leds) { int i; diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.h b/target/linux/generic/files/drivers/net/phy/ar8327.h index a59d306d6..088b28861 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.h +++ b/target/linux/generic/files/drivers/net/phy/ar8327.h @@ -53,10 +53,10 @@ #define AR8327_PAD_RGMII_TXCLK_DELAY_EN BIT(25) #define AR8327_PAD_RGMII_EN BIT(26) -#define AR8327_REG_POWER_ON_STRIP 0x010 -#define AR8327_POWER_ON_STRIP_POWER_ON_SEL BIT(31) -#define AR8327_POWER_ON_STRIP_LED_OPEN_EN BIT(24) -#define AR8327_POWER_ON_STRIP_SERDES_AEN BIT(7) +#define AR8327_REG_POWER_ON_STRAP 0x010 +#define AR8327_POWER_ON_STRAP_POWER_ON_SEL BIT(31) +#define AR8327_POWER_ON_STRAP_LED_OPEN_EN BIT(24) +#define AR8327_POWER_ON_STRAP_SERDES_AEN BIT(7) #define AR8327_REG_INT_STATUS0 0x020 #define AR8327_INT0_VT_DONE BIT(20) diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c index 992689605..8861814be 100644 --- a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c +++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c @@ -39,7 +39,7 @@ #include "routerboot.h" -#define RB_HARDCONFIG_VER "0.04" +#define RB_HARDCONFIG_VER "0.05" #define RB_HC_PR_PFX "[rb_hardconfig] " /* ID values for hardware settings */ @@ -58,6 +58,7 @@ #define RB_ID_BOARD_IDENTIFIER 0x17 #define RB_ID_PRODUCT_NAME 0x21 #define RB_ID_DEFCONF 0x26 +#define RB_ID_BOARD_REVISION 0x27 /* Bit definitions for hardware options */ #define RB_HW_OPT_NO_UART BIT(0) @@ -415,6 +416,10 @@ static struct hc_attr { .tag_id = RB_ID_DEFCONF, .tshow = routerboot_tag_show_string, .kattr = __ATTR(defconf, S_IRUSR, hc_attr_show, NULL), + }, { + .tag_id = RB_ID_BOARD_REVISION, + .tshow = routerboot_tag_show_string, + .kattr = __ATTR(board_revision, S_IRUSR, hc_attr_show, NULL), } }; @@ -475,7 +480,7 @@ static int hc_wlan_data_unpack_lzor(const u8 *inbuf, size_t inlen, /* Temporary buffer same size as the outbuf */ templen = *outlen; tempbuf = kmalloc(templen, GFP_KERNEL); - if (!outbuf) + if (!tempbuf) return -ENOMEM; /* Concatenate into the outbuf */ diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c index 7bef497c9..51a178ec7 100644 --- a/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c +++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_softconfig.c @@ -56,7 +56,7 @@ #include "routerboot.h" -#define RB_SOFTCONFIG_VER "0.02" +#define RB_SOFTCONFIG_VER "0.03" #define RB_SC_PR_PFX "[rb_softconfig] " /* @@ -121,22 +121,36 @@ #define RB_BOOT_DEVICE_FLSHONCE 8 // "boot in flash configuration mode once, then NAND" /* - * ATH79 CPU frequency indices. + * ATH79 9xxx CPU frequency indices. * It is unknown if they apply to all ATH79 RBs, and some do not seem to feature - * the up levels (QCA955x), while U3 is presumably AR9344-only. + * the upper levels (QCA955x), while F is presumably AR9344-only. */ -#define RB_CPU_FREQ_IDX_ATH79_D2 (0 << 3) -#define RB_CPU_FREQ_IDX_ATH79_D1 (1 << 3) // 0x8 -#define RB_CPU_FREQ_IDX_ATH79_N0 (2 << 3) // 0x10 - factory freq for many devices -#define RB_CPU_FREQ_IDX_ATH79_U1 (3 << 3) // 0x18 -#define RB_CPU_FREQ_IDX_ATH79_U2 (4 << 3) // 0x20 -#define RB_CPU_FREQ_IDX_ATH79_U3 (5 << 3) // 0x28 +#define RB_CPU_FREQ_IDX_ATH79_9X_A (0 << 3) +#define RB_CPU_FREQ_IDX_ATH79_9X_B (1 << 3) // 0x8 +#define RB_CPU_FREQ_IDX_ATH79_9X_C (2 << 3) // 0x10 - factory freq for many devices +#define RB_CPU_FREQ_IDX_ATH79_9X_D (3 << 3) // 0x18 +#define RB_CPU_FREQ_IDX_ATH79_9X_E (4 << 3) // 0x20 +#define RB_CPU_FREQ_IDX_ATH79_9X_F (5 << 3) // 0x28 -#define RB_CPU_FREQ_IDX_ATH79_MIN 0 // all devices support lowest setting -#define RB_CPU_FREQ_IDX_ATH79_AR9334_MAX 5 // stops at U3 -#define RB_CPU_FREQ_IDX_ATH79_QCA953X_MAX 4 // stops at U2 -#define RB_CPU_FREQ_IDX_ATH79_QCA9556_MAX 2 // stops at N0 -#define RB_CPU_FREQ_IDX_ATH79_QCA9558_MAX 3 // stops at U1 +#define RB_CPU_FREQ_IDX_ATH79_9X_MIN 0 // all devices support lowest setting +#define RB_CPU_FREQ_IDX_ATH79_9X_AR9334_MAX 5 // stops at F +#define RB_CPU_FREQ_IDX_ATH79_9X_QCA953X_MAX 4 // stops at E +#define RB_CPU_FREQ_IDX_ATH79_9X_QCA9556_MAX 2 // stops at C +#define RB_CPU_FREQ_IDX_ATH79_9X_QCA9558_MAX 3 // stops at D + +/* ATH79 7xxx CPU frequency indices. */ +#define RB_CPU_FREQ_IDX_ATH79_7X_A ((0 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_B ((1 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_C ((2 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_D ((3 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_E ((4 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_F ((5 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_G ((6 * 9) << 4) +#define RB_CPU_FREQ_IDX_ATH79_7X_H ((7 * 9) << 4) + +#define RB_CPU_FREQ_IDX_ATH79_7X_MIN 0 // all devices support lowest setting +#define RB_CPU_FREQ_IDX_ATH79_7X_AR724X_MAX 3 // stops at D +#define RB_CPU_FREQ_IDX_ATH79_7X_AR7161_MAX 7 // stops at H - check if applies to all AR71xx devices #define RB_SC_CRC32_OFFSET 4 // located right after magic @@ -168,8 +182,9 @@ static ssize_t sc_tag_show_u32tvs(const u8 *pld, u16 pld_len, char *buf, u32 data; // cpu-endian int i; + // fallback to raw hex output if we can't handle the input if (tvselmts < 0) - return tvselmts; + return routerboot_tag_show_u32s(pld, pld_len, buf); if (sizeof(data) != pld_len) return -EINVAL; @@ -387,39 +402,71 @@ static ssize_t sc_tag_store_bootdelays(const u8 *pld, u16 pld_len, const char *b /* Support CPU frequency accessors only when the tag format has been asserted */ #if defined(CONFIG_ATH79) -static struct sc_u32tvs const sc_cpufreq_indexes_ath79[] = { - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_D2, "-2"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_D1, "-1"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_N0, "0"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U1, "+1"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U2, "+2"), - RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_U3, "+3"), +/* Use the same letter-based nomenclature as RouterBOOT */ +static struct sc_u32tvs const sc_cpufreq_indexes_ath79_9x[] = { + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_A, "a"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_B, "b"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_C, "c"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_D, "d"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_E, "e"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_9X_F, "f"), }; -static int sc_tag_cpufreq_ath79_idxmax(void) -{ - int idx_max = -EOPNOTSUPP; +static struct sc_u32tvs const sc_cpufreq_indexes_ath79_7x[] = { + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_A, "a"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_B, "b"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_C, "c"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_D, "d"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_E, "e"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_F, "f"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_G, "g"), + RB_SC_TVS(RB_CPU_FREQ_IDX_ATH79_7X_H, "h"), +}; - if (soc_is_ar9344()) - idx_max = RB_CPU_FREQ_IDX_ATH79_AR9334_MAX; +static int sc_tag_cpufreq_ath79_arraysize(void) +{ + int idx_max; + + if (ATH79_SOC_AR7161 == ath79_soc) + idx_max = RB_CPU_FREQ_IDX_ATH79_7X_AR7161_MAX+1; + else if (soc_is_ar724x()) + idx_max = RB_CPU_FREQ_IDX_ATH79_7X_AR724X_MAX+1; + else if (soc_is_ar9344()) + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_AR9334_MAX+1; else if (soc_is_qca953x()) - idx_max = RB_CPU_FREQ_IDX_ATH79_QCA953X_MAX; + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA953X_MAX+1; else if (soc_is_qca9556()) - idx_max = RB_CPU_FREQ_IDX_ATH79_QCA9556_MAX; + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA9556_MAX+1; else if (soc_is_qca9558()) - idx_max = RB_CPU_FREQ_IDX_ATH79_QCA9558_MAX; + idx_max = RB_CPU_FREQ_IDX_ATH79_9X_QCA9558_MAX+1; + else + idx_max = -EOPNOTSUPP; return idx_max; } -static ssize_t sc_tag_show_cpufreq_indexes(const u8 *pld, u16 pld_len, char * buf) +static ssize_t sc_tag_show_cpufreq_indexes(const u8 *pld, u16 pld_len, char *buf) { - return sc_tag_show_u32tvs(pld, pld_len, buf, sc_cpufreq_indexes_ath79, sc_tag_cpufreq_ath79_idxmax()+1); + const struct sc_u32tvs *tvs; + + if (soc_is_ar71xx() || soc_is_ar724x()) + tvs = sc_cpufreq_indexes_ath79_7x; + else + tvs = sc_cpufreq_indexes_ath79_9x; + + return sc_tag_show_u32tvs(pld, pld_len, buf, tvs, sc_tag_cpufreq_ath79_arraysize()); } static ssize_t sc_tag_store_cpufreq_indexes(const u8 *pld, u16 pld_len, const char *buf, size_t count) { - return sc_tag_store_u32tvs(pld, pld_len, buf, count, sc_cpufreq_indexes_ath79, sc_tag_cpufreq_ath79_idxmax()+1); + const struct sc_u32tvs *tvs; + + if (soc_is_ar71xx() || soc_is_ar724x()) + tvs = sc_cpufreq_indexes_ath79_7x; + else + tvs = sc_cpufreq_indexes_ath79_9x; + + return sc_tag_store_u32tvs(pld, pld_len, buf, count, tvs, sc_tag_cpufreq_ath79_arraysize()); } #else /* By default we only show the raw value to help with reverse-engineering */ diff --git a/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c b/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c index 47e4471f8..4c8c0bfac 100644 --- a/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c +++ b/target/linux/generic/files/drivers/platform/mikrotik/routerboot.c @@ -194,18 +194,18 @@ ssize_t routerboot_tag_show_string(const u8 *pld, u16 pld_len, char *buf) ssize_t routerboot_tag_show_u32s(const u8 *pld, u16 pld_len, char *buf) { char *out = buf; - u32 data; // cpu-endian + u32 *data; // cpu-endian /* Caller ensures pld_len > 0 */ - if (pld_len % sizeof(data)) + if (pld_len % sizeof(*data)) return -EINVAL; - data = *(u32 *)pld; + data = (u32 *)pld; do { - out += sprintf(out, "0x%08x\n", data); + out += sprintf(out, "0x%08x\n", *data); data++; - } while ((pld_len -= sizeof(data))); + } while ((pld_len -= sizeof(*data))); return out - buf; } diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch index b69d8a01d..6a4475fc6 100644 --- a/target/linux/generic/hack-4.14/220-gc_sections.patch +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -238,7 +238,7 @@ Signed-off-by: Gabor Juhos /* * Data section helpers -@@ -496,7 +497,7 @@ +@@ -497,7 +498,7 @@ #define ENTRY_TEXT \ ALIGN_FUNCTION(); \ VMLINUX_SYMBOL(__entry_text_start) = .; \ @@ -247,7 +247,7 @@ Signed-off-by: Gabor Juhos VMLINUX_SYMBOL(__entry_text_end) = .; #define IRQENTRY_TEXT \ -@@ -603,7 +604,7 @@ +@@ -604,7 +605,7 @@ . = ALIGN(sbss_align); \ .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ *(.dynsbss) \ diff --git a/target/linux/generic/hack-4.14/221-module_exports.patch b/target/linux/generic/hack-4.14/221-module_exports.patch index 250bf1180..003175c22 100644 --- a/target/linux/generic/hack-4.14/221-module_exports.patch +++ b/target/linux/generic/hack-4.14/221-module_exports.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #include /* Align . to a 8 byte boundary equals to maximum function alignment. */ -@@ -341,14 +351,14 @@ +@@ -342,14 +352,14 @@ /* Kernel symbol table: Normal symbols */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ VMLINUX_SYMBOL(__start___ksymtab) = .; \ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ } \ \ -@@ -410,7 +420,7 @@ +@@ -411,7 +421,7 @@ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau } \ \ /* __*init sections */ \ -@@ -793,6 +803,8 @@ +@@ -796,6 +806,8 @@ EXIT_TEXT \ EXIT_DATA \ EXIT_CALL \ diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index e6e06554d..d67171054 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1412,6 +1412,7 @@ enum netdev_priv_flags { +@@ -1415,6 +1415,7 @@ enum netdev_priv_flags { IFF_PHONY_HEADROOM = 1<<26, IFF_MACSEC = 1<<27, IFF_L3MDEV_RX_HANDLER = 1<<28, @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1442,6 +1443,7 @@ enum netdev_priv_flags { +@@ -1445,6 +1446,7 @@ enum netdev_priv_flags { #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED #define IFF_MACSEC IFF_MACSEC #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER @@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau /** * struct net_device - The DEVICE structure. -@@ -1728,6 +1730,11 @@ struct net_device { +@@ -1731,6 +1733,11 @@ struct net_device { const struct xfrmdev_ops *xfrmdev_ops; #endif @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned int flags; -@@ -1802,6 +1809,10 @@ struct net_device { +@@ -1805,6 +1812,10 @@ struct net_device { struct mpls_dev __rcu *mpls_ptr; #endif @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3000,10 +3000,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3001,10 +3001,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-4.19/204-module_strip.patch b/target/linux/generic/hack-4.19/204-module_strip.patch index c9f84dd63..c5170ba29 100644 --- a/target/linux/generic/hack-4.19/204-module_strip.patch +++ b/target/linux/generic/hack-4.19/204-module_strip.patch @@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau config MODULES_TREE_LOOKUP --- a/kernel/module.c +++ b/kernel/module.c -@@ -3028,9 +3028,11 @@ static int setup_load_info(struct load_i +@@ -3030,9 +3030,11 @@ static int setup_load_info(struct load_i static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau if (flags & MODULE_INIT_IGNORE_VERMAGIC) modmagic = NULL; -@@ -3051,6 +3053,7 @@ static int check_modinfo(struct module * +@@ -3053,6 +3055,7 @@ static int check_modinfo(struct module * mod->name); add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); } diff --git a/target/linux/generic/hack-4.19/221-module_exports.patch b/target/linux/generic/hack-4.19/221-module_exports.patch index cd5ae5830..457baa5a1 100644 --- a/target/linux/generic/hack-4.19/221-module_exports.patch +++ b/target/linux/generic/hack-4.19/221-module_exports.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) -@@ -372,14 +382,14 @@ +@@ -373,14 +383,14 @@ /* Kernel symbol table: Normal symbols */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab = .; \ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau __stop___ksymtab_gpl = .; \ } \ \ -@@ -441,7 +451,7 @@ +@@ -442,7 +452,7 @@ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau } \ \ /* __*init sections */ \ -@@ -841,6 +851,8 @@ +@@ -844,6 +854,8 @@ EXIT_TEXT \ EXIT_DATA \ EXIT_CALL \ diff --git a/target/linux/generic/hack-4.19/259-regmap_dynamic.patch b/target/linux/generic/hack-4.19/259-regmap_dynamic.patch index af9431e18..c9d88a4e5 100644 --- a/target/linux/generic/hack-4.19/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-4.19/259-regmap_dynamic.patch @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3040,3 +3041,5 @@ static int __init regmap_initcall(void) +@@ -3032,3 +3033,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); diff --git a/target/linux/generic/hack-4.19/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch b/target/linux/generic/hack-4.19/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch index e651743c1..c962b7106 100644 --- a/target/linux/generic/hack-4.19/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch +++ b/target/linux/generic/hack-4.19/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch @@ -98,7 +98,7 @@ Signed-off-by: Kevin Darbyshire-Bryant bool rev = !skb->_nfct, upd = false; __be32 ip; -- if (tc_skb_protocol(skb) != htons(ETH_P_IP)) +- if (skb_protocol(skb, true) != htons(ETH_P_IP)) + if (cake_skb_proto(skb) != htons(ETH_P_IP)) return false; @@ -107,7 +107,7 @@ Signed-off-by: Kevin Darbyshire-Bryant u16 *buf, buf_; u8 dscp; -- switch (tc_skb_protocol(skb)) { +- switch (skb_protocol(skb, true)) { + switch (cake_skb_proto(skb)) { case htons(ETH_P_IP): buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_); diff --git a/target/linux/generic/hack-4.19/721-phy_packets.patch b/target/linux/generic/hack-4.19/721-phy_packets.patch index 2bb01718a..9463ed22c 100644 --- a/target/linux/generic/hack-4.19/721-phy_packets.patch +++ b/target/linux/generic/hack-4.19/721-phy_packets.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1514,6 +1514,7 @@ enum netdev_priv_flags { +@@ -1517,6 +1517,7 @@ enum netdev_priv_flags { IFF_FAILOVER_SLAVE = 1<<28, IFF_L3MDEV_RX_HANDLER = 1<<29, IFF_LIVE_RENAME_OK = 1<<30, @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1546,6 +1547,7 @@ enum netdev_priv_flags { +@@ -1549,6 +1550,7 @@ enum netdev_priv_flags { #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK @@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau /** * struct net_device - The DEVICE structure. -@@ -1846,6 +1848,11 @@ struct net_device { +@@ -1849,6 +1851,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned int flags; -@@ -1928,6 +1935,10 @@ struct net_device { +@@ -1931,6 +1938,10 @@ struct net_device { struct mpls_dev __rcu *mpls_ptr; #endif @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3251,10 +3251,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3252,10 +3252,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-5.4/204-module_strip.patch b/target/linux/generic/hack-5.4/204-module_strip.patch index f5a29c017..a36b6d959 100644 --- a/target/linux/generic/hack-5.4/204-module_strip.patch +++ b/target/linux/generic/hack-5.4/204-module_strip.patch @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau config MODULES_TREE_LOOKUP --- a/kernel/module.c +++ b/kernel/module.c -@@ -3107,9 +3107,11 @@ static int setup_load_info(struct load_i +@@ -3110,9 +3110,11 @@ static int setup_load_info(struct load_i static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau if (flags & MODULE_INIT_IGNORE_VERMAGIC) modmagic = NULL; -@@ -3130,6 +3132,7 @@ static int check_modinfo(struct module * +@@ -3133,6 +3135,7 @@ static int check_modinfo(struct module * mod->name); add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); } diff --git a/target/linux/generic/hack-5.4/221-module_exports.patch b/target/linux/generic/hack-5.4/221-module_exports.patch index 00802bb40..673add540 100644 --- a/target/linux/generic/hack-5.4/221-module_exports.patch +++ b/target/linux/generic/hack-5.4/221-module_exports.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau /* Align . to a 8 byte boundary equals to maximum function alignment. */ #define ALIGN_FUNCTION() . = ALIGN(8) -@@ -405,14 +415,14 @@ +@@ -407,14 +417,14 @@ /* Kernel symbol table: Normal symbols */ \ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ __start___ksymtab = .; \ @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau __stop___ksymtab_gpl = .; \ } \ \ -@@ -474,7 +484,7 @@ +@@ -476,7 +486,7 @@ \ /* Kernel symbol table: strings */ \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau } \ \ /* __*init sections */ \ -@@ -881,6 +891,8 @@ +@@ -885,6 +895,8 @@ EXIT_TEXT \ EXIT_DATA \ EXIT_CALL \ diff --git a/target/linux/generic/hack-5.4/259-regmap_dynamic.patch b/target/linux/generic/hack-5.4/259-regmap_dynamic.patch index 0dca23519..185926468 100644 --- a/target/linux/generic/hack-5.4/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-5.4/259-regmap_dynamic.patch @@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3125,3 +3126,5 @@ static int __init regmap_initcall(void) +@@ -3117,3 +3118,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); 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 a6daf1bdb..4af9e5a25 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 -@@ -1156,6 +1156,10 @@ config SYNC_R4K +@@ -1157,6 +1157,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/hack-5.4/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch b/target/linux/generic/hack-5.4/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch deleted file mode 100644 index e651743c1..000000000 --- a/target/linux/generic/hack-5.4/641-sch_cake-fix-IP-protocol-handling-in-the-presence-of.patch +++ /dev/null @@ -1,114 +0,0 @@ -From a00590d570212c3c633bd463cef8ec7377cc7993 Mon Sep 17 00:00:00 2001 -From: Kevin Darbyshire-Bryant -Date: Tue, 30 Jun 2020 12:07:44 +0100 -Subject: [PATCH] sch_cake: fix IP protocol handling in the presence of VLAN - tags -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -From: Ilya Ponetayev - -CAKE was using the return value of tc_skb_protocol() and expecting it to be -the IP protocol type. This can fail in the presence of QinQ VLAN tags, -making CAKE unable to handle ECN marking and diffserv parsing in this case. -Fix this by implementing our own version of tc_skb_protocol(), which will -use skb->protocol directly, but also parse and skip over any VLAN tags and -return the inner protocol number instead. - -Also fix CE marking by implementing a version of INET_ECN_set_ce() that -uses the same parsing routine. - -Fixes: ea82511518f4 ("sch_cake: Add NAT awareness to packet classifier") -Fixes: b2100cc56fca ("sch_cake: Use tc_skb_protocol() helper for getting packet protocol") -Fixes: 046f6fd5daef ("sched: Add Common Applications Kept Enhanced (cake) qdisc") -Signed-off-by: Ilya Ponetayev -[ squash original two patches, rewrite commit message ] -Signed-off-by: Toke Høiland-Jørgensen -Signed-off-by: Kevin Darbyshire-Bryant ---- - net/sched/sch_cake.c | 52 +++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 49 insertions(+), 3 deletions(-) - ---- a/net/sched/sch_cake.c -+++ b/net/sched/sch_cake.c -@@ -497,6 +497,52 @@ static bool cobalt_queue_empty(struct co - return down; - } - -+static __be16 cake_skb_proto(const struct sk_buff *skb) -+{ -+ unsigned int offset = skb_mac_offset(skb) + sizeof(struct ethhdr); -+ __be16 proto = skb->protocol; -+ struct vlan_hdr vhdr, *vh; -+ -+ while (proto == htons(ETH_P_8021Q) || proto == htons(ETH_P_8021AD)) { -+ vh = skb_header_pointer(skb, offset, sizeof(vhdr), &vhdr); -+ if (!vh) -+ break; -+ -+ proto = vh->h_vlan_encapsulated_proto; -+ offset += sizeof(vhdr); -+ } -+ -+ return proto; -+} -+ -+static int cake_set_ce(struct sk_buff *skb) -+{ -+ int wlen = skb_network_offset(skb); -+ -+ switch (cake_skb_proto(skb)) { -+ case htons(ETH_P_IP): -+ wlen += sizeof(struct iphdr); -+ if (!pskb_may_pull(skb, wlen) || -+ skb_try_make_writable(skb, wlen)) -+ return 0; -+ -+ return IP_ECN_set_ce(ip_hdr(skb)); -+ -+ case htons(ETH_P_IPV6): -+ wlen += sizeof(struct ipv6hdr); -+ if (!pskb_may_pull(skb, wlen) || -+ skb_try_make_writable(skb, wlen)) -+ return 0; -+ -+ return IP6_ECN_set_ce(skb, ipv6_hdr(skb)); -+ -+ default: -+ return 0; -+ } -+ -+ return 0; -+} -+ - /* Call this with a freshly dequeued packet for possible congestion marking. - * Returns true as an instruction to drop the packet, false for delivery. - */ -@@ -549,7 +595,7 @@ static bool cobalt_should_drop(struct co - - if (next_due && vars->dropping) { - /* Use ECN mark if possible, otherwise drop */ -- drop = !(vars->ecn_marked = INET_ECN_set_ce(skb)); -+ drop = !(vars->ecn_marked = cake_set_ce(skb)); - - vars->count++; - if (!vars->count) -@@ -592,7 +638,7 @@ static bool cake_update_flowkeys(struct - bool rev = !skb->_nfct, upd = false; - __be32 ip; - -- if (tc_skb_protocol(skb) != htons(ETH_P_IP)) -+ if (cake_skb_proto(skb) != htons(ETH_P_IP)) - return false; - - if (!nf_ct_get_tuple_skb(&tuple, skb)) -@@ -1557,7 +1603,7 @@ static u8 cake_handle_diffserv(struct sk - u16 *buf, buf_; - u8 dscp; - -- switch (tc_skb_protocol(skb)) { -+ switch (cake_skb_proto(skb)) { - case htons(ETH_P_IP): - buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_); - if (unlikely(!buf)) diff --git a/target/linux/generic/hack-5.4/721-phy_packets.patch b/target/linux/generic/hack-5.4/721-phy_packets.patch index b3008cbbc..ed18da9e0 100644 --- a/target/linux/generic/hack-5.4/721-phy_packets.patch +++ b/target/linux/generic/hack-5.4/721-phy_packets.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1546,6 +1546,7 @@ enum netdev_priv_flags { +@@ -1549,6 +1549,7 @@ enum netdev_priv_flags { IFF_FAILOVER_SLAVE = 1<<28, IFF_L3MDEV_RX_HANDLER = 1<<29, IFF_LIVE_RENAME_OK = 1<<30, @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1578,6 +1579,7 @@ enum netdev_priv_flags { +@@ -1581,6 +1582,7 @@ enum netdev_priv_flags { #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK @@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau /** * struct net_device - The DEVICE structure. -@@ -1879,6 +1881,11 @@ struct net_device { +@@ -1882,6 +1884,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned int flags; -@@ -1961,6 +1968,10 @@ struct net_device { +@@ -1964,6 +1971,10 @@ struct net_device { struct mpls_dev __rcu *mpls_ptr; #endif @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3191,10 +3191,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3192,10 +3192,20 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); 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 a05822cbd..7eb6224d4 100644 --- a/target/linux/generic/hack-5.4/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.4/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2992,6 +2992,8 @@ static const struct seq_operations locks +@@ -2989,6 +2989,8 @@ static const struct seq_operations locks static int __init proc_locks_init(void) { @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3608,6 +3608,8 @@ static __net_initdata struct pernet_oper +@@ -3613,6 +3613,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { 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 9c7c3c2c2..ab53b74a7 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 @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau selftest.o \ --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c -@@ -1295,4 +1295,5 @@ static void __exit dma_buf_deinit(void) +@@ -1298,4 +1298,5 @@ static void __exit dma_buf_deinit(void) dma_buf_uninit_debugfs(); kern_unmount(dma_buf_mnt); } @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2668,6 +2668,7 @@ int wake_up_state(struct task_struct *p, +@@ -2679,6 +2679,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch b/target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch deleted file mode 100644 index 4b413996f..000000000 --- a/target/linux/generic/pending-4.14/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 93c33e6a7f3b0aef99d02252e6232a3d8b80f2d5 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 21 Jan 2018 15:47:50 +0100 -Subject: ubifs: Add option to create UBI FS version 4 on empty UBI volume - -Instead of creating an ubifs file system with format version 5 by -default on empty UBI volumes add a compile option to create an older ubi -with file system format version 4 instated. This allows it to be mount -as a volume on kernel versions < 4.10, which does not support format -version 5. -We saw that some people can not access their older data when they -downgraded from kernel 4.14 to kernel 4.9 to prevent this this option -would help. - -Signed-off-by: Hauke Mehrtens ---- - fs/ubifs/Kconfig | 13 +++++++++++++ - fs/ubifs/sb.c | 6 ++++++ - 2 files changed, 19 insertions(+) - ---- a/fs/ubifs/Kconfig -+++ b/fs/ubifs/Kconfig -@@ -74,3 +74,16 @@ config UBIFS_FS_SECURITY - the extended attribute support in advance. - - If you are not using a security module, say N. -+ -+config UBIFS_FS_FORMAT4 -+ bool "Use file system format version 4 for new file systems" -+ depends on UBIFS_FS -+ help -+ Instead of creating new file systems with the new ubifs file -+ system version 5, use the old format version 4 for implicitly -+ by the driver created file systems on an empty UBI volume. This -+ makes it possible to mount these file systems also with kernel -+ versions before 4.10. The driver will still support file system -+ format version 5 for ubifs file systems created with version 5. -+ -+ If you are unsure, say N. ---- a/fs/ubifs/sb.c -+++ b/fs/ubifs/sb.c -@@ -176,7 +176,9 @@ static int create_default_filesystem(str - tmp64 = (long long)max_buds * c->leb_size; - if (big_lpt) - sup_flags |= UBIFS_FLG_BIGLPT; -+#ifndef CONFIG_UBIFS_FS_FORMAT4 - sup_flags |= UBIFS_FLG_DOUBLE_HASH; -+#endif - - sup->ch.node_type = UBIFS_SB_NODE; - sup->key_hash = UBIFS_KEY_HASH_R5; -@@ -192,7 +194,11 @@ static int create_default_filesystem(str - sup->jhead_cnt = cpu_to_le32(DEFAULT_JHEADS_CNT); - sup->fanout = cpu_to_le32(DEFAULT_FANOUT); - sup->lsave_cnt = cpu_to_le32(c->lsave_cnt); -+#ifdef CONFIG_UBIFS_FS_FORMAT4 -+ sup->fmt_version = cpu_to_le32(4); -+#else - sup->fmt_version = cpu_to_le32(UBIFS_FORMAT_VERSION); -+#endif - sup->time_gran = cpu_to_le32(DEFAULT_TIME_GRAN); - if (c->mount_opts.override_compr) - sup->default_compr = cpu_to_le16(c->mount_opts.compr_type); diff --git a/target/linux/generic/pending-4.14/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-4.14/690-net-add-support-for-threaded-NAPI-polling.patch new file mode 100644 index 000000000..1a531cb8f --- /dev/null +++ b/target/linux/generic/pending-4.14/690-net-add-support-for-threaded-NAPI-polling.patch @@ -0,0 +1,339 @@ +From: Felix Fietkau +Date: Sun, 26 Jul 2020 14:03:21 +0200 +Subject: [PATCH] net: add support for threaded NAPI polling + +For some drivers (especially 802.11 drivers), doing a lot of work in the NAPI +poll function does not perform well. Since NAPI poll is bound to the CPU it +was scheduled from, we can easily end up with a few very busy CPUs spending +most of their time in softirq/ksoftirqd and some idle ones. + +Introduce threaded NAPI for such drivers based on a workqueue. The API is the +same except for using netif_threaded_napi_add instead of netif_napi_add. + +In my tests with mt76 on MT7621 using threaded NAPI + a thread for tx scheduling +improves LAN->WLAN bridging throughput by 10-50%. Throughput without threaded +NAPI is wildly inconsistent, depending on the CPU that runs the tx scheduling +thread. + +With threaded NAPI it seems stable and consistent (and higher than the best +results I got without it). + +Based on a patch by Hillf Danton + +Cc: Hillf Danton +Signed-off-by: Felix Fietkau +--- + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -326,6 +326,7 @@ struct napi_struct { + struct list_head dev_list; + struct hlist_node napi_hash_node; + unsigned int napi_id; ++ struct work_struct work; + }; + + enum { +@@ -336,6 +337,7 @@ enum { + NAPI_STATE_HASHED, /* In NAPI hash (busy polling possible) */ + NAPI_STATE_NO_BUSY_POLL,/* Do not add in napi_hash, no busy polling */ + NAPI_STATE_IN_BUSY_POLL,/* sk_busy_loop() owns this NAPI */ ++ NAPI_STATE_THREADED, /* Use threaded NAPI */ + }; + + enum { +@@ -346,6 +348,7 @@ enum { + NAPIF_STATE_HASHED = BIT(NAPI_STATE_HASHED), + NAPIF_STATE_NO_BUSY_POLL = BIT(NAPI_STATE_NO_BUSY_POLL), + NAPIF_STATE_IN_BUSY_POLL = BIT(NAPI_STATE_IN_BUSY_POLL), ++ NAPIF_STATE_THREADED = BIT(NAPI_STATE_THREADED), + }; + + enum gro_result { +@@ -2093,6 +2096,26 @@ void netif_napi_add(struct net_device *d + int (*poll)(struct napi_struct *, int), int weight); + + /** ++ * netif_threaded_napi_add - initialize a NAPI context ++ * @dev: network device ++ * @napi: NAPI context ++ * @poll: polling function ++ * @weight: default weight ++ * ++ * This variant of netif_napi_add() should be used from drivers using NAPI ++ * with CPU intensive poll functions. ++ * This will schedule polling from a high priority workqueue ++ */ ++static inline void netif_threaded_napi_add(struct net_device *dev, ++ struct napi_struct *napi, ++ int (*poll)(struct napi_struct *, int), ++ int weight) ++{ ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++ netif_napi_add(dev, napi, poll, weight); ++} ++ ++/** + * netif_tx_napi_add - initialize a NAPI context + * @dev: network device + * @napi: NAPI context +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -160,6 +160,7 @@ static DEFINE_SPINLOCK(offload_lock); + struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly; + struct list_head ptype_all __read_mostly; /* Taps */ + static struct list_head offload_base __read_mostly; ++static struct workqueue_struct *napi_workq __read_mostly; + + static int netif_rx_internal(struct sk_buff *skb); + static int call_netdevice_notifiers_info(unsigned long val, +@@ -5237,6 +5238,11 @@ void __napi_schedule(struct napi_struct + { + unsigned long flags; + ++ if (test_bit(NAPI_STATE_THREADED, &n->state)) { ++ queue_work(napi_workq, &n->work); ++ return; ++ } ++ + local_irq_save(flags); + ____napi_schedule(this_cpu_ptr(&softnet_data), n); + local_irq_restore(flags); +@@ -5284,6 +5290,11 @@ EXPORT_SYMBOL(napi_schedule_prep); + */ + void __napi_schedule_irqoff(struct napi_struct *n) + { ++ if (test_bit(NAPI_STATE_THREADED, &n->state)) { ++ queue_work(napi_workq, &n->work); ++ return; ++ } ++ + ____napi_schedule(this_cpu_ptr(&softnet_data), n); + } + EXPORT_SYMBOL(__napi_schedule_irqoff); +@@ -5521,6 +5532,82 @@ static enum hrtimer_restart napi_watchdo + return HRTIMER_NORESTART; + } + ++static int __napi_poll(struct napi_struct *n, bool *repoll) ++{ ++ int work, weight; ++ ++ weight = n->weight; ++ ++ /* This NAPI_STATE_SCHED test is for avoiding a race ++ * with netpoll's poll_napi(). Only the entity which ++ * obtains the lock and sees NAPI_STATE_SCHED set will ++ * actually make the ->poll() call. Therefore we avoid ++ * accidentally calling ->poll() when NAPI is not scheduled. ++ */ ++ work = 0; ++ if (test_bit(NAPI_STATE_SCHED, &n->state)) { ++ work = n->poll(n, weight); ++ trace_napi_poll(n, work, weight); ++ } ++ ++ WARN_ON_ONCE(work > weight); ++ ++ if (likely(work < weight)) ++ return work; ++ ++ /* Drivers must not modify the NAPI state if they ++ * consume the entire weight. In such cases this code ++ * still "owns" the NAPI instance and therefore can ++ * move the instance around on the list at-will. ++ */ ++ if (unlikely(napi_disable_pending(n))) { ++ napi_complete(n); ++ return work; ++ } ++ ++ if (n->gro_list) { ++ /* flush too old packets ++ * If HZ < 1000, flush all packets. ++ */ ++ napi_gro_flush(n, HZ >= 1000); ++ } ++ ++ *repoll = true; ++ ++ return work; ++} ++ ++static void napi_workfn(struct work_struct *work) ++{ ++ struct napi_struct *n = container_of(work, struct napi_struct, work); ++ void *have; ++ ++ for (;;) { ++ bool repoll = false; ++ ++ local_bh_disable(); ++ ++ have = netpoll_poll_lock(n); ++ __napi_poll(n, &repoll); ++ netpoll_poll_unlock(have); ++ ++ local_bh_enable(); ++ ++ if (!repoll) ++ return; ++ ++ if (!need_resched()) ++ continue; ++ ++ /* ++ * have to pay for the latency of task switch even if ++ * napi is scheduled ++ */ ++ queue_work(napi_workq, work); ++ return; ++ } ++} ++ + void netif_napi_add(struct net_device *dev, struct napi_struct *napi, + int (*poll)(struct napi_struct *, int), int weight) + { +@@ -5540,6 +5627,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); + } +@@ -5565,6 +5653,7 @@ EXPORT_SYMBOL(napi_disable); + void netif_napi_del(struct napi_struct *napi) + { + might_sleep(); ++ cancel_work_sync(&napi->work); + if (napi_hash_del(napi)) + synchronize_net(); + list_del_init(&napi->dev_list); +@@ -5578,48 +5667,18 @@ EXPORT_SYMBOL(netif_napi_del); + + static int napi_poll(struct napi_struct *n, struct list_head *repoll) + { ++ bool do_repoll = false; + void *have; +- int work, weight; ++ int work; + + list_del_init(&n->poll_list); + + have = netpoll_poll_lock(n); + +- weight = n->weight; +- +- /* This NAPI_STATE_SCHED test is for avoiding a race +- * with netpoll's poll_napi(). Only the entity which +- * obtains the lock and sees NAPI_STATE_SCHED set will +- * actually make the ->poll() call. Therefore we avoid +- * accidentally calling ->poll() when NAPI is not scheduled. +- */ +- work = 0; +- if (test_bit(NAPI_STATE_SCHED, &n->state)) { +- work = n->poll(n, weight); +- trace_napi_poll(n, work, weight); +- } +- +- WARN_ON_ONCE(work > weight); +- +- if (likely(work < weight)) +- goto out_unlock; ++ work = __napi_poll(n, &do_repoll); + +- /* Drivers must not modify the NAPI state if they +- * consume the entire weight. In such cases this code +- * still "owns" the NAPI instance and therefore can +- * move the instance around on the list at-will. +- */ +- if (unlikely(napi_disable_pending(n))) { +- napi_complete(n); ++ if (!do_repoll) + goto out_unlock; +- } +- +- if (n->gro_list) { +- /* flush too old packets +- * If HZ < 1000, flush all packets. +- */ +- napi_gro_flush(n, HZ >= 1000); +- } + + /* Some drivers may have called napi_schedule + * prior to exhausting their budget. +@@ -8855,6 +8914,10 @@ static int __init net_dev_init(void) + sd->backlog.weight = weight_p; + } + ++ napi_workq = alloc_workqueue("napi_workq", WQ_UNBOUND | WQ_HIGHPRI, ++ WQ_UNBOUND_MAX_ACTIVE | WQ_SYSFS); ++ BUG_ON(!napi_workq); ++ + dev_boot_phase = 0; + + /* The loopback device is special if any other network devices +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -441,6 +441,52 @@ static ssize_t proto_down_store(struct d + } + NETDEVICE_SHOW_RW(proto_down, fmt_dec); + ++static int change_napi_threaded(struct net_device *dev, unsigned long val) ++{ ++ struct napi_struct *napi; ++ ++ if (list_empty(&dev->napi_list)) ++ return -EOPNOTSUPP; ++ ++ list_for_each_entry(napi, &dev->napi_list, dev_list) { ++ if (val) ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++ else ++ clear_bit(NAPI_STATE_THREADED, &napi->state); ++ } ++ ++ return 0; ++} ++ ++static ssize_t napi_threaded_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t len) ++{ ++ return netdev_store(dev, attr, buf, len, change_napi_threaded); ++} ++ ++static ssize_t napi_threaded_show(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct net_device *netdev = to_net_dev(dev); ++ struct napi_struct *napi; ++ bool enabled = false; ++ ++ if (!rtnl_trylock()) ++ return restart_syscall(); ++ ++ list_for_each_entry(napi, &netdev->napi_list, dev_list) { ++ if (test_bit(NAPI_STATE_THREADED, &napi->state)) ++ enabled = true; ++ } ++ ++ rtnl_unlock(); ++ ++ return sprintf(buf, fmt_dec, enabled); ++} ++static DEVICE_ATTR_RW(napi_threaded); ++ + static ssize_t phys_port_id_show(struct device *dev, + struct device_attribute *attr, char *buf) + { +@@ -536,6 +582,7 @@ static struct attribute *net_class_attrs + &dev_attr_flags.attr, + &dev_attr_tx_queue_len.attr, + &dev_attr_gro_flush_timeout.attr, ++ &dev_attr_napi_threaded.attr, + &dev_attr_phys_port_id.attr, + &dev_attr_phys_port_name.attr, + &dev_attr_phys_switch_id.attr, diff --git a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch index 718b8addd..1d10af647 100644 --- a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch @@ -32,7 +32,7 @@ Signed-off-by: Gabor Juhos /* The Mellanox Tavor device gives false positive parity errors * Mark this device with a broken_parity_status, to allow * PCI scanning code to "skip" this now blacklisted device. -@@ -3095,6 +3096,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3108,6 +3109,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -40,7 +40,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To -@@ -3151,6 +3153,8 @@ static void fixup_debug_report(struct pc +@@ -3164,6 +3166,8 @@ static void fixup_debug_report(struct pc } } @@ -49,7 +49,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, * even though no one is handling them (f.e. i915 driver is never loaded). -@@ -3189,6 +3193,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3202,6 +3206,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-4.19/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch b/target/linux/generic/pending-4.19/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch deleted file mode 100644 index 92a22bc65..000000000 --- a/target/linux/generic/pending-4.19/350-MIPS-Add-missing-EHB-in-mtc0-mfc0-sequence-for-DSPen.patch +++ /dev/null @@ -1,61 +0,0 @@ -From db4603e30effd74d4adb6bcdf73072b2c06fafcd Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Fri, 3 Jul 2020 00:07:15 +0200 -Subject: [PATCH] MIPS: Add missing EHB in mtc0 -> mfc0 sequence for DSPen - -This resolves the hazard between the mtc0 in the change_c0_status() and -the mfc0 in configure_exception_vector(). Without resolving this hazard -configure_exception_vector() could read an old value and would restore -this old value again. This would revert the changes change_c0_status() -did. I checked this by printing out the read_c0_status() at the end of -per_cpu_trap_init() and the ST0_MX is not set without this patch. - -The hazard is documented in the MIPS Architecture Reference Manual Vol. -III: MIPS32/microMIPS32 Privileged Resource Architecture (MD00088), rev -6.03 table 8.1 which includes: - - Producer | Consumer | Hazard - ----------|----------|---------------------------- - mtc0 | mfc0 | any coprocessor 0 register - -I saw this hazard on an Atheros AR9344 rev 2 SoC with a MIPS 74Kc CPU. -There the change_c0_status() function would activate the DSPen by -setting ST0_MX in the c0_status register. This was reverted and then the -system got a DSP exception when the DSP registers were saved in -save_dsp() in the first process switch. The crash looks like this: - -[ 0.089999] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) -[ 0.097796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) -[ 0.107070] Kernel panic - not syncing: Unexpected DSP exception -[ 0.113470] Rebooting in 1 seconds.. - -We saw this problem in OpenWrt only on the MIPS 74Kc based Atheros SoCs, -not on the 24Kc based SoCs. We only saw it with kernel 5.4 not with -kernel 4.19, in addition we had to use GCC 8.4 or 9.X, with GCC 8.3 it -did not happen. - -In the kernel I bisected this problem to commit 9012d011660e ("compiler: -allow all arches to enable CONFIG_OPTIMIZE_INLINING"), but when this was -reverted it also happened after commit 172dcd935c34b ("MIPS: Always -allocate exception vector for MIPSr2+"). - -Commit 0b24cae4d535 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.") -does similar changes to a different file. I am not sure if there are -more places affected by this problem. - -Signed-off-by: Hauke Mehrtens -Cc: ---- - arch/mips/kernel/traps.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/mips/kernel/traps.c -+++ b/arch/mips/kernel/traps.c -@@ -2096,6 +2096,7 @@ static void configure_status(void) - - change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX, - status_set); -+ back_to_back_c0_hazard(); - } - - unsigned int hwrena; diff --git a/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch b/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch deleted file mode 100644 index 02c9b4c0f..000000000 --- a/target/linux/generic/pending-4.19/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 93c33e6a7f3b0aef99d02252e6232a3d8b80f2d5 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 21 Jan 2018 15:47:50 +0100 -Subject: ubifs: Add option to create UBI FS version 4 on empty UBI volume - -Instead of creating an ubifs file system with format version 5 by -default on empty UBI volumes add a compile option to create an older ubi -with file system format version 4 instated. This allows it to be mount -as a volume on kernel versions < 4.10, which does not support format -version 5. -We saw that some people can not access their older data when they -downgraded from kernel 4.14 to kernel 4.9 to prevent this this option -would help. - -Signed-off-by: Hauke Mehrtens ---- - fs/ubifs/Kconfig | 13 +++++++++++++ - fs/ubifs/sb.c | 6 ++++++ - 2 files changed, 19 insertions(+) - ---- a/fs/ubifs/Kconfig -+++ b/fs/ubifs/Kconfig -@@ -85,3 +85,16 @@ config UBIFS_FS_SECURITY - the extended attribute support in advance. - - If you are not using a security module, say N. -+ -+config UBIFS_FS_FORMAT4 -+ bool "Use file system format version 4 for new file systems" -+ depends on UBIFS_FS -+ help -+ Instead of creating new file systems with the new ubifs file -+ system version 5, use the old format version 4 for implicitly -+ by the driver created file systems on an empty UBI volume. This -+ makes it possible to mount these file systems also with kernel -+ versions before 4.10. The driver will still support file system -+ format version 5 for ubifs file systems created with version 5. -+ -+ If you are unsure, say N. ---- a/fs/ubifs/sb.c -+++ b/fs/ubifs/sb.c -@@ -176,7 +176,9 @@ static int create_default_filesystem(str - tmp64 = (long long)max_buds * c->leb_size; - if (big_lpt) - sup_flags |= UBIFS_FLG_BIGLPT; -+#ifndef CONFIG_UBIFS_FS_FORMAT4 - sup_flags |= UBIFS_FLG_DOUBLE_HASH; -+#endif - - sup->ch.node_type = UBIFS_SB_NODE; - sup->key_hash = UBIFS_KEY_HASH_R5; -@@ -192,7 +194,11 @@ static int create_default_filesystem(str - sup->jhead_cnt = cpu_to_le32(DEFAULT_JHEADS_CNT); - sup->fanout = cpu_to_le32(DEFAULT_FANOUT); - sup->lsave_cnt = cpu_to_le32(c->lsave_cnt); -+#ifdef CONFIG_UBIFS_FS_FORMAT4 -+ sup->fmt_version = cpu_to_le32(4); -+#else - sup->fmt_version = cpu_to_le32(UBIFS_FORMAT_VERSION); -+#endif - sup->time_gran = cpu_to_le32(DEFAULT_TIME_GRAN); - if (c->mount_opts.override_compr) - sup->default_compr = cpu_to_le16(c->mount_opts.compr_type); diff --git a/target/linux/generic/pending-4.19/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-4.19/690-net-add-support-for-threaded-NAPI-polling.patch new file mode 100644 index 000000000..b5c701c80 --- /dev/null +++ b/target/linux/generic/pending-4.19/690-net-add-support-for-threaded-NAPI-polling.patch @@ -0,0 +1,339 @@ +From: Felix Fietkau +Date: Sun, 26 Jul 2020 14:03:21 +0200 +Subject: [PATCH] net: add support for threaded NAPI polling + +For some drivers (especially 802.11 drivers), doing a lot of work in the NAPI +poll function does not perform well. Since NAPI poll is bound to the CPU it +was scheduled from, we can easily end up with a few very busy CPUs spending +most of their time in softirq/ksoftirqd and some idle ones. + +Introduce threaded NAPI for such drivers based on a workqueue. The API is the +same except for using netif_threaded_napi_add instead of netif_napi_add. + +In my tests with mt76 on MT7621 using threaded NAPI + a thread for tx scheduling +improves LAN->WLAN bridging throughput by 10-50%. Throughput without threaded +NAPI is wildly inconsistent, depending on the CPU that runs the tx scheduling +thread. + +With threaded NAPI it seems stable and consistent (and higher than the best +results I got without it). + +Based on a patch by Hillf Danton + +Cc: Hillf Danton +Signed-off-by: Felix Fietkau +--- + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -339,6 +339,7 @@ struct napi_struct { + struct list_head dev_list; + struct hlist_node napi_hash_node; + unsigned int napi_id; ++ struct work_struct work; + }; + + enum { +@@ -349,6 +350,7 @@ enum { + NAPI_STATE_HASHED, /* In NAPI hash (busy polling possible) */ + NAPI_STATE_NO_BUSY_POLL,/* Do not add in napi_hash, no busy polling */ + NAPI_STATE_IN_BUSY_POLL,/* sk_busy_loop() owns this NAPI */ ++ NAPI_STATE_THREADED, /* Use threaded NAPI */ + }; + + enum { +@@ -359,6 +361,7 @@ enum { + NAPIF_STATE_HASHED = BIT(NAPI_STATE_HASHED), + NAPIF_STATE_NO_BUSY_POLL = BIT(NAPI_STATE_NO_BUSY_POLL), + NAPIF_STATE_IN_BUSY_POLL = BIT(NAPI_STATE_IN_BUSY_POLL), ++ NAPIF_STATE_THREADED = BIT(NAPI_STATE_THREADED), + }; + + enum gro_result { +@@ -2230,6 +2233,26 @@ void netif_napi_add(struct net_device *d + int (*poll)(struct napi_struct *, int), int weight); + + /** ++ * netif_threaded_napi_add - initialize a NAPI context ++ * @dev: network device ++ * @napi: NAPI context ++ * @poll: polling function ++ * @weight: default weight ++ * ++ * This variant of netif_napi_add() should be used from drivers using NAPI ++ * with CPU intensive poll functions. ++ * This will schedule polling from a high priority workqueue ++ */ ++static inline void netif_threaded_napi_add(struct net_device *dev, ++ struct napi_struct *napi, ++ int (*poll)(struct napi_struct *, int), ++ int weight) ++{ ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++ netif_napi_add(dev, napi, poll, weight); ++} ++ ++/** + * netif_tx_napi_add - initialize a NAPI context + * @dev: network device + * @napi: NAPI context +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -160,6 +160,7 @@ static DEFINE_SPINLOCK(offload_lock); + struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly; + struct list_head ptype_all __read_mostly; /* Taps */ + static struct list_head offload_base __read_mostly; ++static struct workqueue_struct *napi_workq __read_mostly; + + static int netif_rx_internal(struct sk_buff *skb); + static int call_netdevice_notifiers_info(unsigned long val, +@@ -5891,6 +5892,11 @@ void __napi_schedule(struct napi_struct + { + unsigned long flags; + ++ if (test_bit(NAPI_STATE_THREADED, &n->state)) { ++ queue_work(napi_workq, &n->work); ++ return; ++ } ++ + local_irq_save(flags); + ____napi_schedule(this_cpu_ptr(&softnet_data), n); + local_irq_restore(flags); +@@ -5938,6 +5944,11 @@ EXPORT_SYMBOL(napi_schedule_prep); + */ + void __napi_schedule_irqoff(struct napi_struct *n) + { ++ if (test_bit(NAPI_STATE_THREADED, &n->state)) { ++ queue_work(napi_workq, &n->work); ++ return; ++ } ++ + ____napi_schedule(this_cpu_ptr(&softnet_data), n); + } + EXPORT_SYMBOL(__napi_schedule_irqoff); +@@ -6186,6 +6197,82 @@ static void init_gro_hash(struct napi_st + napi->gro_bitmask = 0; + } + ++static int __napi_poll(struct napi_struct *n, bool *repoll) ++{ ++ int work, weight; ++ ++ weight = n->weight; ++ ++ /* This NAPI_STATE_SCHED test is for avoiding a race ++ * with netpoll's poll_napi(). Only the entity which ++ * obtains the lock and sees NAPI_STATE_SCHED set will ++ * actually make the ->poll() call. Therefore we avoid ++ * accidentally calling ->poll() when NAPI is not scheduled. ++ */ ++ work = 0; ++ if (test_bit(NAPI_STATE_SCHED, &n->state)) { ++ work = n->poll(n, weight); ++ trace_napi_poll(n, work, weight); ++ } ++ ++ WARN_ON_ONCE(work > weight); ++ ++ if (likely(work < weight)) ++ return work; ++ ++ /* Drivers must not modify the NAPI state if they ++ * consume the entire weight. In such cases this code ++ * still "owns" the NAPI instance and therefore can ++ * move the instance around on the list at-will. ++ */ ++ if (unlikely(napi_disable_pending(n))) { ++ napi_complete(n); ++ return work; ++ } ++ ++ if (n->gro_bitmask) { ++ /* flush too old packets ++ * If HZ < 1000, flush all packets. ++ */ ++ napi_gro_flush(n, HZ >= 1000); ++ } ++ ++ *repoll = true; ++ ++ return work; ++} ++ ++static void napi_workfn(struct work_struct *work) ++{ ++ struct napi_struct *n = container_of(work, struct napi_struct, work); ++ void *have; ++ ++ for (;;) { ++ bool repoll = false; ++ ++ local_bh_disable(); ++ ++ have = netpoll_poll_lock(n); ++ __napi_poll(n, &repoll); ++ netpoll_poll_unlock(have); ++ ++ local_bh_enable(); ++ ++ if (!repoll) ++ return; ++ ++ if (!need_resched()) ++ continue; ++ ++ /* ++ * have to pay for the latency of task switch even if ++ * napi is scheduled ++ */ ++ queue_work(napi_workq, work); ++ return; ++ } ++} ++ + void netif_napi_add(struct net_device *dev, struct napi_struct *napi, + int (*poll)(struct napi_struct *, int), int weight) + { +@@ -6204,6 +6291,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); + } +@@ -6242,6 +6330,7 @@ static void flush_gro_hash(struct napi_s + void netif_napi_del(struct napi_struct *napi) + { + might_sleep(); ++ cancel_work_sync(&napi->work); + if (napi_hash_del(napi)) + synchronize_net(); + list_del_init(&napi->dev_list); +@@ -6254,48 +6343,18 @@ EXPORT_SYMBOL(netif_napi_del); + + static int napi_poll(struct napi_struct *n, struct list_head *repoll) + { ++ bool do_repoll = false; + void *have; +- int work, weight; ++ int work; + + list_del_init(&n->poll_list); + + have = netpoll_poll_lock(n); + +- weight = n->weight; +- +- /* This NAPI_STATE_SCHED test is for avoiding a race +- * with netpoll's poll_napi(). Only the entity which +- * obtains the lock and sees NAPI_STATE_SCHED set will +- * actually make the ->poll() call. Therefore we avoid +- * accidentally calling ->poll() when NAPI is not scheduled. +- */ +- work = 0; +- if (test_bit(NAPI_STATE_SCHED, &n->state)) { +- work = n->poll(n, weight); +- trace_napi_poll(n, work, weight); +- } +- +- WARN_ON_ONCE(work > weight); +- +- if (likely(work < weight)) +- goto out_unlock; ++ work = __napi_poll(n, &do_repoll); + +- /* Drivers must not modify the NAPI state if they +- * consume the entire weight. In such cases this code +- * still "owns" the NAPI instance and therefore can +- * move the instance around on the list at-will. +- */ +- if (unlikely(napi_disable_pending(n))) { +- napi_complete(n); ++ if (!do_repoll) + goto out_unlock; +- } +- +- if (n->gro_bitmask) { +- /* flush too old packets +- * If HZ < 1000, flush all packets. +- */ +- napi_gro_flush(n, HZ >= 1000); +- } + + /* Some drivers may have called napi_schedule + * prior to exhausting their budget. +@@ -9895,6 +9954,10 @@ static int __init net_dev_init(void) + sd->backlog.weight = weight_p; + } + ++ napi_workq = alloc_workqueue("napi_workq", WQ_UNBOUND | WQ_HIGHPRI, ++ WQ_UNBOUND_MAX_ACTIVE | WQ_SYSFS); ++ BUG_ON(!napi_workq); ++ + dev_boot_phase = 0; + + /* The loopback device is special if any other network devices +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -447,6 +447,52 @@ static ssize_t proto_down_store(struct d + } + NETDEVICE_SHOW_RW(proto_down, fmt_dec); + ++static int change_napi_threaded(struct net_device *dev, unsigned long val) ++{ ++ struct napi_struct *napi; ++ ++ if (list_empty(&dev->napi_list)) ++ return -EOPNOTSUPP; ++ ++ list_for_each_entry(napi, &dev->napi_list, dev_list) { ++ if (val) ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++ else ++ clear_bit(NAPI_STATE_THREADED, &napi->state); ++ } ++ ++ return 0; ++} ++ ++static ssize_t napi_threaded_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t len) ++{ ++ return netdev_store(dev, attr, buf, len, change_napi_threaded); ++} ++ ++static ssize_t napi_threaded_show(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct net_device *netdev = to_net_dev(dev); ++ struct napi_struct *napi; ++ bool enabled = false; ++ ++ if (!rtnl_trylock()) ++ return restart_syscall(); ++ ++ list_for_each_entry(napi, &netdev->napi_list, dev_list) { ++ if (test_bit(NAPI_STATE_THREADED, &napi->state)) ++ enabled = true; ++ } ++ ++ rtnl_unlock(); ++ ++ return sprintf(buf, fmt_dec, enabled); ++} ++static DEVICE_ATTR_RW(napi_threaded); ++ + static ssize_t phys_port_id_show(struct device *dev, + struct device_attribute *attr, char *buf) + { +@@ -542,6 +588,7 @@ static struct attribute *net_class_attrs + &dev_attr_flags.attr, + &dev_attr_tx_queue_len.attr, + &dev_attr_gro_flush_timeout.attr, ++ &dev_attr_napi_threaded.attr, + &dev_attr_phys_port_id.attr, + &dev_attr_phys_port_name.attr, + &dev_attr_phys_switch_id.attr, diff --git a/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch index 669229c62..c757aeeaa 100644 --- a/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.19/810-pci_disable_common_quirks.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos /* * The Mellanox Tavor device gives false positive parity errors. Mark this * device with a broken_parity_status to allow PCI scanning code to "skip" -@@ -3213,6 +3214,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3226,6 +3227,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. * To work around this, query the size it should be configured to by the -@@ -3238,6 +3241,8 @@ static void quirk_intel_ntb(struct pci_d +@@ -3251,6 +3254,8 @@ static void quirk_intel_ntb(struct pci_d DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); @@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, even * though no one is handling them (e.g., if the i915 driver is never -@@ -3276,6 +3281,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3289,6 +3294,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch b/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch index 75aaa8076..eedb2bb28 100644 --- a/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch +++ b/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch @@ -8,7 +8,7 @@ Signed-off-by: Giuseppe Lippolis --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c -@@ -673,6 +673,7 @@ static const struct of_device_id spidev_ +@@ -678,6 +678,7 @@ static const struct of_device_id spidev_ { .compatible = "lwn,bk4" }, { .compatible = "dh,dhcom-board" }, { .compatible = "menlo,m53cpld" }, 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 f6fdabe60..50029a455 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 -@@ -1066,9 +1066,6 @@ config FW_ARC +@@ -1067,9 +1067,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -3040,6 +3037,18 @@ choice +@@ -3041,6 +3038,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-5.4/445-mtd-spinand-gigadevice-Only-one-dummy-byte-in-QUA.patch b/target/linux/generic/pending-5.4/445-mtd-spinand-gigadevice-Only-one-dummy-byte-in-QUA.patch new file mode 100644 index 000000000..0391094d2 --- /dev/null +++ b/target/linux/generic/pending-5.4/445-mtd-spinand-gigadevice-Only-one-dummy-byte-in-QUA.patch @@ -0,0 +1,39 @@ +From 5f312dcb38b8003d9711290366cd4b1def5daf3b Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 16 Aug 2020 14:43:35 +0200 +Subject: [PATCH v2 445/447] mtd: spinand: gigadevice: Only one dummy byte in + QUADIO + +The datasheet only lists one dummy byte in the 0xEH operation for the +following chips: +* GD5F1GQ4xExxG +* GD5F1GQ4xFxxG +* GD5F1GQ4UAYIG +* GD5F4GQ4UAYIG + +Fixes: c93c613214ac ("mtd: spinand: add support for GigaDevice GD5FxGQ4xA") +Signed-off-by: Hauke Mehrtens +--- + drivers/mtd/nand/spi/gigadevice.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/mtd/nand/spi/gigadevice.c ++++ b/drivers/mtd/nand/spi/gigadevice.c +@@ -21,7 +21,7 @@ + #define GD5FXGQ4UXFXXG_STATUS_ECC_UNCOR_ERROR (7 << 4) + + static SPINAND_OP_VARIANTS(read_cache_variants, +- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), ++ SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), +@@ -29,7 +29,7 @@ static SPINAND_OP_VARIANTS(read_cache_va + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + + static SPINAND_OP_VARIANTS(read_cache_variants_f, +- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), ++ SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP_3A(0, 1, NULL, 0), diff --git a/target/linux/generic/pending-5.4/446-mtd-spinand-gigadevice-Add-QE-Bit.patch b/target/linux/generic/pending-5.4/446-mtd-spinand-gigadevice-Add-QE-Bit.patch new file mode 100644 index 000000000..034cd2a8f --- /dev/null +++ b/target/linux/generic/pending-5.4/446-mtd-spinand-gigadevice-Add-QE-Bit.patch @@ -0,0 +1,67 @@ +From f72e99ada020a81e3e4ef79c0a83ede7e9d6c7b1 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 16 Aug 2020 14:42:17 +0200 +Subject: [PATCH v2 446/447] mtd: spinand: gigadevice: Add QE Bit + +The following GigaDevice chips have the QE BIT in the feature flags, I +checked the datasheets, but did not try this. +* GD5F1GQ4xExxG +* GD5F1GQ4xFxxG +* GD5F1GQ4UAYIG +* GD5F4GQ4UAYIG + +The Quad operations like 0xEB mention that the QE bit has to be set. + +Fixes: c93c613214ac ("mtd: spinand: add support for GigaDevice GD5FxGQ4xA") +Signed-off-by: Hauke Mehrtens +--- + drivers/mtd/nand/spi/gigadevice.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/mtd/nand/spi/gigadevice.c ++++ b/drivers/mtd/nand/spi/gigadevice.c +@@ -201,7 +201,7 @@ static const struct spinand_info gigadev + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), +- 0, ++ SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout, + gd5fxgq4xa_ecc_get_status)), + SPINAND_INFO("GD5F2GQ4xA", 0xF2, +@@ -210,7 +210,7 @@ static const struct spinand_info gigadev + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), +- 0, ++ SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout, + gd5fxgq4xa_ecc_get_status)), + SPINAND_INFO("GD5F4GQ4xA", 0xF4, +@@ -219,7 +219,7 @@ static const struct spinand_info gigadev + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), +- 0, ++ SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout, + gd5fxgq4xa_ecc_get_status)), + SPINAND_INFO("GD5F1GQ4UExxG", 0xd1, +@@ -228,7 +228,7 @@ static const struct spinand_info gigadev + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), +- 0, ++ SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout, + gd5fxgq4uexxg_ecc_get_status)), + SPINAND_INFO("GD5F1GQ4UFxxG", 0xb148, +@@ -237,7 +237,7 @@ static const struct spinand_info gigadev + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_f, + &write_cache_variants, + &update_cache_variants), +- 0, ++ SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4_variant2_ooblayout, + gd5fxgq4ufxxg_ecc_get_status)), + }; diff --git a/target/linux/generic/pending-5.4/447-mtd-spinand-gigadevice-Add-support-for-GD5F4GQ4xC.patch b/target/linux/generic/pending-5.4/447-mtd-spinand-gigadevice-Add-support-for-GD5F4GQ4xC.patch new file mode 100644 index 000000000..e1fcb15d5 --- /dev/null +++ b/target/linux/generic/pending-5.4/447-mtd-spinand-gigadevice-Add-support-for-GD5F4GQ4xC.patch @@ -0,0 +1,87 @@ +From 30521ccfb4597f91b9e5c7967acef9c7c85e58a8 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 12 Aug 2020 22:50:26 +0200 +Subject: [PATCH v2 447/447] mtd: spinand: gigadevice: Add support for + GD5F4GQ4xC + +This adds support for the following 4GiB chips: +GD5F4GQ4RCYIG 1.8V +GD5F4GQ4UCYIG 3.3V + +The datasheet can be found here: +https://www.novitronic.ch/sixcms/media.php/2/DS-00173-GD5F4GQ4xCxIG-Rev1.574695.pdf + +The GD5F4GQ4UCYIGT (3.3V) version is used on the Imagination +Technologies Creator Ci40 (Marduk), the 1.8V version was not tested. + +This device only works in single SPI mode and not in dual or quad mode +for me on this board. + +Signed-off-by: Hauke Mehrtens +--- + drivers/mtd/nand/spi/gigadevice.c | 49 +++++++++++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + +--- a/drivers/mtd/nand/spi/gigadevice.c ++++ b/drivers/mtd/nand/spi/gigadevice.c +@@ -132,6 +132,35 @@ static const struct mtd_ooblayout_ops gd + .free = gd5fxgq4_variant2_ooblayout_free, + }; + ++static int gd5fxgq4xc_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 gd5fxgq4xc_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 gd5fxgq4xc_oob_256_ops = { ++ .ecc = gd5fxgq4xc_ooblayout_256_ecc, ++ .free = gd5fxgq4xc_ooblayout_256_free, ++}; ++ + static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand, + u8 status) + { +@@ -222,6 +251,24 @@ static const struct spinand_info gigadev + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4xa_ooblayout, + gd5fxgq4xa_ecc_get_status)), ++ SPINAND_INFO("GD5F4GQ4RC", 0xa468, ++ NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1), ++ NAND_ECCREQ(8, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants_f, ++ &write_cache_variants, ++ &update_cache_variants), ++ SPINAND_HAS_QE_BIT, ++ SPINAND_ECCINFO(&gd5fxgq4xc_oob_256_ops, ++ gd5fxgq4ufxxg_ecc_get_status)), ++ SPINAND_INFO("GD5F4GQ4UC", 0xb468, ++ NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1), ++ NAND_ECCREQ(8, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants_f, ++ &write_cache_variants, ++ &update_cache_variants), ++ SPINAND_HAS_QE_BIT, ++ SPINAND_ECCINFO(&gd5fxgq4xc_oob_256_ops, ++ gd5fxgq4ufxxg_ecc_get_status)), + SPINAND_INFO("GD5F1GQ4UExxG", 0xd1, + NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1), + NAND_ECCREQ(8, 512), diff --git a/target/linux/generic/pending-5.4/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch b/target/linux/generic/pending-5.4/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch deleted file mode 100644 index e726274ca..000000000 --- a/target/linux/generic/pending-5.4/553-ubifs-Add-option-to-create-UBI-FS-version-4-on-empty.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 93c33e6a7f3b0aef99d02252e6232a3d8b80f2d5 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 21 Jan 2018 15:47:50 +0100 -Subject: ubifs: Add option to create UBI FS version 4 on empty UBI volume - -Instead of creating an ubifs file system with format version 5 by -default on empty UBI volumes add a compile option to create an older ubi -with file system format version 4 instated. This allows it to be mount -as a volume on kernel versions < 4.10, which does not support format -version 5. -We saw that some people can not access their older data when they -downgraded from kernel 4.14 to kernel 4.9 to prevent this this option -would help. - -Signed-off-by: Hauke Mehrtens ---- - fs/ubifs/Kconfig | 13 +++++++++++++ - fs/ubifs/sb.c | 6 ++++++ - 2 files changed, 19 insertions(+) - ---- a/fs/ubifs/Kconfig -+++ b/fs/ubifs/Kconfig -@@ -85,6 +85,19 @@ config UBIFS_FS_SECURITY - - If you are not using a security module, say N. - -+config UBIFS_FS_FORMAT4 -+ bool "Use file system format version 4 for new file systems" -+ depends on UBIFS_FS -+ help -+ Instead of creating new file systems with the new ubifs file -+ system version 5, use the old format version 4 for implicitly -+ by the driver created file systems on an empty UBI volume. This -+ makes it possible to mount these file systems also with kernel -+ versions before 4.10. The driver will still support file system -+ format version 5 for ubifs file systems created with version 5. -+ -+ If you are unsure, say N. -+ - config UBIFS_FS_AUTHENTICATION - bool "UBIFS authentication support" - select KEYS ---- a/fs/ubifs/sb.c -+++ b/fs/ubifs/sb.c -@@ -175,7 +175,9 @@ static int create_default_filesystem(str - tmp64 = (long long)max_buds * c->leb_size; - if (big_lpt) - sup_flags |= UBIFS_FLG_BIGLPT; -+#ifndef CONFIG_UBIFS_FS_FORMAT4 - sup_flags |= UBIFS_FLG_DOUBLE_HASH; -+#endif - - if (ubifs_authenticated(c)) { - sup_flags |= UBIFS_FLG_AUTHENTICATION; -@@ -201,7 +203,11 @@ static int create_default_filesystem(str - sup->jhead_cnt = cpu_to_le32(DEFAULT_JHEADS_CNT); - sup->fanout = cpu_to_le32(DEFAULT_FANOUT); - sup->lsave_cnt = cpu_to_le32(c->lsave_cnt); -+#ifdef CONFIG_UBIFS_FS_FORMAT4 -+ sup->fmt_version = cpu_to_le32(4); -+#else - sup->fmt_version = cpu_to_le32(UBIFS_FORMAT_VERSION); -+#endif - sup->time_gran = cpu_to_le32(DEFAULT_TIME_GRAN); - if (c->mount_opts.override_compr) - sup->default_compr = cpu_to_le16(c->mount_opts.compr_type); 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 622aada94..f082aa145 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 @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1795,6 +1795,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1797,6 +1797,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1802,6 +1803,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1804,6 +1805,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1814,7 +1816,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1816,7 +1818,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2052,12 +2054,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2054,12 +2056,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2182,12 +2184,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2184,12 +2186,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; -@@ -3279,6 +3281,7 @@ static int packet_create(struct net *net +@@ -3284,6 +3286,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; -@@ -3912,6 +3915,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3917,6 +3920,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; } -@@ -3968,6 +3981,13 @@ static int packet_getsockopt(struct sock +@@ -3973,6 +3986,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/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 766abc748..232aee963 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 @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1044,6 +1058,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1047,6 +1061,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1081,6 +1096,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1084,6 +1099,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -4416,6 +4435,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -4419,6 +4438,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -4896,7 +4926,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -4899,7 +4929,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6016,6 +6047,8 @@ static int ip6_route_dev_notify(struct n +@@ -6019,6 +6050,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6027,6 +6060,7 @@ static int ip6_route_dev_notify(struct n +@@ -6030,6 +6063,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6219,6 +6253,8 @@ static int __net_init ip6_route_net_init +@@ -6222,6 +6256,8 @@ static int __net_init ip6_route_net_init #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.fib6_has_custom_rules = false; @@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6229,11 +6265,21 @@ static int __net_init ip6_route_net_init +@@ -6232,11 +6268,21 @@ static int __net_init ip6_route_net_init ip6_template_metrics, true); INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached); @@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); -@@ -6257,6 +6303,8 @@ out: +@@ -6260,6 +6306,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6276,6 +6324,7 @@ static void __net_exit ip6_route_net_exi +@@ -6279,6 +6327,7 @@ static void __net_exit ip6_route_net_exi kfree(net->ipv6.ip6_null_entry); #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); @@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6353,6 +6402,9 @@ void __init ip6_route_init_special_entri +@@ -6356,6 +6405,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); 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 new file mode 100644 index 000000000..0fd837d45 --- /dev/null +++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch @@ -0,0 +1,343 @@ +From: Felix Fietkau +Date: Sun, 26 Jul 2020 14:03:21 +0200 +Subject: [PATCH] net: add support for threaded NAPI polling + +For some drivers (especially 802.11 drivers), doing a lot of work in the NAPI +poll function does not perform well. Since NAPI poll is bound to the CPU it +was scheduled from, we can easily end up with a few very busy CPUs spending +most of their time in softirq/ksoftirqd and some idle ones. + +Introduce threaded NAPI for such drivers based on a workqueue. The API is the +same except for using netif_threaded_napi_add instead of netif_napi_add. + +In my tests with mt76 on MT7621 using threaded NAPI + a thread for tx scheduling +improves LAN->WLAN bridging throughput by 10-50%. Throughput without threaded +NAPI is wildly inconsistent, depending on the CPU that runs the tx scheduling +thread. + +With threaded NAPI it seems stable and consistent (and higher than the best +results I got without it). + +Based on a patch by Hillf Danton + +Cc: Hillf Danton +Signed-off-by: Felix Fietkau +--- + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -340,6 +340,7 @@ struct napi_struct { + struct list_head dev_list; + struct hlist_node napi_hash_node; + unsigned int napi_id; ++ struct work_struct work; + }; + + enum { +@@ -350,6 +351,7 @@ enum { + NAPI_STATE_HASHED, /* In NAPI hash (busy polling possible) */ + NAPI_STATE_NO_BUSY_POLL,/* Do not add in napi_hash, no busy polling */ + NAPI_STATE_IN_BUSY_POLL,/* sk_busy_loop() owns this NAPI */ ++ NAPI_STATE_THREADED, /* Use threaded NAPI */ + }; + + enum { +@@ -360,6 +362,7 @@ enum { + NAPIF_STATE_HASHED = BIT(NAPI_STATE_HASHED), + NAPIF_STATE_NO_BUSY_POLL = BIT(NAPI_STATE_NO_BUSY_POLL), + NAPIF_STATE_IN_BUSY_POLL = BIT(NAPI_STATE_IN_BUSY_POLL), ++ NAPIF_STATE_THREADED = BIT(NAPI_STATE_THREADED), + }; + + enum gro_result { +@@ -2249,6 +2252,26 @@ void netif_napi_add(struct net_device *d + int (*poll)(struct napi_struct *, int), int weight); + + /** ++ * netif_threaded_napi_add - initialize a NAPI context ++ * @dev: network device ++ * @napi: NAPI context ++ * @poll: polling function ++ * @weight: default weight ++ * ++ * This variant of netif_napi_add() should be used from drivers using NAPI ++ * with CPU intensive poll functions. ++ * This will schedule polling from a high priority workqueue ++ */ ++static inline void netif_threaded_napi_add(struct net_device *dev, ++ struct napi_struct *napi, ++ int (*poll)(struct napi_struct *, int), ++ int weight) ++{ ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++ netif_napi_add(dev, napi, poll, weight); ++} ++ ++/** + * netif_tx_napi_add - initialize a NAPI context + * @dev: network device + * @napi: NAPI context +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -156,6 +156,7 @@ static DEFINE_SPINLOCK(offload_lock); + struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly; + struct list_head ptype_all __read_mostly; /* Taps */ + static struct list_head offload_base __read_mostly; ++static struct workqueue_struct *napi_workq __read_mostly; + + static int netif_rx_internal(struct sk_buff *skb); + static int call_netdevice_notifiers_info(unsigned long val, +@@ -5910,6 +5911,11 @@ void __napi_schedule(struct napi_struct + { + unsigned long flags; + ++ if (test_bit(NAPI_STATE_THREADED, &n->state)) { ++ queue_work(napi_workq, &n->work); ++ return; ++ } ++ + local_irq_save(flags); + ____napi_schedule(this_cpu_ptr(&softnet_data), n); + local_irq_restore(flags); +@@ -5957,6 +5963,11 @@ EXPORT_SYMBOL(napi_schedule_prep); + */ + void __napi_schedule_irqoff(struct napi_struct *n) + { ++ if (test_bit(NAPI_STATE_THREADED, &n->state)) { ++ queue_work(napi_workq, &n->work); ++ return; ++ } ++ + ____napi_schedule(this_cpu_ptr(&softnet_data), n); + } + EXPORT_SYMBOL(__napi_schedule_irqoff); +@@ -6218,6 +6229,84 @@ static void init_gro_hash(struct napi_st + napi->gro_bitmask = 0; + } + ++static int __napi_poll(struct napi_struct *n, bool *repoll) ++{ ++ int work, weight; ++ ++ weight = n->weight; ++ ++ /* This NAPI_STATE_SCHED test is for avoiding a race ++ * with netpoll's poll_napi(). Only the entity which ++ * obtains the lock and sees NAPI_STATE_SCHED set will ++ * actually make the ->poll() call. Therefore we avoid ++ * accidentally calling ->poll() when NAPI is not scheduled. ++ */ ++ work = 0; ++ if (test_bit(NAPI_STATE_SCHED, &n->state)) { ++ work = n->poll(n, weight); ++ trace_napi_poll(n, work, weight); ++ } ++ ++ WARN_ON_ONCE(work > weight); ++ ++ if (likely(work < weight)) ++ return work; ++ ++ /* Drivers must not modify the NAPI state if they ++ * consume the entire weight. In such cases this code ++ * still "owns" the NAPI instance and therefore can ++ * move the instance around on the list at-will. ++ */ ++ if (unlikely(napi_disable_pending(n))) { ++ napi_complete(n); ++ return work; ++ } ++ ++ if (n->gro_bitmask) { ++ /* flush too old packets ++ * If HZ < 1000, flush all packets. ++ */ ++ napi_gro_flush(n, HZ >= 1000); ++ } ++ ++ gro_normal_list(n); ++ ++ *repoll = true; ++ ++ return work; ++} ++ ++static void napi_workfn(struct work_struct *work) ++{ ++ struct napi_struct *n = container_of(work, struct napi_struct, work); ++ void *have; ++ ++ for (;;) { ++ bool repoll = false; ++ ++ local_bh_disable(); ++ ++ have = netpoll_poll_lock(n); ++ __napi_poll(n, &repoll); ++ netpoll_poll_unlock(have); ++ ++ local_bh_enable(); ++ ++ if (!repoll) ++ return; ++ ++ if (!need_resched()) ++ continue; ++ ++ /* ++ * have to pay for the latency of task switch even if ++ * napi is scheduled ++ */ ++ queue_work(napi_workq, work); ++ return; ++ } ++} ++ + 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 + #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 + void netif_napi_del(struct napi_struct *napi) + { + might_sleep(); ++ cancel_work_sync(&napi->work); + if (napi_hash_del(napi)) + synchronize_net(); + list_del_init(&napi->dev_list); +@@ -6288,50 +6379,18 @@ EXPORT_SYMBOL(netif_napi_del); + + static int napi_poll(struct napi_struct *n, struct list_head *repoll) + { ++ bool do_repoll = false; + void *have; +- int work, weight; ++ int work; + + list_del_init(&n->poll_list); + + have = netpoll_poll_lock(n); + +- weight = n->weight; +- +- /* This NAPI_STATE_SCHED test is for avoiding a race +- * with netpoll's poll_napi(). Only the entity which +- * obtains the lock and sees NAPI_STATE_SCHED set will +- * actually make the ->poll() call. Therefore we avoid +- * accidentally calling ->poll() when NAPI is not scheduled. +- */ +- work = 0; +- if (test_bit(NAPI_STATE_SCHED, &n->state)) { +- work = n->poll(n, weight); +- trace_napi_poll(n, work, weight); +- } +- +- WARN_ON_ONCE(work > weight); +- +- if (likely(work < weight)) +- goto out_unlock; ++ work = __napi_poll(n, &do_repoll); + +- /* Drivers must not modify the NAPI state if they +- * consume the entire weight. In such cases this code +- * still "owns" the NAPI instance and therefore can +- * move the instance around on the list at-will. +- */ +- if (unlikely(napi_disable_pending(n))) { +- napi_complete(n); ++ if (!do_repoll) + goto out_unlock; +- } +- +- if (n->gro_bitmask) { +- /* flush too old packets +- * If HZ < 1000, flush all packets. +- */ +- napi_gro_flush(n, HZ >= 1000); +- } +- +- gro_normal_list(n); + + /* Some drivers may have called napi_schedule + * prior to exhausting their budget. +@@ -10264,6 +10323,10 @@ static int __init net_dev_init(void) + sd->backlog.weight = weight_p; + } + ++ napi_workq = alloc_workqueue("napi_workq", WQ_UNBOUND | WQ_HIGHPRI, ++ WQ_UNBOUND_MAX_ACTIVE | WQ_SYSFS); ++ BUG_ON(!napi_workq); ++ + dev_boot_phase = 0; + + /* The loopback device is special if any other network devices +--- a/net/core/net-sysfs.c ++++ b/net/core/net-sysfs.c +@@ -442,6 +442,52 @@ static ssize_t proto_down_store(struct d + } + NETDEVICE_SHOW_RW(proto_down, fmt_dec); + ++static int change_napi_threaded(struct net_device *dev, unsigned long val) ++{ ++ struct napi_struct *napi; ++ ++ if (list_empty(&dev->napi_list)) ++ return -EOPNOTSUPP; ++ ++ list_for_each_entry(napi, &dev->napi_list, dev_list) { ++ if (val) ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++ else ++ clear_bit(NAPI_STATE_THREADED, &napi->state); ++ } ++ ++ return 0; ++} ++ ++static ssize_t napi_threaded_store(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t len) ++{ ++ return netdev_store(dev, attr, buf, len, change_napi_threaded); ++} ++ ++static ssize_t napi_threaded_show(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct net_device *netdev = to_net_dev(dev); ++ struct napi_struct *napi; ++ bool enabled = false; ++ ++ if (!rtnl_trylock()) ++ return restart_syscall(); ++ ++ list_for_each_entry(napi, &netdev->napi_list, dev_list) { ++ if (test_bit(NAPI_STATE_THREADED, &napi->state)) ++ enabled = true; ++ } ++ ++ rtnl_unlock(); ++ ++ return sprintf(buf, fmt_dec, enabled); ++} ++static DEVICE_ATTR_RW(napi_threaded); ++ + static ssize_t phys_port_id_show(struct device *dev, + struct device_attribute *attr, char *buf) + { +@@ -532,6 +578,7 @@ static struct attribute *net_class_attrs + &dev_attr_flags.attr, + &dev_attr_tx_queue_len.attr, + &dev_attr_gro_flush_timeout.attr, ++ &dev_attr_napi_threaded.attr, + &dev_attr_phys_port_id.attr, + &dev_attr_phys_port_name.attr, + &dev_attr_phys_switch_id.attr, diff --git a/target/linux/generic/pending-5.4/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-5.4/810-pci_disable_common_quirks.patch index ac659c2f9..3f89103fa 100644 --- a/target/linux/generic/pending-5.4/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-5.4/810-pci_disable_common_quirks.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos /* * The Mellanox Tavor device gives false positive parity errors. Mark this * device with a broken_parity_status to allow PCI scanning code to "skip" -@@ -3307,6 +3308,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I +@@ -3320,6 +3321,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); @@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos /* * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. * To work around this, query the size it should be configured to by the -@@ -3332,6 +3335,8 @@ static void quirk_intel_ntb(struct pci_d +@@ -3345,6 +3348,8 @@ static void quirk_intel_ntb(struct pci_d DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb); @@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, even * though no one is handling them (e.g., if the i915 driver is never -@@ -3370,6 +3375,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3383,6 +3388,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); 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 6c823b348..17b1294fd 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 @@ -1,7 +1,5 @@ -Index: linux-5.4.51/drivers/net/phy/Kconfig -=================================================================== ---- linux-5.4.51.orig/drivers/net/phy/Kconfig -+++ linux-5.4.51/drivers/net/phy/Kconfig +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig @@ -587,6 +587,13 @@ config MDIO_IPQ40XX This driver supports the MDIO interface found in Qualcomm Atheros ipq40xx Soc chip. @@ -16,10 +14,8 @@ Index: linux-5.4.51/drivers/net/phy/Kconfig endif # PHYLIB config MICREL_KS8995MA -Index: linux-5.4.51/drivers/net/phy/Makefile -=================================================================== ---- linux-5.4.51.orig/drivers/net/phy/Makefile -+++ linux-5.4.51/drivers/net/phy/Makefile +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile @@ -70,6 +70,7 @@ ifdef CONFIG_HWMON aquantia-objs += aquantia_hwmon.o endif @@ -28,10 +24,8 @@ Index: linux-5.4.51/drivers/net/phy/Makefile obj-$(CONFIG_AX88796B_PHY) += ax88796b.o obj-$(CONFIG_AT803X_PHY) += at803x.o obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o -Index: linux-5.4.51/drivers/net/phy/ar40xx.c -=================================================================== --- /dev/null -+++ linux-5.4.51/drivers/net/phy/ar40xx.c ++++ b/drivers/net/phy/ar40xx.c @@ -0,0 +1,2118 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. @@ -2151,10 +2145,8 @@ Index: linux-5.4.51/drivers/net/phy/ar40xx.c + +MODULE_DESCRIPTION("IPQ40XX ESS driver"); +MODULE_LICENSE("Dual BSD/GPL"); -Index: linux-5.4.51/drivers/net/phy/ar40xx.h -=================================================================== --- /dev/null -+++ linux-5.4.51/drivers/net/phy/ar40xx.h ++++ b/drivers/net/phy/ar40xx.h @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. diff --git a/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch b/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch index ddc51d241..87a4bf108 100644 --- a/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch +++ b/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch @@ -35,7 +35,7 @@ Signed-off-by: Viresh Kumar -------------------- --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm -@@ -134,7 +134,7 @@ config ARM_OMAP2PLUS_CPUFREQ +@@ -135,7 +135,7 @@ config ARM_OMAP2PLUS_CPUFREQ config ARM_QCOM_CPUFREQ_NVMEM tristate "Qualcomm nvmem based CPUFreq" diff --git a/target/linux/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds index bbe689bbb..3f7fe71c0 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/01_leds +++ b/target/linux/kirkwood/base-files/etc/board.d/01_leds @@ -10,10 +10,11 @@ board_config_update board=$(board_name) case "$board" in -"iom,ix2-200") +iom,ix2-200) ucidef_set_led_timer "health" "health" "status:white:rebuild_led" "200" "800" ;; -"linksys,viper") +linksys,e4200-v2|\ +linksys,ea4500) ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1" ;; esac diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index df01b0bb1..a60b87c91 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -11,6 +11,9 @@ board_config_update board=$(board_name) case "$board" in +"checkpoint,l-50") + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 dmz" "eth0" + ;; "cisco,on100") ucidef_set_interface_lan "eth0 eth1" ;; @@ -21,11 +24,13 @@ case "$board" in "raidsonic,ib-nas62x0"|\ "seagate,dockstar"|\ "seagate,goflexhome"|\ -"seagate,goflexnet") +"seagate,goflexnet"|\ +"zyxel,nsa310s") ucidef_set_interface_lan "eth0" "dhcp" ;; -"linksys,audi"|\ -"linksys,viper") +"linksys,e4200-v2"|\ +"linksys,ea3500"|\ +"linksys,ea4500") ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" "internet" ucidef_set_interface_macaddr "wan" $( mtd_get_mac_ascii u_env eth1addr ) ;; diff --git a/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches b/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches new file mode 100755 index 000000000..046f8d4d2 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/03_gpio_switches @@ -0,0 +1,18 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh + +board_config_update + +board=$(board_name) + +case "$board" in +checkpoint,l-50) + ucidef_add_gpio_switch "mpcie-rst" "mPCIE Card reset" "502" "1" + ucidef_add_gpio_switch "exp-card-rst" "Express Card reset" "497" "1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/base-files/etc/board.d/05_compat-version b/target/linux/kirkwood/base-files/etc/board.d/05_compat-version new file mode 100755 index 000000000..29d1debe5 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/board.d/05_compat-version @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Copyright (C) 2020 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + linksys,e4200-v2|\ + linksys,ea3500|\ + linksys,ea4500) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/kirkwood/base-files/etc/init.d/bootcount b/target/linux/kirkwood/base-files/etc/init.d/bootcount index 478f3d013..bbb36eb6e 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/bootcount +++ b/target/linux/kirkwood/base-files/etc/init.d/bootcount @@ -4,8 +4,9 @@ START=99 boot() { case $(board_name) in - linksys,audi|\ - linksys,viper) + linksys,e4200-v2|\ + linksys,ea3500|\ + linksys,ea4500) mtd resetbc s_env || true ;; esac 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 new file mode 100644 index 000000000..d7f8488e8 --- /dev/null +++ b/target/linux/kirkwood/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,16 @@ +# +# 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/base-files/lib/preinit/07_set_iface_mac b/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac new file mode 100644 index 000000000..75e9e886d --- /dev/null +++ b/target/linux/kirkwood/base-files/lib/preinit/07_set_iface_mac @@ -0,0 +1,25 @@ +. /lib/functions.sh +. /lib/functions/system.sh + +preinit_set_mac_address() { + local mac + + case $(board_name) in + checkpoint,l-50) + mac=$(mtd_get_mac_ascii bootldr-env lan1_mac_addr) + + ip link set dev lan1 address $mac 2>/dev/null + ip link set dev lan2 address $(macaddr_add $mac 1) 2>/dev/null + ip link set dev lan3 address $(macaddr_add $mac 2) 2>/dev/null + ip link set dev lan4 address $(macaddr_add $mac 3) 2>/dev/null + ip link set dev lan5 address $(macaddr_add $mac 4) 2>/dev/null + ip link set dev lan6 address $(macaddr_add $mac 5) 2>/dev/null + ip link set dev lan7 address $(macaddr_add $mac 6) 2>/dev/null + ip link set dev lan8 address $(macaddr_add $mac 7) 2>/dev/null + ip link set dev dmz address $(macaddr_add $mac 8) 2>/dev/null + ip link set dev dsl address $(macaddr_add $mac 9) 2>/dev/null + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh index 6d63a0a4b..8ff1709f2 100644 --- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh +++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh @@ -11,8 +11,9 @@ platform_do_upgrade() { local board="$(board_name)" case "$board" in - "linksys,audi"|\ - "linksys,viper") + linksys,e4200-v2|\ + linksys,ea3500|\ + linksys,ea4500) platform_do_upgrade_linksys "$1" ;; *) diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-e4200-v2.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-e4200-v2.dts new file mode 100644 index 000000000..bfd708a67 --- /dev/null +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-e4200-v2.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "kirkwood-linksys-viper.dts" + +/ { + model = "Linksys E4200 v2 (Viper)"; + compatible = "linksys,e4200-v2", "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood"; +}; diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts similarity index 96% rename from target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts rename to target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts index 90250fefc..851f31671 100644 --- a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-linksys-audi.dts +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea3500.dts @@ -15,8 +15,8 @@ #include "kirkwood-6282.dtsi" / { - model = "Linksys Audi (EA3500)"; - compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + model = "Linksys EA3500 (Audi)"; + compatible = "linksys,ea3500", "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood"; memory@0 { device_type = "memory"; diff --git a/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea4500.dts b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea4500.dts new file mode 100644 index 000000000..495cff34a --- /dev/null +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-ea4500.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "kirkwood-linksys-viper.dts" + +/ { + model = "Linksys EA4500 (Viper)"; + compatible = "linksys,ea4500", "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood"; +}; 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 new file mode 100644 index 000000000..fe892ffdc --- /dev/null +++ b/target/linux/kirkwood/files-5.4/arch/arm/boot/dts/kirkwood-nsa310s.dts @@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + model = "ZyXEL NSA310S"; + compatible = "zyxel,nsa310s", "marvell,kirkwood-88f6702", "marvell,kirkwood"; + + aliases { + led-boot = &led_green_sys; + led-failsafe = &led_red_sys; + led-running = &led_green_sys; + led-upgrade = &led_red_sys; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + stdout-path = &uart0; + }; + + ocp@f1000000 { + pinctrl: pin-controller@10000 { + pinctrl-names = "default"; + + pmx_usb_power: pmx-usb-power { + marvell,pins = "mpp21"; + marvell,function = "gpio"; + }; + + pmx_pwr_off: pmx-pwr-off { + marvell,pins = "mpp27"; + marvell,function = "gpio"; + }; + + pmx_btn_reset: pmx-btn-reset { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + pmx_btn_copy: pmx-btn-copy { + marvell,pins = "mpp25"; + marvell,function = "gpio"; + }; + + pmx_btn_power: pmx-btn-power { + marvell,pins = "mpp26"; + marvell,function = "gpio"; + }; + + pmx_led_usb_green: pmx-led-usb-green { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + + pmx_led_copy_green: pmx-led-copy-green { + marvell,pins = "mpp22"; + marvell,function = "gpio"; + }; + + pmx_led_copy_red: pmx-led-copy-red { + marvell,pins = "mpp23"; + marvell,function = "gpio"; + }; + + pmx_led_sys_green: pmx-led-sys-green { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + + pmx_led_sys_red: pmx-led-sys-red { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + + pmx_led_hdd1_green: pmx-led-hdd1-green { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + + pmx_led_hdd1_red: pmx-led-hdd1-red { + marvell,pins = "mpp13"; + marvell,function = "gpio"; + }; + + pmx_pwr_sata1: pmx-pwr-sata1 { + marvell,pins = "mpp33"; + marvell,function = "gpio"; + }; + + }; + + i2c@11000 { + status = "okay"; + + rtc@68 { + compatible = "htk,ht1382"; + reg = <0x68>; + }; + }; + + serial@12000 { + status = "okay"; + }; + }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_usb_power &pmx_pwr_sata1>; + pinctrl-names = "default"; + + usb0_power: regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "USB Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>; + }; + + sata1_power: regulator@2 { + compatible = "regulator-fixed"; + reg = <2>; + regulator-name = "SATA1 Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&pmx_btn_reset &pmx_btn_copy &pmx_btn_power>; + pinctrl-names = "default"; + + power { + label = "Power Button"; + linux,code = ; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + copy { + label = "Copy Button"; + linux,code = ; + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_green_sys: green-sys { + label = "nsa310s:green:sys"; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + }; + + led_red_sys: red-sys { + label = "nsa310s:red:sys"; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + + green-hdd1 { + label = "nsa310s:green:hdd1"; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "ata1"; + }; + + red-hdd1 { + label = "nsa310s:red:hdd1"; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + + green-usb { + label = "nsa310s:green:usb"; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usb-host"; + }; + + green-copy { + label = "nsa310s:green:copy"; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; + + red-copy { + label = "nsa310s:red:copy"; + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_poweroff { + compatible = "gpio-poweroff"; + pinctrl-0 = <&pmx_pwr_off>; + pinctrl-names = "default"; + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; + }; +}; + + +ð0 { + status = "okay"; + + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@1 { + reg = <1>; + phy-mode = "rgmii-id"; + marvell,reg-init = <0x1 0x16 0x0 0x3>, + <0x1 0x10 0x0 0x1017>, + <0x1 0x11 0x0 0x4408>, + <0x1 0x16 0x0 0x0>; + }; +}; + +&nand { + status = "okay"; + chip-delay = <35>; + + partition@0 { + label = "uboot"; + reg = <0x0000000 0x00c0000>; + read-only; + }; + partition@c0000 { + label = "uboot_env"; + reg = <0x00c0000 0x0080000>; + }; + partition@140000 { + label = "ubi"; + reg = <0x0140000 0x7ec0000>; + }; +}; + +&pciec { + status = "okay"; +}; + +&pcie0 { + status = "okay"; +}; + +&sata { + status = "okay"; + nr-ports = <1>; +}; diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index b8cc92760..89042d172 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -10,9 +10,15 @@ include $(INCLUDE_DIR)/image.mk 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) +endef + define Device/Default PROFILES := Default - DEVICE_DTS = $$(if $$(BOARD_NAME),kirkwood-$$(BOARD_NAME),) + DEVICE_DTS = kirkwood-$(lastword $(subst _, ,$(1))) KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL := kernel-bin | append-dtb | uImage none KERNEL_NAME := zImage @@ -25,9 +31,18 @@ define Device/Default IMAGES := sysupgrade.bin factory.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.bin := append-ubi - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) $$(BOARD_NAME) + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef +define Device/checkpoint_l-50 + DEVICE_VENDOR := Check Point + DEVICE_MODEL := L-50 + DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \ + kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-wolfssl + IMAGES := sysupgrade.bin +endef +TARGET_DEVICES += checkpoint_l-50 + define Device/cisco_on100 DEVICE_VENDOR := Cisco Systems DEVICE_MODEL := ON100 @@ -35,15 +50,16 @@ define Device/cisco_on100 KERNEL_IN_UBI := UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi - BOARD_NAME := on100 DEVICE_PACKAGES := kmod-mvsdio + SUPPORTED_DEVICES += on100 endef TARGET_DEVICES += cisco_on100 define Device/cloudengines_pogoe02 DEVICE_VENDOR := Cloud Engines DEVICE_MODEL := Pogoplug E02 - BOARD_NAME := pogo_e02 + DEVICE_DTS := kirkwood-pogo_e02 + SUPPORTED_DEVICES += pogo_e02 endef TARGET_DEVICES += cloudengines_pogoe02 @@ -51,14 +67,16 @@ define Device/cloudengines_pogoplugv4 DEVICE_VENDOR := Cloud Engines DEVICE_MODEL := Pogoplug V4 DEVICE_DTS := kirkwood-pogoplug-series-4 - DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-mvsdio kmod-usb3 + DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-mvsdio kmod-usb3 \ + kmod-gpio-button-hotplug endef TARGET_DEVICES += cloudengines_pogoplugv4 define Device/iom_iconnect-1.1 DEVICE_VENDOR := Iomega DEVICE_MODEL := Iconnect - BOARD_NAME := iconnect + DEVICE_DTS := kirkwood-iconnect + SUPPORTED_DEVICES += iconnect endef TARGET_DEVICES += iom_iconnect-1.1 @@ -80,61 +98,74 @@ define Device/iom_ix2-200 endef TARGET_DEVICES += iom_ix2-200 -define Device/linksys_audi +define Device/linksys DEVICE_VENDOR := Linksys - DEVICE_MODEL := EA3500 (Audi) - DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug + DEVICE_PACKAGES := kmod-mwl8k wpad-basic-wolfssl kmod-gpio-button-hotplug + KERNEL_IN_UBI := + UBINIZE_OPTS := -E 5 + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi +endef + +define Device/linksys_e4200-v2 + $(Device/linksys) + $(Device/dsa-migration) + DEVICE_MODEL := E4200 + DEVICE_VARIANT := v2 + KERNEL_SIZE := 2688k + SUPPORTED_DEVICES += linksys,viper linksys-viper +endef +TARGET_DEVICES += linksys_e4200-v2 + +define Device/linksys_ea3500 + $(Device/linksys) + $(Device/dsa-migration) + DEVICE_MODEL := EA3500 PAGESIZE := 512 SUBPAGESIZE := 256 BLOCKSIZE := 16k KERNEL_SIZE := 2624k - KERNEL_IN_UBI := - UBINIZE_OPTS := -E 5 - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi - BOARD_NAME := linksys-audi + SUPPORTED_DEVICES += linksys,audi linksys-audi endef -TARGET_DEVICES += linksys_audi +TARGET_DEVICES += linksys_ea3500 -define Device/linksys_viper - DEVICE_VENDOR := Linksys - DEVICE_MODEL := E4200v2 / EA4500 (Viper) - DEVICE_PACKAGES := kmod-mwl8k wpad-basic kmod-gpio-button-hotplug +define Device/linksys_ea4500 + $(Device/linksys) + $(Device/dsa-migration) + DEVICE_MODEL := EA4500 KERNEL_SIZE := 2688k - KERNEL_IN_UBI := - UBINIZE_OPTS := -E 5 - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi - BOARD_NAME := linksys-viper + SUPPORTED_DEVICES += linksys,viper linksys-viper endef -TARGET_DEVICES += linksys_viper +TARGET_DEVICES += linksys_ea4500 define Device/raidsonic_ib-nas62x0 DEVICE_VENDOR := RaidSonic DEVICE_MODEL := ICY BOX IB-NAS62x0 - BOARD_NAME := ib62x0 + DEVICE_DTS := kirkwood-ib62x0 DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 + SUPPORTED_DEVICES += ib62x0 endef TARGET_DEVICES += raidsonic_ib-nas62x0 define Device/seagate_dockstar DEVICE_VENDOR := Seagate DEVICE_MODEL := FreeAgent Dockstar - BOARD_NAME := dockstar + SUPPORTED_DEVICES += dockstar endef TARGET_DEVICES += seagate_dockstar define Device/seagate_goflexnet DEVICE_VENDOR := Seagate DEVICE_MODEL := GoFlexNet - BOARD_NAME := goflexnet DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 + SUPPORTED_DEVICES += goflexnet endef TARGET_DEVICES += seagate_goflexnet define Device/seagate_goflexhome DEVICE_VENDOR := Seagate DEVICE_MODEL := GoFlexHome - BOARD_NAME := goflexhome DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 + SUPPORTED_DEVICES += goflexhome endef TARGET_DEVICES += seagate_goflexhome @@ -143,17 +174,24 @@ define Device/zyxel_nsa310b DEVICE_MODEL := NSA310b DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-r8169 kmod-fs-ext4 \ kmod-gpio-button-hotplug kmod-hwmon-lm85 - BOARD_NAME := nsa310b + SUPPORTED_DEVICES += nsa310b endef TARGET_DEVICES += zyxel_nsa310b +define Device/zyxel_nsa310s + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := NSA310S + DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 kmod-gpio-button-hotplug +endef +TARGET_DEVICES += zyxel_nsa310s + define Device/zyxel_nsa325 DEVICE_VENDOR := ZyXEL DEVICE_MODEL := NSA325 DEVICE_VARIANT := v1/v2 DEVICE_PACKAGES := kmod-ata-marvell-sata kmod-fs-ext4 \ kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3 - BOARD_NAME := nsa325 + SUPPORTED_DEVICES += nsa325 endef TARGET_DEVICES += zyxel_nsa325 diff --git a/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch b/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch new file mode 100644 index 000000000..52caee7b4 --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/001-ARM-dts-kirkwood-Add-Check-Point-L-50-board.patch @@ -0,0 +1,485 @@ +From efa968c18abab78c5e0c40a853caf286c3629a59 Mon Sep 17 00:00:00 2001 +From: Pawel Dembicki +Date: Tue, 17 Mar 2020 21:28:01 +0100 +Subject: [PATCH v3] ARM: dts: kirkwood: Add Check Point L-50 board + +This patch adds dts for the Check Point L-50 from 600/1100 series +routers. + +Specification: +-CPU: Marvell Kirkwood 88F6821 1200MHz +-RAM: 512MB +-Flash: NAND 512MB +-WiFi: mPCIe card based on Atheros AR9287 b/g/n +-WAN: 1 Gigabit Port (Marvell 88E1116R PHY) +-LAN: 9 Gigabit Ports (2x Marvell 88E6171(5+3)) +-USB: 2x USB2.0 +-Express card slot +-SD card slot +-Serial console: RJ-45 115200 8n1 +-Unsupported DSL + +Reviewed-by: Andrew Lunn +Signed-off-by: Pawel Dembicki +--- +Changes in v3: +- fix typo and code style issues pointed by OpenWrt guys +Changes in v2: +- none + + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/kirkwood-l-50.dts | 438 ++++++++++++++++++++++++++++ + 2 files changed, 439 insertions(+) + create mode 100644 arch/arm/boot/dts/kirkwood-l-50.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -270,6 +270,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-iomega_ix2_200.dtb \ + kirkwood-is2.dtb \ + kirkwood-km_kirkwood.dtb \ ++ kirkwood-l-50.dtb \ + kirkwood-laplug.dtb \ + kirkwood-linkstation-lsqvl.dtb \ + kirkwood-linkstation-lsvl.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -0,0 +1,438 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Check Point L-50 Board Description ++ * Copyright 2020 Pawel Dembicki ++ */ ++ ++/dts-v1/; ++ ++#include "kirkwood.dtsi" ++#include "kirkwood-6281.dtsi" ++ ++/ { ++ model = "Check Point L-50"; ++ compatible = "checkpoint,l-50", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; ++ }; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200n8"; ++ stdout-path = &uart0; ++ }; ++ ++ ocp@f1000000 { ++ pinctrl: pin-controller@10000 { ++ pinctrl-0 = <&pmx_led38 &pmx_sysrst &pmx_button29>; ++ pinctrl-names = "default"; ++ ++ pmx_sysrst: pmx-sysrst { ++ marvell,pins = "mpp6"; ++ marvell,function = "sysrst"; ++ }; ++ ++ pmx_button29: pmx_button29 { ++ marvell,pins = "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_led38: pmx_led38 { ++ marvell,pins = "mpp38"; ++ marvell,function = "gpio"; ++ }; ++ ++ pmx_sdio_cd: pmx-sdio-cd { ++ marvell,pins = "mpp46"; ++ marvell,function = "gpio"; ++ }; ++ }; ++ ++ serial@12000 { ++ status = "okay"; ++ }; ++ ++ mvsdio@90000 { ++ status = "okay"; ++ cd-gpios = <&gpio1 14 9>; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <400000>; ++ ++ gpio2: gpio-expander@20{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x20>; ++ ++ gpio-controller; ++ }; ++ ++ /* Three GPIOs from 0x21 exp. are undescribed in dts: ++ * 1: DSL module reset (active low) ++ * 5: mPCIE reset (active low) ++ * 6: Express card reset (active low) ++ */ ++ gpio3: gpio-expander@21{ ++ #gpio-cells = <2>; ++ #interrupt-cells = <2>; ++ compatible = "semtech,sx1505q"; ++ reg = <0x21>; ++ ++ gpio-controller; ++ }; ++ ++ rtc@30 { ++ compatible = "s35390a"; ++ reg = <0x30>; ++ }; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_green { ++ label = "l-50:green:status"; ++ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; ++ }; ++ ++ status_red { ++ label = "l-50:red:status"; ++ gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wifi { ++ label = "l-50:green:wifi"; ++ gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "phy0tpt"; ++ }; ++ ++ internet_green { ++ label = "l-50:green:internet"; ++ gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; ++ }; ++ ++ internet_red { ++ label = "l-50:red:internet"; ++ gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb1_green { ++ label = "l-50:green:usb1"; ++ gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port3>; ++ }; ++ ++ usb1_red { ++ label = "l-50:red:usb1"; ++ gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; ++ }; ++ ++ usb2_green { ++ label = "l-50:green:usb2"; ++ gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "usbport"; ++ trigger-sources = <&hub_port1>; ++ }; ++ ++ usb2_red { ++ label = "l-50:red:usb2"; ++ gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ usb2_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb2_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 3 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ usb1_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "usb1_pwr"; ++ ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ gpio = <&gpio3 4 GPIO_ACTIVE_LOW>; ++ regulator-always-on; ++ }; ++ ++ mpcie_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "mpcie_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ express_card_pwr { ++ compatible = "regulator-fixed"; ++ regulator-name = "express_card_pwr"; ++ ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>; ++ enable-active-high; ++ regulator-always-on; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory_defaults { ++ label = "factory_defaults"; ++ gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++&mdio { ++ status = "okay"; ++ ++ ethphy8: ethernet-phy@8 { ++ reg = <0x08>; ++ }; ++ ++ switch0: switch@10 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x10>; ++ dsa,member = <0 0>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan5"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan1"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan6"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "lan2"; ++ }; ++ ++ port@4 { ++ reg = <4>; ++ label = "lan7"; ++ }; ++ ++ switch0port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch1port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "cpu"; ++ phy-mode = "rgmii-id"; ++ ethernet = <ð1port>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++ ++ switch@11 { ++ compatible = "marvell,mv88e6085"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x11>; ++ dsa,member = <0 1>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ label = "lan3"; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ label = "lan8"; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ label = "lan4"; ++ }; ++ ++ port@3 { ++ reg = <3>; ++ label = "dmz"; ++ }; ++ ++ switch1port5: port@5 { ++ reg = <5>; ++ phy-mode = "rgmii-txid"; ++ link = <&switch0port5>; ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ }; ++ }; ++ ++ port@6 { ++ reg = <6>; ++ label = "dsl"; ++ fixed-link { ++ speed = <100>; ++ full-duplex; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++ð0 { ++ status = "okay"; ++ ethernet0-port@0 { ++ phy-handle = <ðphy8>; ++ }; ++}; ++ ++ð1 { ++ status = "okay"; ++ ethernet1-port@0 { ++ speed = <1000>; ++ duplex = <1>; ++ }; ++}; ++ ++&nand { ++ status = "okay"; ++ pinctrl-0 = <&pmx_nand>; ++ pinctrl-names = "default"; ++ ++ partition@0 { ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; ++ }; ++ ++ partition@a0000 { ++ label = "bootldr-env"; ++ reg = <0x000c0000 0x00040000>; ++ }; ++ ++ partition@100000 { ++ label = "kernel-1"; ++ reg = <0x00100000 0x00800000>; ++ }; ++ ++ partition@900000 { ++ label = "rootfs-1"; ++ reg = <0x00900000 0x07100000>; ++ }; ++ ++ partition@7a00000 { ++ label = "kernel-2"; ++ reg = <0x07a00000 0x00800000>; ++ }; ++ ++ partition@8200000 { ++ label = "rootfs-2"; ++ reg = <0x08200000 0x07100000>; ++ }; ++ ++ partition@f300000 { ++ label = "default_sw"; ++ reg = <0x0f300000 0x07900000>; ++ }; ++ ++ partition@16c00000 { ++ label = "logs"; ++ reg = <0x16c00000 0x01800000>; ++ }; ++ ++ partition@18400000 { ++ label = "preset_cfg"; ++ reg = <0x18400000 0x00100000>; ++ }; ++ ++ partition@18500000 { ++ label = "adsl"; ++ reg = <0x18500000 0x00100000>; ++ }; ++ ++ partition@18600000 { ++ label = "storage"; ++ reg = <0x18600000 0x07a00000>; ++ }; ++}; ++ ++&rtc { ++ status = "disabled"; ++}; ++ ++&pciec { ++ status = "okay"; ++}; ++ ++&pcie0 { ++ status = "okay"; ++}; ++ ++&sata_phy0 { ++ status = "disabled"; ++}; ++ ++&sata_phy1 { ++ status = "disabled"; ++}; ++ ++&usb0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ port@1 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ ++ hub_port1: port@1 { ++ reg = <1>; ++ #trigger-source-cells = <0>; ++ }; ++ ++ hub_port3: port@3 { ++ reg = <3>; ++ #trigger-source-cells = <0>; ++ }; ++ }; ++}; diff --git a/target/linux/kirkwood/patches-5.4/105-ea4500.patch b/target/linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch similarity index 100% rename from target/linux/kirkwood/patches-5.4/105-ea4500.patch rename to target/linux/kirkwood/patches-5.4/105-linksys-viper-dts.patch diff --git a/target/linux/kirkwood/patches-5.4/111-l-50.patch b/target/linux/kirkwood/patches-5.4/111-l-50.patch new file mode 100644 index 000000000..bc933cb61 --- /dev/null +++ b/target/linux/kirkwood/patches-5.4/111-l-50.patch @@ -0,0 +1,47 @@ +--- a/arch/arm/boot/dts/kirkwood-l-50.dts ++++ b/arch/arm/boot/dts/kirkwood-l-50.dts +@@ -18,6 +18,13 @@ + reg = <0x00000000 0x20000000>; + }; + ++ aliases { ++ led-boot = &led_status_green; ++ led-failsafe = &led_status_red; ++ led-running = &led_status_green; ++ led-upgrade = &led_status_red; ++ }; ++ + chosen { + bootargs = "console=ttyS0,115200n8"; + stdout-path = &uart0; +@@ -95,12 +102,12 @@ + leds { + compatible = "gpio-leds"; + +- status_green { ++ led_status_green: status_green { + label = "l-50:green:status"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + }; + +- status_red { ++ led_status_red: status_red { + label = "l-50:red:status"; + gpios = <&gpio3 2 GPIO_ACTIVE_LOW>; + }; +@@ -349,13 +356,8 @@ + }; + + partition@100000 { +- label = "kernel-1"; +- reg = <0x00100000 0x00800000>; +- }; +- +- partition@900000 { +- label = "rootfs-1"; +- reg = <0x00900000 0x07100000>; ++ label = "ubi"; ++ reg = <0x00100000 0x07900000>; + }; + + partition@7a00000 { diff --git a/target/linux/kirkwood/profiles/00-default.mk b/target/linux/kirkwood/profiles/00-default.mk index bfc2154c4..4bad7d668 100644 --- a/target/linux/kirkwood/profiles/00-default.mk +++ b/target/linux/kirkwood/profiles/00-default.mk @@ -7,7 +7,7 @@ define Profile/Default NAME:=Default Profile - PACKAGES:=kmod-mwl8k wpad-basic + PACKAGES:=kmod-mwl8k wpad-basic-wolfssl PRIORITY:=1 endef diff --git a/target/linux/lantiq/falcon/config-5.4 b/target/linux/lantiq/falcon/config-5.4 index a6d9e944f..0dc0cc4e3 100644 --- a/target/linux/lantiq/falcon/config-5.4 +++ b/target/linux/lantiq/falcon/config-5.4 @@ -4,8 +4,6 @@ CONFIG_MTD_NAND_ECC_SW_HAMMING=y CONFIG_MTD_RAW_NAND=y CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux" CONFIG_PINCTRL_FALCON=y -# CONFIG_PSB6970_PHY is not set -# CONFIG_RTL8366_SMI is not set CONFIG_SOC_FALCON=y # CONFIG_SOC_XWAY is not set CONFIG_SPI_FALCON=y 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 79896c647..267788319 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 @@ -96,18 +96,6 @@ gpios = <&gpio 50 GPIO_ACTIVE_HIGH>; }; }; -}; - -&gpio { - pinctrl-names = "default"; - pinctrl-0 = <&state_default>; - - state_default: pinmux { - exin { - lantiq,groups = "exin1"; - lantiq,function = "exin"; - }; - }; usb_vbus: regulator-usb-vbus { compatible = "regulator-fixed"; @@ -122,6 +110,18 @@ }; }; +&gpio { + pinctrl-names = "default"; + pinctrl-0 = <&state_default>; + + state_default: pinmux { + exin { + lantiq,groups = "exin1"; + lantiq,function = "exin"; + }; + }; +}; + &gsw { phy-mode = "rmii"; }; 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 e5fd05fe4..063be778d 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 @@ -73,6 +73,18 @@ gpios = <&gpio 20 GPIO_ACTIVE_LOW>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + + regulator-name = "USB_VBUS"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &gpio { @@ -102,18 +114,6 @@ lantiq,output = <0>; }; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - - gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; &gsw { 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 ae0d27a04..b5e884557 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 @@ -105,6 +105,18 @@ gpios = <&gpiomm 6 GPIO_ACTIVE_LOW>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + + regulator-name = "USB_VBUS"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &gpio { @@ -132,18 +144,6 @@ lantiq,open-drain = <1>; }; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; /* 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 069b1b1ed..5db5f314d 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 @@ -21,6 +21,8 @@ led-dsl = &internet_red; led-usb = &umts; led-wifi = &wifi; + + label-mac-device = &wifi0; }; memory@0 { @@ -106,6 +108,18 @@ gpios = <&gpiomm 9 GPIO_ACTIVE_LOW>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + + regulator-name = "USB_VBUS"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &gpio { @@ -140,18 +154,6 @@ lantiq,open-drain = <1>; }; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - - gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; &gsw { @@ -217,9 +219,10 @@ interrupt-map = <0x7000 0 0 1 &icu0 135>; req-mask = <0x3>; - wifi@1814,0601 { + wifi0: wifi@1814,0601 { compatible = "pci1814,0601"; reg = <0x7000 0 0 0 0>; + mtd-mac-address = <&boardconfig 0x16>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,mtd-eeprom-swap; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi index bac27c364..2c790a488 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi @@ -44,8 +44,8 @@ wifi { label = "wlan"; - gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; - linux,code = ; + gpios = <&gpio 29 GPIO_ACTIVE_LOW>; + linux,code = ; }; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi index 1553d2f7f..f12485b3e 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi @@ -40,7 +40,7 @@ wifi { label = "wifi"; gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; - linux,code = ; + linux,code = ; }; }; diff --git a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 5f8392ca4..6c30a9155 100644 --- a/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files-4.19/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -112,7 +112,7 @@ ð0 { pinctrl-0 = <&mdio_pins>, - <&gphy0_led0_pins>, <&gphy0_led2_pins>, + <&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; pinctrl-names = "default"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts index 943b00f89..ca530e39d 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/amazonse_netgear_dgn1000b.dts @@ -136,8 +136,8 @@ read-only; }; - partition@500000 { - reg = <0x50000 0x003a0000>; + partition@50000 { + reg = <0x50000 0x3a0000>; label = "kernel"; }; }; 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 79896c647..267788319 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 @@ -96,18 +96,6 @@ gpios = <&gpio 50 GPIO_ACTIVE_HIGH>; }; }; -}; - -&gpio { - pinctrl-names = "default"; - pinctrl-0 = <&state_default>; - - state_default: pinmux { - exin { - lantiq,groups = "exin1"; - lantiq,function = "exin"; - }; - }; usb_vbus: regulator-usb-vbus { compatible = "regulator-fixed"; @@ -122,6 +110,18 @@ }; }; +&gpio { + pinctrl-names = "default"; + pinctrl-0 = <&state_default>; + + state_default: pinmux { + exin { + lantiq,groups = "exin1"; + lantiq,function = "exin"; + }; + }; +}; + &gsw { phy-mode = "rmii"; }; 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 dcae06d89..3ed49e4a6 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 @@ -155,7 +155,7 @@ reg = <0x20000 0x3d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@3f0000 { label = "boardconfig"; reg = <0x3f0000 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 cceb42164..fb240b2ed 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 @@ -126,7 +126,7 @@ reg = <0x20000 0x3d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@3f0000 { label = "boardconfig"; reg = <0x3f0000 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 e5fd05fe4..063be778d 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 @@ -73,6 +73,18 @@ gpios = <&gpio 20 GPIO_ACTIVE_LOW>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + + regulator-name = "USB_VBUS"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &gpio { @@ -102,18 +114,6 @@ lantiq,output = <0>; }; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - - gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; &gsw { 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 ae0d27a04..5afc15703 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 @@ -105,6 +105,18 @@ gpios = <&gpiomm 6 GPIO_ACTIVE_LOW>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + + regulator-name = "USB_VBUS"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &gpio { @@ -132,18 +144,6 @@ lantiq,open-drain = <1>; }; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; /* @@ -181,7 +181,7 @@ reg = <0x20000 0x7d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@7f0000 { label = "boardconfig"; reg = <0x7f0000 0x10000>; read-only; 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 d673c9b20..437fecec9 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 @@ -119,7 +119,7 @@ reg = <0x20000 0x3d0000>; }; - boardconfig: partition@400000 { + boardconfig: partition@3f0000 { label = "board_config"; reg = <0x3f0000 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 069b1b1ed..5db5f314d 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 @@ -21,6 +21,8 @@ led-dsl = &internet_red; led-usb = &umts; led-wifi = &wifi; + + label-mac-device = &wifi0; }; memory@0 { @@ -106,6 +108,18 @@ gpios = <&gpiomm 9 GPIO_ACTIVE_LOW>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + + regulator-name = "USB_VBUS"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; &gpio { @@ -140,18 +154,6 @@ lantiq,open-drain = <1>; }; }; - - usb_vbus: regulator-usb-vbus { - compatible = "regulator-fixed"; - - regulator-name = "USB_VBUS"; - - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - - gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>; - enable-active-high; - }; }; &gsw { @@ -217,9 +219,10 @@ interrupt-map = <0x7000 0 0 1 &icu0 135>; req-mask = <0x3>; - wifi@1814,0601 { + wifi0: wifi@1814,0601 { compatible = "pci1814,0601"; reg = <0x7000 0 0 0 0>; + mtd-mac-address = <&boardconfig 0x16>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,mtd-eeprom-swap; }; 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 d6c521cfe..793818471 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 @@ -110,30 +110,30 @@ phy-mode = "rgmii"; phy-handle = <&phy0>; }; - ethernet@1 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <4>; - phy-mode = "mii"; - phy-handle = <&phy13>; - }; ethernet@2 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <5>; - phy-mode = "mii"; - phy-handle = <&phy14>; - }; - ethernet@3 { compatible = "lantiq,xrx200-pdi-port"; reg = <2>; phy-mode = "mii"; phy-handle = <&phy11>; }; - ethernet@4 { + ethernet@3 { compatible = "lantiq,xrx200-pdi-port"; reg = <3>; phy-mode = "mii"; phy-handle = <&phy12>; }; + ethernet@4 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <4>; + phy-mode = "mii"; + phy-handle = <&phy13>; + }; + ethernet@5 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <5>; + phy-mode = "mii"; + phy-handle = <&phy14>; + }; }; mdio { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi index bac27c364..2c790a488 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi @@ -44,8 +44,8 @@ wifi { label = "wlan"; - gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; - linux,code = ; + gpios = <&gpio 29 GPIO_ACTIVE_LOW>; + linux,code = ; }; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts index 9129ef1f7..a2e4bc929 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts @@ -3,9 +3,6 @@ #include "vr9_avm_fritz736x.dtsi" -#include -#include - / { compatible = "avm,fritz7360-v2", "avm,fritz736x", "lantiq,xway", "lantiq,vr9"; model = "AVM FRITZ!Box 7360 V2"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts index 012300ec5..e4c74d443 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts @@ -3,9 +3,6 @@ #include "vr9_avm_fritz736x.dtsi" -#include -#include - / { compatible = "avm,fritz7360sl", "avm,fritz736x", "lantiq,xway", "lantiq,vr9"; model = "AVM FRITZ!Box 7360 SL"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts index a061a482d..0cfdb802e 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts @@ -3,9 +3,6 @@ #include "vr9_avm_fritz736x.dtsi" -#include -#include - / { compatible = "avm,fritz7362sl", "avm,fritz736x", "lantiq,xway", "lantiq,vr9"; model = "AVM FRITZ!Box 7362 SL"; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi index 1553d2f7f..bd89e5951 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi @@ -40,7 +40,7 @@ wifi { label = "wifi"; gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; - linux,code = ; + linux,code = ; }; }; @@ -105,7 +105,7 @@ phy-handle = <&phy11>; }; - ethernet@3 { + ethernet@4 { compatible = "lantiq,xrx200-pdi-port"; reg = <4>; phy-mode = "gmii"; 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 43216d66b..fe02d53c8 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 @@ -212,7 +212,3 @@ }; }; }; - -&vmmc { - status = "okay"; -}; 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 4631ad4ff..7709a86e5 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 @@ -162,30 +162,30 @@ reg = <0>; lantiq,switch; - ethernet@1 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <4>; - phy-mode = "mii"; - phy-handle = <&phy13>; - }; ethernet@2 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <5>; - phy-mode = "mii"; - phy-handle = <&phy14>; - }; - ethernet@3 { compatible = "lantiq,xrx200-pdi-port"; reg = <2>; phy-mode = "mii"; phy-handle = <&phy11>; }; - ethernet@4 { + ethernet@3 { compatible = "lantiq,xrx200-pdi-port"; reg = <3>; phy-mode = "mii"; phy-handle = <&phy12>; }; + ethernet@4 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <4>; + phy-mode = "mii"; + phy-handle = <&phy13>; + }; + ethernet@5 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <5>; + phy-mode = "mii"; + phy-handle = <&phy14>; + }; }; mdio { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi index 4fbc1ac49..223ff7dcf 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi @@ -103,17 +103,11 @@ reg = <0>; lantiq,switch; - ethernet@4 { + ethernet@0 { compatible = "lantiq,xrx200-pdi-port"; - reg = <4>; - phy-mode = "gmii"; - phy-handle = <&phy13>; - }; - ethernet@2 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <2>; - phy-mode = "gmii"; - phy-handle = <&phy11>; + reg = <0>; + phy-mode = "rgmii"; + phy-handle = <&phy0>; }; ethernet@1 { compatible = "lantiq,xrx200-pdi-port"; @@ -121,11 +115,17 @@ phy-mode = "rgmii"; phy-handle = <&phy1>; }; - ethernet@0 { + ethernet@2 { compatible = "lantiq,xrx200-pdi-port"; - reg = <0>; - phy-mode = "rgmii"; - phy-handle = <&phy0>; + reg = <2>; + phy-mode = "gmii"; + phy-handle = <&phy11>; + }; + ethernet@4 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <4>; + phy-mode = "gmii"; + phy-handle = <&phy13>; }; }; @@ -245,8 +245,8 @@ read-only; }; - partition@500000 { - reg = <0x50000 0x003a0000>; + partition@50000 { + reg = <0x50000 0x3a0000>; label = "kernel"; }; }; diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi index eabbc0257..c4ccac893 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi @@ -121,24 +121,24 @@ phy-handle = <&phy0>; // gpios = <&gpio 42 GPIO_ACTIVE_LOW>; }; - ethernet@5 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <5>; - phy-mode = "rgmii"; - phy-handle = <&phy5>; - }; ethernet@2 { compatible = "lantiq,xrx200-pdi-port"; reg = <2>; phy-mode = "gmii"; phy-handle = <&phy11>; }; - ethernet@3 { + ethernet@4 { compatible = "lantiq,xrx200-pdi-port"; reg = <4>; phy-mode = "gmii"; phy-handle = <&phy13>; }; + ethernet@5 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <5>; + phy-mode = "rgmii"; + phy-handle = <&phy5>; + }; }; mdio { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi index 77b4f0def..46b699a93 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi @@ -41,24 +41,24 @@ phy-handle = <&phy0>; // gpios = <&gpio 42 GPIO_ACTIVE_LOW>; }; - ethernet@5 { - compatible = "lantiq,xrx200-pdi-port"; - reg = <5>; - phy-mode = "rgmii"; - phy-handle = <&phy5>; - }; ethernet@2 { compatible = "lantiq,xrx200-pdi-port"; reg = <2>; phy-mode = "gmii"; phy-handle = <&phy11>; }; - ethernet@3 { + ethernet@4 { compatible = "lantiq,xrx200-pdi-port"; reg = <4>; phy-mode = "gmii"; phy-handle = <&phy13>; }; + ethernet@5 { + compatible = "lantiq,xrx200-pdi-port"; + reg = <5>; + phy-mode = "rgmii"; + phy-handle = <&phy5>; + }; }; mdio { diff --git a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 5f8392ca4..6c30a9155 100644 --- a/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files-5.4/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -112,7 +112,7 @@ ð0 { pinctrl-0 = <&mdio_pins>, - <&gphy0_led0_pins>, <&gphy0_led2_pins>, + <&gphy0_led1_pins>, <&gphy0_led2_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>; pinctrl-names = "default"; diff --git a/target/linux/lantiq/image/amazonse.mk b/target/linux/lantiq/image/amazonse.mk index 4a23a68e4..1fd714dee 100644 --- a/target/linux/lantiq/image/amazonse.mk +++ b/target/linux/lantiq/image/amazonse.mk @@ -5,16 +5,18 @@ define Device/allnet_all0333cj DEVICE_PACKAGES := kmod-ltq-adsl-ase kmod-ltq-adsl-ase-mei \ kmod-ltq-adsl-ase-fw-b kmod-ltq-atm-ase \ ltq-adsl-app ppp-mod-pppoe + DEFAULT := n endef TARGET_DEVICES += allnet_all0333cj define Device/netgear_dgn1000b DEVICE_VENDOR := NETGEAR DEVICE_MODEL := DGN1000B - IMAGE_SIZE := 6000k + IMAGE_SIZE := 3712k DEVICE_PACKAGES := kmod-ltq-adsl-ase kmod-ltq-adsl-ase-mei \ kmod-ltq-adsl-ase-fw-b kmod-ltq-atm-ase \ ltq-adsl-app ppp-mod-pppoe SUPPORTED_DEVICES += DGN1000B + DEFAULT := n endef TARGET_DEVICES += netgear_dgn1000b diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk index 7a8f05ea5..ad061b277 100644 --- a/target/linux/lantiq/image/ar9.mk +++ b/target/linux/lantiq/image/ar9.mk @@ -3,7 +3,7 @@ define Device/avm_fritz7312 DEVICE_MODEL := FRITZ!Box 7312 SOC := ar9 IMAGE_SIZE := 15744k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic \ + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ @@ -18,7 +18,7 @@ define Device/avm_fritz7320 DEVICE_ALT0_MODEL := HomeServer SOC := ar9 IMAGE_SIZE := 15744k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic \ + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ @@ -39,7 +39,7 @@ define Device/bt_homehub-v3a kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ kmod-ltq-deu-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath9k kmod-owl-loader wpad-basic \ + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ uboot-envtools SUPPORTED_DEVICES += BTHOMEHUBV3A endef @@ -56,7 +56,7 @@ define Device/buffalo_wbmr-hp-g300h-a kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath9k kmod-owl-loader wpad-basic + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h endef TARGET_DEVICES += buffalo_wbmr-hp-g300h-a @@ -72,7 +72,7 @@ define Device/buffalo_wbmr-hp-g300h-b kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath9k kmod-owl-loader wpad-basic + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h endef TARGET_DEVICES += buffalo_wbmr-hp-g300h-b @@ -102,7 +102,7 @@ define Device/netgear_dgn3500 dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "WW" | pad-rootfs | \ check-size 16320k | pad-to 16384k DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ - kmod-ath9k kmod-owl-loader wpad-basic \ + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ @@ -125,7 +125,7 @@ define Device/netgear_dgn3500b dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "DE" | pad-rootfs | \ check-size 16320k | pad-to 16384k DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ - kmod-ath9k kmod-owl-loader wpad-basic \ + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ @@ -139,7 +139,7 @@ define Device/zte_h201l DEVICE_MODEL := H201L IMAGE_SIZE := 7808k SOC := ar9 - DEVICE_PACKAGES := kmod-ath9k-htc wpad-basic \ + DEVICE_PACKAGES := kmod-ath9k-htc wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ @@ -155,7 +155,7 @@ define Device/zyxel_p-2601hn DEVICE_VARIANT := F1/F3 IMAGE_SIZE := 15616k SOC := ar9 - DEVICE_PACKAGES := kmod-rt2800-usb wpad-basic \ + DEVICE_PACKAGES := kmod-rt2800-usb wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ diff --git a/target/linux/lantiq/image/danube.mk b/target/linux/lantiq/image/danube.mk index 2fb5ea061..ea22081d6 100644 --- a/target/linux/lantiq/image/danube.mk +++ b/target/linux/lantiq/image/danube.mk @@ -10,7 +10,7 @@ define Device/arcadyan_arv4510pw kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ - kmod-rt2800-pci kmod-ath5k wpad-basic + kmod-rt2800-pci kmod-ath5k wpad-basic-wolfssl SUPPORTED_DEVICES += ARV4510PW endef TARGET_DEVICES += arcadyan_arv4510pw @@ -29,6 +29,7 @@ define Device/arcadyan_arv4519pw kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa SUPPORTED_DEVICES += ARV4519PW + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv4519pw @@ -42,7 +43,7 @@ define Device/arcadyan_arv7506pw11 DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-rt2800-pci wpad-basic + kmod-rt2800-pci wpad-basic-wolfssl SUPPORTED_DEVICES += ARV7506PW11 endef TARGET_DEVICES += arcadyan_arv7506pw11 @@ -59,7 +60,7 @@ define Device/arcadyan_arv7510pw22 kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ - kmod-rt2800-pci wpad-basic \ + kmod-rt2800-pci wpad-basic-wolfssl \ kmod-usb-uhci kmod-usb2 kmod-usb2-pci SUPPORTED_DEVICES += ARV7510PW22 endef @@ -76,7 +77,7 @@ define Device/arcadyan_arv7518pw kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath9k kmod-owl-loader wpad-basic + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES += ARV7518PW endef TARGET_DEVICES += arcadyan_arv7518pw @@ -92,7 +93,7 @@ define Device/arcadyan_arv7519pw kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-rt2800-pci wpad-basic + kmod-rt2800-pci wpad-basic-wolfssl SUPPORTED_DEVICES += ARV7519PW endef TARGET_DEVICES += arcadyan_arv7519pw @@ -105,11 +106,12 @@ define Device/arcadyan_arv7525pw DEVICE_ALT0_VARIANT := Typ A IMAGE_SIZE := 3776k SOC := danube - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic \ + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa -swconfig SUPPORTED_DEVICES += ARV4510PW + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv7525pw @@ -125,7 +127,7 @@ define Device/arcadyan_arv752dpw kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ - kmod-rt2800-pci wpad-basic + kmod-rt2800-pci wpad-basic-wolfssl SUPPORTED_DEVICES += ARV752DPW endef TARGET_DEVICES += arcadyan_arv752dpw @@ -142,7 +144,7 @@ define Device/arcadyan_arv752dpw22 kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ - kmod-rt2800-pci wpad-basic + kmod-rt2800-pci wpad-basic-wolfssl SUPPORTED_DEVICES += ARV752DPW22 endef TARGET_DEVICES += arcadyan_arv752dpw22 @@ -158,7 +160,7 @@ define Device/arcadyan_arv8539pw22 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath9k kmod-owl-loader wpad-basic + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES += ARV8539PW22 endef TARGET_DEVICES += arcadyan_arv8539pw22 @@ -174,7 +176,7 @@ define Device/audiocodes_mp-252 kmod-usb-ledtrig-usbport kmod-usb-dwc2 \ kmod-rt2800-pci \ ltq-adsl-app ppp-mod-pppoa \ - wpad-basic + wpad-basic-wolfssl SUPPORTED_DEVICES += ACMP252 endef TARGET_DEVICES += audiocodes_mp-252 @@ -191,7 +193,7 @@ define Device/bt_homehub-v2b kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ kmod-ltq-deu-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath9k kmod-owl-loader wpad-basic + kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES += BTHOMEHUBV2B endef TARGET_DEVICES += bt_homehub-v2b @@ -201,6 +203,7 @@ define Device/lantiq_easy50712 DEVICE_MODEL := Danube (EASY50712) SOC := danube IMAGE_SIZE := 3776k + DEFAULT := n endef TARGET_DEVICES += lantiq_easy50712 @@ -213,7 +216,7 @@ define Device/siemens_gigaset-sx76x kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoe \ - kmod-ath5k wpad-basic + kmod-ath5k wpad-basic-wolfssl SUPPORTED_DEVICES += GIGASX76X endef TARGET_DEVICES += siemens_gigaset-sx76x diff --git a/target/linux/lantiq/image/falcon.mk b/target/linux/lantiq/image/falcon.mk index a5490f6e6..6269cf685 100644 --- a/target/linux/lantiq/image/falcon.mk +++ b/target/linux/lantiq/image/falcon.mk @@ -57,6 +57,7 @@ define Device/lantiq_easy98000-nand DEVICE_VARIANT := NAND IMAGE_SIZE := 3904k DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 + DEFAULT := n endef TARGET_DEVICES += lantiq_easy98000-nand @@ -66,6 +67,7 @@ define Device/lantiq_easy98000-nor DEVICE_VARIANT := NOR IMAGE_SIZE := 3904k DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 + DEFAULT := n endef TARGET_DEVICES += lantiq_easy98000-nor diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk index 2f9fa7b97..cebdf46e1 100644 --- a/target/linux/lantiq/image/tp-link.mk +++ b/target/linux/lantiq/image/tp-link.mk @@ -20,7 +20,7 @@ define Device/tplink_tdw8970 TPLINK_HWID := 0x89700001 TPLINK_HWREV := 1 IMAGE_SIZE := 7680k - DEVICE_PACKAGES:= kmod-ath9k wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES:= kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += TDW8970 endef TARGET_DEVICES += tplink_tdw8970 @@ -33,7 +33,7 @@ define Device/tplink_tdw8980 TPLINK_HWID := 0x89800001 TPLINK_HWREV := 14 IMAGE_SIZE := 7680k - DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += TDW8980 endef TARGET_DEVICES += tplink_tdw8980 @@ -46,7 +46,7 @@ define Device/tplink_vr200 TPLINK_HWID := 0x63e64801 TPLINK_HWREV := 0x53 IMAGE_SIZE := 15808k - DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport SUPPORTED_DEVICES += VR200 endef TARGET_DEVICES += tplink_vr200 @@ -59,7 +59,7 @@ define Device/tplink_vr200v TPLINK_HWID := 0x73b70801 TPLINK_HWREV := 0x2f IMAGE_SIZE := 15808k - DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc + DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += VR200v endef TARGET_DEVICES += tplink_vr200v diff --git a/target/linux/lantiq/image/vr9.mk b/target/linux/lantiq/image/vr9.mk index 426710107..e5ebbd3b6 100644 --- a/target/linux/lantiq/image/vr9.mk +++ b/target/linux/lantiq/image/vr9.mk @@ -43,7 +43,7 @@ define Device/arcadyan_vgv7510kw22-brn SIGNATURE := BRNDA6431 MAGIC := 0x12345678 CRC32_POLY := 0x04c11db7 - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += VGV7510KW22BRN endef TARGET_DEVICES += arcadyan_vgv7510kw22-brn @@ -56,7 +56,7 @@ define Device/arcadyan_vgv7510kw22-nor DEVICE_ALT0_MODEL := Box 6431 DEVICE_ALT0_VARIANT := NOR IMAGE_SIZE := 15232k - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += VGV7510KW22NOR endef TARGET_DEVICES += arcadyan_vgv7510kw22-nor @@ -73,7 +73,7 @@ define Device/arcadyan_vgv7519-brn SIGNATURE := 5D00008000 MAGIC := 0x12345678 CRC32_POLY := 0x2083b8ed - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += VGV7519BRN endef TARGET_DEVICES += arcadyan_vgv7519-brn @@ -86,7 +86,7 @@ define Device/arcadyan_vgv7519-nor DEVICE_ALT0_MODEL := Experiabox 8 DEVICE_ALT0_VARIANT := NOR IMAGE_SIZE := 15360k - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += VGV7519NOR endef TARGET_DEVICES += arcadyan_vgv7519-nor @@ -101,7 +101,7 @@ define Device/avm_fritz3370 IMAGES += eva-kernel.bin eva-filesystem.bin IMAGE/eva-kernel.bin := append-kernel IMAGE/eva-filesystem.bin := append-ubi - DEVICE_PACKAGES := kmod-ath9k wpad-basic kmod-usb-dwc2 fritz-tffs + DEVICE_PACKAGES := kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 fritz-tffs endef define Device/avm_fritz3370-rev2-hynix @@ -122,7 +122,7 @@ define Device/avm_fritz7360sl $(Device/AVM) DEVICE_MODEL := FRITZ!Box 7360 SL IMAGE_SIZE := 15744k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 SUPPORTED_DEVICES += FRITZ7360SL endef TARGET_DEVICES += avm_fritz7360sl @@ -132,7 +132,7 @@ define Device/avm_fritz7360-v2 DEVICE_MODEL := FRITZ!Box 7360 DEVICE_VARIANT := v2 IMAGE_SIZE := 32128k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 endef TARGET_DEVICES += avm_fritz7360-v2 @@ -142,7 +142,7 @@ define Device/avm_fritz7362sl DEVICE_MODEL := FRITZ!Box 7362 SL KERNEL_SIZE := 4096k IMAGE_SIZE := 49152k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 fritz-tffs + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 fritz-tffs endef TARGET_DEVICES += avm_fritz7362sl @@ -153,7 +153,7 @@ define Device/avm_fritz7412 BOARD_NAME := FRITZ7412 KERNEL_SIZE := 4096k IMAGE_SIZE := 49152k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic fritz-tffs-nand fritz-caldata + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl fritz-tffs-nand fritz-caldata endef TARGET_DEVICES += avm_fritz7412 @@ -164,7 +164,7 @@ define Device/bt_homehub-v5a DEVICE_VARIANT := Type A BOARD_NAME := BTHOMEHUBV5A DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader \ - kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic kmod-usb-dwc2 + kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic-wolfssl kmod-usb-dwc2 SUPPORTED_DEVICES += BTHOMEHUBV5A endef TARGET_DEVICES += bt_homehub-v5a @@ -173,7 +173,7 @@ define Device/buffalo_wbmr-300hpd DEVICE_VENDOR := Buffalo DEVICE_MODEL := WBMR-300HPD IMAGE_SIZE := 15616k - DEVICE_PACKAGES := kmod-mt7603 wpad-basic kmod-usb-dwc2 + DEVICE_PACKAGES := kmod-mt7603 wpad-basic-wolfssl kmod-usb-dwc2 SUPPORTED_DEVICES += WBMR300 endef TARGET_DEVICES += buffalo_wbmr-300hpd @@ -184,7 +184,7 @@ define Device/lantiq_easy80920-nand DEVICE_MODEL := VR9 EASY80920 DEVICE_VARIANT := NAND IMAGE_SIZE := 64512k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += lantiq_easy80920-nand @@ -193,7 +193,7 @@ define Device/lantiq_easy80920-nor DEVICE_MODEL := VR9 EASY80920 DEVICE_VARIANT := NOR IMAGE_SIZE := 7936k - DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += lantiq_easy80920-nor @@ -218,7 +218,7 @@ define Device/zyxel_p-2812hnu-f1 DEVICE_MODEL := P-2812HNU DEVICE_VARIANT := F1 BOARD_NAME := P2812HNUF1 - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport KERNEL_SIZE := 3072k SUPPORTED_DEVICES += P2812HNUF1 endef @@ -230,7 +230,7 @@ define Device/zyxel_p-2812hnu-f3 DEVICE_MODEL := P-2812HNU DEVICE_VARIANT := F3 BOARD_NAME := P2812HNUF3 - DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic kmod-usb-dwc2 + DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 SUPPORTED_DEVICES += P2812HNUF3 endef TARGET_DEVICES += zyxel_p-2812hnu-f3 diff --git a/target/linux/lantiq/image/xway_legacy.mk b/target/linux/lantiq/image/xway_legacy.mk index 52a29ab2f..a0bf7a85a 100644 --- a/target/linux/lantiq/image/xway_legacy.mk +++ b/target/linux/lantiq/image/xway_legacy.mk @@ -6,8 +6,9 @@ define Device/arcadyan_arv4518pwr01 kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath5k wpad-mini + kmod-ath5k wpad-basic-wolfssl SUPPORTED_DEVICES += ARV4518PWR01 + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv4518pwr01 @@ -19,8 +20,9 @@ define Device/arcadyan_arv4518pwr01a kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ath5k wpad-basic + kmod-ath5k wpad-basic-wolfssl SUPPORTED_DEVICES += ARV4518PWR01A + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv4518pwr01a @@ -36,8 +38,9 @@ define Device/arcadyan_arv4520pw kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ - kmod-rt61-pci wpad-mini + kmod-rt61-pci wpad-basic-wolfssl SUPPORTED_DEVICES += ARV4520PW + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv4520pw @@ -48,11 +51,12 @@ define Device/arcadyan_arv4525pw DEVICE_ALT0_MODEL := Speedport W502V DEVICE_ALT0_VARIANT := Typ A IMAGE_SIZE := 3776k - DEVICE_PACKAGES := kmod-ath5k wpad-mini \ + DEVICE_PACKAGES := kmod-ath5k wpad-basic-wolfssl \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa -swconfig SUPPORTED_DEVICES += ARV4525PW + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv4525pw @@ -63,10 +67,11 @@ define Device/arcadyan_arv452cqw DEVICE_ALT0_MODEL := Easybox 801 IMAGE_SIZE := 3776k DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ - kmod-ath5k wpad-mini \ + kmod-ath5k wpad-basic-wolfssl \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa SUPPORTED_DEVICES += ARV452CQW + DEFAULT := n endef TARGET_DEVICES += arcadyan_arv452cqw 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 f45405582..fa0f136cb 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 -@@ -2375,6 +2375,12 @@ config MIPS_VPE_LOADER +@@ -2376,6 +2376,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/uci-defaults/01_led_migration b/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration new file mode 100644 index 000000000..35903d212 --- /dev/null +++ b/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration @@ -0,0 +1,32 @@ +# +# Copyright (C) 2013 OpenWrt.org +# + +. /lib/functions/migrations.sh + +do_internet_led_rename() +{ + config_load system + + [ -n $(config_get led_internet name) ] || return + [ -z $(config_get led_dsl name) ] || return + + uci rename system.led_internet=led_dsl + uci set system.led_dsl.name=dsl + + logger -t led-migration "internet led renamed to dsl" +} + +case "$(board_name)" in +alphanetworks,asl56026|\ +arcadyan,arv7519rw22|\ +arcadyan,vg3503j|\ +avm,fritz7360sl|\ +bt,homehub-v5a) + do_internet_led_rename + ;; +esac + +migrations_apply system + +exit 0 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 89368d8bf..54ace3989 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 @@ -36,6 +36,7 @@ lantiq_setup_interfaces() ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0" ;; + arcadyan,arv752dpw|\ bt,homehub-v2b) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5t@eth0" diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xway/base-files/etc/uci-defaults/01_led_migration similarity index 81% rename from target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration rename to target/linux/lantiq/xway/base-files/etc/uci-defaults/01_led_migration index 961e39ee6..0139ef28b 100644 --- a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration +++ b/target/linux/lantiq/xway/base-files/etc/uci-defaults/01_led_migration @@ -18,17 +18,11 @@ do_internet_led_rename() } case "$(board_name)" in -alphanetworks,asl56026|\ -arcadyan,arv452cqw|\ arcadyan,arv7510pw22|\ -arcadyan,arv7519rw22|\ arcadyan,arv752dpw|\ arcadyan,arv752dpw22|\ -arcadyan,vg3503j|\ -avm,fritz7360sl|\ bt,homehub-v2b|\ -bt,homehub-v3a|\ -bt,homehub-v5a) +bt,homehub-v3a) do_internet_led_rename ;; netgear,dgn3500|\ diff --git a/target/linux/lantiq/xway/config-5.4 b/target/linux/lantiq/xway/config-5.4 index 16e9de8f9..8f0345dcb 100644 --- a/target/linux/lantiq/xway/config-5.4 +++ b/target/linux/lantiq/xway/config-5.4 @@ -29,10 +29,13 @@ CONFIG_PCI=y # CONFIG_PCIE_LANTIQ is not set CONFIG_PCI_DOMAINS=y CONFIG_PCI_LANTIQ=y +CONFIG_PSB6970_PHY=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RTL8306_PHY=y +CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366S_PHY=y +CONFIG_RTL8366_SMI=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y diff --git a/target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration new file mode 100644 index 000000000..18bf6a3f9 --- /dev/null +++ b/target/linux/lantiq/xway_legacy/base-files/etc/uci-defaults/01_led_migration @@ -0,0 +1,28 @@ +# +# Copyright (C) 2013 OpenWrt.org +# + +. /lib/functions/migrations.sh + +do_internet_led_rename() +{ + config_load system + + [ -n $(config_get led_internet name) ] || return + [ -z $(config_get led_dsl name) ] || return + + uci rename system.led_internet=led_dsl + uci set system.led_dsl.name=dsl + + logger -t led-migration "internet led renamed to dsl" +} + +case "$(board_name)" in +arcadyan,arv452cqw) + do_internet_led_rename + ;; +esac + +migrations_apply system + +exit 0 diff --git a/target/linux/lantiq/xway_legacy/config-5.4 b/target/linux/lantiq/xway_legacy/config-5.4 index 1d1c2f187..8724bba05 100644 --- a/target/linux/lantiq/xway_legacy/config-5.4 +++ b/target/linux/lantiq/xway_legacy/config-5.4 @@ -22,10 +22,13 @@ CONFIG_PCI=y # CONFIG_PCIE_LANTIQ is not set CONFIG_PCI_DOMAINS=y CONFIG_PCI_LANTIQ=y +CONFIG_PSB6970_PHY=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RTL8306_PHY=y +CONFIG_RTL8366RB_PHY=y CONFIG_RTL8366S_PHY=y +CONFIG_RTL8366_SMI=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y CONFIG_SGL_ALLOC=y diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 476297a67..c5b27ad0c 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -18,6 +18,7 @@ endef include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage +DEFAULT_PACKAGES += kmod-usb3 kmod-usb-dwc3 kmod-usb-storage \ + partx-utils $(eval $(call BuildTarget)) diff --git a/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup new file mode 100644 index 000000000..1bbd8efbc --- /dev/null +++ b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup @@ -0,0 +1,13 @@ +do_sysinfo_layerscape_fixup() { + [ -e /tmp/sysinfo/board_name ] || return + [ -e /proc/cmdline ] || return + cmdline=$(strings /proc/cmdline) + case "${cmdline}" in + *root=/dev/mmcblk*) + board="$(strings /tmp/sysinfo/board_name)-sdboot" + echo ${board} > /tmp/sysinfo/board_name + ;; + esac +} + +boot_hook_add preinit_main do_sysinfo_layerscape_fixup diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index 1e1e28987..8a136d943 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -1,5 +1,6 @@ # # Copyright 2015-2019 Traverse Technologies +# Copyright 2020 NXP # RAMFS_COPY_BIN="/usr/sbin/fw_printenv /usr/sbin/fw_setenv /usr/sbin/ubinfo /bin/echo" @@ -7,6 +8,85 @@ RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock" REQUIRE_IMAGE_METADATA=1 +platform_check_image_sdboot() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + # get partitions table from boot device + get_partitions "/dev/$diskdev" bootdisk + + # get partitions table from sysupgrade.bin + dd if="$1" of=/tmp/image.bs bs=512b count=1 > /dev/null 2>&1 + sync + get_partitions /tmp/image.bs image + + # compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi +} +platform_do_upgrade_sdboot() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + echo "Unable to determine upgrade device" + return 1 + } + + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then + # get partitions table from boot device + get_partitions "/dev/$diskdev" bootdisk + + # get partitions table from sysupgrade.bin + dd if="$1" of=/tmp/image.bs bs=512b count=1 > /dev/null 2>&1 + sync + get_partitions /tmp/image.bs image + + # compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + dd if="$1" of="/dev/$diskdev" bs=1024 count=4 > /dev/null 2>&1 + dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 > /dev/null 2>&1 + sync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 + fi + + # write kernel image + dd if="$1" of="$diskdev" bs=1024 skip=4 seek=16384 count=16384 > /dev/null 2>&1 + sync + + # iterate over each partition from the image and write it to the boot disk + while read part start size; do + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + dd if="$1" of="/dev/$partdev" bs=512 skip="$start" count="$size" > /dev/null 2>&1 + sync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + +} platform_do_upgrade_traverse_nandubi() { bootsys=$(fw_printenv bootsys | awk -F= '{{print $2}}') newbootsys=2 @@ -24,6 +104,15 @@ platform_do_upgrade_traverse_nandubi() { nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys) } +platform_copy_config() { + local partdev parttype=ext4 + + if export_partdevice partdev 1; then + mount -t $parttype -o rw,noatime "/dev/$partdev" /mnt + cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE" + umount /mnt + fi +} platform_check_image() { local board=$(board_name) @@ -33,7 +122,21 @@ platform_check_image() { nand_do_platform_check "traverse-ls1043" $1 return $? ;; - fsl,ls1012a-frdm) + fsl,ls1012a-frdm | \ + fsl,ls1012a-rdb | \ + fsl,ls1021a-twr | \ + fsl,ls1043a-rdb | \ + fsl,ls1046a-rdb | \ + fsl,ls1088a-rdb | \ + fsl,ls2088a-rdb) + return 0 + ;; + fsl,ls1012a-frwy-sdboot | \ + fsl,ls1021a-twr-sdboot | \ + fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-rdb-sdboot | \ + fsl,ls1088a-rdb-sdboot) + platform_check_image_sdboot "$1" return 0 ;; *) @@ -55,10 +158,24 @@ platform_do_upgrade() { traverse,ls1043s) platform_do_upgrade_traverse_nandubi "$1" ;; - fsl,ls1012a-frdm) + fsl,ls1012a-frdm | \ + fsl,ls1012a-rdb | \ + fsl,ls1021a-twr | \ + fsl,ls1043a-rdb | \ + fsl,ls1046a-rdb | \ + fsl,ls1088a-rdb | \ + fsl,ls2088a-rdb) PART_NAME=firmware default_do_upgrade "$1" ;; + fsl,ls1012a-frwy-sdboot | \ + fsl,ls1021a-twr-sdboot | \ + fsl,ls1043a-rdb-sdboot | \ + fsl,ls1046a-rdb-sdboot | \ + fsl,ls1088a-rdb-sdboot) + platform_do_upgrade_sdboot "$1" + return 0 + ;; *) echo "Sysupgrade is not currently supported on $board" ;; diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index f5a5ad998..8a38a2504 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -11,6 +11,9 @@ LS_SD_ROOTFSPART_OFFSET = 64 LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ $(CONFIG_TARGET_ROOTFS_PARTSIZE)) * 1024 * 1024))) +# The limitation of flash sysupgrade.bin is 16MB kernel + 32MB rootfs +LS_SYSUPGRADE_IMAGE_SIZE = 48m + define Build/ls-clean rm -f $@ endef diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index e1a9efb8b..8a8699739 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -1,5 +1,5 @@ # -# Copyright 2018 NXP +# Copyright 2018-2020 NXP # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,19 +8,24 @@ define Device/Default PROFILES := Default FILESYSTEMS := squashfs - IMAGES := firmware.bin + IMAGES := firmware.bin sysupgrade.bin KERNEL := kernel-bin | uImage none KERNEL_NAME := zImage KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 + DEVICE_DTS = $(lastword $(subst _, ,$(1))) + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) + IMAGE_SIZE := 64m + IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef -define Device/ls1021atwr +define Device/fsl_ls1021a-twr DEVICE_VENDOR := NXP DEVICE_MODEL := TWR-LS1021A DEVICE_VARIANT := Default DEVICE_PACKAGES += layerscape-rcw - DEVICE_DTS := ls1021a-twr IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-rcw.bin | pad-to 1M | \ @@ -28,17 +33,17 @@ define Device/ls1021atwr ls-append $(1)-uboot-env.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size endef -TARGET_DEVICES += ls1021atwr +TARGET_DEVICES += fsl_ls1021a-twr -define Device/ls1021atwr-sdboot +define Device/fsl_ls1021a-twr-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := TWR-LS1021A DEVICE_VARIANT := SD Card Boot DEVICE_DTS := ls1021a-twr FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ @@ -47,15 +52,21 @@ define Device/ls1021atwr-sdboot ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef -TARGET_DEVICES += ls1021atwr-sdboot +TARGET_DEVICES += fsl_ls1021a-twr-sdboot -define Device/ls1021aiot-sdboot +define Device/fsl_ls1021a-iot-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1021A-IoT DEVICE_VARIANT := SD Card Boot DEVICE_DTS := ls1021a-iot FILESYSTEMS := ext4 + SUPPORTED_DEVICES := IMAGES := sdcard.img IMAGE/sdcard.img := \ ls-clean | \ @@ -66,4 +77,4 @@ define Device/ls1021aiot-sdboot append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) endef -TARGET_DEVICES += ls1021aiot-sdboot +TARGET_DEVICES += fsl_ls1021a-iot-sdboot diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index ffc8346d2..1bf956584 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -1,5 +1,5 @@ # -# Copyright 2018 NXP +# Copyright 2018-2020 NXP # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -7,25 +7,27 @@ define Device/Default PROFILES := Default - IMAGES := firmware.bin - FILESYSTEMS := ubifs - MKUBIFS_OPTS := -m 1 -e 262016 -c 128 + IMAGES := firmware.bin sysupgrade.bin + FILESYSTEMS := squashfs KERNEL := kernel-bin | gzip | uImage gzip KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 + DEVICE_DTS = freescale/$(subst _,-,$(1)) + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) + IMAGE_SIZE := 64m + IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \ + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata endef -define Device/ls1012afrdm +define Device/fsl_ls1012a-frdm DEVICE_VENDOR := NXP DEVICE_MODEL := FRDM-LS1012A DEVICE_PACKAGES += \ layerscape-ppfe \ - tfa-ls1012afrdm \ + tfa-ls1012a-frdm \ kmod-ppfe - DEVICE_DTS := freescale/fsl-ls1012a-frdm BLOCKSIZE := 256KiB - FILESYSTEMS := squashfs - IMAGES += sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -34,26 +36,22 @@ define Device/ls1012afrdm ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size IMAGE/sysupgrade.bin := append-kernel | pad-to $$(BLOCKSIZE) | \ - append-rootfs | pad-rootfs | check-size 50331648 | append-metadata + append-rootfs | pad-rootfs | \ + check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb - SUPPORTED_DEVICES := fsl,ls1012a-frdm endef -TARGET_DEVICES += ls1012afrdm +TARGET_DEVICES += fsl_ls1012a-frdm -define Device/ls1012ardb +define Device/fsl_ls1012a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1012A-RDB DEVICE_PACKAGES += \ layerscape-ppfe \ - tfa-ls1012ardb \ + tfa-ls1012a-rdb \ kmod-ppfe - DEVICE_DTS := freescale/fsl-ls1012a-rdb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -62,20 +60,20 @@ define Device/ls1012ardb ls-append pfe.itb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size endef -TARGET_DEVICES += ls1012ardb +TARGET_DEVICES += fsl_ls1012a-rdb -define Device/ls1012afrwy +define Device/fsl_ls1012a-frwy-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := FRWY-LS1012A DEVICE_PACKAGES += \ layerscape-ppfe \ - tfa-ls1012afrwy \ + tfa-ls1012a-frwy-sdboot \ kmod-ppfe DEVICE_DTS := freescale/fsl-ls1012a-frwy FILESYSTEMS := ext4 - IMAGES := firmware.bin sdcard.img + IMAGES := firmware.bin sdcard.img sysupgrade.bin IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 128K | \ @@ -89,19 +87,23 @@ define Device/ls1012afrwy ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef -TARGET_DEVICES += ls1012afrwy +TARGET_DEVICES += fsl_ls1012a-frwy-sdboot -define Device/ls1043ardb +define Device/fsl_ls1043a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1043A-RDB DEVICE_VARIANT := Default DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1043ardb \ + tfa-ls1043a-rdb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk - FILESYSTEMS := squashfs IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -110,46 +112,48 @@ define Device/ls1043ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size endef -TARGET_DEVICES += ls1043ardb +TARGET_DEVICES += fsl_ls1043a-rdb -define Device/ls1043ardb-sdboot +define Device/fsl_ls1043a-rdb-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1043A-RDB DEVICE_VARIANT := SD Card Boot DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1043ardb-sdboot \ + tfa-ls1043a-rdb-sdboot \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ ls-append $(1)-fip.bin | pad-to 5M | \ ls-append $(1)-uboot-env.bin | pad-to 9M | \ - ls-append ls1043ardb-fman.bin | pad-to 15M | \ + ls-append fsl_ls1043a-rdb-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef -TARGET_DEVICES += ls1043ardb-sdboot +TARGET_DEVICES += fsl_ls1043a-rdb-sdboot -define Device/ls1046ardb +define Device/fsl_ls1046a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1046A-RDB DEVICE_VARIANT := Default DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1046ardb \ + tfa-ls1046a-rdb \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -158,47 +162,48 @@ define Device/ls1046ardb ls-append $(1)-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size endef -TARGET_DEVICES += ls1046ardb +TARGET_DEVICES += fsl_ls1046a-rdb -define Device/ls1046ardb-sdboot +define Device/fsl_ls1046a-rdb-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1046A-RDB DEVICE_VARIANT := SD Card Boot DEVICE_PACKAGES += \ layerscape-fman \ - tfa-ls1046ardb-sdboot \ + tfa-ls1046a-rdb-sdboot \ fmc fmc-eth-config DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ ls-append $(1)-fip.bin | pad-to 5M | \ ls-append $(1)-uboot-env.bin | pad-to 9M | \ - ls-append ls1046ardb-fman.bin | pad-to 15M | \ + ls-append fsl_ls1046a-rdb-fman.bin | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef -TARGET_DEVICES += ls1046ardb-sdboot +TARGET_DEVICES += fsl_ls1046a-rdb-sdboot -define Device/ls1088ardb +define Device/fsl_ls1088a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS1088A-RDB DEVICE_VARIANT := Default DEVICE_PACKAGES += \ layerscape-mc \ layerscape-dpl \ - tfa-ls1088ardb \ + tfa-ls1088a-rdb \ restool - DEVICE_DTS := freescale/fsl-ls1088a-rdb - UBINIZE_OPTS := -E 5 - BLOCKSIZE := 256KiB - PAGESIZE := 1 IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -209,47 +214,50 @@ define Device/ls1088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ubi | check-size 67108865 + append-rootfs | pad-rootfs | check-size endef -TARGET_DEVICES += ls1088ardb +TARGET_DEVICES += fsl_ls1088a-rdb -define Device/ls1088ardb-sdboot +define Device/fsl_ls1088a-rdb-sdboot DEVICE_VENDOR := NXP DEVICE_MODEL := LS1088A-RDB DEVICE_VARIANT := SD Card Boot DEVICE_PACKAGES += \ layerscape-mc \ layerscape-dpl \ - tfa-ls1088ardb-sdboot \ + tfa-ls1088a-rdb-sdboot \ restool DEVICE_DTS := freescale/fsl-ls1088a-rdb FILESYSTEMS := ext4 - IMAGES := sdcard.img + IMAGES := sdcard.img sysupgrade.bin IMAGE/sdcard.img := \ ls-clean | \ ls-append-sdhead $(1) | pad-to 4K | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ ls-append $(1)-fip.bin | pad-to 5M | \ ls-append $(1)-uboot-env.bin | pad-to 10M | \ - ls-append ls1088ardb-mc.itb | pad-to 13M | \ - ls-append ls1088ardb-dpl.dtb | pad-to 14M | \ - ls-append ls1088ardb-dpc.dtb | pad-to 15M | \ + ls-append fsl_ls1088a-rdb-mc.itb | pad-to 13M | \ + ls-append fsl_ls1088a-rdb-dpl.dtb | pad-to 14M | \ + ls-append fsl_ls1088a-rdb-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ append-rootfs | check-size $(LS_SD_IMAGE_SIZE) + IMAGE/sysupgrade.bin := \ + ls-clean | \ + ls-append-sdhead $(1) | pad-to 16M | \ + append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \ + append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata endef -TARGET_DEVICES += ls1088ardb-sdboot +TARGET_DEVICES += fsl_ls1088a-rdb-sdboot -define Device/ls2088ardb +define Device/fsl_ls2088a-rdb DEVICE_VENDOR := NXP DEVICE_MODEL := LS2088ARDB DEVICE_PACKAGES += \ layerscape-mc \ layerscape-dpl \ - tfa-ls2088ardb \ + tfa-ls2088a-rdb \ restool - DEVICE_DTS := freescale/fsl-ls2088a-rdb - FILESYSTEMS := squashfs IMAGE/firmware.bin := \ ls-clean | \ ls-append $(1)-bl2.pbl | pad-to 1M | \ @@ -260,11 +268,11 @@ define Device/ls2088ardb ls-append $(1)-dpc.dtb | pad-to 15M | \ ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-rootfs | pad-rootfs | check-size 67108865 + append-rootfs | pad-rootfs | check-size endef -TARGET_DEVICES += ls2088ardb +TARGET_DEVICES += fsl_ls2088a-rdb -define Device/traverse-ls1043 +define Device/traverse_ls1043 DEVICE_VENDOR := Traverse DEVICE_MODEL := LS1043 Boards KERNEL_NAME := Image @@ -272,6 +280,7 @@ define Device/traverse-ls1043 KERNEL_INSTALL := 1 FDT_LOADADDR = 0x90000000 FILESYSTEMS := ubifs + MKUBIFS_OPTS := -m 1 -e 262016 -c 128 DEVICE_PACKAGES += \ layerscape-fman \ uboot-envtools \ @@ -293,4 +302,4 @@ define Device/traverse-ls1043 MKUBIFS_OPTS := -m 2048 -e 124KiB -c 4096 SUPPORTED_DEVICES := traverse,ls1043s traverse,ls1043v endef -TARGET_DEVICES += traverse-ls1043 +TARGET_DEVICES += traverse_ls1043 diff --git a/target/linux/layerscape/patches-5.4/302-dts-0085-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interrupt.patch b/target/linux/layerscape/patches-5.4/302-dts-0085-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interrupt.patch deleted file mode 100644 index 17286a815..000000000 --- a/target/linux/layerscape/patches-5.4/302-dts-0085-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interrupt.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 3dc3a4c6ac9e8a0940a9974b8fe2da7641bfa3dd Mon Sep 17 00:00:00 2001 -From: Alex Marginean -Date: Thu, 22 Aug 2019 12:47:12 +0300 -Subject: [PATCH] arm64: dts: LS1028a-rdb: use Ethernet PHY interrupt - -Use the PHY interrupt wired to GPIO pins as part of MDIO WA performance -impact mitigation. - -Signed-off-by: Alex Marginean ---- - arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 10 ++++++++++ - 1 file changed, 10 insertions(+) - ---- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts -+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts -@@ -202,6 +202,8 @@ - #size-cells = <0>; - sgmii_phy0: ethernet-phy@2 { - reg = <0x2>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - }; - }; -@@ -213,18 +215,26 @@ - &enetc_mdio_pf3 { - qsgmii_phy1: ethernet-phy@4 { - reg = <0x10>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - - qsgmii_phy2: ethernet-phy@5 { - reg = <0x11>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - - qsgmii_phy3: ethernet-phy@6 { - reg = <0x12>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - - qsgmii_phy4: ethernet-phy@7 { - reg = <0x13>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - }; - diff --git a/target/linux/layerscape/patches-5.4/302-dts-0092-arm64-dts-ls1028a-Add-DP-DT-nodes.patch b/target/linux/layerscape/patches-5.4/302-dts-0092-arm64-dts-ls1028a-Add-DP-DT-nodes.patch index a6d2253c7..a0fd27e35 100644 --- a/target/linux/layerscape/patches-5.4/302-dts-0092-arm64-dts-ls1028a-Add-DP-DT-nodes.patch +++ b/target/linux/layerscape/patches-5.4/302-dts-0092-arm64-dts-ls1028a-Add-DP-DT-nodes.patch @@ -32,7 +32,7 @@ Signed-off-by: Wen He --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts -@@ -272,13 +272,6 @@ +@@ -262,13 +262,6 @@ }; &hdptx0 { diff --git a/target/linux/layerscape/patches-5.4/302-dts-0108-Revert-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interr.patch b/target/linux/layerscape/patches-5.4/302-dts-0108-Revert-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interr.patch deleted file mode 100644 index efb5cb6cb..000000000 --- a/target/linux/layerscape/patches-5.4/302-dts-0108-Revert-arm64-dts-LS1028a-rdb-use-Ethernet-PHY-interr.patch +++ /dev/null @@ -1,85 +0,0 @@ -From c57a0efc17627d0077408544ded02674aefdecae Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 16:59:02 +0200 -Subject: [PATCH] Revert "arm64: dts: LS1028a-rdb: use Ethernet PHY interrupt" - -This reverts commit 841edb98671cfc4d6f010393ac429c78082ec4bd. - -There are 2 separate issues with interrupts on the LS1028A-RDB board: - -1. The GPIO1_DAT25 interrupt line is shared, so there is a real risk of - race conditions if used in edge-triggered mode, as we currently do. - This can be illustrated in the following setup: - - Take 2 LS1028A-RDB boards - - Connect swp0 to swp0, swp1 to swp1, swp2 to swp2 - - Plug/unplug the power to board 2, 10 times in a row. This will make - the PHYs lose link simultaneously. - - Notice that at one point, the net devices on board 1 remain in a - state where not all the links are down (visible in "ip link"): - - 5: swp0: mtu 1468 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000 - link/ether be:97:36:d3:3d:70 brd ff:ff:ff:ff:ff:ff - 6: swp1: mtu 1468 qdisc pfifo_fast master br0 state UP mode DEFAULT group default qlen 1000 - link/ether be:97:36:d3:3d:71 brd ff:ff:ff:ff:ff:ff - 7: swp2: mtu 1468 qdisc pfifo_fast master br0 state DOWN mode DEFAULT group default qlen 1000 - link/ether be:97:36:d3:3d:72 brd ff:ff:ff:ff:ff:ff - - This cannot be solved by making the interrupts level-triggered, - because the gpio-mpc8xxx controller only supports generating - edge-triggered interrupts. So the effective reality is that we - cannot not use shared interrupts connected to the gpio1 - interrupt-parent. - -2. The uBUS1 and uBUS2 slots that share this interrupt line with the - Ethernet PHYs are not pulled up by default, they are left floating on - current revisions of the LS1028A-RDB boards. So sufficient electrical - noise on these lines will make the CPLD think there's an interrupt - request, so it asserts the GPIO1_DAT25 signal and leaves it asserted. - This means that the PHYs on those boards will never have link when - used in interrupt mode, because their IRQ will be masked by the uBUS - line that is erroneously kept asserted. In poll mode this issue does - not occur. - -Signed-off-by: Vladimir Oltean ---- - arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts | 10 ---------- - 1 file changed, 10 deletions(-) - ---- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts -+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts -@@ -206,8 +206,6 @@ - #size-cells = <0>; - sgmii_phy0: ethernet-phy@2 { - reg = <0x2>; -- interrupt-parent = <&gpio1>; -- interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - }; - }; -@@ -219,26 +217,18 @@ - &enetc_mdio_pf3 { - qsgmii_phy1: ethernet-phy@4 { - reg = <0x10>; -- interrupt-parent = <&gpio1>; -- interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - - qsgmii_phy2: ethernet-phy@5 { - reg = <0x11>; -- interrupt-parent = <&gpio1>; -- interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - - qsgmii_phy3: ethernet-phy@6 { - reg = <0x12>; -- interrupt-parent = <&gpio1>; -- interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - - qsgmii_phy4: ethernet-phy@7 { - reg = <0x13>; -- interrupt-parent = <&gpio1>; -- interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - }; - }; - diff --git a/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch b/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch new file mode 100644 index 000000000..0c6b8e286 --- /dev/null +++ b/target/linux/layerscape/patches-5.4/302-v5.7-dts-0119-arm64-dts-ls1043a-rdb-add-compatible-for-board.patch @@ -0,0 +1,23 @@ +From fa578d4e9fbef8928a45edd904dafb1e3334417e Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 30 Apr 2020 10:56:46 +0800 +Subject: [PATCH] arm64: dts: ls1043a-rdb: add compatible for board + +Add compatible for board to identify. + +Signed-off-by: Yangbo Lu +Signed-off-by: Shawn Guo +--- + arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts +@@ -13,6 +13,7 @@ + + / { + model = "LS1043A RDB Board"; ++ compatible = "fsl,ls1043a-rdb", "fsl,ls1043a"; + + aliases { + serial0 = &duart0; diff --git a/target/linux/layerscape/patches-5.4/701-net-0089-fsl-fman-backup-and-restore-ICID-registers.patch b/target/linux/layerscape/patches-5.4/701-net-0089-fsl-fman-backup-and-restore-ICID-registers.patch index 3b5acba46..a1ac7af5c 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0089-fsl-fman-backup-and-restore-ICID-registers.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0089-fsl-fman-backup-and-restore-ICID-registers.patch @@ -56,7 +56,7 @@ Acked-by: Madalin Bucur static void enable_rams_ecc(struct fman_fpm_regs __iomem *fpm_rg) { -@@ -1919,7 +1941,10 @@ _return: +@@ -1918,7 +1940,10 @@ _return: static int fman_init(struct fman *fman) { struct fman_cfg *cfg = NULL; @@ -68,7 +68,7 @@ Acked-by: Madalin Bucur if (is_init_done(fman->cfg)) return -EINVAL; -@@ -1939,6 +1964,7 @@ static int fman_init(struct fman *fman) +@@ -1938,6 +1963,7 @@ static int fman_init(struct fman *fman) memset_io((void __iomem *)(fman->base_addr + CGP_OFFSET), 0, fman->state->fm_port_num_of_cg); @@ -76,7 +76,7 @@ Acked-by: Madalin Bucur /* Save LIODN info before FMan reset * Skipping non-existent port 0 (i = 1) */ -@@ -1958,6 +1984,9 @@ static int fman_init(struct fman *fman) +@@ -1957,6 +1983,9 @@ static int fman_init(struct fman *fman) } fman->liodn_base[i] = liodn_base; } @@ -86,7 +86,7 @@ Acked-by: Madalin Bucur err = fman_reset(fman); if (err) -@@ -2186,8 +2215,12 @@ int fman_set_port_params(struct fman *fm +@@ -2185,8 +2214,12 @@ int fman_set_port_params(struct fman *fm if (err) goto return_err; diff --git a/target/linux/layerscape/patches-5.4/701-net-0231-enetc-Use-DT-protocol-information-to-set-up-the-port.patch b/target/linux/layerscape/patches-5.4/701-net-0231-enetc-Use-DT-protocol-information-to-set-up-the-port.patch index 54fc619dd..dcdd27920 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0231-enetc-Use-DT-protocol-information-to-set-up-the-port.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0231-enetc-Use-DT-protocol-information-to-set-up-the-port.patch @@ -156,15 +156,15 @@ Signed-off-by: Claudiu Manoil err = enetc_configure_serdes(priv); if (err) dev_warn(&pdev->dev, "Attempted serdes config but failed\n"); -@@ -937,7 +942,6 @@ static int enetc_pf_probe(struct pci_dev - return 0; +@@ -938,7 +943,6 @@ static int enetc_pf_probe(struct pci_dev err_reg_netdev: + enetc_mdio_remove(pf); - enetc_of_put_phy(priv); enetc_free_msix(priv); err_alloc_msix: enetc_free_si_resources(priv); -@@ -945,6 +949,7 @@ err_alloc_si_res: +@@ -946,6 +950,7 @@ err_alloc_si_res: si->ndev = NULL; free_netdev(ndev); err_alloc_netdev: @@ -172,7 +172,7 @@ Signed-off-by: Claudiu Manoil err_map_pf_space: enetc_pci_remove(pdev); -@@ -967,7 +972,7 @@ static void enetc_pf_remove(struct pci_d +@@ -968,7 +973,7 @@ static void enetc_pf_remove(struct pci_d unregister_netdev(si->ndev); enetc_mdio_remove(pf); diff --git a/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch b/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch index b754389f6..5f24a6069 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0234-enetc-WA-for-MDIO-register-access-issue.patch @@ -397,7 +397,7 @@ Signed-off-by: Alex Marginean #define enetc_mdio_rd(mdio_priv, off) \ --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c -@@ -986,6 +986,9 @@ static void enetc_pf_remove(struct pci_d +@@ -987,6 +987,9 @@ static void enetc_pf_remove(struct pci_d enetc_pci_remove(pdev); } diff --git a/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch b/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch index d5a18f6c2..ca79c4384 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0236-enetc-Replace-enetc_gregs-with-a-readers-writer-lock.patch @@ -371,7 +371,7 @@ Signed-off-by: Claudiu Manoil #define enetc_rd(hw, off) enetc_rd_reg((hw)->reg + (off)) --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c -@@ -986,8 +986,9 @@ static void enetc_pf_remove(struct pci_d +@@ -987,8 +987,9 @@ static void enetc_pf_remove(struct pci_d enetc_pci_remove(pdev); } diff --git a/target/linux/layerscape/patches-5.4/701-net-0237-enetc-Remove-mdio-bus-on-PF-probe-error-path.patch b/target/linux/layerscape/patches-5.4/701-net-0237-enetc-Remove-mdio-bus-on-PF-probe-error-path.patch index e3d36978d..87ca136a2 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0237-enetc-Remove-mdio-bus-on-PF-probe-error-path.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0237-enetc-Remove-mdio-bus-on-PF-probe-error-path.patch @@ -48,7 +48,7 @@ Signed-off-by: Claudiu Manoil --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c -@@ -952,6 +952,7 @@ err_alloc_si_res: +@@ -953,6 +953,7 @@ err_alloc_si_res: si->ndev = NULL; free_netdev(ndev); err_alloc_netdev: diff --git a/target/linux/layerscape/patches-5.4/701-net-0275-mii-Add-helpers-for-parsing-SGMII-auto-negotiation.patch b/target/linux/layerscape/patches-5.4/701-net-0275-mii-Add-helpers-for-parsing-SGMII-auto-negotiation.patch deleted file mode 100644 index c783143dd..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0275-mii-Add-helpers-for-parsing-SGMII-auto-negotiation.patch +++ /dev/null @@ -1,117 +0,0 @@ -From bc447c21304c1297f340d3daaf69915ebbc1f882 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 30 Sep 2019 19:20:26 +0300 -Subject: [PATCH] mii: Add helpers for parsing SGMII auto-negotiation - -Typically a MAC PCS auto-configures itself after it receives the -negotiated link settings from the PHY, but some MAC devices are more -special and need manual manipulation of the SGMII AN result. - -Therefore, add the bit definitions for the SGMII registers 4 and 5 -(local device ability, link partner ability), as well as a link_mode -conversion helper that can be used to feed the AN results into -phy_resolve_aneg_linkmode. - -Signed-off-by: Vladimir Oltean ---- - include/linux/mii.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ - include/uapi/linux/mii.h | 10 ++++++++++ - 2 files changed, 60 insertions(+) - ---- a/include/linux/mii.h -+++ b/include/linux/mii.h -@@ -373,6 +373,56 @@ static inline u32 mii_lpa_to_ethtool_lpa - } - - /** -+ * mii_lpa_mod_linkmode_adv_sgmii -+ * @lp_advertising: pointer to destination link mode. -+ * @lpa: value of the MII_LPA register -+ * -+ * A small helper function that translates MII_LPA bits to -+ * linkmode advertisement settings for SGMII. -+ * Leaves other bits unchanged. -+ */ -+static inline void -+mii_lpa_mod_linkmode_lpa_sgmii(unsigned long *lp_advertising, u32 lpa) -+{ -+ u32 speed_duplex = lpa & LPA_SGMII_DPX_SPD_MASK; -+ -+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, lp_advertising, -+ speed_duplex == LPA_SGMII_1000HALF); -+ -+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, lp_advertising, -+ speed_duplex == LPA_SGMII_1000FULL); -+ -+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, lp_advertising, -+ speed_duplex == LPA_SGMII_100HALF); -+ -+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, lp_advertising, -+ speed_duplex == LPA_SGMII_100FULL); -+ -+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, lp_advertising, -+ speed_duplex == LPA_SGMII_10HALF); -+ -+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, lp_advertising, -+ speed_duplex == LPA_SGMII_10FULL); -+} -+ -+/** -+ * mii_lpa_to_linkmode_adv_sgmii -+ * @advertising: pointer to destination link mode. -+ * @lpa: value of the MII_LPA register -+ * -+ * A small helper function that translates MII_ADVERTISE bits -+ * to linkmode advertisement settings when in SGMII mode. -+ * Clears the old value of advertising. -+ */ -+static inline void mii_lpa_to_linkmode_lpa_sgmii(unsigned long *lp_advertising, -+ u32 lpa) -+{ -+ linkmode_zero(lp_advertising); -+ -+ mii_lpa_mod_linkmode_lpa_sgmii(lp_advertising, lpa); -+} -+ -+/** - * mii_adv_mod_linkmode_adv_t - * @advertising:pointer to destination link mode. - * @adv: value of the MII_ADVERTISE register ---- a/include/uapi/linux/mii.h -+++ b/include/uapi/linux/mii.h -@@ -71,6 +71,7 @@ - /* Advertisement control register. */ - #define ADVERTISE_SLCT 0x001f /* Selector bits */ - #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ -+#define ADVERTISE_SGMII 0x0001 /* Can do SGMII */ - #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ - #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ - #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ -@@ -94,6 +95,7 @@ - - /* Link partner ability register. */ - #define LPA_SLCT 0x001f /* Same as advertise selector */ -+#define LPA_SGMII 0x0001 /* Can do SGMII */ - #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ - #define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ - #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ -@@ -104,11 +106,19 @@ - #define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ - #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ - #define LPA_PAUSE_CAP 0x0400 /* Can pause */ -+#define LPA_SGMII_DPX_SPD_MASK 0x1C00 /* SGMII duplex and speed bits */ -+#define LPA_SGMII_10HALF 0x0000 /* Can do SGMII 10mbps half-duplex */ -+#define LPA_SGMII_10FULL 0x1000 /* Can do SGMII 10mbps full-duplex */ -+#define LPA_SGMII_100HALF 0x0400 /* Can do SGMII 100mbps half-duplex */ -+#define LPA_SGMII_100FULL 0x1400 /* Can do SGMII 100mbps full-duplex */ - #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ -+#define LPA_SGMII_1000HALF 0x0800 /* Can do SGMII 1000mbps half-duplex */ -+#define LPA_SGMII_1000FULL 0x1800 /* Can do SGMII 1000mbps full-duplex */ - #define LPA_RESV 0x1000 /* Unused... */ - #define LPA_RFAULT 0x2000 /* Link partner faulted */ - #define LPA_LPACK 0x4000 /* Link partner acked us */ - #define LPA_NPAGE 0x8000 /* Next page bit */ -+#define LPA_SGMII_LINK 0x8000 /* Link partner has link */ - - #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) - #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) diff --git a/target/linux/layerscape/patches-5.4/701-net-0276-net-phylink-make-QSGMII-a-valid-PHY-mode-for-in-band.patch b/target/linux/layerscape/patches-5.4/701-net-0276-net-phylink-make-QSGMII-a-valid-PHY-mode-for-in-band.patch deleted file mode 100644 index d04ed9113..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0276-net-phylink-make-QSGMII-a-valid-PHY-mode-for-in-band.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 4446e9789e662fe53dfcfe34551b5b74a013086c Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Fri, 22 Nov 2019 13:46:46 +0200 -Subject: [PATCH] net: phylink: make QSGMII a valid PHY mode for in-band AN - -QSGMII is just SGMII clocked at a higher frequency (5 Gbaud vs 1.25 -Gbaud). Logically it is just 4 SGMII interfaces multiplexed onto the -same physical lanes. Each MAC PCS has its own in-band AN process with -the system side of the QSGMII PHY, which is identical to the regular -SGMII AN process. So allow QSGMII as a valid in-band AN mode. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/phy/phylink.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/phy/phylink.c -+++ b/drivers/net/phy/phylink.c -@@ -283,6 +283,7 @@ static int phylink_parse_mode(struct phy - - switch (pl->link_config.interface) { - case PHY_INTERFACE_MODE_SGMII: -+ case PHY_INTERFACE_MODE_QSGMII: - phylink_set(pl->supported, 10baseT_Half); - phylink_set(pl->supported, 10baseT_Full); - phylink_set(pl->supported, 100baseT_Half); diff --git a/target/linux/layerscape/patches-5.4/701-net-0277-net-phylink-call-mac_an_restart-for-SGMII-QSGMII-inb.patch b/target/linux/layerscape/patches-5.4/701-net-0277-net-phylink-call-mac_an_restart-for-SGMII-QSGMII-inb.patch deleted file mode 100644 index 487a520f3..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0277-net-phylink-call-mac_an_restart-for-SGMII-QSGMII-inb.patch +++ /dev/null @@ -1,29 +0,0 @@ -From d526228a8159d136c914c8f71d5944cda2f93d9a Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Thu, 28 Nov 2019 03:21:53 +0200 -Subject: [PATCH] net: phylink: call mac_an_restart for SGMII/QSGMII inband - interfaces too - -It doesn't quite make sense why restarting the AN process should be -unique to 802.3z (1000Base-X) modes. It is valid to put an SGMII PCS in -in-band AN mode, therefore also make PHYLINK re-trigger an -auto-negotiation if needed. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/phy/phylink.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/drivers/net/phy/phylink.c -+++ b/drivers/net/phy/phylink.c -@@ -360,7 +360,9 @@ static void phylink_mac_config_up(struct - static void phylink_mac_an_restart(struct phylink *pl) - { - if (pl->link_config.an_enabled && -- phy_interface_mode_is_8023z(pl->link_config.interface)) -+ (phy_interface_mode_is_8023z(pl->link_config.interface) || -+ pl->link_config.interface == PHY_INTERFACE_MODE_SGMII || -+ pl->link_config.interface == PHY_INTERFACE_MODE_QSGMII)) - pl->ops->mac_an_restart(pl->config); - } - diff --git a/target/linux/layerscape/patches-5.4/701-net-0278-enetc-export-enetc_mdio-definitionns-to-include-linu.patch b/target/linux/layerscape/patches-5.4/701-net-0278-enetc-export-enetc_mdio-definitionns-to-include-linu.patch deleted file mode 100644 index b558a78ce..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0278-enetc-export-enetc_mdio-definitionns-to-include-linu.patch +++ /dev/null @@ -1,192 +0,0 @@ -From 210fde07cd9e3f2dc826f538ccec4e90b54eb7e5 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Fri, 22 Nov 2019 17:47:56 +0200 -Subject: [PATCH] enetc: export enetc_mdio definitionns to include/linux/fsl - -The Felix DSA switch has an internal MDIO bus that has the same register -map as the ENETC one, so the accessors can be reused. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 18 +++++++++- - drivers/net/ethernet/freescale/enetc/enetc_mdio.h | 12 ------- - .../net/ethernet/freescale/enetc/enetc_pci_mdio.c | 41 +++++++++++++--------- - include/linux/fsl/enetc_mdio.h | 21 +++++++++++ - 4 files changed, 62 insertions(+), 30 deletions(-) - delete mode 100644 drivers/net/ethernet/freescale/enetc/enetc_mdio.h - create mode 100644 include/linux/fsl/enetc_mdio.h - ---- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -@@ -1,13 +1,13 @@ - // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) - /* Copyright 2019 NXP */ - -+#include - #include - #include - #include - #include - - #include "enetc_pf.h" --#include "enetc_mdio.h" - - #define ENETC_MDIO_CFG 0x0 /* MDIO configuration and status */ - #define ENETC_MDIO_CTL 0x4 /* MDIO control */ -@@ -99,6 +99,7 @@ int enetc_mdio_write(struct mii_bus *bus - - return 0; - } -+EXPORT_SYMBOL_GPL(enetc_mdio_write); - - int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum) - { -@@ -154,6 +155,21 @@ int enetc_mdio_read(struct mii_bus *bus, - - return value; - } -+EXPORT_SYMBOL_GPL(enetc_mdio_read); -+ -+struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs) -+{ -+ struct enetc_hw *hw; -+ -+ hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL); -+ if (!hw) -+ return ERR_PTR(-ENOMEM); -+ -+ hw->port = port_regs; -+ -+ return hw; -+} -+EXPORT_SYMBOL_GPL(enetc_hw_alloc); - - int enetc_mdio_probe(struct enetc_pf *pf) - { ---- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.h -+++ /dev/null -@@ -1,12 +0,0 @@ --/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ --/* Copyright 2019 NXP */ -- --#include -- --struct enetc_mdio_priv { -- struct enetc_hw *hw; -- int mdio_base; --}; -- --int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value); --int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum); ---- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c -+++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c -@@ -1,8 +1,8 @@ - // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) - /* Copyright 2019 NXP */ -+#include - #include - #include "enetc_pf.h" --#include "enetc_mdio.h" - - #define ENETC_MDIO_DEV_ID 0xee01 - #define ENETC_MDIO_DEV_NAME "FSL PCIe IE Central MDIO" -@@ -14,17 +14,29 @@ static int enetc_pci_mdio_probe(struct p - { - struct enetc_mdio_priv *mdio_priv; - struct device *dev = &pdev->dev; -+ void __iomem *port_regs; - struct enetc_hw *hw; - struct mii_bus *bus; - int err; - -- hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL); -- if (!hw) -- return -ENOMEM; -+ port_regs = pci_iomap(pdev, 0, 0); -+ if (!port_regs) { -+ dev_err(dev, "iomap failed\n"); -+ err = -ENXIO; -+ goto err_ioremap; -+ } -+ -+ hw = enetc_hw_alloc(dev, port_regs); -+ if (IS_ERR(enetc_hw_alloc)) { -+ err = PTR_ERR(hw); -+ goto err_hw_alloc; -+ } - - bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); -- if (!bus) -- return -ENOMEM; -+ if (!bus) { -+ err = -ENOMEM; -+ goto err_mdiobus_alloc; -+ } - - bus->name = ENETC_MDIO_BUS_NAME; - bus->read = enetc_mdio_read; -@@ -39,7 +51,7 @@ static int enetc_pci_mdio_probe(struct p - err = pci_enable_device_mem(pdev); - if (err) { - dev_err(dev, "device enable failed\n"); -- return err; -+ goto err_pci_enable; - } - - err = pci_request_region(pdev, 0, KBUILD_MODNAME); -@@ -48,13 +60,6 @@ static int enetc_pci_mdio_probe(struct p - goto err_pci_mem_reg; - } - -- hw->port = pci_iomap(pdev, 0, 0); -- if (!hw->port) { -- err = -ENXIO; -- dev_err(dev, "iomap failed\n"); -- goto err_ioremap; -- } -- - err = of_mdiobus_register(bus, dev->of_node); - if (err) - goto err_mdiobus_reg; -@@ -64,12 +69,14 @@ static int enetc_pci_mdio_probe(struct p - return 0; - - err_mdiobus_reg: -- iounmap(mdio_priv->hw->port); --err_ioremap: - pci_release_mem_regions(pdev); - err_pci_mem_reg: - pci_disable_device(pdev); -- -+err_pci_enable: -+err_mdiobus_alloc: -+ iounmap(port_regs); -+err_hw_alloc: -+err_ioremap: - return err; - } - ---- /dev/null -+++ b/include/linux/fsl/enetc_mdio.h -@@ -0,0 +1,21 @@ -+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ -+/* Copyright 2019 NXP */ -+ -+#include -+ -+/* PCS registers */ -+#define ENETC_PCS_LINK_TIMER1 0x12 -+#define ENETC_PCS_LINK_TIMER1_VAL 0x06a0 -+#define ENETC_PCS_LINK_TIMER2 0x13 -+#define ENETC_PCS_LINK_TIMER2_VAL 0x0003 -+#define ENETC_PCS_IF_MODE 0x14 -+#define ENETC_PCS_IF_MODE_SGMII_AN 0x0003 -+ -+struct enetc_mdio_priv { -+ struct enetc_hw *hw; -+ int mdio_base; -+}; -+ -+int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value); -+int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum); -+struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs); diff --git a/target/linux/layerscape/patches-5.4/701-net-0279-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-value-of-.patch b/target/linux/layerscape/patches-5.4/701-net-0279-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-value-of-.patch deleted file mode 100644 index 02ead2712..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0279-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-value-of-.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 5961ca6738507031a64f8580ceb8ab0b630d47a5 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Wed, 27 Nov 2019 19:21:13 +0200 -Subject: [PATCH] enetc: Set MDIO_CFG_HOLD to the recommended value of 2 - -This increases the MDIO hold time to 5 enet_clk cycles from the previous -value of 0. This is actually the out-of-reset value, that the driver was -previously overwriting with 0. Zero worked for the external MDIO, but -breaks communication with the internal MDIO buses on which the PCS of -ENETC SI's and Felix switch are found. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - ---- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -@@ -31,15 +31,19 @@ static inline void _enetc_mdio_wr(struct - _enetc_mdio_wr(mdio_priv, ENETC_##off, val) - #define enetc_mdio_rd_reg(off) enetc_mdio_rd(mdio_priv, off) - --#define ENETC_MDC_DIV 258 -- - #define MDIO_CFG_CLKDIV(x) ((((x) >> 1) & 0xff) << 8) - #define MDIO_CFG_BSY BIT(0) - #define MDIO_CFG_RD_ER BIT(1) -+#define MDIO_CFG_HOLD(x) (((x) << 2) & GENMASK(4, 2)) - #define MDIO_CFG_ENC45 BIT(6) - /* external MDIO only - driven on neg MDC edge */ - #define MDIO_CFG_NEG BIT(23) - -+#define ENETC_EMDIO_CFG \ -+ (MDIO_CFG_HOLD(2) | \ -+ MDIO_CFG_CLKDIV(258) | \ -+ MDIO_CFG_NEG) -+ - #define MDIO_CTL_DEV_ADDR(x) ((x) & 0x1f) - #define MDIO_CTL_PORT_ADDR(x) (((x) & 0x1f) << 5) - #define MDIO_CTL_READ BIT(15) -@@ -61,7 +65,7 @@ int enetc_mdio_write(struct mii_bus *bus - u16 dev_addr; - int ret; - -- mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG; -+ mdio_cfg = ENETC_EMDIO_CFG; - if (regnum & MII_ADDR_C45) { - dev_addr = (regnum >> 16) & 0x1f; - mdio_cfg |= MDIO_CFG_ENC45; -@@ -108,7 +112,7 @@ int enetc_mdio_read(struct mii_bus *bus, - u16 dev_addr, value; - int ret; - -- mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG; -+ mdio_cfg = ENETC_EMDIO_CFG; - if (regnum & MII_ADDR_C45) { - dev_addr = (regnum >> 16) & 0x1f; - mdio_cfg |= MDIO_CFG_ENC45; diff --git a/target/linux/layerscape/patches-5.4/701-net-0280-net-mscc-ocelot-do-not-force-Felix-MACs-at-lower-spe.patch b/target/linux/layerscape/patches-5.4/701-net-0280-net-mscc-ocelot-do-not-force-Felix-MACs-at-lower-spe.patch deleted file mode 100644 index a31321fd1..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0280-net-mscc-ocelot-do-not-force-Felix-MACs-at-lower-spe.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 4ba6e00c2f45bf4189ec6a8ef71b45346ae804f2 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Thu, 28 Nov 2019 15:36:10 +0200 -Subject: [PATCH] net: mscc: ocelot: do not force Felix MACs at lower speeds - than gigabit - -In the LS1028A, the VSC9959 switch was integrated with an NXP PCS which -performs SGMII AN and rate adaptation autonomously. The MAC does not -need to know about this, and forcing the MAC speed to something else, -when connected to a 10/100 link partner, actually breaks the GMII -internal link between the MAC and the PCS. - -Add a quirk system in the ocelot driver, and a first quirk called "PCS -performs rate adaptation", to distinguish the VSC7514 from the VSC9959 -regarding this behavior. - -Signed-off-by: Catalin Horghidan -Signed-off-by: Vladimir Oltean ---- - drivers/net/dsa/ocelot/felix.c | 1 + - drivers/net/dsa/ocelot/felix.h | 1 + - drivers/net/dsa/ocelot/felix_vsc9959.c | 1 + - drivers/net/ethernet/mscc/ocelot.c | 32 ++++++++++++++++++-------------- - include/soc/mscc/ocelot.h | 7 +++++++ - 5 files changed, 28 insertions(+), 14 deletions(-) - ---- a/drivers/net/dsa/ocelot/felix.c -+++ b/drivers/net/dsa/ocelot/felix.c -@@ -249,6 +249,7 @@ static int felix_init_structs(struct fel - ocelot->num_stats = felix->info->num_stats; - ocelot->shared_queue_sz = felix->info->shared_queue_sz; - ocelot->ops = felix->info->ops; -+ ocelot->quirks = felix->info->quirks; - - base = pci_resource_start(felix->pdev, felix->info->pci_bar); - ---- a/drivers/net/dsa/ocelot/felix.h -+++ b/drivers/net/dsa/ocelot/felix.h -@@ -18,6 +18,7 @@ struct felix_info { - unsigned int num_stats; - int num_ports; - int pci_bar; -+ unsigned long quirks; - }; - - extern struct felix_info felix_info_vsc9959; ---- a/drivers/net/dsa/ocelot/felix_vsc9959.c -+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c -@@ -584,4 +584,5 @@ struct felix_info felix_info_vsc9959 = { - .shared_queue_sz = 128 * 1024, - .num_ports = 6, - .pci_bar = 4, -+ .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION, - }; ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -409,27 +409,32 @@ static u16 ocelot_wm_enc(u16 value) - void ocelot_adjust_link(struct ocelot *ocelot, int port, - struct phy_device *phydev) - { -+ int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA; - struct ocelot_port *ocelot_port = ocelot->ports[port]; -- int speed, mode = 0; - -- switch (phydev->speed) { -+ if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION) -+ speed = SPEED_1000; -+ else -+ speed = phydev->speed; -+ -+ switch (speed) { - case SPEED_10: -- speed = OCELOT_SPEED_10; -+ mac_speed = OCELOT_SPEED_10; - break; - case SPEED_100: -- speed = OCELOT_SPEED_100; -+ mac_speed = OCELOT_SPEED_100; - break; - case SPEED_1000: -- speed = OCELOT_SPEED_1000; -- mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA; -+ mac_speed = OCELOT_SPEED_1000; -+ mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA; - break; - case SPEED_2500: -- speed = OCELOT_SPEED_2500; -- mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA; -+ mac_speed = OCELOT_SPEED_2500; -+ mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA; - break; - default: - dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n", -- port, phydev->speed); -+ port, speed); - return; - } - -@@ -439,8 +444,7 @@ void ocelot_adjust_link(struct ocelot *o - return; - - /* Only full duplex supported for now */ -- ocelot_port_writel(ocelot_port, DEV_MAC_MODE_CFG_FDX_ENA | -- mode, DEV_MAC_MODE_CFG); -+ ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG); - - if (ocelot->ops->pcs_init) - ocelot->ops->pcs_init(ocelot, port); -@@ -451,11 +455,11 @@ void ocelot_adjust_link(struct ocelot *o - - /* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of - * reset */ -- ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed), -+ ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(mac_speed), - DEV_CLOCK_CFG); - - /* No PFC */ -- ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(speed), -+ ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(mac_speed), - ANA_PFC_PFC_CFG, port); - - /* Core: Enable port for frame transfer */ -@@ -469,7 +473,7 @@ void ocelot_adjust_link(struct ocelot *o - SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA | - SYS_MAC_FC_CFG_ZERO_PAUSE_ENA | - SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) | -- SYS_MAC_FC_CFG_FC_LINK_SPEED(speed), -+ SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed), - SYS_MAC_FC_CFG, port); - ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port); - } ---- a/include/soc/mscc/ocelot.h -+++ b/include/soc/mscc/ocelot.h -@@ -404,6 +404,11 @@ enum ocelot_tag_prefix { - OCELOT_TAG_PREFIX_LONG, - }; - -+/* Hardware quirks (differences between switch instantiations) */ -+enum { -+ OCELOT_PCS_PERFORMS_RATE_ADAPTATION = BIT(0), -+}; -+ - struct ocelot; - - struct ocelot_ops { -@@ -464,6 +469,8 @@ struct ocelot { - struct delayed_work stats_work; - struct workqueue_struct *stats_queue; - -+ unsigned long quirks; -+ - u8 ptp:1; - struct ptp_clock *ptp_clock; - struct ptp_clock_info ptp_info; diff --git a/target/linux/layerscape/patches-5.4/701-net-0281-net-mscc-ocelot-convert-to-PHYLINK.patch b/target/linux/layerscape/patches-5.4/701-net-0281-net-mscc-ocelot-convert-to-PHYLINK.patch deleted file mode 100644 index fcf28b866..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0281-net-mscc-ocelot-convert-to-PHYLINK.patch +++ /dev/null @@ -1,689 +0,0 @@ -From 0a2b7489bf60d24a54e16147b416f339ebe4f511 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 18 Nov 2019 18:05:01 +0200 -Subject: [PATCH] net: mscc: ocelot: convert to PHYLINK - -This patch reworks ocelot_board.c (aka the MIPS on the VSC7514) to -register a PHYLINK instance for each port. The registration code is -local to the VSC7514, but the PHYLINK callback implementation is common -so that the Felix DSA front-end can use it as well (but DSA does its own -registration). - -Now Felix can use native PHYLINK callbacks instead of the PHYLIB -adaptation layer in DSA, which had issues supporting fixed-link slave -ports (no struct phy_device to pass to the adjust_link callback), as -well as fixed-link CPU port at 2.5Gbps. - -The old code from ocelot_port_enable and ocelot_port_disable has been -moved into ocelot_phylink_mac_link_up and ocelot_phylink_mac_link_down. - -The PHY connect operation has been moved from ocelot_port_open to -mscc_ocelot_probe in ocelot_board.c. - -The phy_set_mode_ext() call for the SerDes PHY has also been moved into -mscc_ocelot_probe from ocelot_port_open, and since that was the only -reason why a reference to it was kept in ocelot_port_private, that -reference was removed. - -Again, the usage of phy_interface_t phy_mode is now local to -mscc_ocelot_probe only, after moving the PHY connect operation. -So it was also removed from ocelot_port_private. -*Maybe* in the future, it can be added back to the common struct -ocelot_port, with the purpose of validating mismatches between -state->phy_interface and ocelot_port->phy_mode in PHYLINK callbacks. -But at the moment that is not critical, since other DSA drivers are not -doing that either. No SFP+ modules are in use with Felix/Ocelot yet, to -my knowledge. - -In-band AN is not yet supported, due to the fact that this is a mostly -mechanical patch for the moment. The mac_an_restart PHYLINK operation -needs to be implemented, as well as mac_link_state. Both are SerDes -specific, and Felix does not have its PCS configured yet (it works just -by virtue of U-Boot initialization at the moment). - -Signed-off-by: Vladimir Oltean ---- - drivers/net/dsa/ocelot/felix.c | 65 +++++++++---- - drivers/net/ethernet/mscc/Kconfig | 2 +- - drivers/net/ethernet/mscc/ocelot.c | 150 ++++++++++++++++-------------- - drivers/net/ethernet/mscc/ocelot.h | 13 +-- - drivers/net/ethernet/mscc/ocelot_board.c | 154 +++++++++++++++++++++++++++---- - include/soc/mscc/ocelot.h | 22 ++++- - 6 files changed, 289 insertions(+), 117 deletions(-) - ---- a/drivers/net/dsa/ocelot/felix.c -+++ b/drivers/net/dsa/ocelot/felix.c -@@ -58,14 +58,6 @@ static int felix_set_ageing_time(struct - return 0; - } - --static void felix_adjust_link(struct dsa_switch *ds, int port, -- struct phy_device *phydev) --{ -- struct ocelot *ocelot = ds->priv; -- -- ocelot_adjust_link(ocelot, port, phydev); --} -- - static int felix_fdb_dump(struct dsa_switch *ds, int port, - dsa_fdb_dump_cb_t *cb, void *data) - { -@@ -185,21 +177,59 @@ static int felix_tsn_enable(struct dsa_p - } - #endif - --static int felix_port_enable(struct dsa_switch *ds, int port, -- struct phy_device *phy) -+static void felix_phylink_validate(struct dsa_switch *ds, int port, -+ unsigned long *supported, -+ struct phylink_link_state *state) - { - struct ocelot *ocelot = ds->priv; - -- ocelot_port_enable(ocelot, port, phy); -+ ocelot_phylink_validate(ocelot, port, supported, state); -+} -+ -+static int felix_phylink_mac_pcs_get_state(struct dsa_switch *ds, int port, -+ struct phylink_link_state *state) -+{ -+ struct ocelot *ocelot = ds->priv; -+ -+ ocelot_phylink_mac_pcs_get_state(ocelot, port, state); - - return 0; - } - --static void felix_port_disable(struct dsa_switch *ds, int port) -+static void felix_phylink_mac_config(struct dsa_switch *ds, int port, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) -+{ -+ struct ocelot *ocelot = ds->priv; -+ -+ ocelot_phylink_mac_config(ocelot, port, link_an_mode, state); -+} -+ -+static void felix_phylink_mac_an_restart(struct dsa_switch *ds, int port) -+{ -+ struct ocelot *ocelot = ds->priv; -+ -+ ocelot_phylink_mac_an_restart(ocelot, port); -+} -+ -+static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port, -+ unsigned int link_an_mode, -+ phy_interface_t interface) -+{ -+ struct ocelot *ocelot = ds->priv; -+ -+ ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface); -+} -+ -+static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, -+ unsigned int link_an_mode, -+ phy_interface_t interface, -+ struct phy_device *phydev) - { - struct ocelot *ocelot = ds->priv; - -- return ocelot_port_disable(ocelot, port); -+ ocelot_phylink_mac_link_up(ocelot, port, link_an_mode, interface, -+ phydev); - } - - static void felix_get_strings(struct dsa_switch *ds, int port, -@@ -417,9 +447,12 @@ static const struct dsa_switch_ops felix - .get_ethtool_stats = felix_get_ethtool_stats, - .get_sset_count = felix_get_sset_count, - .get_ts_info = felix_get_ts_info, -- .adjust_link = felix_adjust_link, -- .port_enable = felix_port_enable, -- .port_disable = felix_port_disable, -+ .phylink_validate = felix_phylink_validate, -+ .phylink_mac_link_state = felix_phylink_mac_pcs_get_state, -+ .phylink_mac_config = felix_phylink_mac_config, -+ .phylink_mac_an_restart = felix_phylink_mac_an_restart, -+ .phylink_mac_link_down = felix_phylink_mac_link_down, -+ .phylink_mac_link_up = felix_phylink_mac_link_up, - .port_fdb_dump = felix_fdb_dump, - .port_fdb_add = felix_fdb_add, - .port_fdb_del = felix_fdb_del, ---- a/drivers/net/ethernet/mscc/Kconfig -+++ b/drivers/net/ethernet/mscc/Kconfig -@@ -15,7 +15,7 @@ config MSCC_OCELOT_SWITCH - tristate "Ocelot switch driver" - depends on NET_SWITCHDEV - depends on HAS_IOMEM -- select PHYLIB -+ select PHYLINK - select REGMAP_MMIO - help - This driver supports the Ocelot network switch device. ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -13,7 +13,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -406,18 +406,66 @@ static u16 ocelot_wm_enc(u16 value) - return value; - } - --void ocelot_adjust_link(struct ocelot *ocelot, int port, -- struct phy_device *phydev) -+void ocelot_phylink_validate(struct ocelot *ocelot, int port, -+ unsigned long *supported, -+ struct phylink_link_state *state) -+{ -+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -+ -+ if (state->interface != PHY_INTERFACE_MODE_NA && -+ state->interface != PHY_INTERFACE_MODE_GMII && -+ state->interface != PHY_INTERFACE_MODE_SGMII && -+ state->interface != PHY_INTERFACE_MODE_QSGMII) { -+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -+ return; -+ } -+ -+ /* No half-duplex. */ -+ phylink_set_port_modes(mask); -+ phylink_set(mask, Autoneg); -+ phylink_set(mask, Pause); -+ phylink_set(mask, Asym_Pause); -+ phylink_set(mask, 10baseT_Full); -+ phylink_set(mask, 100baseT_Full); -+ phylink_set(mask, 1000baseT_Full); -+ phylink_set(mask, 2500baseT_Full); -+ -+ bitmap_and(supported, supported, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+ bitmap_and(state->advertising, state->advertising, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+} -+EXPORT_SYMBOL(ocelot_phylink_validate); -+ -+void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, -+ struct phylink_link_state *state) -+{ -+ state->link = 1; -+} -+EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state); -+ -+void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port) -+{ -+ /* Not supported */ -+} -+EXPORT_SYMBOL(ocelot_phylink_mac_an_restart); -+ -+void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) - { - int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA; - struct ocelot_port *ocelot_port = ocelot->ports[port]; -+ u32 mac_fc_cfg; - - if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION) - speed = SPEED_1000; - else -- speed = phydev->speed; -+ speed = state->speed; - - switch (speed) { -+ case SPEED_UNKNOWN: -+ return; - case SPEED_10: - mac_speed = OCELOT_SPEED_10; - break; -@@ -433,16 +481,11 @@ void ocelot_adjust_link(struct ocelot *o - mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA; - break; - default: -- dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n", -+ dev_err(ocelot->dev, "Unsupported speed on port %d: %d\n", - port, speed); - return; - } - -- phy_print_status(phydev); -- -- if (!phydev->link) -- return; -- - /* Only full duplex supported for now */ - ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG); - -@@ -469,27 +512,36 @@ void ocelot_adjust_link(struct ocelot *o - QSYS_SWITCH_PORT_MODE, port); - - /* Flow control */ -- ocelot_write_rix(ocelot, SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) | -- SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA | -- SYS_MAC_FC_CFG_ZERO_PAUSE_ENA | -- SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) | -- SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed), -- SYS_MAC_FC_CFG, port); -+ mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed); -+ if (state->pause & MLO_PAUSE_RX) -+ mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA; -+ if (state->pause & MLO_PAUSE_TX) -+ mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA | -+ SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) | -+ SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) | -+ SYS_MAC_FC_CFG_ZERO_PAUSE_ENA; -+ ocelot_write_rix(ocelot, mac_fc_cfg, SYS_MAC_FC_CFG, port); -+ - ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port); - } --EXPORT_SYMBOL(ocelot_adjust_link); -+EXPORT_SYMBOL(ocelot_phylink_mac_config); - --static void ocelot_port_adjust_link(struct net_device *dev) -+void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ phy_interface_t interface) - { -- struct ocelot_port_private *priv = netdev_priv(dev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -+ struct ocelot_port *ocelot_port = ocelot->ports[port]; - -- ocelot_adjust_link(ocelot, port, dev->phydev); -+ ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG); -+ ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA, -+ QSYS_SWITCH_PORT_MODE, port); - } -+EXPORT_SYMBOL(ocelot_phylink_mac_link_down); - --void ocelot_port_enable(struct ocelot *ocelot, int port, -- struct phy_device *phy) -+void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ phy_interface_t interface, -+ struct phy_device *phy) - { - /* Enable receiving frames on the port, and activate auto-learning of - * MAC addresses. -@@ -499,62 +551,22 @@ void ocelot_port_enable(struct ocelot *o - ANA_PORT_PORT_CFG_PORTID_VAL(port), - ANA_PORT_PORT_CFG, port); - } --EXPORT_SYMBOL(ocelot_port_enable); -+EXPORT_SYMBOL(ocelot_phylink_mac_link_up); - - static int ocelot_port_open(struct net_device *dev) - { - struct ocelot_port_private *priv = netdev_priv(dev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- int err; -- -- if (priv->serdes) { -- err = phy_set_mode_ext(priv->serdes, PHY_MODE_ETHERNET, -- priv->phy_mode); -- if (err) { -- netdev_err(dev, "Could not set mode of SerDes\n"); -- return err; -- } -- } -- -- err = phy_connect_direct(dev, priv->phy, &ocelot_port_adjust_link, -- priv->phy_mode); -- if (err) { -- netdev_err(dev, "Could not attach to PHY\n"); -- return err; -- } - -- dev->phydev = priv->phy; -- -- phy_attached_info(priv->phy); -- phy_start(priv->phy); -- -- ocelot_port_enable(ocelot, port, priv->phy); -+ phylink_start(priv->phylink); - - return 0; - } - --void ocelot_port_disable(struct ocelot *ocelot, int port) --{ -- struct ocelot_port *ocelot_port = ocelot->ports[port]; -- -- ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG); -- ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA, -- QSYS_SWITCH_PORT_MODE, port); --} --EXPORT_SYMBOL(ocelot_port_disable); -- - static int ocelot_port_stop(struct net_device *dev) - { - struct ocelot_port_private *priv = netdev_priv(dev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- phy_disconnect(priv->phy); -- -- dev->phydev = NULL; - -- ocelot_port_disable(ocelot, port); -+ phylink_stop(priv->phylink); - - return 0; - } -@@ -2251,8 +2263,7 @@ void ocelot_init_port(struct ocelot *oce - EXPORT_SYMBOL(ocelot_init_port); - - int ocelot_probe_port(struct ocelot *ocelot, u8 port, -- void __iomem *regs, -- struct phy_device *phy) -+ void __iomem *regs) - { - struct ocelot_port_private *priv; - struct ocelot_port *ocelot_port; -@@ -2265,7 +2276,6 @@ int ocelot_probe_port(struct ocelot *oce - SET_NETDEV_DEV(dev, ocelot->dev); - priv = netdev_priv(dev); - priv->dev = dev; -- priv->phy = phy; - priv->chip_port = port; - ocelot_port = &priv->port; - ocelot_port->ocelot = ocelot; ---- a/drivers/net/ethernet/mscc/ocelot.h -+++ b/drivers/net/ethernet/mscc/ocelot.h -@@ -12,8 +12,7 @@ - #include - #include - #include --#include --#include -+#include - #include - #include - #include -@@ -65,14 +64,12 @@ struct ocelot_multicast { - struct ocelot_port_private { - struct ocelot_port port; - struct net_device *dev; -- struct phy_device *phy; -+ struct phylink *phylink; -+ struct phylink_config phylink_config; - u8 chip_port; - - u8 vlan_aware; - -- phy_interface_t phy_mode; -- struct phy *serdes; -- - struct ocelot_port_tc tc; - }; - -@@ -83,9 +80,7 @@ void ocelot_port_writel(struct ocelot_po - #define ocelot_field_read(ocelot, reg, val) regmap_field_read((ocelot)->regfields[(reg)], (val)) - - int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops); --int ocelot_probe_port(struct ocelot *ocelot, u8 port, -- void __iomem *regs, -- struct phy_device *phy); -+int ocelot_probe_port(struct ocelot *ocelot, u8 port, void __iomem *regs); - - void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu, - enum ocelot_tag_prefix injection, ---- a/drivers/net/ethernet/mscc/ocelot_board.c -+++ b/drivers/net/ethernet/mscc/ocelot_board.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include "ocelot.h" - -@@ -262,6 +263,91 @@ static const struct ocelot_ops ocelot_op - .reset = ocelot_reset, - }; - -+static void ocelot_port_phylink_validate(struct phylink_config *config, -+ unsigned long *supported, -+ struct phylink_link_state *state) -+{ -+ struct net_device *ndev = to_net_dev(config->dev); -+ struct ocelot_port_private *priv = netdev_priv(ndev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ ocelot_phylink_validate(ocelot, port, supported, state); -+} -+ -+static int -+ocelot_port_phylink_mac_pcs_get_state(struct phylink_config *config, -+ struct phylink_link_state *state) -+{ -+ struct net_device *ndev = to_net_dev(config->dev); -+ struct ocelot_port_private *priv = netdev_priv(ndev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ ocelot_phylink_mac_pcs_get_state(ocelot, port, state); -+ -+ return 0; -+} -+ -+static void ocelot_port_phylink_mac_an_restart(struct phylink_config *config) -+{ -+ struct net_device *ndev = to_net_dev(config->dev); -+ struct ocelot_port_private *priv = netdev_priv(ndev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ ocelot_phylink_mac_an_restart(ocelot, port); -+} -+ -+static void -+ocelot_port_phylink_mac_config(struct phylink_config *config, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) -+{ -+ struct net_device *ndev = to_net_dev(config->dev); -+ struct ocelot_port_private *priv = netdev_priv(ndev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ ocelot_phylink_mac_config(ocelot, port, link_an_mode, state); -+} -+ -+static void ocelot_port_phylink_mac_link_down(struct phylink_config *config, -+ unsigned int link_an_mode, -+ phy_interface_t interface) -+{ -+ struct net_device *ndev = to_net_dev(config->dev); -+ struct ocelot_port_private *priv = netdev_priv(ndev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ return ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, -+ interface); -+} -+ -+static void ocelot_port_phylink_mac_link_up(struct phylink_config *config, -+ unsigned int link_an_mode, -+ phy_interface_t interface, -+ struct phy_device *phy) -+{ -+ struct net_device *ndev = to_net_dev(config->dev); -+ struct ocelot_port_private *priv = netdev_priv(ndev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ return ocelot_phylink_mac_link_up(ocelot, port, link_an_mode, -+ interface, phy); -+} -+ -+static const struct phylink_mac_ops ocelot_phylink_ops = { -+ .validate = ocelot_port_phylink_validate, -+ .mac_link_state = ocelot_port_phylink_mac_pcs_get_state, -+ .mac_an_restart = ocelot_port_phylink_mac_an_restart, -+ .mac_config = ocelot_port_phylink_mac_config, -+ .mac_link_down = ocelot_port_phylink_mac_link_down, -+ .mac_link_up = ocelot_port_phylink_mac_link_up, -+}; -+ - static int mscc_ocelot_probe(struct platform_device *pdev) - { - struct device_node *np = pdev->dev.of_node; -@@ -369,8 +455,6 @@ static int mscc_ocelot_probe(struct plat - for_each_available_child_of_node(ports, portnp) { - struct ocelot_port_private *priv; - struct ocelot_port *ocelot_port; -- struct device_node *phy_node; -- struct phy_device *phy; - struct resource *res; - struct phy *serdes; - void __iomem *regs; -@@ -389,16 +473,7 @@ static int mscc_ocelot_probe(struct plat - if (IS_ERR(regs)) - continue; - -- phy_node = of_parse_phandle(portnp, "phy-handle", 0); -- if (!phy_node) -- continue; -- -- phy = of_phy_find_device(phy_node); -- of_node_put(phy_node); -- if (!phy) -- continue; -- -- err = ocelot_probe_port(ocelot, port, regs, phy); -+ err = ocelot_probe_port(ocelot, port, regs); - if (err) { - of_node_put(portnp); - goto out_put_ports; -@@ -412,9 +487,7 @@ static int mscc_ocelot_probe(struct plat - if (phy_mode < 0) - phy_mode = PHY_INTERFACE_MODE_NA; - -- priv->phy_mode = phy_mode; -- -- switch (priv->phy_mode) { -+ switch (phy_mode) { - case PHY_INTERFACE_MODE_NA: - continue; - case PHY_INTERFACE_MODE_SGMII: -@@ -451,7 +524,41 @@ static int mscc_ocelot_probe(struct plat - goto out_put_ports; - } - -- priv->serdes = serdes; -+ if (serdes) { -+ err = phy_set_mode_ext(serdes, PHY_MODE_ETHERNET, -+ phy_mode); -+ if (err) { -+ dev_err(ocelot->dev, -+ "Could not set mode of SerDes\n"); -+ of_node_put(portnp); -+ goto out_put_ports; -+ } -+ } -+ -+ priv->phylink_config.dev = &priv->dev->dev; -+ priv->phylink_config.type = PHYLINK_NETDEV; -+ -+ priv->phylink = phylink_create(&priv->phylink_config, -+ of_fwnode_handle(portnp), -+ phy_mode, &ocelot_phylink_ops); -+ if (IS_ERR(priv->phylink)) { -+ dev_err(ocelot->dev, -+ "Could not create a phylink instance (%ld)\n", -+ PTR_ERR(priv->phylink)); -+ err = PTR_ERR(priv->phylink); -+ priv->phylink = NULL; -+ of_node_put(portnp); -+ goto out_put_ports; -+ } -+ -+ err = phylink_of_phy_connect(priv->phylink, portnp, 0); -+ if (err) { -+ dev_err(ocelot->dev, "Could not connect to PHY: %d\n", -+ err); -+ phylink_destroy(priv->phylink); -+ of_node_put(portnp); -+ goto out_put_ports; -+ } - } - - register_netdevice_notifier(&ocelot_netdevice_nb); -@@ -468,12 +575,27 @@ out_put_ports: - static int mscc_ocelot_remove(struct platform_device *pdev) - { - struct ocelot *ocelot = platform_get_drvdata(pdev); -+ int port; - - ocelot_deinit(ocelot); - unregister_switchdev_blocking_notifier(&ocelot_switchdev_blocking_nb); - unregister_switchdev_notifier(&ocelot_switchdev_nb); - unregister_netdevice_notifier(&ocelot_netdevice_nb); - -+ for (port = 0; port < ocelot->num_phys_ports; port++) { -+ struct ocelot_port_private *priv; -+ -+ priv = container_of(ocelot->ports[port], -+ struct ocelot_port_private, -+ port); -+ -+ if (priv->phylink) { -+ rtnl_lock(); -+ phylink_destroy(priv->phylink); -+ rtnl_unlock(); -+ } -+ } -+ - return 0; - } - ---- a/include/soc/mscc/ocelot.h -+++ b/include/soc/mscc/ocelot.h -@@ -518,17 +518,12 @@ void ocelot_deinit(struct ocelot *ocelot - void ocelot_init_port(struct ocelot *ocelot, int port); - - /* DSA callbacks */ --void ocelot_port_enable(struct ocelot *ocelot, int port, -- struct phy_device *phy); --void ocelot_port_disable(struct ocelot *ocelot, int port); - void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data); - void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data); - int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset); - int ocelot_get_ts_info(struct ocelot *ocelot, int port, - struct ethtool_ts_info *info); - void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs); --void ocelot_adjust_link(struct ocelot *ocelot, int port, -- struct phy_device *phydev); - void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, - bool vlan_aware); - void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state); -@@ -597,4 +592,21 @@ int ocelot_rtag_parse_enable(struct ocel - int ocelot_dscp_set(struct ocelot *ocelot, int port, - bool enable, const u8 dscp_ix, - struct tsn_qos_switch_dscp_conf *c); -+void ocelot_phylink_validate(struct ocelot *ocelot, int port, -+ unsigned long *supported, -+ struct phylink_link_state *state); -+void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, -+ struct phylink_link_state *state); -+void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port); -+void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state); -+void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ phy_interface_t interface); -+void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ phy_interface_t interface, -+ struct phy_device *phy); -+ - #endif diff --git a/target/linux/layerscape/patches-5.4/701-net-0282-net-mscc-ocelot-introduce-more-focused-PCS-ops-for-P.patch b/target/linux/layerscape/patches-5.4/701-net-0282-net-mscc-ocelot-introduce-more-focused-PCS-ops-for-P.patch deleted file mode 100644 index d7ae1196d..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0282-net-mscc-ocelot-introduce-more-focused-PCS-ops-for-P.patch +++ /dev/null @@ -1,169 +0,0 @@ -From 07f63e91f5e81f7f36c1e646f72c394c7f60c05c Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Fri, 22 Nov 2019 13:46:34 +0200 -Subject: [PATCH] net: mscc: ocelot: introduce more focused PCS ops for PHYLINK - -The reason for doing this is that the 2 mainline Ocelot switches so far, -VSC7514 and VSC9959, have radically different SoC/SerDes integration. So -although the PHYLINK callbacks are common, the implementations will -actually lie in device-specific function pointers. - -Also, there was a duplicated and unused function pointer for pcs_init in -struct ocelot, remove that. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/ethernet/mscc/ocelot.c | 36 ++++++++------------------------ - drivers/net/ethernet/mscc/ocelot_board.c | 35 ++++++++++++++++++++++++++++++- - include/soc/mscc/ocelot.h | 12 ++++++++--- - 3 files changed, 52 insertions(+), 31 deletions(-) - ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -410,43 +410,25 @@ void ocelot_phylink_validate(struct ocel - unsigned long *supported, - struct phylink_link_state *state) - { -- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -- -- if (state->interface != PHY_INTERFACE_MODE_NA && -- state->interface != PHY_INTERFACE_MODE_GMII && -- state->interface != PHY_INTERFACE_MODE_SGMII && -- state->interface != PHY_INTERFACE_MODE_QSGMII) { -- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -- return; -- } -- -- /* No half-duplex. */ -- phylink_set_port_modes(mask); -- phylink_set(mask, Autoneg); -- phylink_set(mask, Pause); -- phylink_set(mask, Asym_Pause); -- phylink_set(mask, 10baseT_Full); -- phylink_set(mask, 100baseT_Full); -- phylink_set(mask, 1000baseT_Full); -- phylink_set(mask, 2500baseT_Full); -- -- bitmap_and(supported, supported, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); -- bitmap_and(state->advertising, state->advertising, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); -+ if (ocelot->ops->pcs_validate) -+ ocelot->ops->pcs_validate(ocelot, port, supported, state); - } - EXPORT_SYMBOL(ocelot_phylink_validate); - - void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, - struct phylink_link_state *state) - { -- state->link = 1; -+ if (ocelot->ops->pcs_link_state) -+ ocelot->ops->pcs_link_state(ocelot, port, state); -+ else -+ state->link = 1; - } - EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state); - - void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port) - { -- /* Not supported */ -+ if (ocelot->ops->pcs_an_restart) -+ ocelot->ops->pcs_an_restart(ocelot, port); - } - EXPORT_SYMBOL(ocelot_phylink_mac_an_restart); - -@@ -490,7 +472,7 @@ void ocelot_phylink_mac_config(struct oc - ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG); - - if (ocelot->ops->pcs_init) -- ocelot->ops->pcs_init(ocelot, port); -+ ocelot->ops->pcs_init(ocelot, port, link_an_mode, state); - - /* Enable MAC module */ - ocelot_port_writel(ocelot_port, DEV_MAC_ENA_CFG_RX_ENA | ---- a/drivers/net/ethernet/mscc/ocelot_board.c -+++ b/drivers/net/ethernet/mscc/ocelot_board.c -@@ -212,7 +212,9 @@ static const struct of_device_id mscc_oc - }; - MODULE_DEVICE_TABLE(of, mscc_ocelot_match); - --static void ocelot_port_pcs_init(struct ocelot *ocelot, int port) -+static void ocelot_port_pcs_init(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) - { - struct ocelot_port *ocelot_port = ocelot->ports[port]; - -@@ -235,6 +237,36 @@ static void ocelot_port_pcs_init(struct - ocelot_port_writel(ocelot_port, 0, PCS1G_LB_CFG); - } - -+void ocelot_port_pcs_validate(struct ocelot *ocelot, int port, -+ unsigned long *supported, -+ struct phylink_link_state *state) -+{ -+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -+ -+ if (state->interface != PHY_INTERFACE_MODE_NA && -+ state->interface != PHY_INTERFACE_MODE_GMII && -+ state->interface != PHY_INTERFACE_MODE_SGMII && -+ state->interface != PHY_INTERFACE_MODE_QSGMII) { -+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -+ return; -+ } -+ -+ /* No half-duplex. */ -+ phylink_set_port_modes(mask); -+ phylink_set(mask, Autoneg); -+ phylink_set(mask, Pause); -+ phylink_set(mask, Asym_Pause); -+ phylink_set(mask, 10baseT_Full); -+ phylink_set(mask, 100baseT_Full); -+ phylink_set(mask, 1000baseT_Full); -+ phylink_set(mask, 2500baseT_Full); -+ -+ bitmap_and(supported, supported, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+ bitmap_and(state->advertising, state->advertising, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+} -+ - static int ocelot_reset(struct ocelot *ocelot) - { - int retries = 100; -@@ -260,6 +292,7 @@ static int ocelot_reset(struct ocelot *o - - static const struct ocelot_ops ocelot_ops = { - .pcs_init = ocelot_port_pcs_init, -+ .pcs_validate = ocelot_port_pcs_validate, - .reset = ocelot_reset, - }; - ---- a/include/soc/mscc/ocelot.h -+++ b/include/soc/mscc/ocelot.h -@@ -412,7 +412,15 @@ enum { - struct ocelot; - - struct ocelot_ops { -- void (*pcs_init)(struct ocelot *ocelot, int port); -+ void (*pcs_init)(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state); -+ void (*pcs_an_restart)(struct ocelot *ocelot, int port); -+ void (*pcs_link_state)(struct ocelot *ocelot, int port, -+ struct phylink_link_state *state); -+ void (*pcs_validate)(struct ocelot *ocelot, int port, -+ unsigned long *supported, -+ struct phylink_link_state *state); - int (*reset)(struct ocelot *ocelot); - }; - -@@ -479,8 +487,6 @@ struct ocelot { - struct mutex ptp_lock; - /* Protects the PTP clock */ - spinlock_t ptp_clock_lock; -- -- void (*port_pcs_init)(struct ocelot_port *port); - }; - - #define ocelot_read_ix(ocelot, reg, gi, ri) __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri)) diff --git a/target/linux/layerscape/patches-5.4/701-net-0283-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch b/target/linux/layerscape/patches-5.4/701-net-0283-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch deleted file mode 100644 index e2de403c2..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0283-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch +++ /dev/null @@ -1,442 +0,0 @@ -From 0e219a6aa07754d81a25c9e4408d81d194cd2000 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Fri, 22 Nov 2019 13:45:52 +0200 -Subject: [PATCH] net: dsa: felix: Add PCS operations for PHYLINK - -This removes the bootloader dependency for SGMII PCS pre-configuration, -as well as adds support for monitoring the in-band SGMII AN between the -PCS and the system-side link partner (PHY or other MAC). - -Signed-off-by: Vladimir Oltean ---- - drivers/net/dsa/ocelot/felix.c | 23 ++- - drivers/net/dsa/ocelot/felix.h | 7 +- - drivers/net/dsa/ocelot/felix_vsc9959.c | 292 ++++++++++++++++++++++++++++++++- - 3 files changed, 314 insertions(+), 8 deletions(-) - ---- a/drivers/net/dsa/ocelot/felix.c -+++ b/drivers/net/dsa/ocelot/felix.c -@@ -265,7 +265,7 @@ static int felix_get_ts_info(struct dsa_ - static int felix_init_structs(struct felix *felix, int num_phys_ports) - { - struct ocelot *ocelot = &felix->ocelot; -- resource_size_t base; -+ resource_size_t switch_base; - int port, i, err; - - ocelot->num_phys_ports = num_phys_ports; -@@ -281,7 +281,8 @@ static int felix_init_structs(struct fel - ocelot->ops = felix->info->ops; - ocelot->quirks = felix->info->quirks; - -- base = pci_resource_start(felix->pdev, felix->info->pci_bar); -+ switch_base = pci_resource_start(felix->pdev, -+ felix->info->switch_pci_bar); - - for (i = 0; i < TARGET_MAX; i++) { - struct regmap *target; -@@ -292,8 +293,8 @@ static int felix_init_structs(struct fel - - res = &felix->info->target_io_res[i]; - res->flags = IORESOURCE_MEM; -- res->start += base; -- res->end += base; -+ res->start += switch_base; -+ res->end += switch_base; - - target = ocelot_regmap_init(ocelot, res); - if (IS_ERR(target)) { -@@ -327,8 +328,8 @@ static int felix_init_structs(struct fel - - res = &felix->info->port_io_res[port]; - res->flags = IORESOURCE_MEM; -- res->start += base; -- res->end += base; -+ res->start += switch_base; -+ res->end += switch_base; - - port_regs = devm_ioremap_resource(ocelot->dev, res); - if (IS_ERR(port_regs)) { -@@ -342,6 +343,12 @@ static int felix_init_structs(struct fel - ocelot->ports[port] = ocelot_port; - } - -+ if (felix->info->mdio_bus_alloc) { -+ err = felix->info->mdio_bus_alloc(ocelot); -+ if (err < 0) -+ return err; -+ } -+ - return 0; - } - -@@ -377,6 +384,10 @@ static int felix_setup(struct dsa_switch - static void felix_teardown(struct dsa_switch *ds) - { - struct ocelot *ocelot = ds->priv; -+ struct felix *felix = ocelot_to_felix(ocelot); -+ -+ if (felix->imdio) -+ mdiobus_unregister(felix->imdio); - - /* stop workqueue thread */ - ocelot_deinit(ocelot); ---- a/drivers/net/dsa/ocelot/felix.h -+++ b/drivers/net/dsa/ocelot/felix.h -@@ -10,6 +10,7 @@ - struct felix_info { - struct resource *target_io_res; - struct resource *port_io_res; -+ struct resource *imdio_res; - const struct reg_field *regfields; - const u32 *const *map; - const struct ocelot_ops *ops; -@@ -17,8 +18,10 @@ struct felix_info { - const struct ocelot_stat_layout *stats_layout; - unsigned int num_stats; - int num_ports; -- int pci_bar; -+ int switch_pci_bar; -+ int imdio_pci_bar; - unsigned long quirks; -+ int (*mdio_bus_alloc)(struct ocelot *ocelot); - }; - - extern struct felix_info felix_info_vsc9959; -@@ -33,6 +36,8 @@ struct felix { - struct pci_dev *pdev; - struct felix_info *info; - struct ocelot ocelot; -+ struct mii_bus *imdio; -+ struct phy_device **pcs; - }; - - #endif ---- a/drivers/net/dsa/ocelot/felix_vsc9959.c -+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c -@@ -2,6 +2,7 @@ - /* Copyright 2017 Microsemi Corporation - * Copyright 2018-2019 NXP Semiconductors - */ -+#include - #include - #include - #include -@@ -390,6 +391,15 @@ static struct resource vsc9959_port_io_r - }, - }; - -+/* Port MAC 0 Internal MDIO bus through which the SerDes acting as an -+ * SGMII/QSGMII MAC PCS can be found. -+ */ -+static struct resource vsc9959_imdio_res = { -+ .start = 0x8030, -+ .end = 0x8040, -+ .name = "imdio", -+}; -+ - static const struct reg_field vsc9959_regfields[] = { - [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6), - [ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 5), -@@ -569,13 +579,291 @@ static int vsc9959_reset(struct ocelot * - return 0; - } - -+void vsc9959_pcs_validate(struct ocelot *ocelot, int port, -+ unsigned long *supported, -+ struct phylink_link_state *state) -+{ -+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -+ -+ if (state->interface != PHY_INTERFACE_MODE_NA && -+ state->interface != PHY_INTERFACE_MODE_GMII && -+ state->interface != PHY_INTERFACE_MODE_SGMII && -+ state->interface != PHY_INTERFACE_MODE_QSGMII && -+ state->interface != PHY_INTERFACE_MODE_USXGMII) { -+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -+ return; -+ } -+ -+ /* No half-duplex. */ -+ phylink_set_port_modes(mask); -+ phylink_set(mask, Autoneg); -+ phylink_set(mask, Pause); -+ phylink_set(mask, Asym_Pause); -+ phylink_set(mask, 10baseT_Full); -+ phylink_set(mask, 100baseT_Full); -+ phylink_set(mask, 1000baseT_Full); -+ phylink_set(mask, 1000baseX_Full); -+ phylink_set(mask, 2500baseT_Full); -+ phylink_set(mask, 2500baseX_Full); -+ phylink_set(mask, 1000baseKX_Full); -+ -+ bitmap_and(supported, supported, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+ bitmap_and(state->advertising, state->advertising, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+} -+ -+static void vsc9959_pcs_an_restart(struct ocelot *ocelot, int port) -+{ -+ struct felix *felix = ocelot_to_felix(ocelot); -+ struct phy_device *pcs = felix->pcs[port]; -+ -+ if (!pcs) -+ return; -+ -+ phy_set_bits(pcs, MII_BMCR, BMCR_ANRESTART); -+} -+ -+static void vsc9959_pcs_init_sgmii(struct phy_device *pcs, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) -+{ -+ /* SGMII spec requires tx_config_Reg[15:0] to be exactly 0x4001 -+ * for the MAC PCS in order to acknowledge the AN. -+ */ -+ phy_write(pcs, MII_ADVERTISE, ADVERTISE_SGMII | ADVERTISE_LPACK); -+ -+ /* Set to SGMII mode, use AN */ -+ phy_write(pcs, ENETC_PCS_IF_MODE, ENETC_PCS_IF_MODE_SGMII_AN); -+ -+ /* Adjust link timer for SGMII */ -+ phy_write(pcs, ENETC_PCS_LINK_TIMER1, ENETC_PCS_LINK_TIMER1_VAL); -+ phy_write(pcs, ENETC_PCS_LINK_TIMER2, ENETC_PCS_LINK_TIMER2_VAL); -+ -+ phy_write(pcs, MII_BMCR, BMCR_SPEED1000 | -+ BMCR_FULLDPLX | -+ BMCR_ANENABLE); -+} -+ -+#define ADVERTISE_USXGMII_FDX BIT(12) -+ -+static void vsc9959_pcs_init_sxgmii(struct phy_device *pcs, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) -+{ -+ /* Configure device ability for the USXGMII Replicator */ -+ phy_write_mmd(pcs, MDIO_MMD_VEND2, MII_ADVERTISE, -+ ADVERTISE_SGMII | -+ ADVERTISE_LPACK | -+ ADVERTISE_USXGMII_FDX); -+} -+ -+static void vsc9959_pcs_init(struct ocelot *ocelot, int port, -+ unsigned int link_an_mode, -+ const struct phylink_link_state *state) -+{ -+ struct felix *felix = ocelot_to_felix(ocelot); -+ struct phy_device *pcs = felix->pcs[port]; -+ -+ if (!pcs) -+ return; -+ -+ if (link_an_mode == MLO_AN_FIXED) { -+ phydev_err(pcs, "Fixed modes are not yet supported.\n"); -+ return; -+ } -+ -+ pcs->interface = state->interface; -+ if (pcs->interface == PHY_INTERFACE_MODE_USXGMII) -+ pcs->is_c45 = true; -+ else -+ pcs->is_c45 = false; -+ -+ /* The PCS does not implement the BMSR register fully, so capability -+ * detection via genphy_read_abilities does not work. Since we can get -+ * the PHY config word from the LPA register though, there is still -+ * value in using the generic phy_resolve_aneg_linkmode function. So -+ * populate the supported and advertising link modes manually here. -+ */ -+ linkmode_set_bit_array(phy_basic_ports_array, -+ ARRAY_SIZE(phy_basic_ports_array), -+ pcs->supported); -+ linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, pcs->supported); -+ linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, pcs->supported); -+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, pcs->supported); -+ linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, pcs->supported); -+ phy_advertise_supported(pcs); -+ -+ switch (pcs->interface) { -+ case PHY_INTERFACE_MODE_SGMII: -+ case PHY_INTERFACE_MODE_QSGMII: -+ vsc9959_pcs_init_sgmii(pcs, link_an_mode, state); -+ break; -+ case PHY_INTERFACE_MODE_USXGMII: -+ vsc9959_pcs_init_sxgmii(pcs, link_an_mode, state); -+ break; -+ default: -+ dev_err(ocelot->dev, "Unsupported link mode %s\n", -+ phy_modes(pcs->interface)); -+ } -+} -+ -+static void vsc9959_pcs_link_state(struct ocelot *ocelot, int port, -+ struct phylink_link_state *state) -+{ -+ struct felix *felix = ocelot_to_felix(ocelot); -+ struct phy_device *pcs = felix->pcs[port]; -+ int err; -+ -+ if (!pcs) -+ return; -+ -+ /* Reading PCS status not yet supported for USXGMII */ -+ if (pcs->is_c45) { -+ state->link = 1; -+ return; -+ } -+ -+ pcs->speed = SPEED_UNKNOWN; -+ pcs->duplex = DUPLEX_UNKNOWN; -+ pcs->pause = 0; -+ pcs->asym_pause = 0; -+ -+ err = genphy_update_link(pcs); -+ if (err < 0) -+ return; -+ -+ if (pcs->autoneg_complete) { -+ u16 lpa = phy_read(pcs, MII_LPA); -+ -+ switch (state->interface) { -+ case PHY_INTERFACE_MODE_SGMII: -+ case PHY_INTERFACE_MODE_QSGMII: -+ mii_lpa_to_linkmode_lpa_sgmii(pcs->lp_advertising, lpa); -+ break; -+ default: -+ return; -+ } -+ -+ phy_resolve_aneg_linkmode(pcs); -+ } -+ -+ state->an_complete = pcs->autoneg_complete; -+ state->an_enabled = pcs->autoneg; -+ state->link = pcs->link; -+ state->duplex = pcs->duplex; -+ state->speed = pcs->speed; -+ /* SGMII AN does not negotiate flow control, but that's ok, -+ * since phylink already knows that, and does: -+ * link_state.pause |= pl->phy_state.pause; -+ */ -+ state->pause = pcs->pause; -+ -+ dev_dbg(ocelot->dev, -+ "%s: mode=%s/%s/%s adv=%*pb lpa=%*pb link=%u an_enabled=%u an_complete=%u\n", -+ __func__, -+ phy_modes(state->interface), -+ phy_speed_to_str(state->speed), -+ phy_duplex_to_str(state->duplex), -+ __ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising, -+ __ETHTOOL_LINK_MODE_MASK_NBITS, state->lp_advertising, -+ state->link, state->an_enabled, state->an_complete); -+} -+ - static const struct ocelot_ops vsc9959_ops = { - .reset = vsc9959_reset, -+ .pcs_init = vsc9959_pcs_init, -+ .pcs_an_restart = vsc9959_pcs_an_restart, -+ .pcs_link_state = vsc9959_pcs_link_state, -+ .pcs_validate = vsc9959_pcs_validate, - }; - -+static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) -+{ -+ struct felix *felix = ocelot_to_felix(ocelot); -+ struct enetc_mdio_priv *mdio_priv; -+ struct device *dev = ocelot->dev; -+ resource_size_t imdio_base; -+ void __iomem *imdio_regs; -+ struct resource *res; -+ struct enetc_hw *hw; -+ struct mii_bus *bus; -+ int port; -+ int rc; -+ -+ felix->pcs = devm_kcalloc(dev, felix->info->num_ports, -+ sizeof(struct phy_device), -+ GFP_KERNEL); -+ if (!felix->pcs) { -+ dev_err(dev, "failed to allocate array for PCS PHYs\n"); -+ return -ENOMEM; -+ } -+ -+ imdio_base = pci_resource_start(felix->pdev, -+ felix->info->imdio_pci_bar); -+ -+ res = felix->info->imdio_res; -+ res->flags = IORESOURCE_MEM; -+ res->start += imdio_base; -+ res->end += imdio_base; -+ -+ imdio_regs = devm_ioremap_resource(dev, res); -+ if (IS_ERR(imdio_regs)) { -+ dev_err(dev, "failed to map internal MDIO registers\n"); -+ return PTR_ERR(imdio_regs); -+ } -+ -+ hw = enetc_hw_alloc(dev, imdio_regs); -+ if (IS_ERR(hw)) { -+ dev_err(dev, "failed to allocate ENETC HW structure\n"); -+ return PTR_ERR(hw); -+ } -+ -+ bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); -+ if (!bus) -+ return -ENOMEM; -+ -+ bus->name = "VSC9959 internal MDIO bus"; -+ bus->read = enetc_mdio_read; -+ bus->write = enetc_mdio_write; -+ bus->parent = dev; -+ mdio_priv = bus->priv; -+ mdio_priv->hw = hw; -+ /* This gets added to imdio_regs, which already maps addresses -+ * starting with the proper offset. -+ */ -+ mdio_priv->mdio_base = 0; -+ snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev)); -+ -+ /* Needed in order to initialize the bus mutex lock */ -+ rc = mdiobus_register(bus); -+ if (rc < 0) { -+ dev_err(dev, "failed to register MDIO bus\n"); -+ return rc; -+ } -+ -+ felix->imdio = bus; -+ -+ for (port = 0; port < felix->info->num_ports; port++) { -+ struct phy_device *pcs; -+ bool is_c45 = false; -+ -+ pcs = get_phy_device(felix->imdio, port, is_c45); -+ if (IS_ERR(pcs)) -+ continue; -+ -+ felix->pcs[port] = pcs; -+ -+ dev_info(dev, "Found PCS at internal MDIO address %d\n", port); -+ } -+ -+ return 0; -+} -+ - struct felix_info felix_info_vsc9959 = { - .target_io_res = vsc9959_target_io_res, - .port_io_res = vsc9959_port_io_res, -+ .imdio_res = &vsc9959_imdio_res, - .regfields = vsc9959_regfields, - .map = vsc9959_regmap, - .ops = &vsc9959_ops, -@@ -583,6 +871,8 @@ struct felix_info felix_info_vsc9959 = { - .num_stats = ARRAY_SIZE(vsc9959_stats_layout), - .shared_queue_sz = 128 * 1024, - .num_ports = 6, -- .pci_bar = 4, -+ .switch_pci_bar = 4, -+ .imdio_pci_bar = 0, - .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION, -+ .mdio_bus_alloc = vsc9959_mdio_bus_alloc, - }; diff --git a/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch b/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch index 6200bd88a..e54631f71 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0337-enetc-add-support-tsn-capabilities-qbv-qci-qbu-cbs.patch @@ -848,7 +848,7 @@ Signed-off-by: Po Liu return 0; err_reg_netdev: -@@ -973,6 +982,8 @@ static void enetc_pf_remove(struct pci_d +@@ -974,6 +983,8 @@ static void enetc_pf_remove(struct pci_d netif_info(priv, drv, si->ndev, "%s v%s remove\n", enetc_drv_name, enetc_drv_ver); diff --git a/target/linux/layerscape/patches-5.4/701-net-0338-net-dsa-felix-Fix-probing-allocation-and-cleanup-pat.patch b/target/linux/layerscape/patches-5.4/701-net-0338-net-dsa-felix-Fix-probing-allocation-and-cleanup-pat.patch index 3e99861d1..ec4c62a7a 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0338-net-dsa-felix-Fix-probing-allocation-and-cleanup-pat.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0338-net-dsa-felix-Fix-probing-allocation-and-cleanup-pat.patch @@ -90,7 +90,7 @@ Signed-off-by: Claudiu Manoil --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c -@@ -530,7 +530,7 @@ static int felix_pci_probe(struct pci_de +@@ -485,7 +485,7 @@ static int felix_pci_probe(struct pci_de } } @@ -99,7 +99,7 @@ Signed-off-by: Claudiu Manoil if (!felix) { err = -ENOMEM; dev_err(&pdev->dev, "Failed to allocate driver memory\n"); -@@ -577,11 +577,9 @@ static int felix_pci_probe(struct pci_de +@@ -532,11 +532,9 @@ static int felix_pci_probe(struct pci_de return 0; err_register_ds: @@ -111,7 +111,7 @@ Signed-off-by: Claudiu Manoil err_dma: pci_disable_device(pdev); err_pci_enable: -@@ -596,9 +594,6 @@ static void felix_pci_remove(struct pci_ +@@ -551,9 +549,6 @@ static void felix_pci_remove(struct pci_ dsa_unregister_switch(felix->ds); diff --git a/target/linux/layerscape/patches-5.4/701-net-0341-LF-368-net-mscc-ocelot-add-VCAP-IS2-rule-to-trap-PTP.patch b/target/linux/layerscape/patches-5.4/701-net-0341-LF-368-net-mscc-ocelot-add-VCAP-IS2-rule-to-trap-PTP.patch index af80b9f66..0b4cb9695 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0341-LF-368-net-mscc-ocelot-add-VCAP-IS2-rule-to-trap-PTP.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0341-LF-368-net-mscc-ocelot-add-VCAP-IS2-rule-to-trap-PTP.patch @@ -14,7 +14,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -2338,6 +2338,20 @@ void ocelot_set_cpu_port(struct ocelot * +@@ -2342,6 +2342,20 @@ void ocelot_set_cpu_port(struct ocelot * } EXPORT_SYMBOL(ocelot_set_cpu_port); @@ -35,7 +35,7 @@ Signed-off-by: Yangbo Lu int ocelot_init(struct ocelot *ocelot) { char queue_name[32]; -@@ -2475,6 +2489,13 @@ int ocelot_init(struct ocelot *ocelot) +@@ -2479,6 +2493,13 @@ int ocelot_init(struct ocelot *ocelot) "Timestamp initialization failed\n"); return ret; } @@ -49,7 +49,7 @@ Signed-off-by: Yangbo Lu } return 0; -@@ -2489,6 +2510,8 @@ void ocelot_deinit(struct ocelot *ocelot +@@ -2493,6 +2514,8 @@ void ocelot_deinit(struct ocelot *ocelot cancel_delayed_work(&ocelot->stats_work); destroy_workqueue(ocelot->stats_queue); mutex_destroy(&ocelot->stats_lock); diff --git a/target/linux/layerscape/patches-5.4/701-net-0367-net-mscc-ocelot-Workaround-to-allow-traffic-to-CPU-i.patch b/target/linux/layerscape/patches-5.4/701-net-0367-net-mscc-ocelot-Workaround-to-allow-traffic-to-CPU-i.patch index 069c51838..f2d69b633 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0367-net-mscc-ocelot-Workaround-to-allow-traffic-to-CPU-i.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0367-net-mscc-ocelot-Workaround-to-allow-traffic-to-CPU-i.patch @@ -128,7 +128,7 @@ Signed-off-by: Vladimir Oltean --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -2292,6 +2292,18 @@ void ocelot_set_cpu_port(struct ocelot * +@@ -2296,6 +2296,18 @@ void ocelot_set_cpu_port(struct ocelot * enum ocelot_tag_prefix injection, enum ocelot_tag_prefix extraction) { diff --git a/target/linux/layerscape/patches-5.4/701-net-0368-Revert-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch b/target/linux/layerscape/patches-5.4/701-net-0368-Revert-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch deleted file mode 100644 index ea01a8b24..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0368-Revert-net-dsa-felix-Add-PCS-operations-for-PHYLINK.patch +++ /dev/null @@ -1,440 +0,0 @@ -From 9ee918eb911853c7b46cd84779d857988366e845 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:30:24 +0200 -Subject: [PATCH] Revert "net: dsa: felix: Add PCS operations for PHYLINK" - -This reverts commit 1082a3ef9e832cc52c4b0053c7c52453376f4830. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/dsa/ocelot/felix.c | 23 +-- - drivers/net/dsa/ocelot/felix.h | 7 +- - drivers/net/dsa/ocelot/felix_vsc9959.c | 292 +-------------------------------- - 3 files changed, 8 insertions(+), 314 deletions(-) - ---- a/drivers/net/dsa/ocelot/felix.c -+++ b/drivers/net/dsa/ocelot/felix.c -@@ -265,7 +265,7 @@ static int felix_get_ts_info(struct dsa_ - static int felix_init_structs(struct felix *felix, int num_phys_ports) - { - struct ocelot *ocelot = &felix->ocelot; -- resource_size_t switch_base; -+ resource_size_t base; - int port, i, err; - - ocelot->num_phys_ports = num_phys_ports; -@@ -281,8 +281,7 @@ static int felix_init_structs(struct fel - ocelot->ops = felix->info->ops; - ocelot->quirks = felix->info->quirks; - -- switch_base = pci_resource_start(felix->pdev, -- felix->info->switch_pci_bar); -+ base = pci_resource_start(felix->pdev, felix->info->pci_bar); - - for (i = 0; i < TARGET_MAX; i++) { - struct regmap *target; -@@ -293,8 +292,8 @@ static int felix_init_structs(struct fel - - res = &felix->info->target_io_res[i]; - res->flags = IORESOURCE_MEM; -- res->start += switch_base; -- res->end += switch_base; -+ res->start += base; -+ res->end += base; - - target = ocelot_regmap_init(ocelot, res); - if (IS_ERR(target)) { -@@ -328,8 +327,8 @@ static int felix_init_structs(struct fel - - res = &felix->info->port_io_res[port]; - res->flags = IORESOURCE_MEM; -- res->start += switch_base; -- res->end += switch_base; -+ res->start += base; -+ res->end += base; - - port_regs = devm_ioremap_resource(ocelot->dev, res); - if (IS_ERR(port_regs)) { -@@ -343,12 +342,6 @@ static int felix_init_structs(struct fel - ocelot->ports[port] = ocelot_port; - } - -- if (felix->info->mdio_bus_alloc) { -- err = felix->info->mdio_bus_alloc(ocelot); -- if (err < 0) -- return err; -- } -- - return 0; - } - -@@ -384,10 +377,6 @@ static int felix_setup(struct dsa_switch - static void felix_teardown(struct dsa_switch *ds) - { - struct ocelot *ocelot = ds->priv; -- struct felix *felix = ocelot_to_felix(ocelot); -- -- if (felix->imdio) -- mdiobus_unregister(felix->imdio); - - /* stop workqueue thread */ - ocelot_deinit(ocelot); ---- a/drivers/net/dsa/ocelot/felix.h -+++ b/drivers/net/dsa/ocelot/felix.h -@@ -10,7 +10,6 @@ - struct felix_info { - struct resource *target_io_res; - struct resource *port_io_res; -- struct resource *imdio_res; - const struct reg_field *regfields; - const u32 *const *map; - const struct ocelot_ops *ops; -@@ -18,10 +17,8 @@ struct felix_info { - const struct ocelot_stat_layout *stats_layout; - unsigned int num_stats; - int num_ports; -- int switch_pci_bar; -- int imdio_pci_bar; -+ int pci_bar; - unsigned long quirks; -- int (*mdio_bus_alloc)(struct ocelot *ocelot); - }; - - extern struct felix_info felix_info_vsc9959; -@@ -36,8 +33,6 @@ struct felix { - struct pci_dev *pdev; - struct felix_info *info; - struct ocelot ocelot; -- struct mii_bus *imdio; -- struct phy_device **pcs; - }; - - #endif ---- a/drivers/net/dsa/ocelot/felix_vsc9959.c -+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c -@@ -2,7 +2,6 @@ - /* Copyright 2017 Microsemi Corporation - * Copyright 2018-2019 NXP Semiconductors - */ --#include - #include - #include - #include -@@ -391,15 +390,6 @@ static struct resource vsc9959_port_io_r - }, - }; - --/* Port MAC 0 Internal MDIO bus through which the SerDes acting as an -- * SGMII/QSGMII MAC PCS can be found. -- */ --static struct resource vsc9959_imdio_res = { -- .start = 0x8030, -- .end = 0x8040, -- .name = "imdio", --}; -- - static const struct reg_field vsc9959_regfields[] = { - [ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 6, 6), - [ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 5), -@@ -579,291 +569,13 @@ static int vsc9959_reset(struct ocelot * - return 0; - } - --void vsc9959_pcs_validate(struct ocelot *ocelot, int port, -- unsigned long *supported, -- struct phylink_link_state *state) --{ -- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -- -- if (state->interface != PHY_INTERFACE_MODE_NA && -- state->interface != PHY_INTERFACE_MODE_GMII && -- state->interface != PHY_INTERFACE_MODE_SGMII && -- state->interface != PHY_INTERFACE_MODE_QSGMII && -- state->interface != PHY_INTERFACE_MODE_USXGMII) { -- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -- return; -- } -- -- /* No half-duplex. */ -- phylink_set_port_modes(mask); -- phylink_set(mask, Autoneg); -- phylink_set(mask, Pause); -- phylink_set(mask, Asym_Pause); -- phylink_set(mask, 10baseT_Full); -- phylink_set(mask, 100baseT_Full); -- phylink_set(mask, 1000baseT_Full); -- phylink_set(mask, 1000baseX_Full); -- phylink_set(mask, 2500baseT_Full); -- phylink_set(mask, 2500baseX_Full); -- phylink_set(mask, 1000baseKX_Full); -- -- bitmap_and(supported, supported, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); -- bitmap_and(state->advertising, state->advertising, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); --} -- --static void vsc9959_pcs_an_restart(struct ocelot *ocelot, int port) --{ -- struct felix *felix = ocelot_to_felix(ocelot); -- struct phy_device *pcs = felix->pcs[port]; -- -- if (!pcs) -- return; -- -- phy_set_bits(pcs, MII_BMCR, BMCR_ANRESTART); --} -- --static void vsc9959_pcs_init_sgmii(struct phy_device *pcs, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) --{ -- /* SGMII spec requires tx_config_Reg[15:0] to be exactly 0x4001 -- * for the MAC PCS in order to acknowledge the AN. -- */ -- phy_write(pcs, MII_ADVERTISE, ADVERTISE_SGMII | ADVERTISE_LPACK); -- -- /* Set to SGMII mode, use AN */ -- phy_write(pcs, ENETC_PCS_IF_MODE, ENETC_PCS_IF_MODE_SGMII_AN); -- -- /* Adjust link timer for SGMII */ -- phy_write(pcs, ENETC_PCS_LINK_TIMER1, ENETC_PCS_LINK_TIMER1_VAL); -- phy_write(pcs, ENETC_PCS_LINK_TIMER2, ENETC_PCS_LINK_TIMER2_VAL); -- -- phy_write(pcs, MII_BMCR, BMCR_SPEED1000 | -- BMCR_FULLDPLX | -- BMCR_ANENABLE); --} -- --#define ADVERTISE_USXGMII_FDX BIT(12) -- --static void vsc9959_pcs_init_sxgmii(struct phy_device *pcs, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) --{ -- /* Configure device ability for the USXGMII Replicator */ -- phy_write_mmd(pcs, MDIO_MMD_VEND2, MII_ADVERTISE, -- ADVERTISE_SGMII | -- ADVERTISE_LPACK | -- ADVERTISE_USXGMII_FDX); --} -- --static void vsc9959_pcs_init(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) --{ -- struct felix *felix = ocelot_to_felix(ocelot); -- struct phy_device *pcs = felix->pcs[port]; -- -- if (!pcs) -- return; -- -- if (link_an_mode == MLO_AN_FIXED) { -- phydev_err(pcs, "Fixed modes are not yet supported.\n"); -- return; -- } -- -- pcs->interface = state->interface; -- if (pcs->interface == PHY_INTERFACE_MODE_USXGMII) -- pcs->is_c45 = true; -- else -- pcs->is_c45 = false; -- -- /* The PCS does not implement the BMSR register fully, so capability -- * detection via genphy_read_abilities does not work. Since we can get -- * the PHY config word from the LPA register though, there is still -- * value in using the generic phy_resolve_aneg_linkmode function. So -- * populate the supported and advertising link modes manually here. -- */ -- linkmode_set_bit_array(phy_basic_ports_array, -- ARRAY_SIZE(phy_basic_ports_array), -- pcs->supported); -- linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, pcs->supported); -- linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, pcs->supported); -- linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, pcs->supported); -- linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, pcs->supported); -- phy_advertise_supported(pcs); -- -- switch (pcs->interface) { -- case PHY_INTERFACE_MODE_SGMII: -- case PHY_INTERFACE_MODE_QSGMII: -- vsc9959_pcs_init_sgmii(pcs, link_an_mode, state); -- break; -- case PHY_INTERFACE_MODE_USXGMII: -- vsc9959_pcs_init_sxgmii(pcs, link_an_mode, state); -- break; -- default: -- dev_err(ocelot->dev, "Unsupported link mode %s\n", -- phy_modes(pcs->interface)); -- } --} -- --static void vsc9959_pcs_link_state(struct ocelot *ocelot, int port, -- struct phylink_link_state *state) --{ -- struct felix *felix = ocelot_to_felix(ocelot); -- struct phy_device *pcs = felix->pcs[port]; -- int err; -- -- if (!pcs) -- return; -- -- /* Reading PCS status not yet supported for USXGMII */ -- if (pcs->is_c45) { -- state->link = 1; -- return; -- } -- -- pcs->speed = SPEED_UNKNOWN; -- pcs->duplex = DUPLEX_UNKNOWN; -- pcs->pause = 0; -- pcs->asym_pause = 0; -- -- err = genphy_update_link(pcs); -- if (err < 0) -- return; -- -- if (pcs->autoneg_complete) { -- u16 lpa = phy_read(pcs, MII_LPA); -- -- switch (state->interface) { -- case PHY_INTERFACE_MODE_SGMII: -- case PHY_INTERFACE_MODE_QSGMII: -- mii_lpa_to_linkmode_lpa_sgmii(pcs->lp_advertising, lpa); -- break; -- default: -- return; -- } -- -- phy_resolve_aneg_linkmode(pcs); -- } -- -- state->an_complete = pcs->autoneg_complete; -- state->an_enabled = pcs->autoneg; -- state->link = pcs->link; -- state->duplex = pcs->duplex; -- state->speed = pcs->speed; -- /* SGMII AN does not negotiate flow control, but that's ok, -- * since phylink already knows that, and does: -- * link_state.pause |= pl->phy_state.pause; -- */ -- state->pause = pcs->pause; -- -- dev_dbg(ocelot->dev, -- "%s: mode=%s/%s/%s adv=%*pb lpa=%*pb link=%u an_enabled=%u an_complete=%u\n", -- __func__, -- phy_modes(state->interface), -- phy_speed_to_str(state->speed), -- phy_duplex_to_str(state->duplex), -- __ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising, -- __ETHTOOL_LINK_MODE_MASK_NBITS, state->lp_advertising, -- state->link, state->an_enabled, state->an_complete); --} -- - static const struct ocelot_ops vsc9959_ops = { - .reset = vsc9959_reset, -- .pcs_init = vsc9959_pcs_init, -- .pcs_an_restart = vsc9959_pcs_an_restart, -- .pcs_link_state = vsc9959_pcs_link_state, -- .pcs_validate = vsc9959_pcs_validate, - }; - --static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) --{ -- struct felix *felix = ocelot_to_felix(ocelot); -- struct enetc_mdio_priv *mdio_priv; -- struct device *dev = ocelot->dev; -- resource_size_t imdio_base; -- void __iomem *imdio_regs; -- struct resource *res; -- struct enetc_hw *hw; -- struct mii_bus *bus; -- int port; -- int rc; -- -- felix->pcs = devm_kcalloc(dev, felix->info->num_ports, -- sizeof(struct phy_device), -- GFP_KERNEL); -- if (!felix->pcs) { -- dev_err(dev, "failed to allocate array for PCS PHYs\n"); -- return -ENOMEM; -- } -- -- imdio_base = pci_resource_start(felix->pdev, -- felix->info->imdio_pci_bar); -- -- res = felix->info->imdio_res; -- res->flags = IORESOURCE_MEM; -- res->start += imdio_base; -- res->end += imdio_base; -- -- imdio_regs = devm_ioremap_resource(dev, res); -- if (IS_ERR(imdio_regs)) { -- dev_err(dev, "failed to map internal MDIO registers\n"); -- return PTR_ERR(imdio_regs); -- } -- -- hw = enetc_hw_alloc(dev, imdio_regs); -- if (IS_ERR(hw)) { -- dev_err(dev, "failed to allocate ENETC HW structure\n"); -- return PTR_ERR(hw); -- } -- -- bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); -- if (!bus) -- return -ENOMEM; -- -- bus->name = "VSC9959 internal MDIO bus"; -- bus->read = enetc_mdio_read; -- bus->write = enetc_mdio_write; -- bus->parent = dev; -- mdio_priv = bus->priv; -- mdio_priv->hw = hw; -- /* This gets added to imdio_regs, which already maps addresses -- * starting with the proper offset. -- */ -- mdio_priv->mdio_base = 0; -- snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev)); -- -- /* Needed in order to initialize the bus mutex lock */ -- rc = mdiobus_register(bus); -- if (rc < 0) { -- dev_err(dev, "failed to register MDIO bus\n"); -- return rc; -- } -- -- felix->imdio = bus; -- -- for (port = 0; port < felix->info->num_ports; port++) { -- struct phy_device *pcs; -- bool is_c45 = false; -- -- pcs = get_phy_device(felix->imdio, port, is_c45); -- if (IS_ERR(pcs)) -- continue; -- -- felix->pcs[port] = pcs; -- -- dev_info(dev, "Found PCS at internal MDIO address %d\n", port); -- } -- -- return 0; --} -- - struct felix_info felix_info_vsc9959 = { - .target_io_res = vsc9959_target_io_res, - .port_io_res = vsc9959_port_io_res, -- .imdio_res = &vsc9959_imdio_res, - .regfields = vsc9959_regfields, - .map = vsc9959_regmap, - .ops = &vsc9959_ops, -@@ -871,8 +583,6 @@ struct felix_info felix_info_vsc9959 = { - .num_stats = ARRAY_SIZE(vsc9959_stats_layout), - .shared_queue_sz = 128 * 1024, - .num_ports = 6, -- .switch_pci_bar = 4, -- .imdio_pci_bar = 0, -+ .pci_bar = 4, - .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION, -- .mdio_bus_alloc = vsc9959_mdio_bus_alloc, - }; diff --git a/target/linux/layerscape/patches-5.4/701-net-0369-Revert-net-mscc-ocelot-introduce-more-focused-PCS-op.patch b/target/linux/layerscape/patches-5.4/701-net-0369-Revert-net-mscc-ocelot-introduce-more-focused-PCS-op.patch deleted file mode 100644 index 9ba203031..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0369-Revert-net-mscc-ocelot-introduce-more-focused-PCS-op.patch +++ /dev/null @@ -1,164 +0,0 @@ -From e1aa2a770cc5f4d46693bb491ed2ca7f066c3585 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:30:41 +0200 -Subject: [PATCH] Revert "net: mscc: ocelot: introduce more focused PCS ops for - PHYLINK" - -This reverts commit 423c8b04007c85907f8f514de459ebc8541f0a54. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/ethernet/mscc/ocelot.c | 36 ++++++++++++++++++++++++-------- - drivers/net/ethernet/mscc/ocelot_board.c | 35 +------------------------------ - include/soc/mscc/ocelot.h | 12 +++-------- - 3 files changed, 31 insertions(+), 52 deletions(-) - ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -410,25 +410,43 @@ void ocelot_phylink_validate(struct ocel - unsigned long *supported, - struct phylink_link_state *state) - { -- if (ocelot->ops->pcs_validate) -- ocelot->ops->pcs_validate(ocelot, port, supported, state); -+ __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -+ -+ if (state->interface != PHY_INTERFACE_MODE_NA && -+ state->interface != PHY_INTERFACE_MODE_GMII && -+ state->interface != PHY_INTERFACE_MODE_SGMII && -+ state->interface != PHY_INTERFACE_MODE_QSGMII) { -+ bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -+ return; -+ } -+ -+ /* No half-duplex. */ -+ phylink_set_port_modes(mask); -+ phylink_set(mask, Autoneg); -+ phylink_set(mask, Pause); -+ phylink_set(mask, Asym_Pause); -+ phylink_set(mask, 10baseT_Full); -+ phylink_set(mask, 100baseT_Full); -+ phylink_set(mask, 1000baseT_Full); -+ phylink_set(mask, 2500baseT_Full); -+ -+ bitmap_and(supported, supported, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); -+ bitmap_and(state->advertising, state->advertising, mask, -+ __ETHTOOL_LINK_MODE_MASK_NBITS); - } - EXPORT_SYMBOL(ocelot_phylink_validate); - - void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, - struct phylink_link_state *state) - { -- if (ocelot->ops->pcs_link_state) -- ocelot->ops->pcs_link_state(ocelot, port, state); -- else -- state->link = 1; -+ state->link = 1; - } - EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state); - - void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port) - { -- if (ocelot->ops->pcs_an_restart) -- ocelot->ops->pcs_an_restart(ocelot, port); -+ /* Not supported */ - } - EXPORT_SYMBOL(ocelot_phylink_mac_an_restart); - -@@ -472,7 +490,7 @@ void ocelot_phylink_mac_config(struct oc - ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG); - - if (ocelot->ops->pcs_init) -- ocelot->ops->pcs_init(ocelot, port, link_an_mode, state); -+ ocelot->ops->pcs_init(ocelot, port); - - /* Enable MAC module */ - ocelot_port_writel(ocelot_port, DEV_MAC_ENA_CFG_RX_ENA | ---- a/drivers/net/ethernet/mscc/ocelot_board.c -+++ b/drivers/net/ethernet/mscc/ocelot_board.c -@@ -212,9 +212,7 @@ static const struct of_device_id mscc_oc - }; - MODULE_DEVICE_TABLE(of, mscc_ocelot_match); - --static void ocelot_port_pcs_init(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) -+static void ocelot_port_pcs_init(struct ocelot *ocelot, int port) - { - struct ocelot_port *ocelot_port = ocelot->ports[port]; - -@@ -237,36 +235,6 @@ static void ocelot_port_pcs_init(struct - ocelot_port_writel(ocelot_port, 0, PCS1G_LB_CFG); - } - --void ocelot_port_pcs_validate(struct ocelot *ocelot, int port, -- unsigned long *supported, -- struct phylink_link_state *state) --{ -- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -- -- if (state->interface != PHY_INTERFACE_MODE_NA && -- state->interface != PHY_INTERFACE_MODE_GMII && -- state->interface != PHY_INTERFACE_MODE_SGMII && -- state->interface != PHY_INTERFACE_MODE_QSGMII) { -- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -- return; -- } -- -- /* No half-duplex. */ -- phylink_set_port_modes(mask); -- phylink_set(mask, Autoneg); -- phylink_set(mask, Pause); -- phylink_set(mask, Asym_Pause); -- phylink_set(mask, 10baseT_Full); -- phylink_set(mask, 100baseT_Full); -- phylink_set(mask, 1000baseT_Full); -- phylink_set(mask, 2500baseT_Full); -- -- bitmap_and(supported, supported, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); -- bitmap_and(state->advertising, state->advertising, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); --} -- - static int ocelot_reset(struct ocelot *ocelot) - { - int retries = 100; -@@ -292,7 +260,6 @@ static int ocelot_reset(struct ocelot *o - - static const struct ocelot_ops ocelot_ops = { - .pcs_init = ocelot_port_pcs_init, -- .pcs_validate = ocelot_port_pcs_validate, - .reset = ocelot_reset, - }; - ---- a/include/soc/mscc/ocelot.h -+++ b/include/soc/mscc/ocelot.h -@@ -412,15 +412,7 @@ enum { - struct ocelot; - - struct ocelot_ops { -- void (*pcs_init)(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- const struct phylink_link_state *state); -- void (*pcs_an_restart)(struct ocelot *ocelot, int port); -- void (*pcs_link_state)(struct ocelot *ocelot, int port, -- struct phylink_link_state *state); -- void (*pcs_validate)(struct ocelot *ocelot, int port, -- unsigned long *supported, -- struct phylink_link_state *state); -+ void (*pcs_init)(struct ocelot *ocelot, int port); - int (*reset)(struct ocelot *ocelot); - }; - -@@ -487,6 +479,8 @@ struct ocelot { - struct mutex ptp_lock; - /* Protects the PTP clock */ - spinlock_t ptp_clock_lock; -+ -+ void (*port_pcs_init)(struct ocelot_port *port); - }; - - #define ocelot_read_ix(ocelot, reg, gi, ri) __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri)) diff --git a/target/linux/layerscape/patches-5.4/701-net-0370-Revert-net-mscc-ocelot-convert-to-PHYLINK.patch b/target/linux/layerscape/patches-5.4/701-net-0370-Revert-net-mscc-ocelot-convert-to-PHYLINK.patch deleted file mode 100644 index 14231041f..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0370-Revert-net-mscc-ocelot-convert-to-PHYLINK.patch +++ /dev/null @@ -1,653 +0,0 @@ -From 74e550d54d7c8142aefc06d1f00c506cd9039b6d Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:30:48 +0200 -Subject: [PATCH] Revert "net: mscc: ocelot: convert to PHYLINK" - -This reverts commit e51cc023c37902e10d1e0109ff0c6ddcce3d5c03. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/dsa/ocelot/felix.c | 65 ++++--------- - drivers/net/ethernet/mscc/Kconfig | 2 +- - drivers/net/ethernet/mscc/ocelot.c | 150 ++++++++++++++---------------- - drivers/net/ethernet/mscc/ocelot.h | 13 ++- - drivers/net/ethernet/mscc/ocelot_board.c | 154 ++++--------------------------- - include/soc/mscc/ocelot.h | 22 +---- - 6 files changed, 117 insertions(+), 289 deletions(-) - ---- a/drivers/net/dsa/ocelot/felix.c -+++ b/drivers/net/dsa/ocelot/felix.c -@@ -58,6 +58,14 @@ static int felix_set_ageing_time(struct - return 0; - } - -+static void felix_adjust_link(struct dsa_switch *ds, int port, -+ struct phy_device *phydev) -+{ -+ struct ocelot *ocelot = ds->priv; -+ -+ ocelot_adjust_link(ocelot, port, phydev); -+} -+ - static int felix_fdb_dump(struct dsa_switch *ds, int port, - dsa_fdb_dump_cb_t *cb, void *data) - { -@@ -177,59 +185,21 @@ static int felix_tsn_enable(struct dsa_p - } - #endif - --static void felix_phylink_validate(struct dsa_switch *ds, int port, -- unsigned long *supported, -- struct phylink_link_state *state) -+static int felix_port_enable(struct dsa_switch *ds, int port, -+ struct phy_device *phy) - { - struct ocelot *ocelot = ds->priv; - -- ocelot_phylink_validate(ocelot, port, supported, state); --} -- --static int felix_phylink_mac_pcs_get_state(struct dsa_switch *ds, int port, -- struct phylink_link_state *state) --{ -- struct ocelot *ocelot = ds->priv; -- -- ocelot_phylink_mac_pcs_get_state(ocelot, port, state); -+ ocelot_port_enable(ocelot, port, phy); - - return 0; - } - --static void felix_phylink_mac_config(struct dsa_switch *ds, int port, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) --{ -- struct ocelot *ocelot = ds->priv; -- -- ocelot_phylink_mac_config(ocelot, port, link_an_mode, state); --} -- --static void felix_phylink_mac_an_restart(struct dsa_switch *ds, int port) --{ -- struct ocelot *ocelot = ds->priv; -- -- ocelot_phylink_mac_an_restart(ocelot, port); --} -- --static void felix_phylink_mac_link_down(struct dsa_switch *ds, int port, -- unsigned int link_an_mode, -- phy_interface_t interface) --{ -- struct ocelot *ocelot = ds->priv; -- -- ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, interface); --} -- --static void felix_phylink_mac_link_up(struct dsa_switch *ds, int port, -- unsigned int link_an_mode, -- phy_interface_t interface, -- struct phy_device *phydev) -+static void felix_port_disable(struct dsa_switch *ds, int port) - { - struct ocelot *ocelot = ds->priv; - -- ocelot_phylink_mac_link_up(ocelot, port, link_an_mode, interface, -- phydev); -+ return ocelot_port_disable(ocelot, port); - } - - static void felix_get_strings(struct dsa_switch *ds, int port, -@@ -447,12 +417,9 @@ static const struct dsa_switch_ops felix - .get_ethtool_stats = felix_get_ethtool_stats, - .get_sset_count = felix_get_sset_count, - .get_ts_info = felix_get_ts_info, -- .phylink_validate = felix_phylink_validate, -- .phylink_mac_link_state = felix_phylink_mac_pcs_get_state, -- .phylink_mac_config = felix_phylink_mac_config, -- .phylink_mac_an_restart = felix_phylink_mac_an_restart, -- .phylink_mac_link_down = felix_phylink_mac_link_down, -- .phylink_mac_link_up = felix_phylink_mac_link_up, -+ .adjust_link = felix_adjust_link, -+ .port_enable = felix_port_enable, -+ .port_disable = felix_port_disable, - .port_fdb_dump = felix_fdb_dump, - .port_fdb_add = felix_fdb_add, - .port_fdb_del = felix_fdb_del, ---- a/drivers/net/ethernet/mscc/Kconfig -+++ b/drivers/net/ethernet/mscc/Kconfig -@@ -15,7 +15,7 @@ config MSCC_OCELOT_SWITCH - tristate "Ocelot switch driver" - depends on NET_SWITCHDEV - depends on HAS_IOMEM -- select PHYLINK -+ select PHYLIB - select REGMAP_MMIO - help - This driver supports the Ocelot network switch device. ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -13,7 +13,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -406,66 +406,18 @@ static u16 ocelot_wm_enc(u16 value) - return value; - } - --void ocelot_phylink_validate(struct ocelot *ocelot, int port, -- unsigned long *supported, -- struct phylink_link_state *state) --{ -- __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; -- -- if (state->interface != PHY_INTERFACE_MODE_NA && -- state->interface != PHY_INTERFACE_MODE_GMII && -- state->interface != PHY_INTERFACE_MODE_SGMII && -- state->interface != PHY_INTERFACE_MODE_QSGMII) { -- bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); -- return; -- } -- -- /* No half-duplex. */ -- phylink_set_port_modes(mask); -- phylink_set(mask, Autoneg); -- phylink_set(mask, Pause); -- phylink_set(mask, Asym_Pause); -- phylink_set(mask, 10baseT_Full); -- phylink_set(mask, 100baseT_Full); -- phylink_set(mask, 1000baseT_Full); -- phylink_set(mask, 2500baseT_Full); -- -- bitmap_and(supported, supported, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); -- bitmap_and(state->advertising, state->advertising, mask, -- __ETHTOOL_LINK_MODE_MASK_NBITS); --} --EXPORT_SYMBOL(ocelot_phylink_validate); -- --void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, -- struct phylink_link_state *state) --{ -- state->link = 1; --} --EXPORT_SYMBOL(ocelot_phylink_mac_pcs_get_state); -- --void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port) --{ -- /* Not supported */ --} --EXPORT_SYMBOL(ocelot_phylink_mac_an_restart); -- --void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) -+void ocelot_adjust_link(struct ocelot *ocelot, int port, -+ struct phy_device *phydev) - { - int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA; - struct ocelot_port *ocelot_port = ocelot->ports[port]; -- u32 mac_fc_cfg; - - if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION) - speed = SPEED_1000; - else -- speed = state->speed; -+ speed = phydev->speed; - - switch (speed) { -- case SPEED_UNKNOWN: -- return; - case SPEED_10: - mac_speed = OCELOT_SPEED_10; - break; -@@ -481,11 +433,16 @@ void ocelot_phylink_mac_config(struct oc - mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA; - break; - default: -- dev_err(ocelot->dev, "Unsupported speed on port %d: %d\n", -+ dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n", - port, speed); - return; - } - -+ phy_print_status(phydev); -+ -+ if (!phydev->link) -+ return; -+ - /* Only full duplex supported for now */ - ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG); - -@@ -512,36 +469,27 @@ void ocelot_phylink_mac_config(struct oc - QSYS_SWITCH_PORT_MODE, port); - - /* Flow control */ -- mac_fc_cfg = SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed); -- if (state->pause & MLO_PAUSE_RX) -- mac_fc_cfg |= SYS_MAC_FC_CFG_RX_FC_ENA; -- if (state->pause & MLO_PAUSE_TX) -- mac_fc_cfg |= SYS_MAC_FC_CFG_TX_FC_ENA | -- SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) | -- SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) | -- SYS_MAC_FC_CFG_ZERO_PAUSE_ENA; -- ocelot_write_rix(ocelot, mac_fc_cfg, SYS_MAC_FC_CFG, port); -- -+ ocelot_write_rix(ocelot, SYS_MAC_FC_CFG_PAUSE_VAL_CFG(0xffff) | -+ SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA | -+ SYS_MAC_FC_CFG_ZERO_PAUSE_ENA | -+ SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) | -+ SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed), -+ SYS_MAC_FC_CFG, port); - ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port); - } --EXPORT_SYMBOL(ocelot_phylink_mac_config); -+EXPORT_SYMBOL(ocelot_adjust_link); - --void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- phy_interface_t interface) -+static void ocelot_port_adjust_link(struct net_device *dev) - { -- struct ocelot_port *ocelot_port = ocelot->ports[port]; -+ struct ocelot_port_private *priv = netdev_priv(dev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; - -- ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG); -- ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA, -- QSYS_SWITCH_PORT_MODE, port); -+ ocelot_adjust_link(ocelot, port, dev->phydev); - } --EXPORT_SYMBOL(ocelot_phylink_mac_link_down); - --void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- phy_interface_t interface, -- struct phy_device *phy) -+void ocelot_port_enable(struct ocelot *ocelot, int port, -+ struct phy_device *phy) - { - /* Enable receiving frames on the port, and activate auto-learning of - * MAC addresses. -@@ -551,22 +499,62 @@ void ocelot_phylink_mac_link_up(struct o - ANA_PORT_PORT_CFG_PORTID_VAL(port), - ANA_PORT_PORT_CFG, port); - } --EXPORT_SYMBOL(ocelot_phylink_mac_link_up); -+EXPORT_SYMBOL(ocelot_port_enable); - - static int ocelot_port_open(struct net_device *dev) - { - struct ocelot_port_private *priv = netdev_priv(dev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ int err; -+ -+ if (priv->serdes) { -+ err = phy_set_mode_ext(priv->serdes, PHY_MODE_ETHERNET, -+ priv->phy_mode); -+ if (err) { -+ netdev_err(dev, "Could not set mode of SerDes\n"); -+ return err; -+ } -+ } -+ -+ err = phy_connect_direct(dev, priv->phy, &ocelot_port_adjust_link, -+ priv->phy_mode); -+ if (err) { -+ netdev_err(dev, "Could not attach to PHY\n"); -+ return err; -+ } - -- phylink_start(priv->phylink); -+ dev->phydev = priv->phy; -+ -+ phy_attached_info(priv->phy); -+ phy_start(priv->phy); -+ -+ ocelot_port_enable(ocelot, port, priv->phy); - - return 0; - } - -+void ocelot_port_disable(struct ocelot *ocelot, int port) -+{ -+ struct ocelot_port *ocelot_port = ocelot->ports[port]; -+ -+ ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG); -+ ocelot_rmw_rix(ocelot, 0, QSYS_SWITCH_PORT_MODE_PORT_ENA, -+ QSYS_SWITCH_PORT_MODE, port); -+} -+EXPORT_SYMBOL(ocelot_port_disable); -+ - static int ocelot_port_stop(struct net_device *dev) - { - struct ocelot_port_private *priv = netdev_priv(dev); -+ struct ocelot *ocelot = priv->port.ocelot; -+ int port = priv->chip_port; -+ -+ phy_disconnect(priv->phy); -+ -+ dev->phydev = NULL; - -- phylink_stop(priv->phylink); -+ ocelot_port_disable(ocelot, port); - - return 0; - } -@@ -2263,7 +2251,8 @@ void ocelot_init_port(struct ocelot *oce - EXPORT_SYMBOL(ocelot_init_port); - - int ocelot_probe_port(struct ocelot *ocelot, u8 port, -- void __iomem *regs) -+ void __iomem *regs, -+ struct phy_device *phy) - { - struct ocelot_port_private *priv; - struct ocelot_port *ocelot_port; -@@ -2276,6 +2265,7 @@ int ocelot_probe_port(struct ocelot *oce - SET_NETDEV_DEV(dev, ocelot->dev); - priv = netdev_priv(dev); - priv->dev = dev; -+ priv->phy = phy; - priv->chip_port = port; - ocelot_port = &priv->port; - ocelot_port->ocelot = ocelot; ---- a/drivers/net/ethernet/mscc/ocelot.h -+++ b/drivers/net/ethernet/mscc/ocelot.h -@@ -12,7 +12,8 @@ - #include - #include - #include --#include -+#include -+#include - #include - #include - #include -@@ -64,12 +65,14 @@ struct ocelot_multicast { - struct ocelot_port_private { - struct ocelot_port port; - struct net_device *dev; -- struct phylink *phylink; -- struct phylink_config phylink_config; -+ struct phy_device *phy; - u8 chip_port; - - u8 vlan_aware; - -+ phy_interface_t phy_mode; -+ struct phy *serdes; -+ - struct ocelot_port_tc tc; - }; - -@@ -80,7 +83,9 @@ void ocelot_port_writel(struct ocelot_po - #define ocelot_field_read(ocelot, reg, val) regmap_field_read((ocelot)->regfields[(reg)], (val)) - - int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops); --int ocelot_probe_port(struct ocelot *ocelot, u8 port, void __iomem *regs); -+int ocelot_probe_port(struct ocelot *ocelot, u8 port, -+ void __iomem *regs, -+ struct phy_device *phy); - - void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu, - enum ocelot_tag_prefix injection, ---- a/drivers/net/ethernet/mscc/ocelot_board.c -+++ b/drivers/net/ethernet/mscc/ocelot_board.c -@@ -13,7 +13,6 @@ - #include - #include - #include --#include - - #include "ocelot.h" - -@@ -263,91 +262,6 @@ static const struct ocelot_ops ocelot_op - .reset = ocelot_reset, - }; - --static void ocelot_port_phylink_validate(struct phylink_config *config, -- unsigned long *supported, -- struct phylink_link_state *state) --{ -- struct net_device *ndev = to_net_dev(config->dev); -- struct ocelot_port_private *priv = netdev_priv(ndev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- ocelot_phylink_validate(ocelot, port, supported, state); --} -- --static int --ocelot_port_phylink_mac_pcs_get_state(struct phylink_config *config, -- struct phylink_link_state *state) --{ -- struct net_device *ndev = to_net_dev(config->dev); -- struct ocelot_port_private *priv = netdev_priv(ndev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- ocelot_phylink_mac_pcs_get_state(ocelot, port, state); -- -- return 0; --} -- --static void ocelot_port_phylink_mac_an_restart(struct phylink_config *config) --{ -- struct net_device *ndev = to_net_dev(config->dev); -- struct ocelot_port_private *priv = netdev_priv(ndev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- ocelot_phylink_mac_an_restart(ocelot, port); --} -- --static void --ocelot_port_phylink_mac_config(struct phylink_config *config, -- unsigned int link_an_mode, -- const struct phylink_link_state *state) --{ -- struct net_device *ndev = to_net_dev(config->dev); -- struct ocelot_port_private *priv = netdev_priv(ndev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- ocelot_phylink_mac_config(ocelot, port, link_an_mode, state); --} -- --static void ocelot_port_phylink_mac_link_down(struct phylink_config *config, -- unsigned int link_an_mode, -- phy_interface_t interface) --{ -- struct net_device *ndev = to_net_dev(config->dev); -- struct ocelot_port_private *priv = netdev_priv(ndev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- return ocelot_phylink_mac_link_down(ocelot, port, link_an_mode, -- interface); --} -- --static void ocelot_port_phylink_mac_link_up(struct phylink_config *config, -- unsigned int link_an_mode, -- phy_interface_t interface, -- struct phy_device *phy) --{ -- struct net_device *ndev = to_net_dev(config->dev); -- struct ocelot_port_private *priv = netdev_priv(ndev); -- struct ocelot *ocelot = priv->port.ocelot; -- int port = priv->chip_port; -- -- return ocelot_phylink_mac_link_up(ocelot, port, link_an_mode, -- interface, phy); --} -- --static const struct phylink_mac_ops ocelot_phylink_ops = { -- .validate = ocelot_port_phylink_validate, -- .mac_link_state = ocelot_port_phylink_mac_pcs_get_state, -- .mac_an_restart = ocelot_port_phylink_mac_an_restart, -- .mac_config = ocelot_port_phylink_mac_config, -- .mac_link_down = ocelot_port_phylink_mac_link_down, -- .mac_link_up = ocelot_port_phylink_mac_link_up, --}; -- - static int mscc_ocelot_probe(struct platform_device *pdev) - { - struct device_node *np = pdev->dev.of_node; -@@ -455,6 +369,8 @@ static int mscc_ocelot_probe(struct plat - for_each_available_child_of_node(ports, portnp) { - struct ocelot_port_private *priv; - struct ocelot_port *ocelot_port; -+ struct device_node *phy_node; -+ struct phy_device *phy; - struct resource *res; - struct phy *serdes; - void __iomem *regs; -@@ -473,7 +389,16 @@ static int mscc_ocelot_probe(struct plat - if (IS_ERR(regs)) - continue; - -- err = ocelot_probe_port(ocelot, port, regs); -+ phy_node = of_parse_phandle(portnp, "phy-handle", 0); -+ if (!phy_node) -+ continue; -+ -+ phy = of_phy_find_device(phy_node); -+ of_node_put(phy_node); -+ if (!phy) -+ continue; -+ -+ err = ocelot_probe_port(ocelot, port, regs, phy); - if (err) { - of_node_put(portnp); - goto out_put_ports; -@@ -487,7 +412,9 @@ static int mscc_ocelot_probe(struct plat - if (phy_mode < 0) - phy_mode = PHY_INTERFACE_MODE_NA; - -- switch (phy_mode) { -+ priv->phy_mode = phy_mode; -+ -+ switch (priv->phy_mode) { - case PHY_INTERFACE_MODE_NA: - continue; - case PHY_INTERFACE_MODE_SGMII: -@@ -524,41 +451,7 @@ static int mscc_ocelot_probe(struct plat - goto out_put_ports; - } - -- if (serdes) { -- err = phy_set_mode_ext(serdes, PHY_MODE_ETHERNET, -- phy_mode); -- if (err) { -- dev_err(ocelot->dev, -- "Could not set mode of SerDes\n"); -- of_node_put(portnp); -- goto out_put_ports; -- } -- } -- -- priv->phylink_config.dev = &priv->dev->dev; -- priv->phylink_config.type = PHYLINK_NETDEV; -- -- priv->phylink = phylink_create(&priv->phylink_config, -- of_fwnode_handle(portnp), -- phy_mode, &ocelot_phylink_ops); -- if (IS_ERR(priv->phylink)) { -- dev_err(ocelot->dev, -- "Could not create a phylink instance (%ld)\n", -- PTR_ERR(priv->phylink)); -- err = PTR_ERR(priv->phylink); -- priv->phylink = NULL; -- of_node_put(portnp); -- goto out_put_ports; -- } -- -- err = phylink_of_phy_connect(priv->phylink, portnp, 0); -- if (err) { -- dev_err(ocelot->dev, "Could not connect to PHY: %d\n", -- err); -- phylink_destroy(priv->phylink); -- of_node_put(portnp); -- goto out_put_ports; -- } -+ priv->serdes = serdes; - } - - register_netdevice_notifier(&ocelot_netdevice_nb); -@@ -575,27 +468,12 @@ out_put_ports: - static int mscc_ocelot_remove(struct platform_device *pdev) - { - struct ocelot *ocelot = platform_get_drvdata(pdev); -- int port; - - ocelot_deinit(ocelot); - unregister_switchdev_blocking_notifier(&ocelot_switchdev_blocking_nb); - unregister_switchdev_notifier(&ocelot_switchdev_nb); - unregister_netdevice_notifier(&ocelot_netdevice_nb); - -- for (port = 0; port < ocelot->num_phys_ports; port++) { -- struct ocelot_port_private *priv; -- -- priv = container_of(ocelot->ports[port], -- struct ocelot_port_private, -- port); -- -- if (priv->phylink) { -- rtnl_lock(); -- phylink_destroy(priv->phylink); -- rtnl_unlock(); -- } -- } -- - return 0; - } - ---- a/include/soc/mscc/ocelot.h -+++ b/include/soc/mscc/ocelot.h -@@ -518,12 +518,17 @@ void ocelot_deinit(struct ocelot *ocelot - void ocelot_init_port(struct ocelot *ocelot, int port); - - /* DSA callbacks */ -+void ocelot_port_enable(struct ocelot *ocelot, int port, -+ struct phy_device *phy); -+void ocelot_port_disable(struct ocelot *ocelot, int port); - void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data); - void ocelot_get_ethtool_stats(struct ocelot *ocelot, int port, u64 *data); - int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset); - int ocelot_get_ts_info(struct ocelot *ocelot, int port, - struct ethtool_ts_info *info); - void ocelot_set_ageing_time(struct ocelot *ocelot, unsigned int msecs); -+void ocelot_adjust_link(struct ocelot *ocelot, int port, -+ struct phy_device *phydev); - void ocelot_port_vlan_filtering(struct ocelot *ocelot, int port, - bool vlan_aware); - void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state); -@@ -592,21 +597,4 @@ int ocelot_rtag_parse_enable(struct ocel - int ocelot_dscp_set(struct ocelot *ocelot, int port, - bool enable, const u8 dscp_ix, - struct tsn_qos_switch_dscp_conf *c); --void ocelot_phylink_validate(struct ocelot *ocelot, int port, -- unsigned long *supported, -- struct phylink_link_state *state); --void ocelot_phylink_mac_pcs_get_state(struct ocelot *ocelot, int port, -- struct phylink_link_state *state); --void ocelot_phylink_mac_an_restart(struct ocelot *ocelot, int port); --void ocelot_phylink_mac_config(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- const struct phylink_link_state *state); --void ocelot_phylink_mac_link_down(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- phy_interface_t interface); --void ocelot_phylink_mac_link_up(struct ocelot *ocelot, int port, -- unsigned int link_an_mode, -- phy_interface_t interface, -- struct phy_device *phy); -- - #endif diff --git a/target/linux/layerscape/patches-5.4/701-net-0371-Revert-net-mscc-ocelot-do-not-force-Felix-MACs-at-lo.patch b/target/linux/layerscape/patches-5.4/701-net-0371-Revert-net-mscc-ocelot-do-not-force-Felix-MACs-at-lo.patch deleted file mode 100644 index 4859d1746..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0371-Revert-net-mscc-ocelot-do-not-force-Felix-MACs-at-lo.patch +++ /dev/null @@ -1,145 +0,0 @@ -From 6864e50946bf92f96b8452d1e47765230a276bb0 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:30:58 +0200 -Subject: [PATCH] Revert "net: mscc: ocelot: do not force Felix MACs at lower - speeds than gigabit" - -This reverts commit f3ebad1269aad8a04710e84dc1cd5de485e5fec4. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/dsa/ocelot/felix.c | 1 - - drivers/net/dsa/ocelot/felix.h | 1 - - drivers/net/dsa/ocelot/felix_vsc9959.c | 1 - - drivers/net/ethernet/mscc/ocelot.c | 32 ++++++++++++++------------------ - include/soc/mscc/ocelot.h | 7 ------- - 5 files changed, 14 insertions(+), 28 deletions(-) - ---- a/drivers/net/dsa/ocelot/felix.c -+++ b/drivers/net/dsa/ocelot/felix.c -@@ -249,7 +249,6 @@ static int felix_init_structs(struct fel - ocelot->num_stats = felix->info->num_stats; - ocelot->shared_queue_sz = felix->info->shared_queue_sz; - ocelot->ops = felix->info->ops; -- ocelot->quirks = felix->info->quirks; - - base = pci_resource_start(felix->pdev, felix->info->pci_bar); - ---- a/drivers/net/dsa/ocelot/felix.h -+++ b/drivers/net/dsa/ocelot/felix.h -@@ -18,7 +18,6 @@ struct felix_info { - unsigned int num_stats; - int num_ports; - int pci_bar; -- unsigned long quirks; - }; - - extern struct felix_info felix_info_vsc9959; ---- a/drivers/net/dsa/ocelot/felix_vsc9959.c -+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c -@@ -584,5 +584,4 @@ struct felix_info felix_info_vsc9959 = { - .shared_queue_sz = 128 * 1024, - .num_ports = 6, - .pci_bar = 4, -- .quirks = OCELOT_PCS_PERFORMS_RATE_ADAPTATION, - }; ---- a/drivers/net/ethernet/mscc/ocelot.c -+++ b/drivers/net/ethernet/mscc/ocelot.c -@@ -409,32 +409,27 @@ static u16 ocelot_wm_enc(u16 value) - void ocelot_adjust_link(struct ocelot *ocelot, int port, - struct phy_device *phydev) - { -- int speed, mac_speed, mac_mode = DEV_MAC_MODE_CFG_FDX_ENA; - struct ocelot_port *ocelot_port = ocelot->ports[port]; -+ int speed, mode = 0; - -- if (ocelot->quirks & OCELOT_PCS_PERFORMS_RATE_ADAPTATION) -- speed = SPEED_1000; -- else -- speed = phydev->speed; -- -- switch (speed) { -+ switch (phydev->speed) { - case SPEED_10: -- mac_speed = OCELOT_SPEED_10; -+ speed = OCELOT_SPEED_10; - break; - case SPEED_100: -- mac_speed = OCELOT_SPEED_100; -+ speed = OCELOT_SPEED_100; - break; - case SPEED_1000: -- mac_speed = OCELOT_SPEED_1000; -- mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA; -+ speed = OCELOT_SPEED_1000; -+ mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA; - break; - case SPEED_2500: -- mac_speed = OCELOT_SPEED_2500; -- mac_mode |= DEV_MAC_MODE_CFG_GIGA_MODE_ENA; -+ speed = OCELOT_SPEED_2500; -+ mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA; - break; - default: - dev_err(ocelot->dev, "Unsupported PHY speed on port %d: %d\n", -- port, speed); -+ port, phydev->speed); - return; - } - -@@ -444,7 +439,8 @@ void ocelot_adjust_link(struct ocelot *o - return; - - /* Only full duplex supported for now */ -- ocelot_port_writel(ocelot_port, mac_mode, DEV_MAC_MODE_CFG); -+ ocelot_port_writel(ocelot_port, DEV_MAC_MODE_CFG_FDX_ENA | -+ mode, DEV_MAC_MODE_CFG); - - if (ocelot->ops->pcs_init) - ocelot->ops->pcs_init(ocelot, port); -@@ -455,11 +451,11 @@ void ocelot_adjust_link(struct ocelot *o - - /* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of - * reset */ -- ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(mac_speed), -+ ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed), - DEV_CLOCK_CFG); - - /* No PFC */ -- ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(mac_speed), -+ ocelot_write_gix(ocelot, ANA_PFC_PFC_CFG_FC_LINK_SPEED(speed), - ANA_PFC_PFC_CFG, port); - - /* Core: Enable port for frame transfer */ -@@ -473,7 +469,7 @@ void ocelot_adjust_link(struct ocelot *o - SYS_MAC_FC_CFG_RX_FC_ENA | SYS_MAC_FC_CFG_TX_FC_ENA | - SYS_MAC_FC_CFG_ZERO_PAUSE_ENA | - SYS_MAC_FC_CFG_FC_LATENCY_CFG(0x7) | -- SYS_MAC_FC_CFG_FC_LINK_SPEED(mac_speed), -+ SYS_MAC_FC_CFG_FC_LINK_SPEED(speed), - SYS_MAC_FC_CFG, port); - ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port); - } ---- a/include/soc/mscc/ocelot.h -+++ b/include/soc/mscc/ocelot.h -@@ -404,11 +404,6 @@ enum ocelot_tag_prefix { - OCELOT_TAG_PREFIX_LONG, - }; - --/* Hardware quirks (differences between switch instantiations) */ --enum { -- OCELOT_PCS_PERFORMS_RATE_ADAPTATION = BIT(0), --}; -- - struct ocelot; - - struct ocelot_ops { -@@ -469,8 +464,6 @@ struct ocelot { - struct delayed_work stats_work; - struct workqueue_struct *stats_queue; - -- unsigned long quirks; -- - u8 ptp:1; - struct ptp_clock *ptp_clock; - struct ptp_clock_info ptp_info; diff --git a/target/linux/layerscape/patches-5.4/701-net-0372-Revert-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-va.patch b/target/linux/layerscape/patches-5.4/701-net-0372-Revert-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-va.patch deleted file mode 100644 index fda777ba9..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0372-Revert-enetc-Set-MDIO_CFG_HOLD-to-the-recommended-va.patch +++ /dev/null @@ -1,55 +0,0 @@ -From d93ca8d9c8365cf533f88582c57c83cb50fe598a Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:31:13 +0200 -Subject: [PATCH] Revert "enetc: Set MDIO_CFG_HOLD to the recommended value of - 2" - -This reverts commit 3f643e4af035886cd2ca4bf79967098cfe55b40b. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - ---- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -@@ -31,19 +31,15 @@ static inline void _enetc_mdio_wr(struct - _enetc_mdio_wr(mdio_priv, ENETC_##off, val) - #define enetc_mdio_rd_reg(off) enetc_mdio_rd(mdio_priv, off) - -+#define ENETC_MDC_DIV 258 -+ - #define MDIO_CFG_CLKDIV(x) ((((x) >> 1) & 0xff) << 8) - #define MDIO_CFG_BSY BIT(0) - #define MDIO_CFG_RD_ER BIT(1) --#define MDIO_CFG_HOLD(x) (((x) << 2) & GENMASK(4, 2)) - #define MDIO_CFG_ENC45 BIT(6) - /* external MDIO only - driven on neg MDC edge */ - #define MDIO_CFG_NEG BIT(23) - --#define ENETC_EMDIO_CFG \ -- (MDIO_CFG_HOLD(2) | \ -- MDIO_CFG_CLKDIV(258) | \ -- MDIO_CFG_NEG) -- - #define MDIO_CTL_DEV_ADDR(x) ((x) & 0x1f) - #define MDIO_CTL_PORT_ADDR(x) (((x) & 0x1f) << 5) - #define MDIO_CTL_READ BIT(15) -@@ -65,7 +61,7 @@ int enetc_mdio_write(struct mii_bus *bus - u16 dev_addr; - int ret; - -- mdio_cfg = ENETC_EMDIO_CFG; -+ mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG; - if (regnum & MII_ADDR_C45) { - dev_addr = (regnum >> 16) & 0x1f; - mdio_cfg |= MDIO_CFG_ENC45; -@@ -112,7 +108,7 @@ int enetc_mdio_read(struct mii_bus *bus, - u16 dev_addr, value; - int ret; - -- mdio_cfg = ENETC_EMDIO_CFG; -+ mdio_cfg = MDIO_CFG_CLKDIV(ENETC_MDC_DIV) | MDIO_CFG_NEG; - if (regnum & MII_ADDR_C45) { - dev_addr = (regnum >> 16) & 0x1f; - mdio_cfg |= MDIO_CFG_ENC45; diff --git a/target/linux/layerscape/patches-5.4/701-net-0373-Revert-enetc-export-enetc_mdio-definitionns-to-inclu.patch b/target/linux/layerscape/patches-5.4/701-net-0373-Revert-enetc-export-enetc_mdio-definitionns-to-inclu.patch deleted file mode 100644 index 5e934c69d..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0373-Revert-enetc-export-enetc_mdio-definitionns-to-inclu.patch +++ /dev/null @@ -1,192 +0,0 @@ -From 78378454e7978ea3b4128822880677e6efa9ddef Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:31:22 +0200 -Subject: [PATCH] Revert "enetc: export enetc_mdio definitionns to - include/linux/fsl" - -This reverts commit f8d80c003b76f397696bf887ebbd37a78781c050. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 18 +--------- - drivers/net/ethernet/freescale/enetc/enetc_mdio.h | 12 +++++++ - .../net/ethernet/freescale/enetc/enetc_pci_mdio.c | 41 +++++++++------------- - include/linux/fsl/enetc_mdio.h | 21 ----------- - 4 files changed, 30 insertions(+), 62 deletions(-) - create mode 100644 drivers/net/ethernet/freescale/enetc/enetc_mdio.h - delete mode 100644 include/linux/fsl/enetc_mdio.h - ---- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c -@@ -1,13 +1,13 @@ - // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) - /* Copyright 2019 NXP */ - --#include - #include - #include - #include - #include - - #include "enetc_pf.h" -+#include "enetc_mdio.h" - - #define ENETC_MDIO_CFG 0x0 /* MDIO configuration and status */ - #define ENETC_MDIO_CTL 0x4 /* MDIO control */ -@@ -99,7 +99,6 @@ int enetc_mdio_write(struct mii_bus *bus - - return 0; - } --EXPORT_SYMBOL_GPL(enetc_mdio_write); - - int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum) - { -@@ -155,21 +154,6 @@ int enetc_mdio_read(struct mii_bus *bus, - - return value; - } --EXPORT_SYMBOL_GPL(enetc_mdio_read); -- --struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs) --{ -- struct enetc_hw *hw; -- -- hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL); -- if (!hw) -- return ERR_PTR(-ENOMEM); -- -- hw->port = port_regs; -- -- return hw; --} --EXPORT_SYMBOL_GPL(enetc_hw_alloc); - - int enetc_mdio_probe(struct enetc_pf *pf) - { ---- /dev/null -+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.h -@@ -0,0 +1,12 @@ -+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ -+/* Copyright 2019 NXP */ -+ -+#include -+ -+struct enetc_mdio_priv { -+ struct enetc_hw *hw; -+ int mdio_base; -+}; -+ -+int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value); -+int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum); ---- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c -+++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c -@@ -1,8 +1,8 @@ - // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) - /* Copyright 2019 NXP */ --#include - #include - #include "enetc_pf.h" -+#include "enetc_mdio.h" - - #define ENETC_MDIO_DEV_ID 0xee01 - #define ENETC_MDIO_DEV_NAME "FSL PCIe IE Central MDIO" -@@ -14,29 +14,17 @@ static int enetc_pci_mdio_probe(struct p - { - struct enetc_mdio_priv *mdio_priv; - struct device *dev = &pdev->dev; -- void __iomem *port_regs; - struct enetc_hw *hw; - struct mii_bus *bus; - int err; - -- port_regs = pci_iomap(pdev, 0, 0); -- if (!port_regs) { -- dev_err(dev, "iomap failed\n"); -- err = -ENXIO; -- goto err_ioremap; -- } -- -- hw = enetc_hw_alloc(dev, port_regs); -- if (IS_ERR(enetc_hw_alloc)) { -- err = PTR_ERR(hw); -- goto err_hw_alloc; -- } -+ hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL); -+ if (!hw) -+ return -ENOMEM; - - bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); -- if (!bus) { -- err = -ENOMEM; -- goto err_mdiobus_alloc; -- } -+ if (!bus) -+ return -ENOMEM; - - bus->name = ENETC_MDIO_BUS_NAME; - bus->read = enetc_mdio_read; -@@ -51,7 +39,7 @@ static int enetc_pci_mdio_probe(struct p - err = pci_enable_device_mem(pdev); - if (err) { - dev_err(dev, "device enable failed\n"); -- goto err_pci_enable; -+ return err; - } - - err = pci_request_region(pdev, 0, KBUILD_MODNAME); -@@ -60,6 +48,13 @@ static int enetc_pci_mdio_probe(struct p - goto err_pci_mem_reg; - } - -+ hw->port = pci_iomap(pdev, 0, 0); -+ if (!hw->port) { -+ err = -ENXIO; -+ dev_err(dev, "iomap failed\n"); -+ goto err_ioremap; -+ } -+ - err = of_mdiobus_register(bus, dev->of_node); - if (err) - goto err_mdiobus_reg; -@@ -69,14 +64,12 @@ static int enetc_pci_mdio_probe(struct p - return 0; - - err_mdiobus_reg: -+ iounmap(mdio_priv->hw->port); -+err_ioremap: - pci_release_mem_regions(pdev); - err_pci_mem_reg: - pci_disable_device(pdev); --err_pci_enable: --err_mdiobus_alloc: -- iounmap(port_regs); --err_hw_alloc: --err_ioremap: -+ - return err; - } - ---- a/include/linux/fsl/enetc_mdio.h -+++ /dev/null -@@ -1,21 +0,0 @@ --/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ --/* Copyright 2019 NXP */ -- --#include -- --/* PCS registers */ --#define ENETC_PCS_LINK_TIMER1 0x12 --#define ENETC_PCS_LINK_TIMER1_VAL 0x06a0 --#define ENETC_PCS_LINK_TIMER2 0x13 --#define ENETC_PCS_LINK_TIMER2_VAL 0x0003 --#define ENETC_PCS_IF_MODE 0x14 --#define ENETC_PCS_IF_MODE_SGMII_AN 0x0003 -- --struct enetc_mdio_priv { -- struct enetc_hw *hw; -- int mdio_base; --}; -- --int enetc_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value); --int enetc_mdio_read(struct mii_bus *bus, int phy_id, int regnum); --struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs); diff --git a/target/linux/layerscape/patches-5.4/701-net-0374-Revert-net-phylink-call-mac_an_restart-for-SGMII-QSG.patch b/target/linux/layerscape/patches-5.4/701-net-0374-Revert-net-phylink-call-mac_an_restart-for-SGMII-QSG.patch deleted file mode 100644 index 4b2cee677..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0374-Revert-net-phylink-call-mac_an_restart-for-SGMII-QSG.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d3a532021976d98bfc9e3dac18a17abccf6eb567 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:31:42 +0200 -Subject: [PATCH] Revert "net: phylink: call mac_an_restart for SGMII/QSGMII - inband interfaces too" - -This reverts commit 57fe15baac62dad00817e3359cefc123e24f10a2. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/phy/phylink.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - ---- a/drivers/net/phy/phylink.c -+++ b/drivers/net/phy/phylink.c -@@ -360,9 +360,7 @@ static void phylink_mac_config_up(struct - static void phylink_mac_an_restart(struct phylink *pl) - { - if (pl->link_config.an_enabled && -- (phy_interface_mode_is_8023z(pl->link_config.interface) || -- pl->link_config.interface == PHY_INTERFACE_MODE_SGMII || -- pl->link_config.interface == PHY_INTERFACE_MODE_QSGMII)) -+ phy_interface_mode_is_8023z(pl->link_config.interface)) - pl->ops->mac_an_restart(pl->config); - } - diff --git a/target/linux/layerscape/patches-5.4/701-net-0375-Revert-net-phylink-make-QSGMII-a-valid-PHY-mode-for-.patch b/target/linux/layerscape/patches-5.4/701-net-0375-Revert-net-phylink-make-QSGMII-a-valid-PHY-mode-for-.patch deleted file mode 100644 index e2bce2f6a..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0375-Revert-net-phylink-make-QSGMII-a-valid-PHY-mode-for-.patch +++ /dev/null @@ -1,23 +0,0 @@ -From e53b64cab45ea4d01226840efd963a6bec8ad2f9 Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:31:58 +0200 -Subject: [PATCH] Revert "net: phylink: make QSGMII a valid PHY mode for - in-band AN" - -This reverts commit fe7fd9f6afce50c0fc09fd3d56cd59eda44d8dd0. - -Signed-off-by: Vladimir Oltean ---- - drivers/net/phy/phylink.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/net/phy/phylink.c -+++ b/drivers/net/phy/phylink.c -@@ -283,7 +283,6 @@ static int phylink_parse_mode(struct phy - - switch (pl->link_config.interface) { - case PHY_INTERFACE_MODE_SGMII: -- case PHY_INTERFACE_MODE_QSGMII: - phylink_set(pl->supported, 10baseT_Half); - phylink_set(pl->supported, 10baseT_Full); - phylink_set(pl->supported, 100baseT_Half); diff --git a/target/linux/layerscape/patches-5.4/701-net-0376-Revert-mii-Add-helpers-for-parsing-SGMII-auto-negoti.patch b/target/linux/layerscape/patches-5.4/701-net-0376-Revert-mii-Add-helpers-for-parsing-SGMII-auto-negoti.patch deleted file mode 100644 index 3831cac48..000000000 --- a/target/linux/layerscape/patches-5.4/701-net-0376-Revert-mii-Add-helpers-for-parsing-SGMII-auto-negoti.patch +++ /dev/null @@ -1,110 +0,0 @@ -From c6f9fb78b7534392d3be307e566d10c8525c7c9a Mon Sep 17 00:00:00 2001 -From: Vladimir Oltean -Date: Mon, 6 Jan 2020 14:32:06 +0200 -Subject: [PATCH] Revert "mii: Add helpers for parsing SGMII auto-negotiation" - -This reverts commit de81e3c1ccbf27eda7584e23c713705a221a57da. - -Signed-off-by: Vladimir Oltean ---- - include/linux/mii.h | 50 ------------------------------------------------ - include/uapi/linux/mii.h | 10 ---------- - 2 files changed, 60 deletions(-) - ---- a/include/linux/mii.h -+++ b/include/linux/mii.h -@@ -373,56 +373,6 @@ static inline u32 mii_lpa_to_ethtool_lpa - } - - /** -- * mii_lpa_mod_linkmode_adv_sgmii -- * @lp_advertising: pointer to destination link mode. -- * @lpa: value of the MII_LPA register -- * -- * A small helper function that translates MII_LPA bits to -- * linkmode advertisement settings for SGMII. -- * Leaves other bits unchanged. -- */ --static inline void --mii_lpa_mod_linkmode_lpa_sgmii(unsigned long *lp_advertising, u32 lpa) --{ -- u32 speed_duplex = lpa & LPA_SGMII_DPX_SPD_MASK; -- -- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, lp_advertising, -- speed_duplex == LPA_SGMII_1000HALF); -- -- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, lp_advertising, -- speed_duplex == LPA_SGMII_1000FULL); -- -- linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, lp_advertising, -- speed_duplex == LPA_SGMII_100HALF); -- -- linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, lp_advertising, -- speed_duplex == LPA_SGMII_100FULL); -- -- linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, lp_advertising, -- speed_duplex == LPA_SGMII_10HALF); -- -- linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, lp_advertising, -- speed_duplex == LPA_SGMII_10FULL); --} -- --/** -- * mii_lpa_to_linkmode_adv_sgmii -- * @advertising: pointer to destination link mode. -- * @lpa: value of the MII_LPA register -- * -- * A small helper function that translates MII_ADVERTISE bits -- * to linkmode advertisement settings when in SGMII mode. -- * Clears the old value of advertising. -- */ --static inline void mii_lpa_to_linkmode_lpa_sgmii(unsigned long *lp_advertising, -- u32 lpa) --{ -- linkmode_zero(lp_advertising); -- -- mii_lpa_mod_linkmode_lpa_sgmii(lp_advertising, lpa); --} -- --/** - * mii_adv_mod_linkmode_adv_t - * @advertising:pointer to destination link mode. - * @adv: value of the MII_ADVERTISE register ---- a/include/uapi/linux/mii.h -+++ b/include/uapi/linux/mii.h -@@ -71,7 +71,6 @@ - /* Advertisement control register. */ - #define ADVERTISE_SLCT 0x001f /* Selector bits */ - #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ --#define ADVERTISE_SGMII 0x0001 /* Can do SGMII */ - #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ - #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ - #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ -@@ -95,7 +94,6 @@ - - /* Link partner ability register. */ - #define LPA_SLCT 0x001f /* Same as advertise selector */ --#define LPA_SGMII 0x0001 /* Can do SGMII */ - #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ - #define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ - #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ -@@ -106,19 +104,11 @@ - #define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ - #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ - #define LPA_PAUSE_CAP 0x0400 /* Can pause */ --#define LPA_SGMII_DPX_SPD_MASK 0x1C00 /* SGMII duplex and speed bits */ --#define LPA_SGMII_10HALF 0x0000 /* Can do SGMII 10mbps half-duplex */ --#define LPA_SGMII_10FULL 0x1000 /* Can do SGMII 10mbps full-duplex */ --#define LPA_SGMII_100HALF 0x0400 /* Can do SGMII 100mbps half-duplex */ --#define LPA_SGMII_100FULL 0x1400 /* Can do SGMII 100mbps full-duplex */ - #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ --#define LPA_SGMII_1000HALF 0x0800 /* Can do SGMII 1000mbps half-duplex */ --#define LPA_SGMII_1000FULL 0x1800 /* Can do SGMII 1000mbps full-duplex */ - #define LPA_RESV 0x1000 /* Unused... */ - #define LPA_RFAULT 0x2000 /* Link partner faulted */ - #define LPA_LPACK 0x4000 /* Link partner acked us */ - #define LPA_NPAGE 0x8000 /* Next page bit */ --#define LPA_SGMII_LINK 0x8000 /* Link partner has link */ - - #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) - #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) diff --git a/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch b/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch index e88d0fb39..5b51fa279 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0001-Revert-ASoC-fsl_sai-Fix-noise-when-using-EDMA.patch @@ -28,7 +28,7 @@ This reverts commit e75f4940e8ad0dd76527302a10c06b58bf7eb590. ret = snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &fsl_sai_rate_constraints); -@@ -1048,35 +1038,30 @@ static int fsl_sai_remove(struct platfor +@@ -1049,35 +1039,30 @@ static int fsl_sai_remove(struct platfor static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, diff --git a/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch b/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch index ba3eb4dc3..08198f2c4 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0003-Revert-ASoC-fsl_sai-Add-support-for-imx8qm.patch @@ -10,7 +10,7 @@ This reverts commit 6eeb60be5ebb73b2e5911e26fb1aed02940b7d09. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1043,19 +1043,12 @@ static const struct fsl_sai_soc_data fsl +@@ -1044,19 +1044,12 @@ static const struct fsl_sai_soc_data fsl .reg_offset = 8, }; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch b/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch index 4735ccee0..d3518b277 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0004-Revert-ASoC-fsl_sai-Add-support-for-imx7ulp-imx8mq.patch @@ -10,7 +10,7 @@ This reverts commit a860fac420971c5a90d4f78959b44ead793aee4f. --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1031,24 +1031,10 @@ static const struct fsl_sai_soc_data fsl +@@ -1032,24 +1032,10 @@ static const struct fsl_sai_soc_data fsl .reg_offset = 0, }; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch b/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch index 85dec5cd2..bf5ee6024 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch @@ -287,7 +287,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. FSL_SAI_CR3_TRCE_MASK, 0); } -@@ -643,20 +633,18 @@ static const struct snd_soc_dai_ops fsl_ +@@ -643,20 +633,17 @@ static const struct snd_soc_dai_ops fsl_ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); @@ -305,17 +305,16 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. + regmap_write(sai->regmap, FSL_SAI_RCSR, 0); - regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs), -- FSL_SAI_CR1_RFW_MASK, +- FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth), + regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX); - regmap_update_bits(sai->regmap, FSL_SAI_RCR1(ofs), -- FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1); +- FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth), + regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, -+ FSL_SAI_MAXBURST_RX - 1); + FSL_SAI_MAXBURST_RX - 1); snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, - &sai->dma_params_rx); -@@ -693,12 +681,12 @@ static const struct snd_soc_component_dr +@@ -694,12 +681,12 @@ static const struct snd_soc_component_dr .name = "fsl-sai", }; @@ -334,7 +333,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. {FSL_SAI_TDR0, 0}, {FSL_SAI_TDR1, 0}, {FSL_SAI_TDR2, 0}, -@@ -707,50 +695,24 @@ static struct reg_default fsl_sai_reg_de +@@ -708,50 +695,24 @@ static struct reg_default fsl_sai_reg_de {FSL_SAI_TDR5, 0}, {FSL_SAI_TDR6, 0}, {FSL_SAI_TDR7, 0}, @@ -398,7 +397,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_TFR0: case FSL_SAI_TFR1: case FSL_SAI_TFR2: -@@ -760,6 +722,12 @@ static bool fsl_sai_readable_reg(struct +@@ -761,6 +722,12 @@ static bool fsl_sai_readable_reg(struct case FSL_SAI_TFR6: case FSL_SAI_TFR7: case FSL_SAI_TMR: @@ -411,7 +410,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_RDR0: case FSL_SAI_RDR1: case FSL_SAI_RDR2: -@@ -785,13 +753,9 @@ static bool fsl_sai_readable_reg(struct +@@ -786,13 +753,9 @@ static bool fsl_sai_readable_reg(struct static bool fsl_sai_volatile_reg(struct device *dev, unsigned int reg) { @@ -427,7 +426,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_TFR0: case FSL_SAI_TFR1: case FSL_SAI_TFR2: -@@ -824,16 +788,13 @@ static bool fsl_sai_volatile_reg(struct +@@ -825,16 +788,13 @@ static bool fsl_sai_volatile_reg(struct static bool fsl_sai_writeable_reg(struct device *dev, unsigned int reg) { @@ -450,7 +449,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_TDR0: case FSL_SAI_TDR1: case FSL_SAI_TDR2: -@@ -843,6 +804,12 @@ static bool fsl_sai_writeable_reg(struct +@@ -844,6 +804,12 @@ static bool fsl_sai_writeable_reg(struct case FSL_SAI_TDR6: case FSL_SAI_TDR7: case FSL_SAI_TMR: @@ -463,7 +462,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. case FSL_SAI_RMR: return true; default: -@@ -850,15 +817,15 @@ static bool fsl_sai_writeable_reg(struct +@@ -851,15 +817,15 @@ static bool fsl_sai_writeable_reg(struct } } @@ -482,7 +481,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. .readable_reg = fsl_sai_readable_reg, .volatile_reg = fsl_sai_volatile_reg, .writeable_reg = fsl_sai_writeable_reg, -@@ -890,12 +857,6 @@ static int fsl_sai_probe(struct platform +@@ -891,12 +857,6 @@ static int fsl_sai_probe(struct platform if (IS_ERR(base)) return PTR_ERR(base); @@ -495,7 +494,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", base, &fsl_sai_regmap_config); -@@ -1022,13 +983,11 @@ static int fsl_sai_remove(struct platfor +@@ -1023,13 +983,11 @@ static int fsl_sai_remove(struct platfor static const struct fsl_sai_soc_data fsl_sai_vf610_data = { .use_imx_pcm = false, .fifo_depth = 32, @@ -509,7 +508,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. }; static const struct of_device_id fsl_sai_ids[] = { -@@ -1061,7 +1020,6 @@ static int fsl_sai_runtime_suspend(struc +@@ -1062,7 +1020,6 @@ static int fsl_sai_runtime_suspend(struc static int fsl_sai_runtime_resume(struct device *dev) { struct fsl_sai *sai = dev_get_drvdata(dev); @@ -517,7 +516,7 @@ This reverts commit 4f7a0728b5305e2d865f543fbcffd617e03c7674. int ret; ret = clk_prepare_enable(sai->bus_clk); -@@ -1083,11 +1041,11 @@ static int fsl_sai_runtime_resume(struct +@@ -1084,11 +1041,11 @@ static int fsl_sai_runtime_resume(struct } regcache_cache_only(sai->regmap, false); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0023-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-part-2.patch b/target/linux/layerscape/patches-5.4/801-audio-0023-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-part-2.patch deleted file mode 100644 index d09dd9b41..000000000 --- a/target/linux/layerscape/patches-5.4/801-audio-0023-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-part-2.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 5d816f1a5cac458a7fff9ecf896c85eb351a7352 Mon Sep 17 00:00:00 2001 -From: Viorel Suman -Date: Mon, 30 Mar 2020 16:24:59 +0800 -Subject: [PATCH] ASoC: fsl: add imx-pcm-dma v2 platform driver (part 2) - -which don't request the dma channel in the probe, but request -dma channel when needed. for the dma channel of cpu dai in BE -can be reused by the FE. - -Signed-off-by: Shengjiu Wang -[ Aisheng: split PCM changes ] -Signed-off-by: Dong Aisheng -[rebase] -Signed-off-by: Yangbo Lu ---- - sound/soc/fsl/fsl_sai.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/sound/soc/fsl/fsl_sai.c -+++ b/sound/soc/fsl/fsl_sai.c -@@ -1046,6 +1046,8 @@ static int fsl_sai_probe(struct platform - MCLK_DIR(index)); - } - -+ sai->dma_params_rx.filter_data = "rx"; -+ sai->dma_params_tx.filter_data = "tx"; - sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0; - sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0; - sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; -@@ -1061,7 +1063,7 @@ static int fsl_sai_probe(struct platform - goto err_pm_disable; - - if (sai->soc->imx) -- ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); -+ ret = imx_pcm_platform_register(&pdev->dev); - if (ret) - goto err_pm_disable; - } else { diff --git a/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch b/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch index 38d3041ba..7f234a27c 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0027-MLK-15140-1-ASoC-fsl_sai-support-latest-sai-module.patch @@ -590,7 +590,7 @@ Signed-off-by: Shengjiu Wang if (ret) { dev_err(&pdev->dev, "failed to claim irq %u\n", irq); return ret; -@@ -1090,6 +1134,7 @@ static int fsl_sai_runtime_suspend(struc +@@ -1088,6 +1132,7 @@ static int fsl_sai_runtime_suspend(struc static int fsl_sai_runtime_resume(struct device *dev) { struct fsl_sai *sai = dev_get_drvdata(dev); @@ -598,7 +598,7 @@ Signed-off-by: Shengjiu Wang int ret; ret = clk_prepare_enable(sai->bus_clk); -@@ -1115,11 +1160,11 @@ static int fsl_sai_runtime_resume(struct +@@ -1113,11 +1158,11 @@ static int fsl_sai_runtime_resume(struct PM_QOS_CPU_DMA_LATENCY, 0); regcache_cache_only(sai->regmap, false); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch b/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch index 5232a6989..9f9db86f6 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0030-MLK-15960-2-ASoC-fsl_sai-refine-the-pm-runtime-funct.patch @@ -16,7 +16,7 @@ Signed-off-by: Shengjiu Wang --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1096,6 +1096,8 @@ static int fsl_sai_probe(struct platform +@@ -1094,6 +1094,8 @@ static int fsl_sai_probe(struct platform pm_runtime_enable(&pdev->dev); @@ -25,7 +25,7 @@ Signed-off-by: Shengjiu Wang ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component, &fsl_sai_dai, 1); if (ret) -@@ -1139,6 +1141,8 @@ static int fsl_sai_runtime_suspend(struc +@@ -1137,6 +1139,8 @@ static int fsl_sai_runtime_suspend(struc { struct fsl_sai *sai = dev_get_drvdata(dev); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0036-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_data-pa.patch b/target/linux/layerscape/patches-5.4/801-audio-0036-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_data-pa.patch deleted file mode 100644 index 5cc427496..000000000 --- a/target/linux/layerscape/patches-5.4/801-audio-0036-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_data-pa.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8d4837f146cd14cf7041050ddec77b2a5c3f2f27 Mon Sep 17 00:00:00 2001 -From: Shengjiu Wang -Date: Tue, 23 Jan 2018 13:25:40 +0800 -Subject: [PATCH] MLK-17442: ASoC: fsl: fix wrong usage of filter_data (part 1) - -The filter_data should be used for dma_filter_fn function, -but we used the filter_data wrongly for dma channel name. -This patch is to fix the issue. - -Signed-off-by: Shengjiu Wang -Reviwed-by: Daniel Baluta -[ Aisheng: split out esai and pcm changes ] -Signed-off-by: Dong Aisheng ---- - sound/soc/fsl/fsl_sai.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/sound/soc/fsl/fsl_sai.c -+++ b/sound/soc/fsl/fsl_sai.c -@@ -1136,8 +1136,8 @@ static int fsl_sai_probe(struct platform - MCLK_DIR(index)); - } - -- sai->dma_params_rx.filter_data = "rx"; -- sai->dma_params_tx.filter_data = "tx"; -+ sai->dma_params_rx.chan_name = "rx"; -+ sai->dma_params_tx.chan_name = "tx"; - sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0; - sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0; - sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch b/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch index 033ab0d06..b5802d325 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0037-MLK-16224-4-ASoC-fsl_sai-support-multi-fifo-and-DSD.patch @@ -274,7 +274,7 @@ Reviewed-by: Viorel Suman if ((of_find_property(np, "fsl,i2s-xtor", NULL) != NULL) || (of_find_property(np, "fsl,txm-rxs", NULL) != NULL)) { -@@ -1143,6 +1282,11 @@ static int fsl_sai_probe(struct platform +@@ -1141,6 +1280,11 @@ static int fsl_sai_probe(struct platform sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0048-MLK-17580-ASoC-fsl-sai-Use-DSD-helper.patch b/target/linux/layerscape/patches-5.4/801-audio-0048-MLK-17580-ASoC-fsl-sai-Use-DSD-helper.patch index ffd74f81d..856f2bb6d 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0048-MLK-17580-ASoC-fsl-sai-Use-DSD-helper.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0048-MLK-17580-ASoC-fsl-sai-Use-DSD-helper.patch @@ -73,7 +73,7 @@ Reviewed-by: Shengjiu Wang dev, "failed to set proper pins state: %d\n", ret); -@@ -1356,9 +1347,6 @@ static int fsl_sai_probe(struct platform +@@ -1354,9 +1345,6 @@ static int fsl_sai_probe(struct platform sai->pinctrl = devm_pinctrl_get(&pdev->dev); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0049-MLK-17580-ASoC-fsl-sai-check-for-pinctrl-status.patch b/target/linux/layerscape/patches-5.4/801-audio-0049-MLK-17580-ASoC-fsl-sai-check-for-pinctrl-status.patch index 5f69c1daa..ebd71672b 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0049-MLK-17580-ASoC-fsl-sai-check-for-pinctrl-status.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0049-MLK-17580-ASoC-fsl-sai-check-for-pinctrl-status.patch @@ -49,7 +49,7 @@ Signed-off-by: Viorel Suman ret = pinctrl_select_state(sai->pinctrl, sai->pins_state); if (ret) { dev_err(cpu_dai->dev, -@@ -1345,7 +1348,7 @@ static int fsl_sai_probe(struct platform +@@ -1343,7 +1346,7 @@ static int fsl_sai_probe(struct platform sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0062-ASoC-fsl-sai-fix-build-failture-due-to-5.1-RC7-upgra.patch b/target/linux/layerscape/patches-5.4/801-audio-0062-ASoC-fsl-sai-fix-build-failture-due-to-5.1-RC7-upgra.patch index 7cce9d45a..3f92c2185 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0062-ASoC-fsl-sai-fix-build-failture-due-to-5.1-RC7-upgra.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0062-ASoC-fsl-sai-fix-build-failture-due-to-5.1-RC7-upgra.patch @@ -25,7 +25,7 @@ Signed-off-by: Dong Aisheng break; case SND_SOC_DAIFMT_CBM_CFS: val_cr4 |= FSL_SAI_CR4_FSD_MSTR; -@@ -1574,14 +1572,6 @@ static int fsl_sai_remove(struct platfor +@@ -1572,14 +1570,6 @@ static int fsl_sai_remove(struct platfor return 0; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0064-ASoC-fsl_sai-Mark-cache-dirty-at-resume.patch b/target/linux/layerscape/patches-5.4/801-audio-0064-ASoC-fsl_sai-Mark-cache-dirty-at-resume.patch index 1f74ff235..3fd355498 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0064-ASoC-fsl_sai-Mark-cache-dirty-at-resume.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0064-ASoC-fsl_sai-Mark-cache-dirty-at-resume.patch @@ -17,7 +17,7 @@ Signed-off-by: Daniel Baluta --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c -@@ -1616,6 +1616,8 @@ static int fsl_sai_runtime_resume(struct +@@ -1614,6 +1614,8 @@ static int fsl_sai_runtime_resume(struct PM_QOS_CPU_DMA_LATENCY, 0); regcache_cache_only(sai->regmap, false); diff --git a/target/linux/layerscape/patches-5.4/801-audio-0065-LF-106-ASoC-fsl_sai-request-BUS_FREQ_AUDIO.patch b/target/linux/layerscape/patches-5.4/801-audio-0065-LF-106-ASoC-fsl_sai-request-BUS_FREQ_AUDIO.patch index 25c65f17d..ed0afdbac 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0065-LF-106-ASoC-fsl_sai-request-BUS_FREQ_AUDIO.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0065-LF-106-ASoC-fsl_sai-request-BUS_FREQ_AUDIO.patch @@ -20,7 +20,7 @@ Signed-off-by: Shengjiu Wang #include "fsl_dsd.h" #include "fsl_sai.h" -@@ -1570,6 +1571,8 @@ static int fsl_sai_runtime_suspend(struc +@@ -1568,6 +1569,8 @@ static int fsl_sai_runtime_suspend(struc regcache_cache_only(sai->regmap, true); @@ -29,7 +29,7 @@ Signed-off-by: Shengjiu Wang if (sai->mclk_streams & BIT(SNDRV_PCM_STREAM_CAPTURE)) clk_disable_unprepare(sai->mclk_clk[sai->mclk_id[0]]); -@@ -1611,6 +1614,8 @@ static int fsl_sai_runtime_resume(struct +@@ -1609,6 +1612,8 @@ static int fsl_sai_runtime_resume(struct goto disable_tx_clk; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0067-Revert-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_.patch b/target/linux/layerscape/patches-5.4/801-audio-0067-Revert-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_.patch deleted file mode 100644 index d36101e09..000000000 --- a/target/linux/layerscape/patches-5.4/801-audio-0067-Revert-MLK-17442-ASoC-fsl-fix-wrong-usage-of-filter_.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 912323e5d1290cbee651270f65de338663012c9b Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Mon, 30 Mar 2020 16:30:03 +0800 -Subject: [PATCH] Revert "MLK-17442: ASoC: fsl: fix wrong usage of filter_data - (part 1)" - -This reverts commit 8d4837f146cd14cf7041050ddec77b2a5c3f2f27. ---- - sound/soc/fsl/fsl_sai.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/sound/soc/fsl/fsl_sai.c -+++ b/sound/soc/fsl/fsl_sai.c -@@ -1519,8 +1519,8 @@ static int fsl_sai_probe(struct platform - MCLK_DIR(index)); - } - -- sai->dma_params_rx.chan_name = "rx"; -- sai->dma_params_tx.chan_name = "tx"; -+ sai->dma_params_rx.filter_data = "rx"; -+ sai->dma_params_tx.filter_data = "tx"; - sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0; - sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0; - sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; diff --git a/target/linux/layerscape/patches-5.4/801-audio-0068-Revert-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-p.patch b/target/linux/layerscape/patches-5.4/801-audio-0068-Revert-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-p.patch deleted file mode 100644 index 1045b9049..000000000 --- a/target/linux/layerscape/patches-5.4/801-audio-0068-Revert-ASoC-fsl-add-imx-pcm-dma-v2-platform-driver-p.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d8715f02b84c1a210b6fd84badc41eced6272424 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Mon, 30 Mar 2020 16:30:26 +0800 -Subject: [PATCH] Revert "ASoC: fsl: add imx-pcm-dma v2 platform driver (part - 2)" - -This reverts commit 5d816f1a5cac458a7fff9ecf896c85eb351a7352. ---- - sound/soc/fsl/fsl_sai.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - ---- a/sound/soc/fsl/fsl_sai.c -+++ b/sound/soc/fsl/fsl_sai.c -@@ -1519,8 +1519,6 @@ static int fsl_sai_probe(struct platform - MCLK_DIR(index)); - } - -- sai->dma_params_rx.filter_data = "rx"; -- sai->dma_params_tx.filter_data = "tx"; - sai->dma_params_rx.addr = res->start + FSL_SAI_RDR0; - sai->dma_params_tx.addr = res->start + FSL_SAI_TDR0; - sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; -@@ -1540,7 +1538,7 @@ static int fsl_sai_probe(struct platform - goto err_pm_disable; - - if (sai->soc->imx) -- ret = imx_pcm_platform_register(&pdev->dev); -+ ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); - if (ret) - goto err_pm_disable; - } else { diff --git a/target/linux/layerscape/patches-5.4/805-display-0030-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sinks.patch b/target/linux/layerscape/patches-5.4/805-display-0030-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sinks.patch deleted file mode 100644 index be72d1fd3..000000000 --- a/target/linux/layerscape/patches-5.4/805-display-0030-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sinks.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d9440f7cb8fa5853b9dcc6e2b165725ac3e8b70c Mon Sep 17 00:00:00 2001 -From: Laurentiu Palcu -Date: Wed, 27 Nov 2019 13:34:51 +0200 -Subject: [PATCH] drm/imx/hdp: fix issue with non-SCDC HDMI sinks - -Currently, if sink does not support SCDC, even if the sink is HDMI 1.4 or 2.0, -the hdmi_type is left to default value (MODE_DVI). Hence the HDMI controler is -not properly initialized when cdns_hdmi_ctrl_init() is called. - -Signed-off-by: Laurentiu Palcu -Reported-by: Jared Hu -Reviewed-by: Sandor Yu ---- - drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - ---- a/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c -+++ b/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c -@@ -29,11 +29,17 @@ - static void hdmi_sink_config(struct cdns_mhdp_device *mhdp) - { - struct drm_scdc *scdc = &mhdp->connector.base.display_info.hdmi.scdc; -- u8 buff; -+ struct drm_display_info *di = &mhdp->connector.base.display_info; -+ u8 buff = 0; -+ -+ if (scdc->supported || di->color_formats & DRM_COLOR_FORMAT_YCRCB420) -+ mhdp->hdmi.hdmi_type = MODE_HDMI_2_0; -+ else -+ mhdp->hdmi.hdmi_type = MODE_HDMI_1_4; - - /* check sink support SCDC or not */ -- if (scdc->supported != true) { -- DRM_INFO("Sink Not Support SCDC\n"); -+ if (!scdc->supported) { -+ DRM_INFO("Sink does not support SCDC\n"); - return; - } - -@@ -43,19 +49,13 @@ static void hdmi_sink_config(struct cdns - * Enable scrambling and TMDS_Bit_Clock_Ratio - */ - buff = SCDC_TMDS_BIT_CLOCK_RATIO_BY_40 | SCDC_SCRAMBLING_ENABLE; -- mhdp->hdmi.hdmi_type = MODE_HDMI_2_0; - } else if (scdc->scrambling.low_rates) { - /* - * Enable scrambling and HDMI2.0 when scrambling capability of sink - * be indicated in the HF-VSDB LTE_340Mcsc_scramble bit - */ - buff = SCDC_SCRAMBLING_ENABLE; -- mhdp->hdmi.hdmi_type = MODE_HDMI_2_0; -- } else { -- /* Default work in HDMI1.4 */ -- buff = 0; -- mhdp->hdmi.hdmi_type = MODE_HDMI_1_4; -- } -+ } - - /* TMDS config */ - cdns_hdmi_scdc_write(mhdp, 0x20, buff); diff --git a/target/linux/layerscape/patches-5.4/805-display-0031-Revert-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sink.patch b/target/linux/layerscape/patches-5.4/805-display-0031-Revert-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sink.patch deleted file mode 100644 index e906be460..000000000 --- a/target/linux/layerscape/patches-5.4/805-display-0031-Revert-drm-imx-hdp-fix-issue-with-non-SCDC-HDMI-sink.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 575fc16e92287349f0ffd8399dd9d7e408954cd4 Mon Sep 17 00:00:00 2001 -From: Sandor Yu -Date: Fri, 29 Nov 2019 15:05:03 +0800 -Subject: [PATCH] Revert "drm/imx/hdp: fix issue with non-SCDC HDMI sinks" - -For HDMI sinks that support HDMI2.0, those video modes have -listed in hdmi1.4 specification should work in hdmi 1.4. -Remove the patch, make sure all video modes can work well -in HDMI2.0 sinks. -For non-SCDC HDMI sinks issue, -it will be fixed with another patch. - -This reverts commit 4b6617643f9e3a6f61d42eae39034ddc8d4825af. - -Signed-off-by: Sandor Yu ---- - drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - ---- a/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c -+++ b/drivers/gpu/drm/bridge/cadence/cdns-hdmi-core.c -@@ -29,17 +29,11 @@ - static void hdmi_sink_config(struct cdns_mhdp_device *mhdp) - { - struct drm_scdc *scdc = &mhdp->connector.base.display_info.hdmi.scdc; -- struct drm_display_info *di = &mhdp->connector.base.display_info; -- u8 buff = 0; -- -- if (scdc->supported || di->color_formats & DRM_COLOR_FORMAT_YCRCB420) -- mhdp->hdmi.hdmi_type = MODE_HDMI_2_0; -- else -- mhdp->hdmi.hdmi_type = MODE_HDMI_1_4; -+ u8 buff; - - /* check sink support SCDC or not */ -- if (!scdc->supported) { -- DRM_INFO("Sink does not support SCDC\n"); -+ if (scdc->supported != true) { -+ DRM_INFO("Sink Not Support SCDC\n"); - return; - } - -@@ -49,13 +43,19 @@ static void hdmi_sink_config(struct cdns - * Enable scrambling and TMDS_Bit_Clock_Ratio - */ - buff = SCDC_TMDS_BIT_CLOCK_RATIO_BY_40 | SCDC_SCRAMBLING_ENABLE; -+ mhdp->hdmi.hdmi_type = MODE_HDMI_2_0; - } else if (scdc->scrambling.low_rates) { - /* - * Enable scrambling and HDMI2.0 when scrambling capability of sink - * be indicated in the HF-VSDB LTE_340Mcsc_scramble bit - */ - buff = SCDC_SCRAMBLING_ENABLE; -- } -+ mhdp->hdmi.hdmi_type = MODE_HDMI_2_0; -+ } else { -+ /* Default work in HDMI1.4 */ -+ buff = 0; -+ mhdp->hdmi.hdmi_type = MODE_HDMI_1_4; -+ } - - /* TMDS config */ - cdns_hdmi_scdc_write(mhdp, 0x20, buff); diff --git a/target/linux/layerscape/patches-5.4/805-display-0042-drm-imx-Revert-a-patch-which-merges-imx-drm-core-and.patch b/target/linux/layerscape/patches-5.4/805-display-0042-drm-imx-Revert-a-patch-which-merges-imx-drm-core-and.patch deleted file mode 100644 index 017f0e347..000000000 --- a/target/linux/layerscape/patches-5.4/805-display-0042-drm-imx-Revert-a-patch-which-merges-imx-drm-core-and.patch +++ /dev/null @@ -1,116 +0,0 @@ -From d27d7c25c946776c015a39f1a9eb0c6d4e724a70 Mon Sep 17 00:00:00 2001 -From: Liu Ying -Date: Fri, 25 Jan 2019 11:23:39 +0800 -Subject: [PATCH] drm/imx: Revert a patch which merges imx-drm-core and - ipuv3-crtc in one module - -DPU CRTC found in i.MX8qm/qxp SoCs can be hooked into imx-drm. -Thus, move ipuv3-crtc out of imx-drm-core. - -Revert "drm/imx: merge imx-drm-core and ipuv3-crtc in one module" - -This reverts commit 3d1df96ad46856ce850be5ac112eab919cbe1cab. - -Signed-off-by: Liu Ying -[ Aisheng: fix conflicts ] -Signed-off-by: Dong Aisheng ---- - drivers/gpu/drm/imx/Kconfig | 7 +++++++ - drivers/gpu/drm/imx/Makefile | 4 +++- - drivers/gpu/drm/imx/imx-drm-core.c | 18 +----------------- - drivers/gpu/drm/imx/imx-drm.h | 2 -- - drivers/gpu/drm/imx/ipuv3-crtc.c | 8 +++++++- - 5 files changed, 18 insertions(+), 21 deletions(-) - ---- a/drivers/gpu/drm/imx/Kconfig -+++ b/drivers/gpu/drm/imx/Kconfig -@@ -33,6 +33,13 @@ config DRM_IMX_LDB - Choose this to enable the internal LVDS Display Bridge (LDB) - found on i.MX53 and i.MX6 processors. - -+config DRM_IMX_IPUV3 -+ tristate -+ depends on DRM_IMX -+ depends on IMX_IPUV3_CORE -+ default y if DRM_IMX=y -+ default m if DRM_IMX=m -+ - config DRM_IMX_HDMI - tristate "Freescale i.MX DRM HDMI" - select DRM_DW_HDMI ---- a/drivers/gpu/drm/imx/Makefile -+++ b/drivers/gpu/drm/imx/Makefile -@@ -1,6 +1,6 @@ - # SPDX-License-Identifier: GPL-2.0 - --imxdrm-objs := imx-drm-core.o ipuv3-crtc.o ipuv3-plane.o -+imxdrm-objs := imx-drm-core.o - - obj-$(CONFIG_DRM_IMX) += imxdrm.o - -@@ -8,5 +8,7 @@ obj-$(CONFIG_DRM_IMX_PARALLEL_DISPLAY) + - obj-$(CONFIG_DRM_IMX_TVE) += imx-tve.o - obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o - -+imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o -+obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o - obj-$(CONFIG_DRM_IMX_HDMI) += dw_hdmi-imx.o - obj-$(CONFIG_DRM_IMX_CDNS_MHDP) += cdn-mhdp-imxdrv.o cdn-mhdp-dp-phy.o cdn-mhdp-hdmi-phy.o cdn-mhdp-imx8qm.o cdn-mhdp-ls1028a.o ---- a/drivers/gpu/drm/imx/imx-drm-core.c -+++ b/drivers/gpu/drm/imx/imx-drm-core.c -@@ -343,23 +343,7 @@ static struct platform_driver imx_drm_pd - .of_match_table = imx_drm_dt_ids, - }, - }; -- --static struct platform_driver * const drivers[] = { -- &imx_drm_pdrv, -- &ipu_drm_driver, --}; -- --static int __init imx_drm_init(void) --{ -- return platform_register_drivers(drivers, ARRAY_SIZE(drivers)); --} --module_init(imx_drm_init); -- --static void __exit imx_drm_exit(void) --{ -- platform_unregister_drivers(drivers, ARRAY_SIZE(drivers)); --} --module_exit(imx_drm_exit); -+module_platform_driver(imx_drm_pdrv); - - MODULE_AUTHOR("Sascha Hauer "); - MODULE_DESCRIPTION("i.MX drm driver core"); ---- a/drivers/gpu/drm/imx/imx-drm.h -+++ b/drivers/gpu/drm/imx/imx-drm.h -@@ -28,8 +28,6 @@ int imx_drm_init_drm(struct platform_dev - int preferred_bpp); - int imx_drm_exit_drm(void); - --extern struct platform_driver ipu_drm_driver; -- - void imx_drm_mode_config_init(struct drm_device *drm); - - struct drm_gem_cma_object *imx_drm_fb_get_obj(struct drm_framebuffer *fb); ---- a/drivers/gpu/drm/imx/ipuv3-crtc.c -+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c -@@ -492,10 +492,16 @@ static int ipu_drm_remove(struct platfor - return 0; - } - --struct platform_driver ipu_drm_driver = { -+static struct platform_driver ipu_drm_driver = { - .driver = { - .name = "imx-ipuv3-crtc", - }, - .probe = ipu_drm_probe, - .remove = ipu_drm_remove, - }; -+module_platform_driver(ipu_drm_driver); -+ -+MODULE_AUTHOR("Sascha Hauer "); -+MODULE_DESCRIPTION(DRIVER_DESC); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:imx-ipuv3-crtc"); diff --git a/target/linux/layerscape/patches-5.4/805-display-0043-gpu-Move-ipu-v3-to-imx-folder.patch b/target/linux/layerscape/patches-5.4/805-display-0043-gpu-Move-ipu-v3-to-imx-folder.patch deleted file mode 100644 index 6deb30f88..000000000 --- a/target/linux/layerscape/patches-5.4/805-display-0043-gpu-Move-ipu-v3-to-imx-folder.patch +++ /dev/null @@ -1,19995 +0,0 @@ -From a7782c6e5e37b2b406221827b177c2bfcc8825cd Mon Sep 17 00:00:00 2001 -From: Liu Ying -Date: Tue, 22 Jan 2019 17:08:01 +0800 -Subject: [PATCH] gpu: Move ipu-v3 to imx folder - -The new imx folder may contain ipu-v3 and dpu common drivers. - -Signed-off-by: Liu Ying -[ Aisheng: fix source path ] -Signed-off-by: Dong Aisheng ---- - drivers/gpu/Makefile | 2 +- - drivers/gpu/imx/Kconfig | 1 + - drivers/gpu/imx/Makefile | 1 + - drivers/gpu/imx/ipu-v3/Kconfig | 11 + - drivers/gpu/imx/ipu-v3/Makefile | 10 + - drivers/gpu/imx/ipu-v3/ipu-common.c | 1565 ++++++++++++++++++ - drivers/gpu/imx/ipu-v3/ipu-cpmem.c | 976 +++++++++++ - drivers/gpu/imx/ipu-v3/ipu-csi.c | 821 +++++++++ - drivers/gpu/imx/ipu-v3/ipu-dc.c | 420 +++++ - drivers/gpu/imx/ipu-v3/ipu-di.c | 745 +++++++++ - drivers/gpu/imx/ipu-v3/ipu-dmfc.c | 214 +++ - drivers/gpu/imx/ipu-v3/ipu-dp.c | 357 ++++ - drivers/gpu/imx/ipu-v3/ipu-ic.c | 761 +++++++++ - drivers/gpu/imx/ipu-v3/ipu-image-convert.c | 2475 ++++++++++++++++++++++++++++ - drivers/gpu/imx/ipu-v3/ipu-pre.c | 346 ++++ - drivers/gpu/imx/ipu-v3/ipu-prg.c | 483 ++++++ - drivers/gpu/imx/ipu-v3/ipu-prv.h | 274 +++ - drivers/gpu/imx/ipu-v3/ipu-smfc.c | 202 +++ - drivers/gpu/imx/ipu-v3/ipu-vdi.c | 234 +++ - drivers/gpu/ipu-v3/Kconfig | 11 - - drivers/gpu/ipu-v3/Makefile | 10 - - drivers/gpu/ipu-v3/ipu-common.c | 1565 ------------------ - drivers/gpu/ipu-v3/ipu-cpmem.c | 976 ----------- - drivers/gpu/ipu-v3/ipu-csi.c | 821 --------- - drivers/gpu/ipu-v3/ipu-dc.c | 420 ----- - drivers/gpu/ipu-v3/ipu-di.c | 745 --------- - drivers/gpu/ipu-v3/ipu-dmfc.c | 214 --- - drivers/gpu/ipu-v3/ipu-dp.c | 357 ---- - drivers/gpu/ipu-v3/ipu-ic.c | 761 --------- - drivers/gpu/ipu-v3/ipu-image-convert.c | 2475 ---------------------------- - drivers/gpu/ipu-v3/ipu-pre.c | 346 ---- - drivers/gpu/ipu-v3/ipu-prg.c | 483 ------ - drivers/gpu/ipu-v3/ipu-prv.h | 274 --- - drivers/gpu/ipu-v3/ipu-smfc.c | 202 --- - drivers/gpu/ipu-v3/ipu-vdi.c | 234 --- - drivers/video/Kconfig | 2 +- - 36 files changed, 9898 insertions(+), 9896 deletions(-) - create mode 100644 drivers/gpu/imx/Kconfig - create mode 100644 drivers/gpu/imx/Makefile - create mode 100644 drivers/gpu/imx/ipu-v3/Kconfig - create mode 100644 drivers/gpu/imx/ipu-v3/Makefile - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-common.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-cpmem.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-csi.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-dc.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-di.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-dmfc.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-dp.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-ic.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-image-convert.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-pre.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-prg.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-prv.h - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-smfc.c - create mode 100644 drivers/gpu/imx/ipu-v3/ipu-vdi.c - delete mode 100644 drivers/gpu/ipu-v3/Kconfig - delete mode 100644 drivers/gpu/ipu-v3/Makefile - delete mode 100644 drivers/gpu/ipu-v3/ipu-common.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-cpmem.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-csi.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-dc.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-di.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-dmfc.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-dp.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-ic.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-image-convert.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-pre.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-prg.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-prv.h - delete mode 100644 drivers/gpu/ipu-v3/ipu-smfc.c - delete mode 100644 drivers/gpu/ipu-v3/ipu-vdi.c - ---- a/drivers/gpu/Makefile -+++ b/drivers/gpu/Makefile -@@ -3,5 +3,5 @@ - # taken to initialize them in the correct order. Link order is the only way - # to ensure this currently. - obj-$(CONFIG_TEGRA_HOST1X) += host1x/ -+obj-y += imx/ - obj-y += drm/ vga/ --obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ ---- /dev/null -+++ b/drivers/gpu/imx/Kconfig -@@ -0,0 +1 @@ -+source "drivers/gpu/imx/ipu-v3/Kconfig" ---- /dev/null -+++ b/drivers/gpu/imx/Makefile -@@ -0,0 +1 @@ -+obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ ---- /dev/null -+++ b/drivers/gpu/imx/ipu-v3/Kconfig -@@ -0,0 +1,11 @@ -+# SPDX-License-Identifier: GPL-2.0-only -+config IMX_IPUV3_CORE -+ tristate "IPUv3 core support" -+ depends on SOC_IMX5 || SOC_IMX6Q || ARCH_MULTIPLATFORM || COMPILE_TEST -+ depends on DRM || !DRM # if DRM=m, this can't be 'y' -+ select BITREVERSE -+ select GENERIC_ALLOCATOR if DRM -+ select GENERIC_IRQ_CHIP -+ help -+ Choose this if you have a i.MX5/6 system and want to use the Image -+ Processing Unit. This option only enables IPU base support. ---- /dev/null -+++ b/drivers/gpu/imx/ipu-v3/Makefile -@@ -0,0 +1,10 @@ -+# SPDX-License-Identifier: GPL-2.0 -+obj-$(CONFIG_IMX_IPUV3_CORE) += imx-ipu-v3.o -+ -+imx-ipu-v3-objs := ipu-common.o ipu-cpmem.o ipu-csi.o ipu-dc.o ipu-di.o \ -+ ipu-dp.o ipu-dmfc.o ipu-ic.o ipu-ic-csc.o \ -+ ipu-image-convert.o ipu-smfc.o ipu-vdi.o -+ -+ifdef CONFIG_DRM -+ imx-ipu-v3-objs += ipu-pre.o ipu-prg.o -+endif ---- /dev/null -+++ b/drivers/gpu/imx/ipu-v3/ipu-common.c -@@ -0,0 +1,1565 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+/* -+ * Copyright (c) 2010 Sascha Hauer -+ * Copyright (C) 2005-2009 Freescale Semiconductor, Inc. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include