summaryrefslogtreecommitdiff
path: root/drivers/staging/mt7621-eth/mtk_eth_soc.c
AgeCommit message (Collapse)Author
2019-03-18staging: remove mt7621-ethNeilBrown
driver/net/ethernet/mediatek/ now supports this hardware, so we don't need a separate driver. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-08cross-tree: phase out dma_zalloc_coherent()Luis Chamberlain
We already need to zero out memory for dma_alloc_coherent(), as such using dma_zalloc_coherent() is superflous. Phase it out. This change was generated with the following Coccinelle SmPL patch: @ replace_dma_zalloc_coherent @ expression dev, size, data, handle, flags; @@ -dma_zalloc_coherent(dev, size, handle, flags) +dma_alloc_coherent(dev, size, handle, flags) Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> [hch: re-ran the script on the latest tree] Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-12-12staging: mt7621-eth: set correct dma mask.NeilBrown
Since commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") changed MIPS dma handling, the eth driver fails because the dma mask is set on the wrong 'struct device'. Move the setting to the correct struct device. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14staging: remove unneeded static set .owner field in platform_driverzhong jiang
platform_driver_register will set the .owner field. So it is safe to remove the redundant assignment. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-01drivers/staging/mt7621-eth: Use dma_zalloc_coherent to replace ↵zhong jiang
dma_alloc_coherent+memset we prefer to use dma_zalloc_coherent rather than dam_alloc_coherent+memset Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-eth: Use eth_hw_addr_random()Kamal Heib
Use eth_hw_addr_random() to set a random dev_addr and update addr_assign_type. Fixes: e3cbf478f846 ('staging: mt7621-eth: add the drivers core files') Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28staging: mt7621-eth: Fix memory leak in mtk_add_mac() error pathKamal Heib
Fix memory leak in error path of mtk_add_mac() by make sure to free the allocated netdev. Fixes: e3cbf478f846 ('staging: mt7621-eth: add the drivers core files') Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-15staging: mt7621-eth: Remove unused variableKamal Heib
Remove unused variable 'condition' which was set but not used. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: mt7621-eth: Fix quoted string split across linesKamal Heib
Quoted strings should not be split to help text grep in the source. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-14staging: mt7621-eth: Prefer unsigned int to bare use of unsignedKamal Heib
This commit replaces all the unsigned definitions in favour of 'unsigned int' which is preferred. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: mt7621-eth: Alignment should match open parenthesisKamal Heib
Fix alignment issues reported by checkpatch.pl. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: mt7621-eth: Fix compilation errorKamal Heib
Fix the following comilation error by making sure that "phy_ring_head" is defined as "dma_addr_t" and change "phy_ring_tail" to match it as both should be "dma_addr_t". error: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22staging: mt7621-eth: fix spelling mistake: "devictree" -> "devicetree"Colin Ian King
Trivial fix to spelling mistake in dev_err message text Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22staging: mt7621-eth: fix return value check in mtk_probe()Wei Yongjun
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: e3cbf478f846 ("staging: mt7621-eth: add the drivers core files") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19staging: mt7621-eth: add the drivers core filesJohn Crispin
Original comment: This patch adds the main chunk of the driver. The ethernet core is used in all of the Mediatek/Ralink Wireless SoCs. Over the years we have seen various changes to * the register layout * the type of ports (single/dual gbit, internal FE/Gbit switch) * dma engine (PDMA/QDMA) and new offloading features were added, such as * checksum * VLAN TX/RX * TSO * LRO The core functionality has however remained the same allowing us to use the same code for all SoCs. The abstraction for the various SoCs uses the typical ops struct pattern which allows us to extend or override the core functionality depending on which SoC we are on. The code to bring up the switches and external ports has also been split into separate files. There are 2 types of DMA engine, PDMA and the newer QDMA. PDMA uses a typical ring buffer while QDMA uses a linked list. Unfortunatley we have the MT7621 which has a few silicon issues. Due to these issues we need to PDMA for RX and QDMA for TX. All SoCs newer than the MT7621 can can run on QDMA exclusively. Most of the SoCs have a switch frontend. Older silicon has a so called ESW (Ethernet Switch) while newer cores have a GSW (Gigabit switch). Additionally there is a MDIO bus that can be used to talk to PHYs. In these cases one switch port get changed into a normal MAC port. Some SoCs have a dual MAC, we currently only support this on MT7623. NeilBrown: - removed everything not closely related to mt7621, as that is all I can test - converted ethtool.c to new ethtool_link_ksettings interfaces. Doesn't work yet. - updated some phydev interface use: e.g. dev_name() -> phydev_name() - updated mdio to use mdiobus_get_phy() - added some missing export_symbols - updated get_stats64 interface - TX_DMA_FPORT and TX_DMA_TSO to tx dma descriptor - range checked RX_DMA_FPORT in rx dma descriptor - tell hardware what mac address was chosen - fixed MT7620_GDMA1_FWD_CFG which was using wrong value Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Michael Lee <igvtee@gmail.com> Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>