From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37E09C4332F for ; Thu, 8 Dec 2022 19:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hm4JjRNrBZekih820w/00mV862TuKI9SukiFURDWFeU=; b=MKyIEX7iwc9IJK bpnN/7jXFTgDVbDX8+OXu74Uw5OtzEHw7OLlj91jxVEm3cRyUKEquRbVf3y2Zm2tU9NnGARLnC9Fk 8Dl7J2XFWEUr4ZbvLN+F/cptu5ZMqqGTsxWxDXsKkZY7tJV7DXV21rtFL53G3N/4BaqPqrj2XxGhj 9AbPLeIoFS+jrU4g3SaLdPobFrwo8eiWFzwD1EwKbAFD8iIBIErI/PCWUnlMtFW64KUAlL9gTybjx c5Ly8aGZBKUTKtj9DDA2pW4pETcdymmu+zrzIdo/sxiRwaHH1bTlXrS7FYSz7lhNicfzhkPuG1rPm 6v4unMgf+UdplzlXCtqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3MIG-009Ala-6J; Thu, 08 Dec 2022 19:10:52 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3MIC-009ANf-TS for linux-arm-kernel@lists.infradead.org; Thu, 08 Dec 2022 19:10:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=M5qgR9z9/aXhE8FCQ+Y9Qm2E2s4Im7J0TM9pUn+fh4w=; b=vjcmJ050Ll5ZcSccJLh3sQNpBu kujr75KWtMx7xLA1Ruef/jXzEoR3apHSfRRzK+q64Ou3LbibVCXuppmZ/3jQXSy8xF+BbFCBOWPR1 TZM0S8nZ/ZeroPDe0tpa0mUL6XFubqqSMcgem5lwBaslBqtXOqWS2JRhMX9jLsmCk65gswAjM0+d9 E7EqojeUqFhgtFFEH+5Y3cZIFOnd9Yl7RpkHJ3rtKSxNjdV6K4p+8m5hCyADq8BJj86L57Sb3lN4u hoj0f+rxEljSm2ZW54zzQbaATJJoVsioFTbkAPPT3SxB3B0/GbUvBZYku3PysCxIRk+cWaS+5yl6f Vtm4ipzg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:35634) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p3MHu-00028F-6h; Thu, 08 Dec 2022 19:10:31 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1p3MHp-0001v9-Ni; Thu, 08 Dec 2022 19:10:25 +0000 Date: Thu, 8 Dec 2022 19:10:25 +0000 From: "Russell King (Oracle)" To: Robert Jarzmik Cc: Jonathan =?iso-8859-1?Q?Neusch=E4fer?= , Andrew Lunn , linux-arm-kernel@lists.infradead.org, Haojian Zhuang , Daniel Mack , linux-kernel@vger.kernel.org Subject: Re: PXA25x: GPIO driver fails probe due to resource conflict with pinctrl driver Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221208_111048_977526_10B4017F X-CRM114-Status: GOOD ( 22.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 08, 2022 at 07:46:26PM +0100, Robert Jarzmik wrote: > = > Jonathan Neusch=E4fer writes: > = > > Without further code changes this wouldn't be sufficient, because the > > pinctrl driver also touches the GPIO direction registers at offset > > 0x0c-0x14. > = > Historically, this problem was adressed by a "hack" if I remember correct= ly, > as the > registers do overlap (on pxa27x at least, but I think on pxa25x as well) : > - GAFR (alternate functions) and GPDR (input or output) are "pinctrl" > - GPSR, GPCR, GPLR are "gpio" registers > - the memory map (physical) at 0x40e0 0000 is as Jonathan wrote : > - 3 u32 GPLR (gpio) > - 3 u32 GPDR (pinctrl) > - 3 u32 GPSR (gpio) > - 3 u32 GPCR (gpio) > = > The "hack" was that one driver was mapping the area _without_ claiming it > (this > is part from memory, I didn't check in the code today). The gpio was > probably > the claiming one, while the pinctrl was the "only using one". > = > As of today, I should have a look what was changed, but I'm pretty sure in > all > pxa2xx architecture there is an overlap, as for these ancient platforms t= he > pinctrl wasn't yet separated from the gpio IC. > = > The only was out so far I can see from my head would be to declare multip= le > very small IO ranges : > - pinctrl pxa25x : 0x40e0 000c (12 bytes), 0x40e0 0054 (32 bytes) > - pinctrl pxa25x : 0x40e0 000c (12 bytes), 0x40e0 0054 (32 bytes), 0x40e0 > 010c (4 bytes) > - gpio : from 0x40e0 0000 to 0x40e0 0070 included, without the pinctrl o= nes > = > As a general guide, in gpio-pxa.c, you have the table in [1]. Think GPDR = and > GAFR as > pinctrl, and all the other ones as gpio. Ah and yes, the GAFR ones are > missing in this > table. > = > One last think : in a pre device-tree world, when we didn't had yet the p= xa > pinctrl > driver, the gpio driver was directly playing with the GPDR registers, fun > old times. >From a quick look, I think this commit is to blame: 542c25b7a209 drivers: gpio: pxa: use devm_platform_ioremap_resource() Someone "helpfully" making this change: - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - gpio_reg_base =3D devm_ioremap(&pdev->dev, res->start, - resource_size(res)); + + gpio_reg_base =3D devm_platform_ioremap_resource(pdev, 0); which introduces request_mem_region() to the PXA GPIO driver, resulting in this resource clash. -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel