Commit Graph

1076956 Commits

Author SHA1 Message Date
Lorenzo Bianconi
1c71e03afe mt76: mt7921: move mt7921_init_hw in a dedicated work
Firmware initialization can take a while. Move mt7921_init_hw routine in
a dedicated work in order to not slow down bootstrap process.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
0d2afe09fa mt76: mt7921: add mt7921u driver
Introduce support for MT7921U 802.11ax 2x2:2SS wireless devices.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Tested-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
8b7a56d5c0 mt76: mt7921: move mt7921_usb_sdio_tx_status_data in mac common code.
This is a preliminary patch to add mt7921u driver support.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
9da47b504c mt76: mt7921: move mt7921_usb_sdio_tx_complete_skb in common mac code.
This is a preliminary patch to add mt7921u driver support.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
5b834b0d4d mt76: mt7921: move mt7921_usb_sdio_tx_prepare_skb in common mac code
This is a preliminary patch to add mt7921u driver support.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
b72fd21793 mt76: mt7921: update mt7921_skb_add_usb_sdio_hdr to support usb
This is a preliminary patch to add mt7921u driver support.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
eafe031fd6 mt76: mt7921: disable runtime pm for usb
Runtime-pm is not currently supported by usb driver

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:23 +01:00
Lorenzo Bianconi
6cb596ba84 mt76: usb: introduce __mt76u_init utility routine
Introduce __mt76u_init unitility routine and move mt7615 usb bus ops
into mt7615 module in order to allow specifying driver specific
parameter.
This is a preliminary patch to add usb support to mt7921 driver.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Lorenzo Bianconi
e0daf14d9f mt76: usb: add req_type to ___mt76u_wr signature
This is a preliminary patch to add usb support to mt7921 driver.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Lorenzo Bianconi
84bba93ac4 mt76: usb: add req_type to ___mt76u_rr signature
This is a preliminary patch to add usb support to mt7921 driver.

Tested-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Julia Lawall
51f9325c7b mt76: mt7915: fix typos in comments
Various spelling mistakes in comments.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Peter Chiu
381d9de774 mt76: mt7915: fix phy cap in mt7915_set_stream_he_txbf_caps()
This patch fixes performance issue of beamforming tx on
bandwidth 160MHz.

Fixes: 99ad32a4ca ("mt76: mt7915: add support for MT7986")
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Shayne Chen
bd1407ed22 mt76: mt7915: fix beamforming mib stats
Some of beamforming mib counters are moved to different offsets
or registers in newer chipsets.

Fixes: 99ad32a4ca ("mt76: mt7915: add support for MT7986")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Shayne Chen
70493b8692 mt76: mt7915: set band1 TGID field in tx descriptor
Set proper group index of tx descriptor for band1.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Deren Wu
6450b1335f mt76: fix invalid rssi report
Drop invalid rssi value to calculate a reasonable report

Fixes: 4550fb9e98 ("mt76: improve signal strength reporting")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Ryder Lee
f1fe8eefd2 mt76: use le32/16_get_bits() whenever possible
Switch to use le32/16_get_bits() to simplfy codes and specify
the size explicitly to avoid potential issues.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Colin Ian King
c00e13726b mt76: connac: make read-only array ba_range static const
Don't populate the read-only array ba_range on the stack but
instead make it static const. Also makes the object code a little
smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Dan Carpenter
01318bc00d mt76: mt7915: check for devm_pinctrl_get() failure
If devm_pinctrl_get() fails then it leads to an error pointer
dereference.  Add a check to prevent that.

Fixes: 99ad32a4ca ("mt76: mt7915: add support for MT7986")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Lorenzo Bianconi
9a65768415 mt76: mt7921: get rid of mt7921_wait_for_mcu_init declaration
mt7921_wait_for_mcu_init is no longer used.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Shayne Chen
ae14668300 mt76: mt7915: add txpower init for 6GHz
Add support to init txpower values of 6GHz band.

Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Shayne Chen
1c2d366ecb mt76: mt7915: fix eeprom fields of txpower init values
A-die 7976 has different offset and uses different channel group
definition on txpower init values.

Fixes: 99ad32a4ca ("mt76: mt7915: add support for MT7986")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
MeiChia Chiu
b4d093e321 mt76: mt7915: add 6 GHz support
Basic 6 GHz support is added to mt76.
Modification includes:
1. Add 6 GHz E2P definition
2. Register 6 GHz HE cap
3. Refactor existing code of adding a STA

