From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
linux-arm-kernel@lists.infradead.org,
"Robert Jarzmik" <robert.jarzmik@free.fr>,
"Haojian Zhuang" <haojian.zhuang@gmail.com>,
"Daniel Mack" <daniel@zonque.org>,
linux-kernel@vger.kernel.org
Subject: Re: PXA25x: GPIO driver fails probe due to resource conflict with pinctrl driver
Date: Wed, 7 Dec 2022 17:40:29 +0100 [thread overview]
Message-ID: <Y5DB/aUpFrS68DMd@probook> (raw)
In-Reply-To: <Y5CxBzy47Gjn/V5a@lunn.ch>
[-- Attachment #1.1: Type: text/plain, Size: 2230 bytes --]
On Wed, Dec 07, 2022 at 04:28:07PM +0100, Andrew Lunn wrote:
> On Wed, Dec 07, 2022 at 12:25:53PM +0100, Jonathan Neuschäfer wrote:
> > Hello,
> >
> > I am currently trying to bring up Linux 6.1-rcX on a PXA255 board, using a
> > devicetree. One problem I encountered is that the PXA GPIO driver fails to
> > probe because it uses the same MMIO register range as the pinctrl driver:
> >
> > [ 0.666169] pxa25x-pinctrl 40e00054.pinctrl: initialized pxa2xx pinctrl driver
> > [ 0.694407] pxa-gpio 40e00000.gpio: can't request region for resource [mem 0x40e00000-0x40e0ffff]
> > [ 0.695050] pxa-gpio: probe of 40e00000.gpio failed with error -16
> >
> > Before I try to fix this myself: Is GPIO on PXA25x currently expected to
> > work and when has it last been seen working?
> >
> > What would be a good way to fix this?
>
> How are the registers arranged? Is 0x40e00000-0x40e0ffff simply too
> large, and making it smaller would fix the issue? Or are the registers
> interleaved? It is possible to request a region in a non-exclusive
> manor. Or is it more than interleaving, individual registers need to
> be shared between the two drivers? If so, you have the locking issues
> you mentioned.
>
> Andrew
(I wrote this before I saw the other reply, so there are probably
duplicate information)
They overlap. pxa25x.dtsi declares:
pinctrl: pinctrl@40e00000 {
reg = <0x40e00054 0x20>, // base_af[0]
<0x40e0000c 0xc>, // base_dir[0]
<0x40e0010c 4>, // base_dir[3]
<0x40f00020 0x10>; // base_sleep[0]
compatible = "marvell,pxa25x-pinctrl";
};
(comments mine, based on pinctrl-pxxa25x.c)
The GPIO driver mentions these registers (for PXA25x):
GPLR GPDR GPSR GPCR GRER GFER GEDR
BANK 0 - 0x0000 0x000C 0x0018 0x0024 0x0030 0x003C 0x0048
BANK 1 - 0x0004 0x0010 0x001C 0x0028 0x0034 0x0040 0x004C
BANK 2 - 0x0008 0x0014 0x0020 0x002C 0x0038 0x0044 0x0050
So, there are overlaps in GPDR (0x0c-0x14, GPIO pin direction register).
The register at 0x10c seems bogus for PXA25x: gpio-pxa.c mentions it as
part of bank 3, which only exists in PXA27x or later.
Jonathan
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
linux-arm-kernel@lists.infradead.org,
"Robert Jarzmik" <robert.jarzmik@free.fr>,
"Haojian Zhuang" <haojian.zhuang@gmail.com>,
"Daniel Mack" <daniel@zonque.org>,
linux-kernel@vger.kernel.org
Subject: Re: PXA25x: GPIO driver fails probe due to resource conflict with pinctrl driver
Date: Wed, 7 Dec 2022 17:40:29 +0100 [thread overview]
Message-ID: <Y5DB/aUpFrS68DMd@probook> (raw)
In-Reply-To: <Y5CxBzy47Gjn/V5a@lunn.ch>
[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]
On Wed, Dec 07, 2022 at 04:28:07PM +0100, Andrew Lunn wrote:
> On Wed, Dec 07, 2022 at 12:25:53PM +0100, Jonathan Neuschäfer wrote:
> > Hello,
> >
> > I am currently trying to bring up Linux 6.1-rcX on a PXA255 board, using a
> > devicetree. One problem I encountered is that the PXA GPIO driver fails to
> > probe because it uses the same MMIO register range as the pinctrl driver:
> >
> > [ 0.666169] pxa25x-pinctrl 40e00054.pinctrl: initialized pxa2xx pinctrl driver
> > [ 0.694407] pxa-gpio 40e00000.gpio: can't request region for resource [mem 0x40e00000-0x40e0ffff]
> > [ 0.695050] pxa-gpio: probe of 40e00000.gpio failed with error -16
> >
> > Before I try to fix this myself: Is GPIO on PXA25x currently expected to
> > work and when has it last been seen working?
> >
> > What would be a good way to fix this?
>
> How are the registers arranged? Is 0x40e00000-0x40e0ffff simply too
> large, and making it smaller would fix the issue? Or are the registers
> interleaved? It is possible to request a region in a non-exclusive
> manor. Or is it more than interleaving, individual registers need to
> be shared between the two drivers? If so, you have the locking issues
> you mentioned.
>
> Andrew
(I wrote this before I saw the other reply, so there are probably
duplicate information)
They overlap. pxa25x.dtsi declares:
pinctrl: pinctrl@40e00000 {
reg = <0x40e00054 0x20>, // base_af[0]
<0x40e0000c 0xc>, // base_dir[0]
<0x40e0010c 4>, // base_dir[3]
<0x40f00020 0x10>; // base_sleep[0]
compatible = "marvell,pxa25x-pinctrl";
};
(comments mine, based on pinctrl-pxxa25x.c)
The GPIO driver mentions these registers (for PXA25x):
GPLR GPDR GPSR GPCR GRER GFER GEDR
BANK 0 - 0x0000 0x000C 0x0018 0x0024 0x0030 0x003C 0x0048
BANK 1 - 0x0004 0x0010 0x001C 0x0028 0x0034 0x0040 0x004C
BANK 2 - 0x0008 0x0014 0x0020 0x002C 0x0038 0x0044 0x0050
So, there are overlaps in GPDR (0x0c-0x14, GPIO pin direction register).
The register at 0x10c seems bogus for PXA25x: gpio-pxa.c mentions it as
part of bank 3, which only exists in PXA27x or later.
Jonathan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-12-07 16:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 11:25 PXA25x: GPIO driver fails probe due to resource conflict with pinctrl driver Jonathan Neuschäfer
2022-12-07 11:25 ` Jonathan Neuschäfer
2022-12-07 15:28 ` Andrew Lunn
2022-12-07 15:28 ` Andrew Lunn
2022-12-07 15:41 ` Russell King (Oracle)
2022-12-07 15:41 ` Russell King (Oracle)
2022-12-07 16:44 ` Jonathan Neuschäfer
2022-12-07 16:44 ` Jonathan Neuschäfer
2022-12-07 18:27 ` Russell King (Oracle)
2022-12-07 18:27 ` Russell King (Oracle)
2022-12-08 18:36 ` Jonathan Neuschäfer
2022-12-08 18:36 ` Jonathan Neuschäfer
2022-12-08 18:46 ` Robert Jarzmik
2022-12-08 18:46 ` Robert Jarzmik
2022-12-08 19:10 ` Russell King (Oracle)
2022-12-08 19:10 ` Russell King (Oracle)
2022-12-08 20:19 ` Robert Jarzmik
2022-12-08 20:19 ` Robert Jarzmik
2022-12-08 21:53 ` Jonathan Neuschäfer
2022-12-08 21:53 ` Jonathan Neuschäfer
2022-12-08 22:29 ` Russell King (Oracle)
2022-12-08 22:29 ` Russell King (Oracle)
2022-12-09 8:55 ` Robert Jarzmik
2022-12-09 8:55 ` Robert Jarzmik
2022-12-07 16:40 ` Jonathan Neuschäfer [this message]
2022-12-07 16:40 ` Jonathan Neuschäfer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y5DB/aUpFrS68DMd@probook \
--to=j.neuschaefer@gmx.net \
--cc=andrew@lunn.ch \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.