Message ID | 351f7993397a496bf7d6d79b9096079a41157919.1697620929.git.ante.knezic@helmholz.de |
---|---|
State | New |
Headers | show |
Series | net: dsa: microchip: enable setting rmii reference | expand |
On Wed, Oct 18, 2023 at 11:24:14AM +0200, Ante Knezic wrote: > Microchip KSZ8863/KSZ8873 have the ability to select between internal > and external RMII reference clock. By default, reference clock > needs to be provided via REFCLKI_3 pin. If required, device can be > setup to provide RMII clock internally so that REFCLKI_3 pin can be > left unconnected. > Add a new "microchip,rmii-clk-internal" property which will set > RMII clock reference to internal. If property is not set, reference > clock needs to be provided externally. > > Signed-off-by: Ante Knezic <ante.knezic@helmholz.de> > --- > drivers/net/dsa/microchip/ksz8795.c | 10 +++++++++- > drivers/net/dsa/microchip/ksz8795_reg.h | 3 +++ > drivers/net/dsa/microchip/ksz_common.h | 1 + > 3 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c > index 91aba470fb2f..b50ad9552c65 100644 > --- a/drivers/net/dsa/microchip/ksz8795.c > +++ b/drivers/net/dsa/microchip/ksz8795.c > @@ -1312,8 +1312,16 @@ void ksz8_port_setup(struct ksz_device *dev, int port, bool cpu_port) > ksz_port_cfg(dev, port, P_PRIO_CTRL, PORT_802_1P_ENABLE, true); > > if (cpu_port) { > - if (!ksz_is_ksz88x3(dev)) > + if (!ksz_is_ksz88x3(dev)) { > ksz8795_cpu_interface_select(dev, port); > + } else { > + dev->rmii_clk_internal = of_property_read_bool(dev->dev->of_node, > + "microchip,rmii-clk-internal"); > + > + ksz_cfg(dev, KSZ88X3_REG_FVID_AND_HOST_MODE, > + KSZ88X3_PORT3_RMII_CLK_INTERNAL, > + dev->rmii_clk_internal); > + } It looks like this is the only use of dev->rmii_clk_internal? So does it actually need to be a member of ksz_device? Andrew
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index 41014f5c01c4..624feb1bb9be 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -72,6 +72,23 @@ properties: interrupts: maxItems: 1 + microchip,rmii-clk-internal: + $ref: /schemas/types.yaml#/definitions/flag + description: + Set if the RMII reference clock is provided internally. Otherwise + reference clock should be provided externally. + +if: + not: + properties: + compatible: + enum: + - microchip,ksz8863 + - microchip,ksz8873 +then: + properties: + microchip,rmii-clk-internal: false + required: - compatible - reg
Add documentation for selecting reference rmii clock on KSZ88X3 devices Signed-off-by: Ante Knezic <ante.knezic@helmholz.de> --- .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)