Add Bananapi R4 variants and add xsphy
Subsystems (5)
v3 cover Add Bananapi R4 variants and add xsphy
From: Frank Wunderlich <[email protected]>
With this series i continue the mt7988/bananapi-r4 dts upstream work
https://patchwork.kernel.org/project/linux-mediatek/list/?series=952704
https://patchwork.kernel.org/project/linux-mediatek/list/?series=952805
- Adding new Hardware Variant for bananapi R4 (1 SFP replaced by RJ45 port with internal phy)
- Adding XS-phy for pcie2
because of new compatible for 2g5 variant now requires also a series i merged both into one.
Daniel Golle (1):
phy: mediatek: xsphy: support type switch by pericfg
Frank Wunderlich (7):
dt-bindings: arm: mediatek: add bpi-r4 2g5 phy variant
arm64: dts: mediatek: mt7988a-bpi-r4: allow hw variants of bpi-r4
dt-bindings: phy: mtk-xs-phy: Add mt7988 compatible
dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
dt-bindings: mfd: syscon: Add mt7988-topmisc
arm64: dts: mediatek: mt7988: Add xsphy for ssusb0/pcie2
arm64: dts: mediatek: mt7988a-bpi-r4: enable xsphy
.../devicetree/bindings/arm/mediatek.yaml | 4 + .../devicetree/bindings/mfd/syscon.yaml | 2 + .../bindings/phy/mediatek,xsphy.yaml | 17 + arch/arm64/boot/dts/mediatek/Makefile | 2 + .../mediatek/mt7988a-bananapi-bpi-r4-2g5.dts | 11 + .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 400 +---------------- .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 403 ++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 36 ++ drivers/phy/mediatek/phy-mtk-xsphy.c | 85 +++- 9 files changed, 564 insertions(+), 396 deletions(-) create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
Signature · 1 line
2.43.0
PATCH v3 3/8 dt-bindings: phy: mtk-xs-phy: Add mt7988 compatible
From: Frank Wunderlich <[email protected]>
Add compatible for xs-phy on mt7988.
--- Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +1 -0
@@ -49,6 +49,7 @@ properties: - enum: - mediatek,mt3611-xsphy - mediatek,mt3612-xsphy + - mediatek,mt7988-xsphy - const: mediatek,xsphy reg:
Signature · 1 line
2.43.0
PATCH v3 1/8 dt-bindings: arm: mediatek: add bpi-r4 2g5 phy variant
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add new compatible for Bananapi R4 with 2.5G phy.
Base board is compatible with existing BPI-R4 only 1 SFP is replaced by RJ45 port and use mt7988 internal phy.
---
v3:
- new patch adding compatible for 2.5g variant
--- Documentation/devicetree/bindings/arm/mediatek.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/arm/mediatek.yaml +4 -0
@@ -104,6 +104,10 @@ properties: - enum: - bananapi,bpi-r4 - const: mediatek,mt7988a + - items: + - const: bananapi,bpi-r4-2g5 + - const: bananapi,bpi-r4 + - const: mediatek,mt7988a - items: - enum: - mediatek,mt8127-moose
Signature · 1 line
2.43.0
PATCH v3 2/8 arm64: dts: mediatek: mt7988a-bpi-r4: allow hw variants of bpi-r4
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Sinovoip has released other variants of Bananapi-R4 board. The known changes affecting only the LAN SFP+ slot which is replaced by a 2.5G phy with optional PoE.
Just move the common parts to a new dtsi and keep differences (only i2c for lan-sfp) in dts.
---
v3:
- move compatible to dts
- added own compatible for 2g5 variant
- update information in board model
v2:
- added basic dts for 2g5 variant
- moved i2c used for sfp-lan to board dts
--- arch/arm64/boot/dts/mediatek/Makefile | 2 + .../mediatek/mt7988a-bananapi-bpi-r4-2g5.dts | 11 + .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts | 400 +----------------- .../dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 399 +++++++++++++++++ 4 files changed, 417 insertions(+), 395 deletions(-) create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
arch/arm64/boot/dts/mediatek/Makefile +2 -0
@@ -22,6 +22,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
@@ -107,4 +108,5 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@ DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@ DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@ +DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@ DTC_FLAGS_mt8395-radxa-nio-12l := -@
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-2g5.dts new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7988a-bananapi-bpi-r4.dtsi" + +/ { + compatible = "bananapi,bpi-r4-2g5", "bananapi,bpi-r4", "mediatek,mt7988a"; + model = "Banana Pi BPI-R4 (1x SFP+, 1x 2.5GbE)"; + chassis-type = "embedded"; +};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts +5 -395
413 lines not on this page · raw message
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi new file +399 -0
399 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v3 4/8 dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add support for type switch by pericfg register between USB3/PCIe.
--- .../devicetree/bindings/phy/mediatek,xsphy.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +16 -0
@@ -151,6 +151,22 @@ patternProperties: minimum: 1 maximum: 31 + mediatek,syscon-type: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: + A phandle to syscon used to access the register of type switch, + the field should always be 3 cells long. + items: + items: + - description: + The first cell represents a phandle to syscon + - description: + The second cell represents the register offset + - description: + The third cell represents the index of config segment + enum: [0, 1, 2, 3] + required: - reg - clocks
Signature · 1 line
2.43.0
PATCH v3 5/8 dt-bindings: mfd: syscon: Add mt7988-topmisc
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Add compatible for Mediatek mt7988 topmisc syscon. This hardware block contains 2 functional blocks
- a powercontroller which is not needed (switched by atf)
- a multiplexer for high-speed Combo-Phy
This compatible is only for the multiplexer part.
--- Documentation/devicetree/bindings/mfd/syscon.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/mfd/syscon.yaml +2 -0
@@ -84,6 +84,7 @@ select: - mediatek,mt2701-pctl-a-syscfg - mediatek,mt2712-pctl-a-syscfg - mediatek,mt6397-pctl-pmic-syscfg + - mediatek,mt7988-topmisc - mediatek,mt8135-pctl-a-syscfg - mediatek,mt8135-pctl-b-syscfg - mediatek,mt8173-pctl-a-syscfg
@@ -187,6 +188,7 @@ properties: - mediatek,mt2701-pctl-a-syscfg - mediatek,mt2712-pctl-a-syscfg - mediatek,mt6397-pctl-pmic-syscfg + - mediatek,mt7988-topmisc - mediatek,mt8135-pctl-a-syscfg - mediatek,mt8135-pctl-b-syscfg - mediatek,mt8173-pctl-a-syscfg
Signature · 1 line
2.43.0
PATCH v3 6/8 phy: mediatek: xsphy: support type switch by pericfg
In reply to Frank WunderlichFrom: Daniel Golle <[email protected]>
Patch from Sam Shih <[email protected]> found in MediaTek SDK released under GPL.
Get syscon and use it to set the PHY type.
Extend support to PCIe and SGMII mode in addition to USB2 and USB3.
--- drivers/phy/mediatek/phy-mtk-xsphy.c | 85 +++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-)
drivers/phy/mediatek/phy-mtk-xsphy.c +84 -1
@@ -11,10 +11,12 @@#include <linux/clk.h> #include <linux/delay.h> #include <linux/iopoll.h> +#include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of_address.h> #include <linux/phy/phy.h> #include <linux/platform_device.h> +#include <linux/regmap.h> #include "phy-mtk-io.h"
@@ -81,12 +83,22 @@#define XSP_SR_COEF_DIVISOR 1000#define XSP_FM_DET_CYCLE_CNT 1024 +/* PHY switch between pcie/usb3/sgmii */ +#define USB_PHY_SWITCH_CTRL 0x0 +#define RG_PHY_SW_TYPE GENMASK(3, 0) +#define RG_PHY_SW_PCIE 0x0 +#define RG_PHY_SW_USB3 0x1 +#define RG_PHY_SW_SGMII 0x2 +struct xsphy_instance {struct phy *phy;void __iomem *port_base;struct clk *ref_clk;/* reference clock of anolog phy */ u32 index;u32 type; +struct regmap *type_sw; +u32 type_sw_reg; +u32 type_sw_index;/* only for HQA test */ int efuse_intr;int efuse_tx_imp;
@@ -259,6 +271,10 @@ static void phy_parse_property(struct mtk_xsphy *xsphy, inst->efuse_intr, inst->efuse_tx_imp, inst->efuse_rx_imp);break ; +case PHY_TYPE_PCIE : +case PHY_TYPE_SGMII : +/* nothing to do */ +break ;default :dev_err (xsphy->dev,"incompatible phy type\n" );return ;
@@ -305,6 +321,62 @@ static void u3_phy_props_set(struct mtk_xsphy *xsphy, RG_XTP_LN0_RX_IMPSEL, inst->efuse_rx_imp); } +/* type switch for usb3/pcie/sgmii */ +static int phy_type_syscon_get (struct xsphy_instance *instance, +struct device_node *dn) +{ +struct of_phandle_args args; +int ret; + +/* type switch function is optional */ +if (!of_property_present (dn,"mediatek,syscon-type" )) +return 0 ; + + ret =of_parse_phandle_with_fixed_args (dn,"mediatek,syscon-type" , +2 ,0 , &args); +if (ret) +return ret; + + instance->type_sw_reg = args.args[0 ]; + instance->type_sw_index = args.args[1 ] &0x3 ;/* <=3 */ + instance->type_sw =syscon_node_to_regmap (args.np); +of_node_put (args.np); +dev_info (&instance->phy->dev,"type_sw - reg %#x, index %d\n" , + instance->type_sw_reg, instance->type_sw_index); + +return PTR_ERR_OR_ZERO (instance->type_sw); +} + +static int phy_type_set (struct xsphy_instance *instance) +{ +int type; +u32 offset; + +if (!instance->type_sw) +return 0 ; + +switch (instance->type) { +case PHY_TYPE_USB3 : + type =RG_PHY_SW_USB3 ; +break ; +case PHY_TYPE_PCIE : + type =RG_PHY_SW_PCIE ; +break ; +case PHY_TYPE_SGMII : + type =RG_PHY_SW_SGMII ; +break ; +case PHY_TYPE_USB2 : +default : +return 0 ; + } + + offset = instance->type_sw_index *BITS_PER_BYTE ; +regmap_update_bits (instance->type_sw, instance->type_sw_reg, +RG_PHY_SW_TYPE << offset, type << offset); + +return 0 ; +} +static int mtk_phy_init (struct phy *phy) {struct xsphy_instance *inst =phy_get_drvdata (phy);
@@ -325,6 +397,10 @@ static int mtk_phy_init(struct phy *phy)case PHY_TYPE_USB3 :u3_phy_props_set (xsphy, inst);break ; +case PHY_TYPE_PCIE : +case PHY_TYPE_SGMII : +/* nothing to do, only used to set type */ +break ;default :dev_err (xsphy->dev,"incompatible phy type\n" );clk_disable_unprepare (inst->ref_clk);
@@ -403,12 +479,15 @@ static struct phy *mtk_phy_xlate(struct device *dev, inst->type = args->args[0 ];if (!(inst->type ==PHY_TYPE_USB2 || - inst->type ==PHY_TYPE_USB3 )) { + inst->type ==PHY_TYPE_USB3 || + inst->type ==PHY_TYPE_PCIE || + inst->type ==PHY_TYPE_SGMII )) {dev_err (dev,"unsupported phy type: %d\n" , inst->type);return ERR_PTR (-EINVAL ); }phy_parse_property (xsphy, inst); +phy_type_set (inst);return inst->phy; }
@@ -510,6 +589,10 @@ static int mtk_xsphy_probe(struct platform_device *pdev)dev_err (dev,"failed to get ref_clk(id-%d)\n" , port);return PTR_ERR (inst->ref_clk); } + + retval =phy_type_syscon_get (inst, child_np); +if (retval) +return retval; } provider =devm_of_phy_provider_register (dev, mtk_phy_xlate);
Signature · 1 line
2.43.0
PATCH v3 8/8 arm64: dts: mediatek: mt7988a-bpi-r4: enable xsphy
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
Enable XS-Phy on Bananapi R4 for pcie2.
--- arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi +4 -0
@@ -397,3 +397,7 @@ &tphy { &watchdog { status = "okay"; }; + +&xsphy { + status = "okay"; +};
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
@@ -560,7 +560,7 @@ topmisc: system-controller@11d10000 { reg = <0 0x11d10084 0 0xff80>; }; - xs-phy@11e10000 { + xsphy: xs-phy@11e10000 { compatible = "mediatek,mt7988-xsphy", "mediatek,xsphy"; #address-cells = <2>;
Signature · 1 line
2.43.0
PATCH v3 7/8 arm64: dts: mediatek: mt7988: Add xsphy for ssusb0/pcie2
In reply to Frank WunderlichFrom: Frank Wunderlich <[email protected]>
First usb and third pcie controller on mt7988 need a xs-phy to work properly.
---
v3:
- drop unneeded properties and compatibles from topmisc
- xsphy unit name not changed because binding requires this name (not only phy)
- also not changed port names to be clear abour which phy is used (mt7988 also have tphy)
- change offset to have clean syscon (without power controller)
--- arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +36 -0
@@ -334,6 +334,8 @@ usb@11190000 { <&infracfg CLK_INFRA_133M_USB_HCK>, <&infracfg CLK_INFRA_USB_XHCI>; clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; + phys = <&xphyu2port0 PHY_TYPE_USB2>, + <&xphyu3port0 PHY_TYPE_USB3>; status = "disabled"; };
@@ -398,6 +400,9 @@ pcie2: pcie@11280000 { pinctrl-0 = <&pcie2_pins>; status = "disabled"; + phys = <&xphyu3port0 PHY_TYPE_PCIE>; + phy-names = "pcie-phy"; + #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; interrupt-map = <0 0 0 1 &pcie_intc2 0>,
@@ -548,6 +553,37 @@ tphyu3port0: usb-phy@11c50700 { }; }; + + topmisc: system-controller@11d10000 { + compatible = "mediatek,mt7988-topmisc", + "syscon"; + reg = <0 0x11d10084 0 0xff80>; + }; + + xs-phy@11e10000 { + compatible = "mediatek,mt7988-xsphy", + "mediatek,xsphy"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + xphyu2port0: usb-phy@11e10000 { + reg = <0 0x11e10000 0 0x400>; + clocks = <&infracfg CLK_INFRA_USB_UTMI>; + clock-names = "ref"; + #phy-cells = <1>; + }; + + xphyu3port0: usb-phy@11e13000 { + reg = <0 0x11e13400 0 0x500>; + clocks = <&infracfg CLK_INFRA_USB_PIPE>; + clock-names = "ref"; + #phy-cells = <1>; + mediatek,syscon-type = <&topmisc 0x194 0>; + }; + }; + clock-controller@11f40000 { compatible = "mediatek,mt7988-xfi-pll"; reg = <0 0x11f40000 0 0x1000>;
Signature · 1 line
2.43.0
Re: [PATCH v3 1/8] dt-bindings: arm: mediatek: add bpi-r4 2g5 phy variant
In reply to Frank WunderlichQuoted 6 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add new compatible for Bananapi R4 with 2.5G phy.
Base board is compatible with existing BPI-R4 only 1 SFP is replaced by RJ45 port and use mt7988 internal phy.
Quoted 7 lines
Signed-off-by Frank Wunderlich <[email protected]>---
v3:
- new patch adding compatible for 2.5g variant--- Documentation/devicetree/bindings/arm/mediatek.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Best regards,
Krzysztof
Re: [PATCH v3 3/8] dt-bindings: phy: mtk-xs-phy: Add mt7988 compatible
In reply to Frank WunderlichQuoted 8 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add compatible for xs-phy on mt7988.
Signed-off-by Frank Wunderlich <[email protected]>--- Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml | 1 + 1 file changed, 1 insertion(+)
Best regards,
Krzysztof
Re: [PATCH v3 4/8] dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
In reply to Frank WunderlichQuoted 15 lines · Frank Wunderlich
From: Frank Wunderlich <[email protected]>
Add support for type switch by pericfg register between USB3/PCIe.
Signed-off-by Frank Wunderlich <[email protected]>--- .../devicetree/bindings/phy/mediatek,xsphy.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +0
-0@@ -151,6 +151,22 @@ patternProperties: minimum: 1
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 161
Quoted 10 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +8
-0maximum: 31 + mediatek,syscon-type: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: + A phandle to syscon used to access the register of type switch, + the field should always be 3 cells long. + items: + items:
Missing -, because you have one phandle.
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 163
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The first cell represents a phandle to syscon
Don't repeat constraints in free form text. "Foo bar system controller" or "Phandle to foo bar system controller"
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 165
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The second cell represents the register offset
"Baz register offset"
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 167
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The third cell represents the index of config segment
"Index of config segment", but what is index of config?
Best regards,
Krzysztof
Re: [PATCH v3 4/8] dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
Hi Krzysztof,
thanks for review.
basicly i used the same binding like for tphy.
Am 2025-04-17 08:56, schrieb Krzysztof Kozlowski:
Quoted 19 lines · Frank Wunderlich
Quoted 18 lines
From: Frank Wunderlich <[email protected]>
Add support for type switch by pericfg register between USB3/PCIe.
Signed-off-by Frank Wunderlich <[email protected]>--- .../devicetree/bindings/phy/mediatek,xsphy.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +0
-0@@ -151,6 +151,22 @@ patternProperties: minimum: 1 maximum: 31
Quoted 11 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 161
Quoted 9 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +8
-0+ mediatek,syscon-type: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: + A phandle to syscon used to access the register of type switch, + the field should always be 3 cells long. + items: + items:Missing -, because you have one phandle.
ok, then i need to drop MaxItems and indent 2 spaces more, but no problem
Quoted 5 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 163
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The first cell represents a phandle to sysconDon't repeat constraints in free form text. "Foo bar system controller" or "Phandle to foo bar system controller"
i would write only "phandle to system controller". on mt7988 it is the topmisc syscon, but maybe on other SoC it is different name.
Quoted 4 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 166
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The second cell represents the register offset"Baz register offset"
same here, only "register offset".
Quoted 4 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 168
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The third cell represents the index of config segment"Index of config segment", but what is index of config?
unfortunately we have no detailed documentation here, but based on driver (i guess daniel ported it from SDK) this value is multiplied with BITS_PER_BYTE so it can handle up to 4 config-segments in the 32bit register (maybe configuring 4 phys). But on mt7988 we use only the first config-segment (last cell=0 in dts-patch).
at the end it will look like this:
mediatek,syscon-type:
$ref: /schemas/types.yaml#/definitions/phandle-array description:
A phandle to syscon used to access the register of type
switch,
the field should always be 3 cells long.
items:
- items:
- description:
Phandle to system controller
- description:
Register offset
- description:
Index of config segment
enum: [0, 1, 2, 3]
would this be ok?
Quoted 2 lines
Best regards,
Krzysztof
regards Frank
Re: [PATCH v3 4/8] dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
Quoted 11 lines · Frank Wunderlich (linux)
Quoted 11 lines
Quoted 10 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +5
-0+ mediatek,syscon-type: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: + A phandle to syscon used to access the register of typeswitch,
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +3
-0+ the field should always be 3 cells long. + items: + items:
Quoted 4 lines
Quoted 1 line
Missing -, because you have one phandle.
ok, then i need to drop MaxItems and indent 2 spaces more, but no problem
I missed that maxItems - should not be placed above description, but immediately around items.
Quoted 10 lines
Quoted 6 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 163
Quoted 3 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The first cell represents a phandle to sysconDon't repeat constraints in free form text. "Foo bar system controller" or "Phandle to foo bar system controller"
i would write only "phandle to system controller". on mt7988 it is the topmisc syscon, but maybe on
other SoC it is different name.
This must be specific to what sort of system controller you point. You are not interested in phandle to any system controller.
Quoted 7 lines
Quoted 5 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ - description: + The second cell represents the register offset"Baz register offset"
same here, only "register offset".
Also not. You need specific register, not any register.
Best regards,
Krzysztof
Re: [PATCH v3 4/8] dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
Am 2025-04-17 09:59, schrieb Krzysztof Kozlowski:
Quoted 12 lines · Frank Wunderlich (linux)
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +5
-0+ mediatek,syscon-type: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 1 + description: + A phandle to syscon used to access the register of typeswitch,
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +3
-0+ the field should always be 3 cells long. + items: + items:
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Missing -, because you have one phandle.
ok, then i need to drop MaxItems and indent 2 spaces more, but no problem
I missed that maxItems - should not be placed above description, but immediately around items.
dt_binding_check complains about maxItems should not be set when having only 1 item ;) so i dropped it in my current version completely.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 163
Quoted 3 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The first cell represents a phandle to sysconDon't repeat constraints in free form text. "Foo bar system controller" or "Phandle to foo bar system controller"
Quoted 6 lines
Quoted 3 lines
i would write only "phandle to system controller". on mt7988 it is the topmisc syscon, but maybe on
other SoC it is different name.This must be specific to what sort of system controller you point. You are not interested in phandle to any system controller.
how about phy configuration controller/register?
Quoted 13 lines
Quoted 7 lines
Quoted 5 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ - description: + The second cell represents the register offset"Baz register offset"
same here, only "register offset".
Also not. You need specific register, not any register.
Best regards,
Krzysztof
Re: [PATCH v3 4/8] dt-bindings: phy: mtk-xs-phy: support type switch by pericfg
Quoted 7 lines · Frank Wunderlich (linux)
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml patternProperties: · line 163
Quoted 2 lines
Documentation/devicetree/bindings/phy/mediatek,xsphy.yaml +2
-0+ - description: + The first cell represents a phandle to sysconDon't repeat constraints in free form text. "Foo bar system controller"
or "Phandle to foo bar system controller"
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
i would write only "phandle to system controller". on mt7988 it is the topmisc syscon, but maybe on
other SoC it is different name.This must be specific to what sort of system controller you point. You are not interested in phandle to any system controller.
how about phy configuration controller/register?
If that's distinctive enough to identify the controller and its register, then sure.
Best regards,
Krzysztof