[PATCH v2 0/2] ARM: Add Rockchip rk3288w support
From: MylÃne Josserand
Date: Wed Apr 01 2020 - 11:35:37 EST
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