Message ID | 1447949176-21926-2-git-send-email-stefan.wahren@i2se.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 11/19/2015 09:06 AM, Stefan Wahren wrote: > Currently the pins alt3 (sdhci) are assigned to GPIO pinctrl. > This is bad because a user could export it to sysfs and break > sdhci. In order to avoid that remove those pins from GPIO pintrl. > 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 = <&gpioout &alt0 &i2s_alt0 &alt3>; > + pinctrl-0 = <&gpioout &alt0 &i2s_alt0>; This doesn't make sense. The current DT content is configuring those pins as SDHCI, not as GPIO. Admitedly this is redundant since the firmware and/or bootloader already did this in order to boot the system, but irrespective, the current DT causes no issues. Removing the pinctrl setting should not influence whether the pins can be exported via GPIO sysfs either.
> Stephen Warren <swarren@wwwdotorg.org> hat am 2. Dezember 2015 um 04:40 > geschrieben: > > > On 11/19/2015 09:06 AM, Stefan Wahren wrote: > > Currently the pins alt3 (sdhci) are assigned to GPIO pinctrl. > > This is bad because a user could export it to sysfs and break > > sdhci. In order to avoid that remove those pins from GPIO pintrl. > > > 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 = <&gpioout &alt0 &i2s_alt0 &alt3>; > > + pinctrl-0 = <&gpioout &alt0 &i2s_alt0>; > > This doesn't make sense. The current DT content is configuring those > pins as SDHCI, not as GPIO. Admitedly this is redundant since the > firmware and/or bootloader already did this in order to boot the system, > but irrespective, the current DT causes no issues. Removing the pinctrl > setting should not influence whether the pins can be exported via GPIO > sysfs either. You are right. Is it generally possible to avoid the GPIO sysfs export for SDHCI pins? Is it an issue of pinctrl-bcm2835?
On 12/05/2015 02:12 AM, Stefan Wahren wrote: > >> Stephen Warren <swarren@wwwdotorg.org> hat am 2. Dezember 2015 um 04:40 >> geschrieben: >> >> >> On 11/19/2015 09:06 AM, Stefan Wahren wrote: >>> Currently the pins alt3 (sdhci) are assigned to GPIO pinctrl. >>> This is bad because a user could export it to sysfs and break >>> sdhci. In order to avoid that remove those pins from GPIO pintrl. >> >>> 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 = <&gpioout &alt0 &i2s_alt0 &alt3>; >>> + pinctrl-0 = <&gpioout &alt0 &i2s_alt0>; >> >> This doesn't make sense. The current DT content is configuring those >> pins as SDHCI, not as GPIO. Admitedly this is redundant since the >> firmware and/or bootloader already did this in order to boot the system, >> but irrespective, the current DT causes no issues. Removing the pinctrl >> setting should not influence whether the pins can be exported via GPIO >> sysfs either. > > You are right. > > Is it generally possible to avoid the GPIO sysfs export for SDHCI pins? > Is it an issue of pinctrl-bcm2835? I believe this same issue exists on all platforms where GPIO pins can be mux'd onto the same pins as other functions.
diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts index b2bff43..50be11d 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts @@ -20,7 +20,7 @@ }; &gpio { - pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>; + pinctrl-0 = <&gpioout &alt0 &i2s_alt0>; /* I2S interface */ i2s_alt0: i2s_alt0 { diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts index 668442b..43dd5ef 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts @@ -20,7 +20,7 @@ }; &gpio { - pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>; + pinctrl-0 = <&gpioout &alt0 &i2s_alt0>; /* I2S interface */ i2s_alt0: i2s_alt0 { diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts index eab8b591..e5a65a8 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts @@ -13,7 +13,7 @@ }; &gpio { - pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>; + pinctrl-0 = <&gpioout &alt0 &i2s_alt2>; /* I2S interface */ i2s_alt2: i2s_alt2 { diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts index ff6b2d1..e6cd93b 100644 --- a/arch/arm/boot/dts/bcm2835-rpi-b.dts +++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts @@ -13,5 +13,5 @@ }; &gpio { - pinctrl-0 = <&gpioout &alt0 &alt3>; + pinctrl-0 = <&gpioout &alt0>; };
Currently the pins alt3 (sdhci) are assigned to GPIO pinctrl. This is bad because a user could export it to sysfs and break sdhci. In order to avoid that remove those pins from GPIO pintrl. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> --- arch/arm/boot/dts/bcm2835-rpi-a-plus.dts | 2 +- arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 2 +- arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 2 +- arch/arm/boot/dts/bcm2835-rpi-b.dts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)