summaryrefslogtreecommitdiff
path: root/drivers/net/pcs/pcs-rzn1-miic.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-10net: pcs: rzn1-miic: remove unused struct members and use miic variableClément Léger1-5/+1
Remove unused bulk clocks struct from the miic state and use an already existing miic variable in miic_config(). Signed-off-by: Clément Léger <clement.leger@bootlin.com> Link: https://lore.kernel.org/r/20230208161249.329631-1-clement.leger@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-07-02net: pcs: rzn1-miic: update speed only if interface is changedClément Léger1-5/+16
As stated by Russel King, miic_config() can be called as a result of ethtool setting the configuration while the link is already up. Since the speed is also set in this function, it could potentially modify the current speed that is set. This will only happen if there is no PHY present and we aren't using fixed-link mode. Handle that by storing the current interface mode in the miic_port structure and update the speed only if the interface mode is going to be changed. Signed-off-by: Clément Léger <clement.leger@bootlin.com> Link: https://lore.kernel.org/r/20220629122003.189397-1-clement.leger@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-30net: pcs-rzn1-miic: fix return value check in miic_probe()Yang Yingliang1-2/+2
On failure, devm_platform_ioremap_resource() returns a ERR_PTR() value and not NULL. Fix return value checking by using IS_ERR() and return PTR_ERR() as error value. Fixes: 7dc54d3b8d91 ("net: pcs: add Renesas MII converter driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Clément Léger <clement.leger@bootlin.com> Link: https://lore.kernel.org/r/20220628131259.3109124-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-27net: pcs: add Renesas MII converter driverClément Léger1-0/+520
Add a PCS driver for the MII converter that is present on the Renesas RZ/N1 SoC. This MII converter is reponsible for converting MII to RMII/RGMII or act as a MII pass-trough. Exposing it as a PCS allows to reuse it in both the switch driver and the stmmac driver. Currently, this driver only allows the PCS to be used by the dual Cortex-A7 subsystem since the register locking system is not used. Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>