summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/arc/emac_rockchip.c
Commit message (Collapse)AuthorAgeFilesLines
* net: ethernet: arc: Fix a potential memory leak if an optional regulator is ↵Christophe JAILLET2018-03-201-2/+4
| | | | | | | | | | | deferred If the optional regulator is deferred, we must release some resources. They will be re-allocated when the probe function will be called again. Fixes: 6eacf31139bf ("ethernet: arc: Add support for Rockchip SoC layer device tree bindings") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: arc: fix error handling in emac_rockchip_probeBranislav Radocaj2017-12-131-3/+7
| | | | | | | | | | | | | | | | If clk_set_rate() fails, we should disable clk before return. Found by Linux Driver Verification project (linuxtesting.org). Changes since v2 [1]: * Merged with latest code changes Changes since v1: Update made thanks to David's review, much appreciated David. * Improved inconsistent failure handling of clock rate setting * For completeness of usecase, added arc_emac_probe error handling Signed-off-by: Branislav Radocaj <branislav@radocaj.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: arc: fix error handling in emac_rockchip_probeBranislav Radocaj2017-12-071-2/+5
| | | | | | | | If clk_set_rate() fails, we should disable clk before return. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Branislav Radocaj <branislav@radocaj.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: arc: trivial: cleanup the emac driverCaesar Wang2016-03-171-12/+29
| | | | | | | | | | | | | | | | This patch will make the driver more readability The emac has the error and warnings if you run 'scripts/checkpatch.pl -f --subjective xxx' to check. Let's clean up such trivial details. Signed-off-by: Caesar Wang <wxt@rock-chips.com> Cc: Jiri Kosina <trivial@kernel.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexander Kochetkov <al.kochet@gmail.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: arc: Add support emac for RK3036Xing Zheng2016-01-111-1/+7
| | | | | | | | The RK3036's GRFs offset are different with RK3066/RK3188, and need to set mac TX/RX clock before probe emac. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: arc: Keep emac compatibility for more Rockchip SoCsXing Zheng2016-01-111-24/+45
| | | | | | | | | | On the RK3066/RK3188, there was fixed GRF offset configuration to set emac and fixed DIV2 mac TX/RX clock. So, we need to easily set and fit to other SoCs (RK3036) which maybe have different GRF offset, and need adjust mac TX/RX clock. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: arc: Probe emac after set RMII clockXing Zheng2016-01-111-4/+7
| | | | | | | | | After enter arc_emac_probe, emac will get_phy_id, phy_poll_reset and other connecting PHY via mdiobus_read, so we need to set correct ref clock rate for emac before probe emac. Signed-off-by: Xing Zheng <zhengxing@rock-chips.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: arc: Don't free Rockchip resources before disconnect from phyRomain Perier2014-09-101-1/+2
| | | | | | | | | Free resources before being disconnected from phy and calling core driver is wrong and should not happen. It avoids a delay of 4-5s caused by the timeout of phy_disconnect(). Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ethernet: arc: Add support for Rockchip SoC layer device tree bindingsRomain Perier2014-09-101-0/+228
This patch defines a platform glue layer for Rockchip SoCs which support arc-emac driver. It ensures that regulator for the rmii is on before trying to connect to the ethernet controller. It applies right speed and mode changes to the grf when ethernet settings change. Signed-off-by: Romain Perier <romain.perier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>