mbox series

[0/4] fix up pin definitions for BPI-R3 board

Message ID 20240627075856.2314804-1-leith@bade.nz (mailing list archive)
Headers show
Series fix up pin definitions for BPI-R3 board | expand

Message

Leith Bade June 27, 2024, 7:58 a.m. UTC
This is my first patch submission to Linux so I apologise in advance for
any mistakes.

These changes were motivated by a pin conflict with the PCIe M.2 connector
and the push buttons. As a result I decided go work through all 100 GPIO
pins using the public board schematics. As I need to acquire a M.2 SSD to
test the PCIe pin change that patch is not included in this series yet.

Working though the pins I noticed a bug with with the MT7531 chip's reset
line which was on the wrong GPIO. Since it was conflicting with the boot
mode switch input GPIO pins I looked into ways to document the use of
those pins with the switch. I ended up choosing a gpio-hog, but please
let me know if there is a better alternative.

I also added some missing pin groups for some of the built-in SoC devices
to clearly document the use of those GPIO pins.

I have actually written up a gpio-line-names list give all the pins        
names to match their usage on this board. If there is interest in this     
I can submit this as an additional patch. I see only some MT8xxx devices   
in the mediatek directory have a gpio-line-names so I wasn't sure if I     
should add it.

Comments

Rob Herring (Arm) June 27, 2024, 2:48 p.m. UTC | #1
On Thu, 27 Jun 2024 17:58:52 +1000, Leith Bade wrote:
> This is my first patch submission to Linux so I apologise in advance for
> any mistakes.
> 
> These changes were motivated by a pin conflict with the PCIe M.2 connector
> and the push buttons. As a result I decided go work through all 100 GPIO
> pins using the public board schematics. As I need to acquire a M.2 SSD to
> test the PCIe pin change that patch is not included in this series yet.
> 
> Working though the pins I noticed a bug with with the MT7531 chip's reset
> line which was on the wrong GPIO. Since it was conflicting with the boot
> mode switch input GPIO pins I looked into ways to document the use of
> those pins with the switch. I ended up choosing a gpio-hog, but please
> let me know if there is a better alternative.
> 
> I also added some missing pin groups for some of the built-in SoC devices
> to clearly document the use of those GPIO pins.
> 
> I have actually written up a gpio-line-names list give all the pins
> names to match their usage on this board. If there is interest in this
> I can submit this as an additional patch. I see only some MT8xxx devices
> in the mediatek directory have a gpio-line-names so I wasn't sure if I
> should add it.
> 
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y mediatek/mt7986a-bananapi-bpi-r3.dtb' for 20240627075856.2314804-1-leith@bade.nz:

arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pinctrl@1001f000: 'boot-mode-hog' does not match any of the regexes: '-pins$', 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/pinctrl/mediatek,mt7986-pinctrl.yaml#
Leith Bade June 29, 2024, 11:06 p.m. UTC | #2
On Fri, 28 Jun 2024 at 00:48, Rob Herring (Arm) <robh@kernel.org> wrote:
> New warnings running 'make CHECK_DTBS=y mediatek/mt7986a-bananapi-bpi-r3.dtb' for 20240627075856.2314804-1-leith@bade.nz:
>
> arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pinctrl@1001f000: 'boot-mode-hog' does not match any of the regexes: '-pins$', 'pinctrl-[0-9]+'
>         from schema $id: http://devicetree.org/schemas/pinctrl/mediatek,mt7986-pinctrl.yaml#

I saw this warning as well when I ran the DT schema check.

However I think this is a false warning as the gpio-hog schema
requires "*-hog" in the name, but the MT7986 pinctrl schema doesn't
allow for this.

Looking at other examples of gpio-hog I can see in
arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi some hogs that are
very similar to my new one with "*-hog" in the name under a node with
"gpio-controller". Another example is
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts which has a
hog ("asm_sel") under "pio" which is the same location as my new hog,
but this one seems to violate the requirement for "hog" to be in the
name.