[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJM55Z8hb3vBgwOHoHuJpEPFVMNirhcs8AfZWRn4EgxbOGsq2Q@mail.gmail.com>
Date: Sat, 2 Dec 2023 06:44:03 -0800
From: Emil Renner Berthing <emil.renner.berthing@...onical.com>
To: Minda Chen <minda.chen@...rfivetech.com>,
Conor Dooley <conor@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh+dt@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Daire McNamara <daire.mcnamara@...rochip.com>,
Emil Renner Berthing <emil.renner.berthing@...onical.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-pci@...r.kernel.org,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Philipp Zabel <p.zabel@...gutronix.de>,
Mason Huo <mason.huo@...rfivetech.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Kevin Xie <kevin.xie@...rfivetech.com>
Subject: Re: [PATCH v11 19/20] PCI: starfive: Add JH7110 PCIe controller
Minda Chen wrote:
> Add StarFive JH7110 SoC PCIe controller platform driver codes, JH7110
> with PLDA host PCIe core.
>
> Signed-off-by: Minda Chen <minda.chen@...rfivetech.com>
> Co-developed-by: Kevin Xie <kevin.xie@...rfivetech.com>
> Reviewed-by: Mason Huo <mason.huo@...rfivetech.com>
> ---
> MAINTAINERS | 7 +
> drivers/pci/controller/plda/Kconfig | 11 +
> drivers/pci/controller/plda/Makefile | 1 +
> drivers/pci/controller/plda/pcie-plda.h | 71 ++-
> drivers/pci/controller/plda/pcie-starfive.c | 460 ++++++++++++++++++++
> drivers/pci/pci.h | 7 +
> 6 files changed, 556 insertions(+), 1 deletion(-)
> create mode 100644 drivers/pci/controller/plda/pcie-starfive.c
>
...
> +
> +static int starfive_pcie_parse_dt(struct starfive_jh7110_pcie *pcie,
> + struct device *dev)
> +{
> + int domain_nr;
> +
> + pcie->num_clks = devm_clk_bulk_get_all(dev, &pcie->clks);
> + if (pcie->num_clks < 0)
> + return dev_err_probe(dev, -ENODEV,
> + "failed to get pcie clocks\n");
Hi Minda,
>From Damian's mail I noticed that this should propagate the error from
devm_clk_bulk_get_all() properly, so -EPROBE is converted to an -ENODEV error.
Eg.
if (pcie->num_clks < 0)
return dev_err_probe(dev, pcie->num_clks,
"failed to get pcie clocks\n");
> +
> + pcie->resets = devm_reset_control_array_get_exclusive(dev);
> + if (IS_ERR(pcie->resets))
> + return dev_err_probe(dev, PTR_ERR(pcie->resets),
> + "failed to get pcie resets");
> +
> + pcie->reg_syscon =
> + syscon_regmap_lookup_by_phandle(dev->of_node,
> + "starfive,stg-syscon");
> +
> + if (IS_ERR(pcie->reg_syscon))
> + return dev_err_probe(dev, PTR_ERR(pcie->reg_syscon),
> + "failed to parse starfive,stg-syscon\n");
> +
> + pcie->phy = devm_phy_optional_get(dev, NULL);
> + if (IS_ERR(pcie->phy))
> + return dev_err_probe(dev, PTR_ERR(pcie->phy),
> + "failed to get pcie phy\n");
> +
> + domain_nr = of_get_pci_domain_nr(dev->of_node);
> +
> + if (domain_nr < 0 || domain_nr > 1)
> + return dev_err_probe(dev, -ENODEV,
> + "failed to get valid pcie domain\n");
> +
> + if (domain_nr == 0)
> + pcie->stg_pcie_base = STG_SYSCON_PCIE0_BASE;
> + else
> + pcie->stg_pcie_base = STG_SYSCON_PCIE1_BASE;
> +
> + pcie->reset_gpio = devm_gpiod_get_optional(dev, "perst",
> + GPIOD_OUT_HIGH);
> + if (IS_ERR(pcie->reset_gpio))
> + return dev_err_probe(dev, PTR_ERR(pcie->reset_gpio),
> + "failed to get perst-gpio\n");
> +
> + pcie->power_gpio = devm_gpiod_get_optional(dev, "enable",
> + GPIOD_OUT_LOW);
> + if (IS_ERR(pcie->power_gpio))
> + return dev_err_probe(dev, PTR_ERR(pcie->power_gpio),
> + "failed to get power-gpio\n");
> +
> + return 0;
> +}
Powered by blists - more mailing lists