This adds support for Wi-Fi 6E on MT7986/MT7916.
Detailed link:
https://www.mediatek.com/products/mediatek-filogic-830
Detailed link:
https://www.mediatek.com/products/products/broadband-wifi/mediatek-filogic-630

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Shayne Chen <Shayne.Chen@mediatek.com>
Signed-off-by: Peter Chiu <Chui-Hao.Chiu@mediatek.com>
Signed-off-by: Money Wang <Money.Wang@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
MeiChia Chiu
37b5e57b0c mt76: connac: add 6 GHz support for wtbl and starec configuration
Since there are no HT & VHT IEs being sent in 6ghz,
some capabilities judgement and parsing for wtbl &
starec configuration should be modified to reflect such changes.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Money Wang <Money.Wang@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Ryder Lee
3f71ff0868 mt76: mt7915: allow beaconing on all chains
This improves rate reach performance on units with polarized antennas.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Deren Wu
123bc712b1 mt76: fix monitor mode crash with sdio driver
mt7921s driver may receive frames with fragment buffers. If there is a
CTS packet received in monitor mode, the payload is 10 bytes only and
need 6 bytes header padding after RXD buffer. However, only RXD in the
first linear buffer, if we pull buffer size RXD-size+6 bytes with
skb_pull(), that would trigger "BUG_ON(skb->len < skb->data_len)" in
__skb_pull().

To avoid the nonlinear buffer issue, enlarge the RXD size from 128 to
256 to make sure all MCU operation in linear buffer.

[   52.007562] kernel BUG at include/linux/skbuff.h:2313!
[   52.007578] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[   52.007987] pc : skb_pull+0x48/0x4c
[   52.008015] lr : mt7921_queue_rx_skb+0x494/0x890 [mt7921_common]
[   52.008361] Call trace:
[   52.008377]  skb_pull+0x48/0x4c
[   52.008400]  mt76s_net_worker+0x134/0x1b0 [mt76_sdio 35339a92c6eb7d4bbcc806a1d22f56365565135c]
[   52.008431]  __mt76_worker_fn+0xe8/0x170 [mt76 ef716597d11a77150bc07e3fdd68eeb0f9b56917]
[   52.008449]  kthread+0x148/0x3ac
[   52.008466]  ret_from_fork+0x10/0x30

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Lorenzo Bianconi
849ee6ac9d mt76: mt7921: fix mt7921_queues_acq implementation
Fix mt7921_queues_acq implementation according to the vendor sdk.

