This patch series add the MDIO reset features, which includes
configuring MDIO clock source frequency and indicating CMN_PLL that
ethernet LDO has been ready, this ethernet LDO is dedicated in the
IPQ5018 platform.
Specify more chipset IPQ40xx, IPQ807x, IPQ60xx and IPQ50xx supported by
this MDIO driver.
Changes in v3:
* simplify the function ipq_mdio_reset.
Changes in v2:
* Addressed review comments (Andrew Lunn).
* Remove the IS_ERR().
* make binding patch part of series.
* document the property 'reg' and 'clock'.
Changes in v1:
* make MDIO_IPQ4019 unchanged for backwards compatibility.
* remove the PHY reset functions
Luo Jie (3):
net: mdio: Add the reset function for IPQ MDIO driver
MDIO: Kconfig: Specify more IPQ chipset supported
dt-bindings: net: Add the properties for ipq4019 MDIO
.../bindings/net/qcom,ipq4019-mdio.yaml | 15 ++++++-
drivers/net/mdio/Kconfig | 3 +-
drivers/net/mdio/mdio-ipq4019.c | 44 +++++++++++++++++++
3 files changed, 60 insertions(+), 2 deletions(-)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
The IPQ MDIO driver currently supports the chipset IPQ40xx, IPQ807x,
IPQ60xx and IPQ50xx.
Add the compatible 'qcom,ipq5018-mdio' because of ethernet LDO dedicated
to the IPQ5018 platform.
Signed-off-by: Luo Jie <redacted>
---
drivers/net/mdio/Kconfig | 2 +-
drivers/net/mdio/mdio-ipq4019.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
The new added properties resource "reg" is for configuring
ethernet LDO in the IPQ5018 chipset, the property "clocks"
is for configuring the MDIO clock source frequency.
Signed-off-by: Luo Jie <redacted>
---
.../bindings/net/qcom,ipq4019-mdio.yaml | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
@@ -23,7 +25,18 @@ properties:const:0reg:+minItems:1+maxItems:2+description:+the first Address and length of the register set for the MDIO controller.+the second Address and length of the register for ethernet LDO, this second+address range is only required by the platform IPQ50xx.++clocks:maxItems:1+description:|+MDIO clock source frequency fixed to 100MHZ, this clock should be specified+by the platform IPQ807x, IPQ60xx and IPQ50xx.required:-compatible
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
1. configure the MDIO clock source frequency.
2. the LDO resource is needed to configure the ethernet LDO available
for CMN_PLL.
Signed-off-by: Luo Jie <redacted>
---
drivers/net/mdio/Kconfig | 1 +
drivers/net/mdio/mdio-ipq4019.c | 43 +++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
@@ -31,8 +32,15 @@#define IPQ4019_MDIO_TIMEOUT 10000#define IPQ4019_MDIO_SLEEP 10+/* MDIO clock source frequency is fixed to 100M */+#define IPQ_MDIO_CLK_RATE 100000000++#define IPQ_PHY_SET_DELAY_US 100000+structipq4019_mdio_data{void__iomem*membase;+void__iomem*eth_ldo_rdy;+structclk*mdio_clk;};staticintipq4019_mdio_wait_busy(structmii_bus*bus)
@@ -171,10 +179,35 @@ static int ipq4019_mdio_write(struct mii_bus *bus, int mii_id, int regnum,return0;}+staticintipq_mdio_reset(structmii_bus*bus)+{+structipq4019_mdio_data*priv=bus->priv;+u32val;+intret;++/* To indicate CMN_PLL that ethernet_ldo has been ready if platform resource 1+*isspecifiedinthedevicetree.+*/+if(priv->eth_ldo_rdy){+val=readl(priv->eth_ldo_rdy);+val|=BIT(0);+writel(val,priv->eth_ldo_rdy);+fsleep(IPQ_PHY_SET_DELAY_US);+}++/* Configure MDIO clock source frequency if clock is specified in the device tree */+ret=clk_set_rate(priv->mdio_clk,IPQ_MDIO_CLK_RATE);+if(ret)+returnret;++returnclk_prepare_enable(priv->mdio_clk);+}+staticintipq4019_mdio_probe(structplatform_device*pdev){structipq4019_mdio_data*priv;structmii_bus*bus;+structresource*res;intret;bus=devm_mdiobus_alloc_size(&pdev->dev,sizeof(*priv));
@@ -187,9 +220,19 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)if(IS_ERR(priv->membase))returnPTR_ERR(priv->membase);+priv->mdio_clk=devm_clk_get_optional(&pdev->dev,"gcc_mdio_ahb_clk");+if(IS_ERR(priv->mdio_clk))+returnPTR_ERR(priv->mdio_clk);++/* The platform resource is provided on the chipset IPQ5018 */+res=platform_get_resource(pdev,IORESOURCE_MEM,1);+if(res)+priv->eth_ldo_rdy=devm_ioremap_resource(&pdev->dev,res);+bus->name="ipq4019_mdio";bus->read=ipq4019_mdio_read;bus->write=ipq4019_mdio_write;+bus->reset=ipq_mdio_reset;bus->parent=&pdev->dev;snprintf(bus->id,MII_BUS_ID_SIZE,"%s%d",pdev->name,pdev->id);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-08-15 14:49:46
On Thu, Aug 12, 2021 at 06:06:40PM +0800, Luo Jie wrote:
1. configure the MDIO clock source frequency.
2. the LDO resource is needed to configure the ethernet LDO available
for CMN_PLL.
Signed-off-by: Luo Jie <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-08-15 14:49:59
On Thu, Aug 12, 2021 at 06:06:41PM +0800, Luo Jie wrote:
The IPQ MDIO driver currently supports the chipset IPQ40xx, IPQ807x,
IPQ60xx and IPQ50xx.
Add the compatible 'qcom,ipq5018-mdio' because of ethernet LDO dedicated
to the IPQ5018 platform.
Signed-off-by: Luo Jie <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-08-15 14:50:32
On Thu, Aug 12, 2021 at 06:06:42PM +0800, Luo Jie wrote:
The new added properties resource "reg" is for configuring
ethernet LDO in the IPQ5018 chipset, the property "clocks"
is for configuring the MDIO clock source frequency.
Signed-off-by: Luo Jie <redacted>
---
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Thu, 12 Aug 2021 18:06:39 +0800 you wrote:
This patch series add the MDIO reset features, which includes
configuring MDIO clock source frequency and indicating CMN_PLL that
ethernet LDO has been ready, this ethernet LDO is dedicated in the
IPQ5018 platform.
Specify more chipset IPQ40xx, IPQ807x, IPQ60xx and IPQ50xx supported by
this MDIO driver.
[...]