aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
Commit message (Collapse)AuthorAgeFilesLines
* ramips: ethernet: ralink: add struct fe_priv as context to fe_reset()Alexander Couzens2021-06-251-1/+1
| | | | | | | | The fe_reset function direct access the reset controller instead using the reset controller api. In preparation to use the reset controller. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* ramips: mt7620: ethernet: use more macros and bump versionMichael Pratt2021-06-231-2/+0
| | | | | | | | | | | | | | | Define and use some missing macros, and use them instead of BIT() or numbers for more readable code. Add comment for a bit change that seems unrelated to ethernet but is actually needed (PCIe Root Complex mode). Remove unknown and unused macro RST_CTRL_MCM (probably from MT7621 / MT7622) This is the last of a series of fixes, so bump version. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: mt7620: fix RGMII TXID PHY modeMichael Pratt2021-06-231-1/+1
| | | | | | | | | | | | | | the register bits for TX delay and RX delay are opposites: when TX delay bit is set, delay is enabled when RX delay bit is set, delay is disabled So, when both bits are unset, it is RX delay and when both bits are set, it is TX delay Note: TXID is the default RGMII mode of the SOC Fixes: 5410a8e2959a ("ramips: mt7620: add rgmii delays support") Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: mt7620: move mt7620_mdio_mode() to ethernet driverMichael Pratt2021-06-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function mt7620_mdio_mode is only called once and both the function and mdio_mode block have been named incorrectly, leading to confusion and useless commits. These lines in the mdio_mode block of mt7620_hw_init are only intended for boards with an external mt7530 switch. (see commit 194ca6127ee18cd3a95da4d03f02e43b5428c0bb) Therefore, move lines from mdio_mode to the place in soc_mt7620.c where the type of mt7530 switch is identified, and move lines from mt7620_mdio_mode to a main function. mt7620_mdio_mode was called from mt7620_gsw_init where the priv struct is available, so the lines must stay in mt7620_gsw_init function. In order to keep things as simple as possible, keep the DTS property related function calls together, by moving them from mt7620_gsw_probe to init. Remove the now useless DTS properties and extra phy nodes. Fixes: 5a6229a93df8 ("ramips: remove superfluous & confusing DT binding") Fixes: b85fe43ec8c4 ("ramips: mt7620: add force use of mdio-mode") Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: mt7620: fix ethernet driver GMAC port initMichael Pratt2021-06-231-9/+9
| | | | | | | | | | | | | | | | | | | | | | | A workaround was added to the switch driver to set SOC port 4 as an RGMII GMAC interface based on the DTS property mediatek,port4-gmac. (previously mediatek,port4) However, the ethernet driver already does this, but is being blocked by a return statement whenever the phy-handle and fixed-link properties are both missing from nodes that define the port properties. Revert the workaround, so that both the switch driver and ethernet driver are not doing the same thing and move the phy-handle related lines down so nothing is ending the function prematurely. While at it, clean up kernel messages and delete useless return statements. Fixes: f6d81e2fa1f1 ("mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible") Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: mt7620: simplify DTS properties for GMACMichael Pratt2021-06-231-1/+1
| | | | | | | | | | | | | | | | | | | There are only 2 options in the driver for the function of mt7620 internal switch port 4: EPHY mode (RJ-45, internal PHY) GMAC mode (RGMII, external PHY) Let the DTS property be boolean instead of string where EPHY mode is the default. Fix how the properties are written for all DTS that use them, and add missing nodes where applicable, and remove useless nodes, and minor DTS formatting. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: 5.10: port and refresh patches, ralink drvIlya Lipnitskiy2021-03-061-1/+10
| | | | | | | | | | | | | | | | | | | Enable testing kernel. Fix compile errors by using new kernel APIs. Fix fuzz by manually editing patches to ensure the code goes in the right place. For 721-NET-no-auto-carrier-off-support.patch, revert upstream commit a307593a6 to keep the OpenWrt ralink driver operational. Add mt7621-pci-phy patch to select REGMAP_MMIO as discussed in PR #3693 and #3952. Run automatic quilt refresh on the rest. Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
* Revert "ramips: add support for kernel 5.10"Adrian Schmutzler2021-03-061-10/+1
| | | | | | | | | This reverts commit b4aad29a1d7ad77d67073c1c54b28c429c64ed9b. This was accidentally folded into a single commit. Remove it and apply it properly again. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for kernel 5.10Ilya Lipnitskiy2021-03-051-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Enable testing kernel. Delete upstreamed patches: 0098-disable_cm.patch can be dropped, upstream fixed CM handling. Fix compile errors by using new kernel APIs. Fix fuzz by manually editing patches to ensure the code goes in the right place. For 721-NET-no-auto-carrier-off-support.patch, revert upstream commit a307593a6 to keep the OpenWrt ralink driver operational. Add mt7621-pci-phy patch to select REGMAP_MMIO as discussed in PR #3693 and #3952. Rename patches to follow the 3-digit classification from the OpenWrt Developer Guide. Run automatic quilt refresh. Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
* ramips: remove further mt7621 code from local ethernet driverAdrian Schmutzler2020-08-261-12/+0
| | | | | | | | | | | | | | | While commit 734a8c46e703 focussed on removing stuff directly selected by the NET_RALINK_* symbols, this patch removes additional unused mt7621-specific code from the ethernet driver. As with the previous patch, the main reason is to reduce the amount of code we have to maintain and care about. Note that this patch still keeps a few lines with IS_ENABLED(CONFIG_SOC_MT7621) in mtk_eth_soc.h/.c, as this file is still selected for the mt7621 subtarget. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: move and rename out-of-tree mtk eth driverChuanhong Guo2020-04-121-0/+373
| | | | | | | move the driver into shared 'files' directory and rename all symbols from mediatek/mtk to ralink. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* ralink: drop old ethernet driverJohn Crispin2015-12-171-278/+0
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 47899
* ramips: make ethernet register map u16 instead of u32Felix Fietkau2015-03-221-2/+2
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 44940
* ralink: use random generate mac address instead of default one.John Crispin2015-03-131-2/+0
| | | | | | Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44740
* ralink: fix hw status almost full not work on mt7620 and mt7621John Crispin2015-02-091-0/+13
| | | | | | | | | | | | | | the old FE_INT_STATUS register becomes two registers. FE_INT_STATUS and INT_STATUS. so the hw status almost full must change to read from FE_INT_STATUS register. tx/rx done read from INT_STATUS register. mt7620 datasheet define CNT_GDM1_AF at BIT(29). but after test it should be BIT(13). why? Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44371
* ralink: fix ethernet feature TSO not workFelix Fietkau2015-01-241-7/+6
| | | | | | | | | | | | | | | | * fix TSO features verify on mt7621 firewrt board * improve tx clean up. no need to access uncached memory. also use TX_DTX register instead of read tx ring DONE bit * mt7621 need napi weight 64 to get more performance * remove netif_receive_skb, after kernel version 3.7 tcp4_gro_receive can handle tcp checksum. on rt2880 use iperf tcp LAN to WAN throughput test. with gro 135 Mbits/sec. without gro 80.4Mbits/sec. Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44118
* ralink: init tx/rx vlan offload register for mt7621Felix Fietkau2015-01-241-3/+15
| | | | | | | | | | on mt7621 don't have tx vlan vid registers. so set FE_REG_FE_DMA_VID_BASE to 0. set rx vlan offload register to disable. Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44117
* ralink: improve check rx sg function. use check frags instead of function callFelix Fietkau2015-01-181-9/+4
| | | | | | Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44046
* ralink: correct handle hardware rx 2bytes offsetFelix Fietkau2015-01-181-5/+4
| | | | | | Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44045
* ralink: use fe_reset to control all resetFelix Fietkau2015-01-181-10/+2
| | | | | | Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44044
* ralink: improve tx_timeout functionFelix Fietkau2015-01-181-0/+4
| | | | | | | | | | * use default timeout value * print more debug ring info * move timeout reset function to workqueue Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44043
* ralink: reduce access to uncached tx/rx dma ring bufferFelix Fietkau2015-01-181-6/+6
| | | | | | Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 44041
* ramips: remove interrupt coalescing, it is unnecessary with napi polling and ↵Felix Fietkau2015-01-131-4/+4
| | | | | | | | could reduce throughput Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43952
* ramips: disable ethernet checksum offloads for mt7621, they are brokenFelix Fietkau2015-01-021-1/+10
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43811
* ralink: fix tx vlan offload and hardware statusJohn Crispin2014-11-191-1/+6
| | | | | | | | | | | | | hardware status and tx vlan offload support on all targets except rt5350. so i modify the IS_ENABLE condition only for mt7621. support mt7621 hardware status reference by SDK. but i don't have mt7621. if not work just set mt7621 FE_REG_FE_COUNTER_BASE to 0 to let software count. Signed-off-by: michael lee <igvtee@gmail.com> SVN-Revision: 43303
* ralink: mt7621 has a different base addr for PVIDJohn Crispin2014-11-141-1/+19
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43243
* ralink: add support for mt7621 ethernetJohn Crispin2014-11-121-3/+73
| | | | | | | | somehow all switch ports still come up as 10mbit. Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43237
* ralink: move ethernet driver to files/John Crispin2014-11-061-0/+164
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 43194