* [RFC PATCH 0/3] KingFisher: support regulators for PCIe @ 2023-05-08 10:45 Wolfram Sang 2023-05-08 10:45 ` [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators Wolfram Sang 2023-05-08 10:45 ` [RFC PATCH 2/3] PCI: rcar-host: add support for " Wolfram Sang 0 siblings, 2 replies; 10+ messages in thread From: Wolfram Sang @ 2023-05-08 10:45 UTC (permalink / raw) To: linux-renesas-soc Cc: Wolfram Sang, devicetree, linux-kernel, linux-pci, Marek Vasut, Yoshihiro Shimoda Here are the patches to make PCIe cards work in the slot CN15 on a KingFisher board. This is still RFC only, so we can agree on all the DT namings before I send out the patches individually. Looking forward to comments! Wolfram Wolfram Sang (3): dt-bindings: PCI: rcar-pci-host: add optional regulators PCI: rcar-host: add support for optional regulators arm64: dts: renesas: ulcb-kf: add regulators for PCIe ch1 .../bindings/pci/rcar-pci-host.yaml | 8 +++++++ arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 21 +++++++++++++++++++ drivers/pci/controller/pcie-rcar-host.c | 9 ++++++++ 3 files changed, 38 insertions(+) -- 2.30.2 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators 2023-05-08 10:45 [RFC PATCH 0/3] KingFisher: support regulators for PCIe Wolfram Sang @ 2023-05-08 10:45 ` Wolfram Sang 2023-05-08 11:27 ` Rob Herring 2023-05-08 13:40 ` Geert Uytterhoeven 2023-05-08 10:45 ` [RFC PATCH 2/3] PCI: rcar-host: add support for " Wolfram Sang 1 sibling, 2 replies; 10+ messages in thread From: Wolfram Sang @ 2023-05-08 10:45 UTC (permalink / raw) To: linux-renesas-soc Cc: Wolfram Sang, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley, linux-pci, devicetree, linux-kernel Support regulators found on the e.g. KingFisher board. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- Documentation/devicetree/bindings/pci/rcar-pci-host.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml b/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml index 8fdfbc763d70..23e44f78e62e 100644 --- a/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml +++ b/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml @@ -68,6 +68,12 @@ properties: phy-names: const: pcie + vpcie1v5-supply: + description: The 1.5v regulator to use for PCIe. + + vpcie3v3-supply: + description: The 3.3v regulator to use for PCIe. + required: - compatible - reg @@ -121,5 +127,7 @@ examples: clock-names = "pcie", "pcie_bus"; power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; resets = <&cpg 319>; + vpcie1v5-supply = <&pcie_1v5>; + vpcie3v3-supply = <&pcie_3v3>; }; }; -- 2.30.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators 2023-05-08 10:45 ` [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators Wolfram Sang @ 2023-05-08 11:27 ` Rob Herring 2023-05-08 13:40 ` Geert Uytterhoeven 1 sibling, 0 replies; 10+ messages in thread From: Rob Herring @ 2023-05-08 11:27 UTC (permalink / raw) To: Wolfram Sang Cc: Krzysztof Kozlowski, Conor Dooley, Marek Vasut, linux-renesas-soc, Lorenzo Pieralisi, devicetree, linux-kernel, Krzysztof Wilczyński, linux-pci, Yoshihiro Shimoda, Bjorn Helgaas On Mon, 08 May 2023 12:45:55 +0200, Wolfram Sang wrote: > Support regulators found on the e.g. KingFisher board. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> > --- > Documentation/devicetree/bindings/pci/rcar-pci-host.yaml | 8 ++++++++ > 1 file changed, 8 insertions(+) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/rockchip-isp1.example.dtb: camera@3c: port:endpoint:data-lanes: [[1]] is too short From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.example.dtb: camera-sensor@3c: port:endpoint:data-lanes: [[1]] is too short From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/i2c/ovti,ov2685.yaml /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.example.dtb: pcie-ep@33800000: Unevaluated properties are not allowed ('assigned-clock-parents', 'assigned-clock-rates', 'assigned-clocks' were unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie-ep.yaml doc reference errors (make refcheckdocs): Documentation/usb/gadget_uvc.rst: Documentation/userspace-api/media/v4l/pixfmt-packed.yuv.rst MAINTAINERS: Documentation/devicetree/bindings/pwm/pwm-apple.yaml See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230508104557.47889-2-wsa+renesas@sang-engineering.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators 2023-05-08 10:45 ` [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators Wolfram Sang 2023-05-08 11:27 ` Rob Herring @ 2023-05-08 13:40 ` Geert Uytterhoeven 2023-05-08 18:48 ` Wolfram Sang 1 sibling, 1 reply; 10+ messages in thread From: Geert Uytterhoeven @ 2023-05-08 13:40 UTC (permalink / raw) To: Wolfram Sang Cc: linux-renesas-soc, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley, linux-pci, devicetree, linux-kernel Hi Wolfram, On Mon, May 8, 2023 at 12:46 PM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > Support regulators found on the e.g. KingFisher board. ... for the mini-PCIe slot. > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Thanks for your patch! > --- a/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml > +++ b/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml > @@ -68,6 +68,12 @@ properties: > phy-names: > const: pcie > > + vpcie1v5-supply: > + description: The 1.5v regulator to use for PCIe. +1.5V is only present on mini-PCIe slots... > + > + vpcie3v3-supply: > + description: The 3.3v regulator to use for PCIe. ... while +3.3V is present on PCIe, mini-PCIe, and M2 PCIe slots. In addition, normal PCIe slots also have +12V. So I think it would be prudent to add a vpcie12v0-supply property, too. W.r.t. to the actual naming, I don't know if there's already a (de facto) standard for that? > + > required: > - compatible > - reg > @@ -121,5 +127,7 @@ examples: > clock-names = "pcie", "pcie_bus"; > power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; > resets = <&cpg 319>; > + vpcie1v5-supply = <&pcie_1v5>; > + vpcie3v3-supply = <&pcie_3v3>; > }; > }; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators 2023-05-08 13:40 ` Geert Uytterhoeven @ 2023-05-08 18:48 ` Wolfram Sang 2023-05-09 10:35 ` Geert Uytterhoeven 0 siblings, 1 reply; 10+ messages in thread From: Wolfram Sang @ 2023-05-08 18:48 UTC (permalink / raw) To: Geert Uytterhoeven Cc: linux-renesas-soc, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley, linux-pci, devicetree, linux-kernel [-- Attachment #1: Type: text/plain, Size: 892 bytes --] Hi Geert, > > + vpcie1v5-supply: > > + description: The 1.5v regulator to use for PCIe. > > +1.5V is only present on mini-PCIe slots... Since mini-PCIe is a subset of PCIe, I'd think we can leave the description as-is. > > + > > + vpcie3v3-supply: > > + description: The 3.3v regulator to use for PCIe. > > ... while +3.3V is present on PCIe, mini-PCIe, and M2 PCIe slots. > > In addition, normal PCIe slots also have +12V. > So I think it would be prudent to add a vpcie12v0-supply property, too. I agree. I can't test it but it is trivial enough to add 12v support as well. > W.r.t. to the actual naming, I don't know if there's already a (de facto) > standard for that? I couldn't find one and took what I think is the most used pattern. But I wasn't entirely sure, this is why the series is still RFC. Thanks for the review! Wolfram [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators 2023-05-08 18:48 ` Wolfram Sang @ 2023-05-09 10:35 ` Geert Uytterhoeven 2023-05-09 12:30 ` Wolfram Sang 0 siblings, 1 reply; 10+ messages in thread From: Geert Uytterhoeven @ 2023-05-09 10:35 UTC (permalink / raw) To: Wolfram Sang, Geert Uytterhoeven, linux-renesas-soc, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley, linux-pci, devicetree, linux-kernel Hi Wolfram, On Mon, May 8, 2023 at 8:48 PM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > > > + vpcie1v5-supply: > > > + description: The 1.5v regulator to use for PCIe. > > > > +1.5V is only present on mini-PCIe slots... > > Since mini-PCIe is a subset of PCIe, I'd think we can leave the > description as-is. Sure, the description is fine. > > > + > > > + vpcie3v3-supply: > > > + description: The 3.3v regulator to use for PCIe. > > > > ... while +3.3V is present on PCIe, mini-PCIe, and M2 PCIe slots. > > > > In addition, normal PCIe slots also have +12V. > > So I think it would be prudent to add a vpcie12v0-supply property, too. > > I agree. I can't test it but it is trivial enough to add 12v support as > well. > > > W.r.t. to the actual naming, I don't know if there's already a (de facto) > > standard for that? > > I couldn't find one and took what I think is the most used pattern. But > I wasn't entirely sure, this is why the series is still RFC. Upon second thought, shouldn't these supplies be part of a PCIe connector subnode, as they are not properties of the PCIe host controller itself? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators 2023-05-09 10:35 ` Geert Uytterhoeven @ 2023-05-09 12:30 ` Wolfram Sang 0 siblings, 0 replies; 10+ messages in thread From: Wolfram Sang @ 2023-05-09 12:30 UTC (permalink / raw) To: Geert Uytterhoeven Cc: linux-renesas-soc, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley, linux-pci, devicetree, linux-kernel [-- Attachment #1: Type: text/plain, Size: 373 bytes --] > > I couldn't find one and took what I think is the most used pattern. But > > I wasn't entirely sure, this is why the series is still RFC. > > Upon second thought, shouldn't these supplies be part of a PCIe > connector subnode, as they are not properties of the PCIe host > controller itself? Beats me. Current practice is to put it in the host controller. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* [RFC PATCH 2/3] PCI: rcar-host: add support for optional regulators 2023-05-08 10:45 [RFC PATCH 0/3] KingFisher: support regulators for PCIe Wolfram Sang 2023-05-08 10:45 ` [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators Wolfram Sang @ 2023-05-08 10:45 ` Wolfram Sang 2023-05-08 13:45 ` Geert Uytterhoeven 1 sibling, 1 reply; 10+ messages in thread From: Wolfram Sang @ 2023-05-08 10:45 UTC (permalink / raw) To: linux-renesas-soc Cc: Wolfram Sang, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel The KingFisher board has regulators. They just need to be en-/disabled, so we can leave the handling to devm. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> --- drivers/pci/controller/pcie-rcar-host.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index e80e56b2a842..b0e4834176d2 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -29,6 +29,7 @@ #include <linux/phy/phy.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/regulator/consumer.h> #include "pcie-rcar.h" @@ -992,6 +993,14 @@ static int rcar_pcie_probe(struct platform_device *pdev) pcie->dev = dev; platform_set_drvdata(pdev, host); + err = devm_regulator_get_enable_optional(dev, "vpcie3v3"); + if (err < 0 && err != -ENODEV) + dev_err_probe(dev, err, "error enabling 3.3V regulator"); + + err = devm_regulator_get_enable_optional(dev, "vpcie1v5"); + if (err < 0 && err != -ENODEV) + dev_err_probe(dev, err, "error enabling 1.5V regulator"); + pm_runtime_enable(pcie->dev); err = pm_runtime_get_sync(pcie->dev); if (err < 0) { -- 2.30.2 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 2/3] PCI: rcar-host: add support for optional regulators 2023-05-08 10:45 ` [RFC PATCH 2/3] PCI: rcar-host: add support for " Wolfram Sang @ 2023-05-08 13:45 ` Geert Uytterhoeven 2023-05-09 10:20 ` Wolfram Sang 0 siblings, 1 reply; 10+ messages in thread From: Geert Uytterhoeven @ 2023-05-08 13:45 UTC (permalink / raw) To: Wolfram Sang Cc: linux-renesas-soc, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel Hi Wolfram, On Mon, May 8, 2023 at 12:47 PM Wolfram Sang <wsa+renesas@sang-engineering.com> wrote: > > The KingFisher board has regulators. They just need to be en-/disabled, > so we can leave the handling to devm. > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Thanks for your patch! > --- a/drivers/pci/controller/pcie-rcar-host.c > +++ b/drivers/pci/controller/pcie-rcar-host.c > @@ -992,6 +993,14 @@ static int rcar_pcie_probe(struct platform_device *pdev) > pcie->dev = dev; > platform_set_drvdata(pdev, host); > > + err = devm_regulator_get_enable_optional(dev, "vpcie3v3"); > + if (err < 0 && err != -ENODEV) > + dev_err_probe(dev, err, "error enabling 3.3V regulator"); > + > + err = devm_regulator_get_enable_optional(dev, "vpcie1v5"); > + if (err < 0 && err != -ENODEV) > + dev_err_probe(dev, err, "error enabling 1.5V regulator"); As per my comment on patch 1/3, I think you want to grab "vpcie12v0-supply", too. And perhaps factor out the voltage as a parameter in the error message, to increase string sharing? I don't know if PCIe specifies some ordering w.r.t. power supply enablement. > + > pm_runtime_enable(pcie->dev); > err = pm_runtime_get_sync(pcie->dev); > if (err < 0) { Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH 2/3] PCI: rcar-host: add support for optional regulators 2023-05-08 13:45 ` Geert Uytterhoeven @ 2023-05-09 10:20 ` Wolfram Sang 0 siblings, 0 replies; 10+ messages in thread From: Wolfram Sang @ 2023-05-09 10:20 UTC (permalink / raw) To: Geert Uytterhoeven Cc: linux-renesas-soc, Marek Vasut, Yoshihiro Shimoda, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel [-- Attachment #1: Type: text/plain, Size: 397 bytes --] > I don't know if PCIe specifies some ordering w.r.t. power supply > enablement. I found this which is good enough for me: "There is no requirement for supply sequencing in either PCI Express or PCI Express Mini Card; the supplies may come up or go down in any order." [1] Thanks, Linear Technology! [1] https://www.analog.com/media/en/reference-design-documentation/design-notes/dn346f.pdf [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-05-09 12:30 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-05-08 10:45 [RFC PATCH 0/3] KingFisher: support regulators for PCIe Wolfram Sang 2023-05-08 10:45 ` [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators Wolfram Sang 2023-05-08 11:27 ` Rob Herring 2023-05-08 13:40 ` Geert Uytterhoeven 2023-05-08 18:48 ` Wolfram Sang 2023-05-09 10:35 ` Geert Uytterhoeven 2023-05-09 12:30 ` Wolfram Sang 2023-05-08 10:45 ` [RFC PATCH 2/3] PCI: rcar-host: add support for " Wolfram Sang 2023-05-08 13:45 ` Geert Uytterhoeven 2023-05-09 10:20 ` Wolfram Sang
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).