Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 222B1CCF9E3 for ; Fri, 24 Oct 2025 13:09:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F60283677; Fri, 24 Oct 2025 15:09:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=freeshell.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 0C17F83678; Fri, 24 Oct 2025 15:09:47 +0200 (CEST) Received: from freeshell.de (freeshell.de [116.202.128.144]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1FD2183623 for ; Fri, 24 Oct 2025 15:09:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=freeshell.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=e@freeshell.de Received: from [192.168.2.54] (unknown [98.97.26.255]) (Authenticated sender: e) by freeshell.de (Postfix) with ESMTPSA id 0C173B22070B; Fri, 24 Oct 2025 15:09:42 +0200 (CEST) Message-ID: <17e37755-6a5b-4950-af34-281e4930969b@freeshell.de> Date: Fri, 24 Oct 2025 06:09:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 6/9] pcie: starfive: Add a optional power gpio support To: Hal Feng , Leo , Tom Rini , Rick Chen , Sumit Garg , Emil Renner Berthing , Heinrich Schuchardt Cc: u-boot@lists.denx.de References: <20251024085932.83596-1-hal.feng@starfivetech.com> <20251024085932.83596-7-hal.feng@starfivetech.com> Content-Language: en-US From: E Shattow In-Reply-To: <20251024085932.83596-7-hal.feng@starfivetech.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 10/24/25 01:59, Hal Feng wrote: > Get and enable a optional power gpio. This feature is ported > from the jh7110 pcie driver in Linux. VisionFive 2 Lite needs > this gpio to enable the PCI bus device (M.2 M-Key) power. > That's alright. Good. > Signed-off-by: Hal Feng > --- > drivers/pci/pcie_starfive_jh7110.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/pci/pcie_starfive_jh7110.c b/drivers/pci/pcie_starfive_jh7110.c > index 0908ae16b67..04088b48ddc 100644 > --- a/drivers/pci/pcie_starfive_jh7110.c > +++ b/drivers/pci/pcie_starfive_jh7110.c > @@ -45,6 +45,7 @@ struct starfive_pcie { > struct pcie_plda plda; > struct clk_bulk clks; > struct reset_ctl_bulk rsts; > + struct gpio_desc power_gpio; > struct gpio_desc reset_gpio; > struct regmap *regmap; > unsigned int stg_pcie_base; > @@ -184,6 +185,10 @@ static int starfive_pcie_parse_dt(struct udevice *dev) > dev_err(dev, "reset-gpio is not valid\n"); > return -EINVAL; > } > + > + gpio_request_by_name(dev, "enable-gpios", 0, &priv->power_gpio, > + GPIOD_IS_OUT); > + Are we missing some error handling here? I don't know, everything else above in the function is verbose with the dev_err() reporting. > return 0; > } > > @@ -205,6 +210,9 @@ static int starfive_pcie_init_port(struct udevice *dev) > goto err_deassert_clk; > } > > + if (dm_gpio_is_valid(&priv->power_gpio)) > + dm_gpio_set_value(&priv->power_gpio, 1); > + > dm_gpio_set_value(&priv->reset_gpio, 1); > /* Disable physical functions except #0 */ > for (i = 1; i < PLDA_FUNC_NUM; i++) { With that, Reviewed-by: E Shattow