All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: bcm2837-rpi-3-b: fix pwm1 pin
@ 2017-12-31 15:12 Baruch Siach
  2017-12-31 16:14 ` Stefan Wahren
  0 siblings, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2017-12-31 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

Raspberry Pi 3 uses GPIO45 for I2C SCL0. pwm1 is on GPIO41. Update the
DT description accordingly. Fix the following error that shows when
GPIO44 and GPIO45 are configured to I2C:

[    1.751563] pinctrl-bcm2835 3f200000.gpio: pin gpio45 already requested by 3f205000.i2c; cannot claim for 3f20c000.pwm
[    1.762474] pinctrl-bcm2835 3f200000.gpio: pin-45 (3f20c000.pwm) status -22
[    1.775176] pinctrl-bcm2835 3f200000.gpio: could not request pin 45 (gpio45) from group gpio45  on device pinctrl-bcm2835
[    1.786344] bcm2835-pwm 3f20c000.pwm: Error applying setting, reverse things back
[    1.793980] bcm2835-pwm: probe of 3f20c000.pwm failed with error -22

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
index a8844d033b3f..b44b3b5af00d 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
@@ -60,3 +60,9 @@
 	status = "okay";
 	bus-width = <4>;
 };
+
+&pwm {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
+	status = "okay";
+};
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: dts: bcm2837-rpi-3-b: fix pwm1 pin
  2017-12-31 15:12 [PATCH] ARM: dts: bcm2837-rpi-3-b: fix pwm1 pin Baruch Siach
@ 2017-12-31 16:14 ` Stefan Wahren
  2018-02-09 17:01   ` Stefan Wahren
  2018-02-09 21:28   ` Eric Anholt
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Wahren @ 2017-12-31 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Baruch,

> Baruch Siach <baruch@tkos.co.il> hat am 31. Dezember 2017 um 16:12 geschrieben:
> 
> 
> Raspberry Pi 3 uses GPIO45 for I2C SCL0. pwm1 is on GPIO41. Update the
> DT description accordingly. Fix the following error that shows when
> GPIO44 and GPIO45 are configured to I2C:
> 
> [    1.751563] pinctrl-bcm2835 3f200000.gpio: pin gpio45 already requested by 3f205000.i2c; cannot claim for 3f20c000.pwm
> [    1.762474] pinctrl-bcm2835 3f200000.gpio: pin-45 (3f20c000.pwm) status -22
> [    1.775176] pinctrl-bcm2835 3f200000.gpio: could not request pin 45 (gpio45) from group gpio45  on device pinctrl-bcm2835
> [    1.786344] bcm2835-pwm 3f20c000.pwm: Error applying setting, reverse things back
> [    1.793980] bcm2835-pwm: probe of 3f20c000.pwm failed with error -22
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> index a8844d033b3f..b44b3b5af00d 100644
> --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> @@ -60,3 +60,9 @@
>  	status = "okay";
>  	bus-width = <4>;
>  };
> +
> +&pwm {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
> +	status = "okay";
> +};

thanks for addressing this old issue. Unfortunately this is only a part of the solution. The real problem is the definition of pinctrl in a very common dtsi file (bcm2835-rpi.dtsi). Based on the Firmware dt-blob i created a pin usage map [1], which also shows a potential conflict on RPI Zero W.

So i think we should remove the pwm part from bcm2835-rpi.dtsi and define it on board level like in your patch, but also for the other boards. My suggestion would be the following (based on Firmware):

A Plus -> PWM on pin 40,45
A -> PWM on pin 40,45
B Plus -> PWM on pin 40,45
B Rev 2 -> PWM on pin 40,45
B -> PWM on pin 40,45
2 b -> PWM on pin 40,45
3 b -> PWM on pin 40,41
Zero -> No PWM
Zero W -> No PWM

But i think we should wait for Eric's opinion.

Regards
Stefan

