* [PATCH 0/1] pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type @ 2023-04-28 18:28 John Clark 2023-04-28 18:28 ` [PATCH 1/1] " John Clark 0 siblings, 1 reply; 3+ messages in thread From: John Clark @ 2023-04-28 18:28 UTC (permalink / raw) To: Kever Yang, Philipp Tomsich, Simon Glass; +Cc: u-boot, John Clark When trying to nvme boot rk3568 boards (tested with odroid-m1 and nanopi-r5s), it failes with error -19. This is because it is trying to set the voltage of a fixed-regulator to 3.3v. John Clark (1): pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.39.2 (Apple Git-143) ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type 2023-04-28 18:28 [PATCH 0/1] pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type John Clark @ 2023-04-28 18:28 ` John Clark 2023-04-29 9:44 ` Jonas Karlman 0 siblings, 1 reply; 3+ messages in thread From: John Clark @ 2023-04-28 18:28 UTC (permalink / raw) To: Kever Yang, Philipp Tomsich, Simon Glass; +Cc: u-boot, John Clark If the regulator is fixed, the call to regulator_set_value will fail with -ENOSYS as fixed regulators do not support dm_regulator_ops->set_value. see: regulator-uclass.c, regulator_set_value(), ops->set_value This patch ignores -ENOSYS and enables the regulator via regulator_set_enable which should be suitable for all regulator types. Signed-off-by: John Clark <inindev@gmail.com> --- drivers/pci/pcie_dw_rockchip.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c index 9322e735b9..a30fb45222 100644 --- a/drivers/pci/pcie_dw_rockchip.c +++ b/drivers/pci/pcie_dw_rockchip.c @@ -289,6 +289,13 @@ static int rockchip_pcie_init_port(struct udevice *dev) /* Set power and maybe external ref clk input */ if (priv->vpcie3v3) { ret = regulator_set_value(priv->vpcie3v3, 3300000); + if (ret && ret != -ENOSYS) { + dev_err(priv->dw.dev, + "failed to set vpcie3v3 value (ret=%d)\n", ret); + return ret; + } + + ret = regulator_set_enable(priv->vpcie3v3, true); if (ret) { dev_err(priv->dw.dev, "failed to enable vpcie3v3 (ret=%d)\n", ret); -- 2.39.2 (Apple Git-143) ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type 2023-04-28 18:28 ` [PATCH 1/1] " John Clark @ 2023-04-29 9:44 ` Jonas Karlman 0 siblings, 0 replies; 3+ messages in thread From: Jonas Karlman @ 2023-04-29 9:44 UTC (permalink / raw) To: John Clark, Kever Yang, Philipp Tomsich, Simon Glass; +Cc: u-boot Hi John, On 2023-04-28 20:28, John Clark wrote: > If the regulator is fixed, the call to regulator_set_value will fail with > -ENOSYS as fixed regulators do not support dm_regulator_ops->set_value. > see: regulator-uclass.c, regulator_set_value(), ops->set_value > > This patch ignores -ENOSYS and enables the regulator via > regulator_set_enable which should be suitable for all regulator types. Please see patch [1] in my series "rockchip: Fix PCIe and NVMe support on RK3568", that series fixes this and other issues to fully support PCIe and NVMe on RK3568. [1] https://patchwork.ozlabs.org/project/uboot/patch/20230422181943.889436-3-jonas@kwiboo.se/ Regards, Jonas > > Signed-off-by: John Clark <inindev@gmail.com> > > --- > > drivers/pci/pcie_dw_rockchip.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c > index 9322e735b9..a30fb45222 100644 > --- a/drivers/pci/pcie_dw_rockchip.c > +++ b/drivers/pci/pcie_dw_rockchip.c > @@ -289,6 +289,13 @@ static int rockchip_pcie_init_port(struct udevice *dev) > /* Set power and maybe external ref clk input */ > if (priv->vpcie3v3) { > ret = regulator_set_value(priv->vpcie3v3, 3300000); > + if (ret && ret != -ENOSYS) { > + dev_err(priv->dw.dev, > + "failed to set vpcie3v3 value (ret=%d)\n", ret); > + return ret; > + } > + > + ret = regulator_set_enable(priv->vpcie3v3, true); > if (ret) { > dev_err(priv->dw.dev, "failed to enable vpcie3v3 (ret=%d)\n", > ret); ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-29 9:44 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-04-28 18:28 [PATCH 0/1] pci: pcie_dw_rockchip: support fixed vcc3v3 regulator type John Clark 2023-04-28 18:28 ` [PATCH 1/1] " John Clark 2023-04-29 9:44 ` Jonas Karlman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox