All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Eric Anholt <eric@anholt.net>
Cc: linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Lee Jones <lee@kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	devicetree@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org,
	Stefan Wahren <stefan.wahren@i2se.com>
Subject: Re: [PATCH 2/5] ARM: bcm2835: Replace alt0/i2s_alt[02] with standard groups.
Date: Thu, 3 Mar 2016 14:26:12 -0700	[thread overview]
Message-ID: <56D8ABF4.6060801@wwwdotorg.org> (raw)
In-Reply-To: <1456510756-15337-3-git-send-email-eric@anholt.net>

On 02/26/2016 11:19 AM, Eric Anholt wrote:
> Since all of these pins were documented, we can use their names to
> explain what's going on.

> diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts

>   &gpio {
> +	pinctrl-0 = <&i2c0_gpio0
> +		     &i2c1_gpio2
> +		     &gpclk0_gpio4
> +		     &gpclk1_gpio5
> +		     &spi0_gpio7
> +		     &pcm_gpio18
> +		     &pwm0_gpio40
> +		     &pwm1_gpio45
> +		     &gpioout
> +		     &alt3>;
>   };

Why not convert alt3 to the new scheme too?

I think this configures too many pins, which in turn makes assumptions 
about what those pins are used for that may not be valid.

Recent RPi firmware configures almost all expansion connector GPIOs as 
GPIO-in. This ensures that no matter what is connected to the expansion 
connector, there can be no signal conflicts due to both the bcm283x and 
some external device both attempting to drive the same pin. I believe 
the default Linux pinmux should adopt the same approach, by simply not 
configuring any expansion connector pins except those known to have a 
100% hard-coded usage. For example, the HAT I2C pins must only be used 
for that purpose on the RPi, so even if the HW supported using them as 
arbitrary GPIO or PWM or ..., we know they're actually I2C.

So, I think this list should only include configuration for pins 
connected to on-board devices, or expansion pins that have a 100% known 
purpose.

(I can't quite remember how many pins are being configured in the 
upstream kernel's DT files at present; it's possible the complying with 
this rule may involve removing some pinctrl settings that are currently 
present to avoid conflicts. User-specific additions should come from DT 
overlays or manual DT edits.)

WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: bcm2835: Replace alt0/i2s_alt[02] with standard groups.
Date: Thu, 3 Mar 2016 14:26:12 -0700	[thread overview]
Message-ID: <56D8ABF4.6060801@wwwdotorg.org> (raw)
In-Reply-To: <1456510756-15337-3-git-send-email-eric@anholt.net>

On 02/26/2016 11:19 AM, Eric Anholt wrote:
> Since all of these pins were documented, we can use their names to
> explain what's going on.

> diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts

>   &gpio {
> +	pinctrl-0 = <&i2c0_gpio0
> +		     &i2c1_gpio2
> +		     &gpclk0_gpio4
> +		     &gpclk1_gpio5
> +		     &spi0_gpio7
> +		     &pcm_gpio18
> +		     &pwm0_gpio40
> +		     &pwm1_gpio45
> +		     &gpioout
> +		     &alt3>;
>   };

Why not convert alt3 to the new scheme too?

I think this configures too many pins, which in turn makes assumptions 
about what those pins are used for that may not be valid.

Recent RPi firmware configures almost all expansion connector GPIOs as 
GPIO-in. This ensures that no matter what is connected to the expansion 
connector, there can be no signal conflicts due to both the bcm283x and 
some external device both attempting to drive the same pin. I believe 
the default Linux pinmux should adopt the same approach, by simply not 
configuring any expansion connector pins except those known to have a 
100% hard-coded usage. For example, the HAT I2C pins must only be used 
for that purpose on the RPi, so even if the HW supported using them as 
arbitrary GPIO or PWM or ..., we know they're actually I2C.

So, I think this list should only include configuration for pins 
connected to on-board devices, or expansion pins that have a 100% known 
purpose.

(I can't quite remember how many pins are being configured in the 
upstream kernel's DT files at present; it's possible the complying with 
this rule may involve removing some pinctrl settings that are currently 
present to avoid conflicts. User-specific additions should come from DT 
overlays or manual DT edits.)

  reply	other threads:[~2016-03-03 21:26 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 18:19 [PATCH 0/5] BCM2835 pinctrl DT rework (resend) Eric Anholt
2016-02-26 18:19 ` Eric Anholt
2016-02-26 18:19 ` [PATCH 1/5] ARM: bcm2835: Define standard pinctrl groups in the gpio node Eric Anholt
2016-03-03 21:20   ` Stephen Warren
2016-03-03 21:20     ` Stephen Warren
     [not found]     ` <56D8AAA2.60907-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-03-03 22:23       ` Eric Anholt
2016-03-03 22:23         ` Eric Anholt
2016-03-03 22:23         ` Eric Anholt
2016-03-03 22:32         ` Stephen Warren
2016-03-03 22:32           ` Stephen Warren
2016-03-04  9:27     ` Martin Sperl
2016-03-04  9:27       ` Martin Sperl
2016-03-04  9:27       ` Martin Sperl
2016-02-26 18:19 ` [PATCH 2/5] ARM: bcm2835: Replace alt0/i2s_alt[02] with standard groups Eric Anholt
2016-03-03 21:26   ` Stephen Warren [this message]
2016-03-03 21:26     ` Stephen Warren
2016-03-03 22:28     ` Eric Anholt
2016-03-03 22:28       ` Eric Anholt
2016-03-03 22:28       ` Eric Anholt
2016-03-03 22:34       ` Stephen Warren
2016-03-03 22:34         ` Stephen Warren
2016-03-08  8:24   ` Linus Walleij
2016-03-08  8:24     ` Linus Walleij
2016-03-08  8:24     ` Linus Walleij
2016-03-08 16:42     ` Stephen Warren
2016-03-08 16:42       ` Stephen Warren
2016-03-08 16:42       ` Stephen Warren
2016-02-26 18:19 ` [PATCH 3/5] ARM: bcm2835: Move the emmc pin group to bcm283x.dtsi Eric Anholt
2016-02-26 18:19 ` [PATCH 4/5] ARM: bcm2835: Add a group for mapping pins 48-53 to sdhost Eric Anholt
2016-02-26 18:19 ` [PATCH 5/5] ARM: bcm2835: Move most RPi default pin groups to their devices Eric Anholt
2016-03-08  8:25   ` Linus Walleij
2016-03-08  8:25     ` Linus Walleij
2016-03-08  8:25     ` Linus Walleij
     [not found] <1456266111-2508-1-git-send-email-eric@anholt.net>
2016-02-23 22:21 ` [PATCH 2/5] ARM: bcm2835: Replace alt0/i2s_alt[02] with standard groups Eric Anholt
2016-02-23 22:21   ` Eric Anholt
2016-02-24 17:11   ` Stephen Warren
2016-02-24 17:11     ` Stephen Warren

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=56D8ABF4.6060801@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=stefan.wahren@i2se.com \
    /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.