linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ARM: Add Rockchip rk3288w support
@ 2020-04-01 15:35 Mylène Josserand
  2020-04-01 15:35 ` [PATCH v2 1/2] soc: rockchip: Register a soc_device to retrieve revision Mylène Josserand
  2020-04-01 15:35 ` [PATCH v2 2/2] clk: rockchip: rk3288: Handle clock tree for rk3288w Mylène Josserand
  0 siblings, 2 replies; 9+ messages in thread
From: Mylène Josserand @ 2020-04-01 15:35 UTC (permalink / raw)
  To: heiko, linux-arm-kernel, mturquette, sboyd
  Cc: linux-kernel, linux-rockchip, linux-clk, mylene.josserand,
	kernel, kever.yang, geert

Hello everyone,

Here is my V2 of my patches that add the support for the Rockchip
RK3288w which is a revision of the RK3288. It is mostly the same SOC
except for, at least, one clock tree which is different.
This difference is only known by looking at the BSP kernel [1].

Currently, the mainline kernel will not hang on rk3288w but it is
probably by "chance" because we got an issue on a lower kernel version.

According to Rockchip's U-Boot [2], the rk3288w can be detected using
the HDMI revision number (= 0x1A) in this version of the SOC.
Not to rely on U-Boot about the compatible, the patch 01 will handle
the detection of the HDMI version.

In this V2, the revision's detection is done using soc_device
registration. Thanks to that, in case of other differences than the clock
tree, it will be possible to detect rk3288/rk3288w using the 'soc_device_match'
function.
The main issue was an ordering issue: my rk3288 driver was
registered too late to be able to act on the clock tree. This is fixed
by using an initcall in the clock driver. One possible way would be to
convert the clock driver into platform_driver but, as it is using
some common functions to all Rockchip's drivers, it would have been
necessary to update all others. Instead, using an initcall to post-pone
hclkvio clock's registration is enough to make everything work correctly
without a big change on the clock driver.

Changes since v1:
   - As suggested by Geert, update the HDMI detection by using all
   'soc_device' functions
   - Use 'soc_device_match' function to detect the revision in the
   clock driver
   - Create a function that registers hclkvio clocks later than others
   to be sure that RK3288 revision is read.

Best regards,
Mylène Josserand

[1] https://github.com/rockchip-linux/kernel/blob/develop-4.4/drivers/clk/rockchip/clk-rk3288.c#L960..L964
[2] https://github.com/rockchip-linux/u-boot/blob/next-dev/arch/arm/mach-rockchip/rk3288/rk3288.c#L378..L388

Mylène Josserand (2):
  soc: rockchip: Register a soc_device to retrieve revision
  clk: rockchip: rk3288: Handle clock tree for rk3288w

 drivers/clk/rockchip/clk-rk3288.c |  36 ++++++++-
 drivers/soc/rockchip/Makefile     |   1 +
 drivers/soc/rockchip/rk3288.c     | 125 ++++++++++++++++++++++++++++++
 3 files changed, 158 insertions(+), 4 deletions(-)
 create mode 100644 drivers/soc/rockchip/rk3288.c

-- 
2.25.1


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

end of thread, other threads:[~2020-04-02 14:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 15:35 [PATCH v2 0/2] ARM: Add Rockchip rk3288w support Mylène Josserand
2020-04-01 15:35 ` [PATCH v2 1/2] soc: rockchip: Register a soc_device to retrieve revision Mylène Josserand
2020-04-01 16:34   ` Heiko Stübner
2020-04-02  6:31     ` Mylene Josserand
2020-04-02 11:45     ` Robin Murphy
2020-04-02 14:14       ` Heiko Stübner
2020-04-01 15:35 ` [PATCH v2 2/2] clk: rockchip: rk3288: Handle clock tree for rk3288w Mylène Josserand
2020-04-01 16:56   ` Geert Uytterhoeven
2020-04-02  6:35     ` Mylene Josserand

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).