mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
Merge branch 'ipq5018-add-and-enable-gephy-rx-and-tx-clocks'
George Moussalem says: ==================== IPQ5018: Add and enable GEPHY RX and TX clocks This patch series addresses a missing hardware description issue for the Qualcomm IPQ5018 Internal Ethernet PHY, where the data paths fail to function correctly unless their dedicated RX and TX clocks are explicitly enabled. Further testing revealed that leaving these clocks unmanaged by the kernel, they were inadvertently left enabled by the bootloader / QSDK platform, which masked the issue. Testing a fresh network configuration path exposed that the data link fails to work without explicit software gating. To correctly introduce the required multi-clock properties, the IPQ5018 binding definition must first be split away from the shared qca,ar803x.yaml schema. This isolation is required because ar803x references the generic ethernet-phy.yaml, which enforces a strict single-clock limit constraint. - Patch 1: Moves the clocks property and its restriction out of the generic ethernet-phy.yaml schema to individual bindings files that need it to allow for PHYs that require multiple clocks. - Patch 2: Add clocks property to qca,ar803x.yaml for the IPQ5018 PHY. - Patch 3: Updates the Qualcomm AT803x PHY driver framework to acquire, enable, and gate these clocks upon link state changes for runtime power optimization. ==================== Link: https://patch.msgid.link/20260608-ipq5018-gephy-clocks-v4-0-fb2ccd56894b@outlook.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
70c82b84b6
|
|
@ -106,10 +106,13 @@ properties:
|
|||
by software.
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
description:
|
||||
External clock connected to the PHY. If not specified it is assumed
|
||||
that the PHY uses a fixed crystal or an internal oscillator.
|
||||
External clock connected to the PHY or RX and TX clocks that the PHY
|
||||
requires to enable explicitly. If not specified it is assumed
|
||||
that the PHY uses a fixed crystal or an internal oscillator or that the
|
||||
RX/TX clocks are hardware enabled by default.
|
||||
|
||||
enet-phy-lane-swap:
|
||||
$ref: /schemas/types.yaml#/definitions/flag
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ allOf:
|
|||
reg:
|
||||
const: 7 # This PHY is always at MDIO address 7 in the IPQ5018 SoC
|
||||
|
||||
clocks:
|
||||
items:
|
||||
- description: RX clock
|
||||
- description: TX clock
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: rx
|
||||
- const: tx
|
||||
|
||||
resets:
|
||||
items:
|
||||
- description:
|
||||
|
|
@ -42,6 +52,11 @@ allOf:
|
|||
of this PHY are directly connected to an RJ45 connector.
|
||||
type: boolean
|
||||
|
||||
required:
|
||||
- clocks
|
||||
- clock-names
|
||||
- resets
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
|
|
@ -162,6 +177,7 @@ examples:
|
|||
};
|
||||
};
|
||||
- |
|
||||
#include <dt-bindings/clock/qcom,gcc-ipq5018.h>
|
||||
#include <dt-bindings/reset/qcom,gcc-ipq5018.h>
|
||||
|
||||
mdio {
|
||||
|
|
@ -172,6 +188,9 @@ examples:
|
|||
compatible = "ethernet-phy-id004d.d0c0";
|
||||
reg = <7>;
|
||||
|
||||
clocks = <&gcc GCC_GEPHY_RX_CLK>,
|
||||
<&gcc GCC_GEPHY_TX_CLK>;
|
||||
clock-names = "rx", "tx";
|
||||
resets = <&gcc GCC_GEPHY_MISC_ARES>;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/phylink.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/phy_port.h>
|
||||
#include <dt-bindings/net/qca-ar803x.h>
|
||||
|
|
@ -1074,6 +1075,7 @@ static void ipq5018_link_change_notify(struct phy_device *phydev)
|
|||
static int ipq5018_probe(struct phy_device *phydev)
|
||||
{
|
||||
struct device *dev = &phydev->mdio.dev;
|
||||
struct clk *rx_clk, *tx_clk;
|
||||
struct ipq5018_priv *priv;
|
||||
int ret;
|
||||
|
||||
|
|
@ -1084,6 +1086,16 @@ static int ipq5018_probe(struct phy_device *phydev)
|
|||
priv->set_short_cable_dac = of_property_read_bool(dev->of_node,
|
||||
"qcom,dac-preset-short-cable");
|
||||
|
||||
rx_clk = devm_clk_get_enabled(dev, "rx");
|
||||
if (IS_ERR(rx_clk))
|
||||
return dev_err_probe(dev, PTR_ERR(rx_clk),
|
||||
"failed to get and enable RX clock\n");
|
||||
|
||||
tx_clk = devm_clk_get_enabled(dev, "tx");
|
||||
if (IS_ERR(tx_clk))
|
||||
return dev_err_probe(dev, PTR_ERR(tx_clk),
|
||||
"failed to get and enable TX clock\n");
|
||||
|
||||
priv->rst = devm_reset_control_array_get_exclusive(dev);
|
||||
if (IS_ERR(priv->rst))
|
||||
return dev_err_probe(dev, PTR_ERR(priv->rst),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user