Fixes: 474a9f21e2 ("mt76: mt7921: add debugfs support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Lorenzo Bianconi
e907341dab mt76: mt7921: fix xmit-queue dump for usb and sdio
Use proper xmit queue handler to dump queue stats.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Lorenzo Bianconi
11a7226592 mt76: mt7921: make mt7921_init_tx_queues static
mt7921 is only used in mt7921_dma_init routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
MeiChia Chiu
499da7200f mt76: split single ldpc cap bit into bits
The original single LDPC cap bit cannot be used to
differentiate LDPC cap in each PHY mode.
This modification split the single bit into 3 bits,
ht_ldpc, vht_ldpc, and he_ldpc.

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Suggested-by: Money Wang <Money.Wang@mediatek.com>
Signed-off-by: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Evelyn Tsai
233e39d1ed mt76: mt7915: fix DFS no radar detection event
Driver needs to carry region definition when radar detection starts.
Need to remap nl80211 DFS regions to chip region definition.

Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Rubio Lu <Rubio-DW.Lu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Sean Wang
07241519b3 mt76: mt7921: use mt76_hw instead of open coding it
use mt76_hw instead of open coding it

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:22 +01:00
Sean Wang
cbaa0a404f mt76: mt7921: fix up the monitor mode
Properly set up the monitor mode the firmware can support to fix up
RTS/CTS and beacon frames cannot be captured and forwarded to the host.

Tested-by: Deren Wu <deren.wu@mediatek.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:21 +01:00
Lorenzo Bianconi
4dd4ad44b7 mt76: mt7663u: introduce mt7663u_mcu_power_on routine
Introduce mt7663u_mcu_power_on utility routine since the code is shared
between mt7663u_mcu_init() and mt7663u_probe().

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:21 +01:00
Lorenzo Bianconi
e809904f9b mt76: mt7615: honor ret from mt7615_mcu_restart in mt7663u_mcu_init
Check return value of mt7615_mcu_restart routine in mt7663u_mcu_init().

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-16 17:40:21 +01:00
Ping-Ke Shih
d179c1f1c3 rtw89: fix uninitialized variable of rtw89_append_probe_req_ie()
smatch reports that:
  fw.c:1997 rtw89_append_probe_req_ie() error: uninitialized symbol 'ret'.

This can be a issue only if no band is supported by the chip, but it is
impossible. So, it is still safe without this patch.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220311020007.20414-1-pkshih@realtek.com
2022-03-16 17:49:04 +02:00
Wojciech Drewek
02f393381d gtp: Fix inconsistent indenting
Fix the following warning as reported by smatch:

New smatch warnings:
drivers/net/gtp.c:1796 gtp_genl_send_echo_req() warn: inconsistent indenting

Fixes: d33bd757d3 ("gtp: Implement GTP echo request")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-03-16 08:47:02 -07:00
Lukas Bulwahn
5df2dc0087 MAINTAINERS: fix ath11k DT bindings location
Commit dae0978d41 ("dt: bindings: net: add qcom,ath11k.yaml") obviously
adds qcom,ath11k.yaml, but the file entry in MAINTAINERS, added with
commit fcda1cb816 ("MAINTAINERS: add DT bindings files for ath10k and
ath11k") then refers to qcom,ath11k.txt.

Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a
broken reference.

Repair this file reference in QUALCOMM ATHEROS ATH11K WIRELESS DRIVER, and
put it in alphabetic order while at it.

Fixes: fcda1cb816 ("MAINTAINERS: add DT bindings files for ath10k and ath11k")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220308085503.537-1-lukas.bulwahn@gmail.com
2022-03-16 17:32:46 +02:00
Julia Lawall
bfbd78cfdd airo: fix typos in comments
Various spelling mistakes in comments.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220314115354.144023-21-Julia.Lawall@inria.fr
2022-03-16 17:30:40 +02:00
Julia Lawall
31f8bef8ac rtlwifi: rtl8821ae: fix typos in comments
Various spelling mistakes in comments.
Detected with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220314115354.144023-20-Julia.Lawall@inria.fr
2022-03-16 17:30:29 +02:00
Jonathan Teh
ceb7482f2d rtlwifi: rtl8192cu: Add On Networks N150
This is an RTL8188CUS device, identifies as model N150MA-199WWS.

Signed-off-by: Jonathan Teh <jonathan.teh@outlook.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/DBAPR04MB7366E8014ECA839E1F5CCE29920E9@DBAPR04MB7366.eurprd04.prod.outlook.com
2022-03-16 17:29:27 +02:00
Julia Lawall
3c0e3ca602 zd1201: use kzalloc
Use kzalloc instead of kmalloc + memset.

The semantic patch that makes this change is:
(https://coccinelle.gitlabpages.inria.fr/website/)

//<smpl>
@@
expression res, size, flag;
@@
- res = kmalloc(size, flag);
+ res = kzalloc(size, flag);
  ...
- memset(res, 0, size);
//</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220312102705.71413-6-Julia.Lawall@inria.fr
2022-03-16 17:28:40 +02:00
Colin Ian King
e7d1fc0b5f mwifiex: make read-only array wmm_oui static const
Don't populate the read-only array wmm_oui on the stack but
instead make it static const. Also makes the object code a little
smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220311225610.10895-1-colin.i.king@gmail.com
2022-03-16 17:28:01 +02:00
David S. Miller
49045b9c81 Merge branch 'mediatek-next'
Biao Huang says:

====================
MediaTek Ethernet Patches on MT8195

Changes in v13:
1. add reviewed-by in "net: dt-bindings: dwmac: add support for mt8195"
   as Rob's comments.
2. drop num_clks defined in mediatek_dwmac_plat_data struct in "stmmac:
   dwmac-mediatek: Reuse more common features" as Angelo's comments.

Changes in v12:
1. add a new patch "stmmac: dwmac-mediatek: re-arrange clock setting" to
   this series, to simplify clock handling in driver, which benefits to
   binding file mediatek-dwmac.yaml.
2. modify dt-binding description in patch "net: dt-bindings: dwmac: add
   support for mt8195" as Rob's comments in v10 series, put mac_cg to the
   end of clock list.
3. there are small changes in patch "stmmac: dwmac-mediatek: add support
   for mt8195", @AngeloGioacchino, please review it kindly.

Changes in v11:
1. add reivewed-by in "net: dt-bindings: dwmac: Convert mediatek-dwmac to
   DT schema" as Rob's comments.
2. fall back "net: dt-bindings: dwmac: add support for mt8195" to v8 version
   as mentioned in previous reply(https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20211216055328.15953-7-biao.huang@mediatek.com/):
   2.1 there is already a special clock named "rmii_internal", which need to
       be put to the end of the clock list(driver special handling),
       so we can't simply put new "mac_cg" for mt8195 to the end of the clock
       list.
   2.2 we prefer the if-then schema, which will make mt8195 clock list clearer
       with some duplicated information.
   2.3 we expect the future IC will follow mt2712 or mt8195, so we only need
       add new IC name to compatible list for future IC, and will not make the
       clock list binding files worse.

Changes in v10:
1. add detailed description in "arm64: dts: mt2712: update ethernet
   device node" to make the modifications clearer as Matthias's comments.
2. modify dt-binding description as Rob's comments, and "make dtbs_check" runs
   pass locally with "arm64: dts: mt2712: update ethernet device node"
   in this series.

Changes in v9:
1. remove oneOf for 1 entry as Rob's comments.
2. add new clocks to the end of existing clocks to simplify
   the binding as Rob's comments.

Changes in v8:
1. add acked-by in "stmmac: dwmac-mediatek: add platform level clocks
   management" patch

Changes in v7:
1. fix uninitialized warning as Jakub's comments.

Changes in v6:
1. update commit message as Jakub's comments.
2. split mt8195 eth dts patch("arm64: dts: mt8195: add ethernet device
   node") from this series, since mt8195 dtsi/dts basic patches is still
   under reviewing.
   https://patchwork.kernel.org/project/linux-mediatek/list/?series=579071
   we'll resend mt8195 eth dts patch once all the dependent patches are
   accepted.

Changes in v5:
1. remove useless inclusion in dwmac-mediatek.c as Angelo's comments.
2. add acked-by in "net-next: stmmac: dwmac-mediatek: add support for
   mt8195" patch

Changes in v4:
1. add changes in commit message in "net-next: dt-bindings: dwmac:
   Convert mediatek-dwmac to DT schema" patch.
2. remove ethernet-controller.yaml since snps,dwmac.yaml already include it.

Changes in v3:
1. Add prefix "net-next" to support new IC as Denis's suggestion.
2. Split dt-bindings to two patches, one for conversion, and the other for
   new IC.
3. add a new patch to update device node in mt2712-evb.dts to accommodate to
   changes in driver.
4. remove unnecessary wrapper as Angelo's suggestion.
5. Add acked-by in "net-next: stmmac: dwmac-mediatek: Reuse more common
   features" patch.

Changes in v2:
1. fix errors/warnings in mediatek-dwmac.yaml with upgraded dtschema tools

Changes in v1:
This series include 5 patches:
1. add platform level clocks management for dwmac-mediatek
2. resue more common features defined in stmmac_platform.c
3. add ethernet entry for mt8195
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:23 +00:00
Biao Huang
ee410d5100 net: dt-bindings: dwmac: add support for mt8195
Add binding document for the ethernet on mt8195.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:23 +00:00
Biao Huang
f2d356a6ab stmmac: dwmac-mediatek: add support for mt8195
Add Ethernet support for MediaTek SoCs from the mt8195 family.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Acked-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:23 +00:00
Biao Huang
150b6adda6 net: dt-bindings: dwmac: Convert mediatek-dwmac to DT schema
Convert mediatek-dwmac to DT schema, and delete old mediatek-dwmac.txt.
And there are some changes in .yaml than .txt, others almost keep the same:
  1. compatible "const: snps,dwmac-4.20".
  2. delete "snps,reset-active-low;" in example, since driver remove this
     property long ago.
  3. add "snps,reset-delay-us = <0 10000 10000>" in example.
  4. the example is for rgmii interface, keep related properties only.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:23 +00:00
Biao Huang
79e1177809 arm64: dts: mt2712: update ethernet device node
Since there are some changes in ethernet driver:
update ethernet device node in dts to accommodate to it.

1. stmmac_probe_config_dt() in stmmac_platform.c will initialize specified
   parameters according to compatible string "snps,dwmac-4.20a", then,
   dwmac-mediatek.c can skip the initialization if add compatible string
   "snps,dwmac-4.20a" in eth device node.
2. commit 882007ed78 ("net-next: dt-binding: dwmac-mediatek: add more
   description for RMII") added rmii internal support, we should add
   corresponding clocks/clocks-names in eth device node.
3. add "snps,reset-delays-us = <0 10000 10000>;" to ensure reset delay
   can meet PHY requirement.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:23 +00:00
Biao Huang
4fe3075fa6 stmmac: dwmac-mediatek: re-arrange clock setting
The rmii_internal clock is needed only when PHY
interface is RMII, and reference clock is from MAC.

Re-arrange the clock setting as following:
1. the optional "rmii_internal" is controlled by devm_clk_get(),
2. other clocks still be configured by devm_clk_bulk_get().

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:23 +00:00
Biao Huang
a71e67b210 stmmac: dwmac-mediatek: Reuse more common features
This patch makes dwmac-mediatek reuse more features
supported by stmmac_platform.c.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Acked-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:22 +00:00
Biao Huang
3186bdad97 stmmac: dwmac-mediatek: add platform level clocks management
This patch implements clks_config callback for dwmac-mediatek platform,
which could support platform level clocks management.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Acked-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-03-16 12:49:22 +00:00