[1] - https://github.com/raspberrypi/firmware/wiki/Pin-usage-reference

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: dts: bcm2837-rpi-3-b: fix pwm1 pin
  2017-12-31 16:14 ` Stefan Wahren
@ 2018-02-09 17:01   ` Stefan Wahren
  2018-02-09 21:28   ` Eric Anholt
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Wahren @ 2018-02-09 17:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eric,

> Stefan Wahren <stefan.wahren@i2se.com> hat am 31. Dezember 2017 um 17:14 geschrieben:
> 
> 
> Hi Baruch,
> 
> > Baruch Siach <baruch@tkos.co.il> hat am 31. Dezember 2017 um 16:12 geschrieben:
> > 
> > 
> > Raspberry Pi 3 uses GPIO45 for I2C SCL0. pwm1 is on GPIO41. Update the
> > DT description accordingly. Fix the following error that shows when
> > GPIO44 and GPIO45 are configured to I2C:
> > 
> > [    1.751563] pinctrl-bcm2835 3f200000.gpio: pin gpio45 already requested by 3f205000.i2c; cannot claim for 3f20c000.pwm
> > [    1.762474] pinctrl-bcm2835 3f200000.gpio: pin-45 (3f20c000.pwm) status -22
> > [    1.775176] pinctrl-bcm2835 3f200000.gpio: could not request pin 45 (gpio45) from group gpio45  on device pinctrl-bcm2835
> > [    1.786344] bcm2835-pwm 3f20c000.pwm: Error applying setting, reverse things back
> > [    1.793980] bcm2835-pwm: probe of 3f20c000.pwm failed with error -22
> > 
> > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> > ---
> >  arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> > index a8844d033b3f..b44b3b5af00d 100644
> > --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> > +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
> > @@ -60,3 +60,9 @@
> >  	status = "okay";
> >  	bus-width = <4>;
> >  };
> > +
> > +&pwm {
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
> > +	status = "okay";
> > +};
> 
> thanks for addressing this old issue. Unfortunately this is only a part of the solution. The real problem is the definition of pinctrl in a very common dtsi file (bcm2835-rpi.dtsi). Based on the Firmware dt-blob i created a pin usage map [1], which also shows a potential conflict on RPI Zero W.
> 
> So i think we should remove the pwm part from bcm2835-rpi.dtsi and define it on board level like in your patch, but also for the other boards. My suggestion would be the following (based on Firmware):
> 
> A Plus -> PWM on pin 40,45
> A -> PWM on pin 40,45
> B Plus -> PWM on pin 40,45
> B Rev 2 -> PWM on pin 40,45
> B -> PWM on pin 40,45
> 2 b -> PWM on pin 40,45
> 3 b -> PWM on pin 40,41
> Zero -> No PWM
> Zero W -> No PWM
> 
> But i think we should wait for Eric's opinion.

ping ...

> 
> Regards
> Stefan
> 
> [1] - https://github.com/raspberrypi/firmware/wiki/Pin-usage-reference

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: dts: bcm2837-rpi-3-b: fix pwm1 pin
  2017-12-31 16:14 ` Stefan Wahren
  2018-02-09 17:01   ` Stefan Wahren
@ 2018-02-09 21:28   ` Eric Anholt
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Anholt @ 2018-02-09 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

Stefan Wahren <stefan.wahren@i2se.com> writes:

> Hi Baruch,
>
>> Baruch Siach <baruch@tkos.co.il> hat am 31. Dezember 2017 um 16:12 geschrieben:
>> 
>> 
>> Raspberry Pi 3 uses GPIO45 for I2C SCL0. pwm1 is on GPIO41. Update the
>> DT description accordingly. Fix the following error that shows when
>> GPIO44 and GPIO45 are configured to I2C:
>> 
>> [    1.751563] pinctrl-bcm2835 3f200000.gpio: pin gpio45 already requested by 3f205000.i2c; cannot claim for 3f20c000.pwm
>> [    1.762474] pinctrl-bcm2835 3f200000.gpio: pin-45 (3f20c000.pwm) status -22
>> [    1.775176] pinctrl-bcm2835 3f200000.gpio: could not request pin 45 (gpio45) from group gpio45  on device pinctrl-bcm2835
>> [    1.786344] bcm2835-pwm 3f20c000.pwm: Error applying setting, reverse things back
>> [    1.793980] bcm2835-pwm: probe of 3f20c000.pwm failed with error -22
>> 
>> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
>> ---
>>  arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 6 ++++++
>>  1 file changed, 6 insertions(+)
>> 
>> diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
>> index a8844d033b3f..b44b3b5af00d 100644
>> --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
>> +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
   >> @@ -60,3 +60,9 @@
>>  	status = "okay";
>>  	bus-width = <4>;
>>  };
>> +
>> +&pwm {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio41>;
>> +	status = "okay";
>> +};
>
> thanks for addressing this old issue. Unfortunately this is only a part of the solution. The real problem is the definition of pinctrl in a very common dtsi file (bcm2835-rpi.dtsi). Based on the Firmware dt-blob i created a pin usage map [1], which also shows a potential conflict on RPI Zero W.
>
> So i think we should remove the pwm part from bcm2835-rpi.dtsi and define it on board level like in your patch, but also for the other boards. My suggestion would be the following (based on Firmware):
>
> A Plus -> PWM on pin 40,45
> A -> PWM on pin 40,45
> B Plus -> PWM on pin 40,45
> B Rev 2 -> PWM on pin 40,45
> B -> PWM on pin 40,45
> 2 b -> PWM on pin 40,45
> 3 b -> PWM on pin 40,41
> Zero -> No PWM
> Zero W -> No PWM
>
> But i think we should wait for Eric's opinion.

This seems like a reasonable plan for resolving the boot error. The
alternative I can see would be to drop our pwm pinmux setup, in the
absence of any consumer of pwm trying to use it for some specific
purpose.

(Some day it would be nice to have an analog audio driver using pwm on
these pins, but I'm not volunteering to write that code either)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180209/b5189393/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-09 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-31 15:12 [PATCH] ARM: dts: bcm2837-rpi-3-b: fix pwm1 pin Baruch Siach
2017-12-31 16:14 ` Stefan Wahren
2018-02-09 17:01   ` Stefan Wahren
2018-02-09 21:28   ` Eric Anholt

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.