* [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY
@ 2025-06-30 12:34 George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 1/3] clk: qcom: gcc-ipq5018: fix GE PHY reset George Moussalem via B4 Relay
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: George Moussalem via B4 Relay @ 2025-06-30 12:34 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree,
George Moussalem, Konrad Dybcio
The IPQ5018 SoC contains an internal Gigabit Ethernet PHY with its
output pins that provide an MDI interface to either an external switch
in a PHY to PHY link architecture or directly to an attached RJ45
connector.
The PHY supports 10BASE-T/100BASE-TX/1000BASE-T link modes in SGMII
interface mode, CDT, auto-negotiation and 802.3az EEE.
The LDO controller found in the IPQ5018 SoC needs to be enabled to drive
power to the CMN Ethernet Block (CMN BLK) which the GE PHY depends on.
The LDO must be enabled in TCSR by writing to a specific register.
In a phy to phy architecture, DAC values need to be set to accommodate
for the short cable length.
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
Changes in v6:
- Rebased on top of linux-next which includes the bindings (patch 2 in
v5) and driver (patch 3 in v5) picked up from and merged by net-next,
no changes otherwise.
- Link to v5: https://lore.kernel.org/r/20250610-ipq5018-ge-phy-v5-0-daa9694bdbd1@outlook.com
Changes in v5:
- Removed unused macro definition (IPQ5018_TCSR_ETH_LDO_READY)
- Reverted sorting of header files for which a separate patch can be
submitted
- Added a comment to explain why the FIFO buffer needs to be reset
- Do not initialize local variable as caught by Russell
- Updated macro definition names to more accurately describe the PHY
registers and their functions
- Include SGMII as supported interface mode in driver commit message
- Changed error handling of acquirement of PHY reset to use IR_ERR
instead of IS_ERR_OR_NULL
- Link to v4: https://lore.kernel.org/r/20250609-ipq5018-ge-phy-v4-0-1d3a125282c3@outlook.com
Changes in v4:
- Updated description of qcom,dac-preset-short-cable property in
accordance with Andrew's recommendation to indicate that if the
property is not set, no DAC values will be modified.
- Added newlines between properties
- Added PHY ID as compatible in DT bindings for conditional check to
evaluate correctly. Did a 'git grep' on all other PHY IDs defined in
the driver but none are explicitly referenced so I haven't added them
- Link to v3: https://lore.kernel.org/r/20250602-ipq5018-ge-phy-v3-0-421337a031b2@outlook.com
Changes in v3:
- Replace bitmask of GEPHY_MISC_ARES with GENMASK as suggested by Konrad
- Removed references to RX and TX clocks as the driver need not
explicitly enable them. The GCC gatecontrols and routes the PHY's
output clocks, registered in the DT as fixed clocks, back to the PHY.
The bindings file has been updated accordingly.
- Removed acquisition and enablement of RX and TX clocks from the driver
- Link to v2: https://lore.kernel.org/r/20250528-ipq5018-ge-phy-v2-0-dd063674c71c@outlook.com
Changes in v2:
- Moved values for MDAC and EDAC into the driver and converted DT
property qca,dac to a new boolean: qcom,dac-preset-short-cable as per
discussion.
- Added compatible string along with a condition with a description of
properties including clocks, resets, and qcom,dac-preset-short-cable
in the bindings to address bindings issues reported by Rob and to
bypass restrictions on nr of clocks and resets in ethernet-phy.yaml
- Added example to bindings file
- Renamed all instances of IPQ5018_PHY_MMD3* macros to IPQ5018_PHY_PCS*
- Removed qca,eth-ldo-ready property and moved the TCSR register to the
mdio bus the phy is on as there's already support for setting this reg
property in the mdio-ipq4019 driver as per commit:
23a890d493e3ec1e957bc925fabb120962ae90a7
- Explicitly probe on PHY ID as otherwise the PHY wouldn't come up and
initialize as found during further testing when the kernel is flashed
to NAND
- Link to v1: https://lore.kernel.org/r/20250525-ipq5018-ge-phy-v1-0-ddab8854e253@outlook.com
---
George Moussalem (3):
clk: qcom: gcc-ipq5018: fix GE PHY reset
arm64: dts: qcom: ipq5018: Add MDIO buses
arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus
arch/arm64/boot/dts/qcom/ipq5018.dtsi | 48 +++++++++++++++++++++++++++++++++--
drivers/clk/qcom/gcc-ipq5018.c | 2 +-
2 files changed, 47 insertions(+), 3 deletions(-)
---
base-commit: bc4672f3c5df8a47a3e5b4c31dead2b01103e70f
change-id: 20250430-ipq5018-ge-phy-db654afa4ced
Best regards,
--
George Moussalem <george.moussalem@outlook.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v6 1/3] clk: qcom: gcc-ipq5018: fix GE PHY reset
2025-06-30 12:34 [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY George Moussalem via B4 Relay
@ 2025-06-30 12:35 ` George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 2/3] arm64: dts: qcom: ipq5018: Add MDIO buses George Moussalem via B4 Relay
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: George Moussalem via B4 Relay @ 2025-06-30 12:35 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree,
George Moussalem, Konrad Dybcio
From: George Moussalem <george.moussalem@outlook.com>
The MISC reset is supposed to trigger a resets across the MDC, DSP, and
RX & TX clocks of the IPQ5018 internal GE PHY. So let's set the bitmask
of the reset definition accordingly in the GCC as per the downstream
driver.
Link: https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/commit/00743c3e82fa87cba4460e7a2ba32f473a9ce932
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
drivers/clk/qcom/gcc-ipq5018.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c
index 70f5dcb96700f55da1fb19fc893d22350a7e63bf..6eb86c034fda18c38dcd9726f0903841252381da 100644
--- a/drivers/clk/qcom/gcc-ipq5018.c
+++ b/drivers/clk/qcom/gcc-ipq5018.c
@@ -3660,7 +3660,7 @@ static const struct qcom_reset_map gcc_ipq5018_resets[] = {
[GCC_WCSS_AXI_S_ARES] = { 0x59008, 6 },
[GCC_WCSS_Q6_BCR] = { 0x18004, 0 },
[GCC_WCSSAON_RESET] = { 0x59010, 0},
- [GCC_GEPHY_MISC_ARES] = { 0x56004, 0 },
+ [GCC_GEPHY_MISC_ARES] = { 0x56004, .bitmask = GENMASK(3, 0) },
};
static const struct of_device_id gcc_ipq5018_match_table[] = {
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v6 2/3] arm64: dts: qcom: ipq5018: Add MDIO buses
2025-06-30 12:34 [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 1/3] clk: qcom: gcc-ipq5018: fix GE PHY reset George Moussalem via B4 Relay
@ 2025-06-30 12:35 ` George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 3/3] arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus George Moussalem via B4 Relay
2025-07-17 4:30 ` (subset) [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY Bjorn Andersson
3 siblings, 0 replies; 5+ messages in thread
From: George Moussalem via B4 Relay @ 2025-06-30 12:35 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree,
George Moussalem, Konrad Dybcio
From: George Moussalem <george.moussalem@outlook.com>
IPQ5018 contains two mdio buses of which one bus is used to control the
SoC's internal GE PHY, while the other bus is connected to external PHYs
or switches.
There's already support for IPQ5018 in the mdio-ipq4019 driver, so let's
simply add the mdio nodes for them.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
arch/arm64/boot/dts/qcom/ipq5018.dtsi | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/ipq5018.dtsi b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
index 130360014c5e14c778e348d37e601f60325b0b14..03ebc3e305b267c98a034c41ce47a39269afce75 100644
--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
@@ -182,6 +182,30 @@ pcie0_phy: phy@86000 {
status = "disabled";
};
+ mdio0: mdio@88000 {
+ compatible = "qcom,ipq5018-mdio";
+ reg = <0x00088000 0x64>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ clocks = <&gcc GCC_MDIO0_AHB_CLK>;
+ clock-names = "gcc_mdio_ahb_clk";
+
+ status = "disabled";
+ };
+
+ mdio1: mdio@90000 {
+ compatible = "qcom,ipq5018-mdio";
+ reg = <0x00090000 0x64>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ clocks = <&gcc GCC_MDIO1_AHB_CLK>;
+ clock-names = "gcc_mdio_ahb_clk";
+
+ status = "disabled";
+ };
+
tlmm: pinctrl@1000000 {
compatible = "qcom,ipq5018-tlmm";
reg = <0x01000000 0x300000>;
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v6 3/3] arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus
2025-06-30 12:34 [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 1/3] clk: qcom: gcc-ipq5018: fix GE PHY reset George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 2/3] arm64: dts: qcom: ipq5018: Add MDIO buses George Moussalem via B4 Relay
@ 2025-06-30 12:35 ` George Moussalem via B4 Relay
2025-07-17 4:30 ` (subset) [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY Bjorn Andersson
3 siblings, 0 replies; 5+ messages in thread
From: George Moussalem via B4 Relay @ 2025-06-30 12:35 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree,
George Moussalem, Konrad Dybcio
From: George Moussalem <george.moussalem@outlook.com>
The IPQ5018 SoC contains an internal GE PHY, always at phy address 7.
As such, let's add the GE PHY node to the SoC dtsi.
The LDO controller found in the SoC must be enabled to provide constant
low voltages to the PHY. The mdio-ipq4019 driver already has support
for this, so adding the appropriate TCSR register offset.
In addition, the GE PHY outputs both the RX and TX clocks to the GCC
which gate controls them and routes them back to the PHY itself.
So let's create two DT fixed clocks and register them in the GCC node.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
---
arch/arm64/boot/dts/qcom/ipq5018.dtsi | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq5018.dtsi b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
index 03ebc3e305b267c98a034c41ce47a39269afce75..d47ad62b01991fafa51e7082bd1fcf6670d9b0bc 100644
--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
@@ -16,6 +16,18 @@ / {
#size-cells = <2>;
clocks {
+ gephy_rx_clk: gephy-rx-clk {
+ compatible = "fixed-clock";
+ clock-frequency = <125000000>;
+ #clock-cells = <0>;
+ };
+
+ gephy_tx_clk: gephy-tx-clk {
+ compatible = "fixed-clock";
+ clock-frequency = <125000000>;
+ #clock-cells = <0>;
+ };
+
sleep_clk: sleep-clk {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -184,7 +196,8 @@ pcie0_phy: phy@86000 {
mdio0: mdio@88000 {
compatible = "qcom,ipq5018-mdio";
- reg = <0x00088000 0x64>;
+ reg = <0x00088000 0x64>,
+ <0x019475c4 0x4>;
#address-cells = <1>;
#size-cells = <0>;
@@ -192,6 +205,13 @@ mdio0: mdio@88000 {
clock-names = "gcc_mdio_ahb_clk";
status = "disabled";
+
+ ge_phy: ethernet-phy@7 {
+ compatible = "ethernet-phy-id004d.d0c0";
+ reg = <7>;
+
+ resets = <&gcc GCC_GEPHY_MISC_ARES>;
+ };
};
mdio1: mdio@90000 {
@@ -232,8 +252,8 @@ gcc: clock-controller@1800000 {
<&pcie0_phy>,
<&pcie1_phy>,
<0>,
- <0>,
- <0>,
+ <&gephy_rx_clk>,
+ <&gephy_tx_clk>,
<0>,
<0>;
#clock-cells = <1>;
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: (subset) [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY
2025-06-30 12:34 [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY George Moussalem via B4 Relay
` (2 preceding siblings ...)
2025-06-30 12:35 ` [PATCH v6 3/3] arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus George Moussalem via B4 Relay
@ 2025-07-17 4:30 ` Bjorn Andersson
3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2025-07-17 4:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, George Moussalem
Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, Konrad Dybcio
On Mon, 30 Jun 2025 16:34:59 +0400, George Moussalem wrote:
> The IPQ5018 SoC contains an internal Gigabit Ethernet PHY with its
> output pins that provide an MDI interface to either an external switch
> in a PHY to PHY link architecture or directly to an attached RJ45
> connector.
>
> The PHY supports 10BASE-T/100BASE-TX/1000BASE-T link modes in SGMII
> interface mode, CDT, auto-negotiation and 802.3az EEE.
>
> [...]
Applied, thanks!
[2/3] arm64: dts: qcom: ipq5018: Add MDIO buses
commit: 23b3da8734e94acad2b98180cacbedf97754e1c1
[3/3] arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus
commit: a150a9c4807ab37d9f63112ef8e11710104a9d09
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-07-17 4:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 12:34 [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 1/3] clk: qcom: gcc-ipq5018: fix GE PHY reset George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 2/3] arm64: dts: qcom: ipq5018: Add MDIO buses George Moussalem via B4 Relay
2025-06-30 12:35 ` [PATCH v6 3/3] arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus George Moussalem via B4 Relay
2025-07-17 4:30 ` (subset) [PATCH v6 0/3] Add support for the IPQ5018 Internal GE PHY Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).