linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: rockchip: Set the proper PWM for rk3288
@ 2019-04-09 20:49 Douglas Anderson
  2019-04-11 11:42 ` Heiko Stuebner
  0 siblings, 1 reply; 2+ messages in thread
From: Douglas Anderson @ 2019-04-09 20:49 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Douglas Anderson, linux-kernel, linux-rockchip, mka, ryandcase,
	Caesar Wang, linux-arm-kernel

The rk3288 SoC has two PWM implementations available, the "old"
implementation and the "new" one.  You can switch between the two of
them by flipping a bit in the grf.

The "old" implementation is the default at chip power up but isn't the
one that's officially supposed to be used.  ...and, in fact, the
driver that gets selected in Linux using the rk3288 device tree only
supports the "new" implementation.

Long ago I tried to get a switch to the right IP block landed in the
PWM driver (search for "rk3288: Switch to use the proper PWM IP") but
that got rejected.  In the mean time the grf has grown a full-fledged
driver that already sets other random bits like this.  That means we
can now get the fix landed.

For those wondering how things could have possibly worked for the last
4.5 years, folks have mostly been relying on the bootloader to set
this bit.  ...but occasionally folks have pointed back to my old patch
series [1] in downstream kernels.

[1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1391597.html

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/soc/rockchip/grf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
index 96882ffde67e..3b81e1d75a97 100644
--- a/drivers/soc/rockchip/grf.c
+++ b/drivers/soc/rockchip/grf.c
@@ -66,9 +66,11 @@ static const struct rockchip_grf_info rk3228_grf __initconst = {
 };
 
 #define RK3288_GRF_SOC_CON0		0x244
+#define RK3288_GRF_SOC_CON2		0x24c
 
 static const struct rockchip_grf_value rk3288_defaults[] __initconst = {
 	{ "jtag switching", RK3288_GRF_SOC_CON0, HIWORD_UPDATE(0, 1, 12) },
+	{ "pwm select", RK3288_GRF_SOC_CON2, HIWORD_UPDATE(1, 1, 0) },
 };
 
 static const struct rockchip_grf_info rk3288_grf __initconst = {
-- 
2.21.0.392.gf8f6787159e-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] soc: rockchip: Set the proper PWM for rk3288
  2019-04-09 20:49 [PATCH] soc: rockchip: Set the proper PWM for rk3288 Douglas Anderson
@ 2019-04-11 11:42 ` Heiko Stuebner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2019-04-11 11:42 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: linux-kernel, linux-rockchip, mka, ryandcase, Caesar Wang,
	linux-arm-kernel

Am Dienstag, 9. April 2019, 22:49:05 CEST schrieb Douglas Anderson:
> The rk3288 SoC has two PWM implementations available, the "old"
> implementation and the "new" one.  You can switch between the two of
> them by flipping a bit in the grf.
> 
> The "old" implementation is the default at chip power up but isn't the
> one that's officially supposed to be used.  ...and, in fact, the
> driver that gets selected in Linux using the rk3288 device tree only
> supports the "new" implementation.
> 
> Long ago I tried to get a switch to the right IP block landed in the
> PWM driver (search for "rk3288: Switch to use the proper PWM IP") but
> that got rejected.  In the mean time the grf has grown a full-fledged
> driver that already sets other random bits like this.  That means we
> can now get the fix landed.
> 
> For those wondering how things could have possibly worked for the last
> 4.5 years, folks have mostly been relying on the bootloader to set
> this bit.  ...but occasionally folks have pointed back to my old patch
> series [1] in downstream kernels.
> 
> [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1391597.html
> 
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

applied for 5.2

Thanks
Heiko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-04-11 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 20:49 [PATCH] soc: rockchip: Set the proper PWM for rk3288 Douglas Anderson
2019-04-11 11:42 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).