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 90601C00140 for ; Fri, 5 Aug 2022 14:03:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B51884817; Fri, 5 Aug 2022 16:03:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="BGvdyJRq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D6BB847EC; Fri, 5 Aug 2022 16:03:14 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8430C84835 for ; Fri, 5 Aug 2022 16:03:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1AA5BB8293F; Fri, 5 Aug 2022 14:03:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77E57C433D7; Fri, 5 Aug 2022 14:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659708189; bh=2vohE+mgVfJpihyaxnhOD1P4UhjwN/DOlBNDRkbHcaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BGvdyJRq6LMy5ZCUHdUZlSI0GB/biu6hS6DNqsf/r5qY5oKsCbiEQ+kEIM1K9JXqH oMCNTuz2GQy3L6c42tpSiI+zDpCkLJeoksCQaJEpfbcbebq3JnxOgfIV37kVB5vJE6 jMOmGQYJWQ5rKkbRAAtijVwuLp/mz8QSLnLtds/cBsS7Buus+2DZtUOT6aV6kPcyYd syWkgq7HcONI6feldcVMuAqpK++cIBrB1ekBBmOJRQMKOLCjGUJ673Fg7tyEb9dwGr OHRUkAYDN5Vby9xPEy5DkpWqOQNi+R02w6j0uDiS4B2YCr78/n8mjdXseGmkTtuEse sKmqhIqGK0/Pg== Received: by pali.im (Postfix) id 82C6F82D; Fri, 5 Aug 2022 16:03:06 +0200 (CEST) Date: Fri, 5 Aug 2022 16:03:06 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Stefan Roese Cc: u-boot@lists.denx.de Subject: Re: [PATCH] pci: pci_mvebu: Add support for reset-gpios Message-ID: <20220805140306.ul6ribyz6by67ac2@pali> References: <20220728130357.24514-1-pali@kernel.org> <20220805114541.xzkqzulwsgwwrty3@pali> <62a7581d-4a5b-9590-703d-c93040d3ad1a@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <62a7581d-4a5b-9590-703d-c93040d3ad1a@denx.de> User-Agent: NeoMutt/20180716 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.6 at phobos.denx.de X-Virus-Status: Clean On Friday 05 August 2022 13:48:36 Stefan Roese wrote: > On 05.08.22 13:45, Pali Rohár wrote: > > On Friday 05 August 2022 13:01:27 Stefan Roese wrote: > > > On 28.07.22 15:03, Pali Rohár wrote: > > > > Release PERST# signal via GPIO when "reset-gpios" is defined in device tree. > > > > > > > > Signed-off-by: Pali Rohár > > > > --- > > > > drivers/pci/pci_mvebu.c | 14 ++++++++++++++ > > > > 1 file changed, 14 insertions(+) > > > > > > > > diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c > > > > index d80f87e0cfc6..269c027db204 100644 > > > > --- a/drivers/pci/pci_mvebu.c > > > > +++ b/drivers/pci/pci_mvebu.c > > > > @@ -22,6 +22,7 @@ > > > > #include > > > > #include > > > > #include > > > > +#include > > > > #include > > > > #include > > > > #include > > > > @@ -60,6 +61,7 @@ struct mvebu_pcie { > > > > struct resource mem; > > > > void __iomem *iobase; > > > > struct resource io; > > > > + struct gpio_desc reset_gpio; > > > > u32 intregs; > > > > u32 port; > > > > u32 lane; > > > > @@ -416,6 +418,14 @@ static int mvebu_pcie_probe(struct udevice *dev) > > > > struct udevice *ctlr = pci_get_controller(dev); > > > > struct pci_controller *hose = dev_get_uclass_priv(ctlr); > > > > u32 reg; > > > > + int ret; > > > > + > > > > + /* Request for optional PERST# GPIO */ > > > > + ret = gpio_request_by_name(dev, "reset-gpios", 0, &pcie->reset_gpio, GPIOD_IS_OUT); > > > > + if (ret && ret != -ENOENT) { > > > > + printf("%s: unable to request reset-gpios: %d\n", pcie->name, ret); > > > > + return ret; > > > > + } > > > > /* > > > > * Change Class Code of PCI Bridge device to PCI Bridge (0x600400) > > > > @@ -537,6 +547,10 @@ static int mvebu_pcie_probe(struct udevice *dev) > > > > pcie->cfgcache[(PCI_PREF_MEMORY_BASE - 0x10) / 4] = > > > > PCI_PREF_RANGE_TYPE_64 | (PCI_PREF_RANGE_TYPE_64 << 16); > > > > + /* Release PERST# via GPIO when it was defined */ > > > > + if (dm_gpio_is_valid(&pcie->reset_gpio)) > > > > + dm_gpio_set_value(&pcie->reset_gpio, 0); > > > > + > > > > mvebu_pcie_wait_for_link(pcie); > > > > return 0; > > > > > > While running some build tests, this error shows on some Kirkwood > > > boards: > > > > > > $ make pogo_v4_defconfig > > > $ make -s -j20 > > > ===================== WARNING ====================== > > > This board does not use CONFIG_TIMER (Driver Model > > > for Timer drivers). Please update the board to use > > > CONFIG_TIMER before the v2023.01 release. Failure to > > > update by the deadline may result in board removal. > > > See doc/develop/driver-model/migration.rst for more info. > > > ==================================================== > > > ===================== WARNING ====================== > > > This board does not use CONFIG_DM_SERIAL (Driver Model > > > for Serial drivers). Please update the board to use > > > CONFIG_DM_SERIAL before the v2023.04 release. Failure to > > > update by the deadline may result in board removal. > > > See doc/develop/driver-model/migration.rst for more info. > > > ==================================================== > > > /opt/kernel.org/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd: > > > drivers/pci/pci_mvebu.o: in function `mvebu_pcie_probe': > > > /home/stefan/git/u-boot/u-boot-marvell/drivers/pci/pci_mvebu.c:424: > > > undefined reference to `gpio_request_by_name' > > > /opt/kernel.org/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd: > > > /home/stefan/git/u-boot/u-boot-marvell/drivers/pci/pci_mvebu.c:552: > > > undefined reference to `dm_gpio_set_value' > > > make: *** [Makefile:1818: u-boot] Error 1 > > > > > > Could you please take a look and make sure, that world build succeeds? > > > > > > Thanks, > > > Stefan > > > > There is probably missing DM_GPIO. Now I started CI test on github: > > https://github.com/u-boot/u-boot/pull/204 > > After that I will send v2. > > Perfect. Thanks. > > Thanks, > Stefan CI tests passed, now sending v2.