Commit Graph

1056243 Commits

Author SHA1 Message Date
Elaine Zhang
0dd59e559a thermal: rockchip: Support the RV1126 SoC in thermal driver
RV1126 SOC has two independent Temperature Sensors for CPU and NPU.
RV1126 TSADC clock design has been updated, added the PHY clock,
using the group managed clocks.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I395daa3b591390980a11ea7eed827c0e297f6ebe
2021-05-20 18:35:49 +08:00
Elaine Zhang
0ddd45d54c thermal: rockchip: fix up the thermal panic block
Fixed the panic reloads when there are multiple thermal devices.

Change-Id: Ia08b0bfec940be089440b9246cc1abf9626c19a7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-20 18:34:53 +08:00
Elaine Zhang
f5bf680d2d dt-bindings: rockchip-thermal: Support the RV1126 SoC compatible
Add a new compatible for thermal founding on RV1126 SoC.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I84e7ca521f4edce9516575bd54709326e62fc85c
2021-05-20 18:33:25 +08:00
Elaine Zhang
7631249708 thermal: rockchip: add pinctrl control
Based on the TSADC Tshut mode to select pinctrl,
instead of setting pinctrl based on architecture
(Not depends on pinctrl setting by "init" or "default").
And it requires setting the tshut polarity before select pinctrl.

Change-Id: Iac9ca05073b0181ee13b0048d0c2a54204f82bca
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-20 18:32:43 +08:00
Elaine Zhang
c64efffd36 FROMLIST: clk: rockchip: fix rk3568 cpll clk gate bits
The cpll clk gate bits had an ordering issue. This led to the loss of
the boot sdmmc controller when the gmac was shut down with:
`ip link set eth0 down`
as the cpll_100m was shut off instead of the cpll_62p5.
cpll_62p5, cpll_50m, cpll_25m were all off by one with cpll_100m
misplaced.

Fixes: e9ac850b88 ("clk: rockchip: add clock controller for rk3568")

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://patchwork.kernel.org/project/linux-clk/patch/20210519174149.3691335-1-pgwipeout@gmail.com/
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I012bdbdc44c4e8de1b42a00c2a9bffb7bd66faef
2021-05-20 10:05:33 +08:00
Elaine Zhang
736782477e dt-bindings: thermal: rockchip-thermal: Support the RK1808 SoCs compatible
This patch set attempts to new compatible for thermal founding
on RK1808 SoCs.

Change-Id: I133218cd958e0aabf711a5d22fe5e5da2fbd59ce
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 17:25:05 +08:00
Elaine Zhang
52d92252ce thermal: rockchip: add pinctrl control
Based on the TSADC Tshut mode to select pinctrl,
instead of setting pinctrl based on architecture
(Not depends on pinctrl setting by "init" or "default").
And it requires setting the tshut polarity before select pinctrl.

Change-Id: Ieb181ec19dedbbfb7aef474b3558aac867e668eb
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 17:25:05 +08:00
Rocky Hao
b6d5f24ad5 thermal: rockchip: add shutdown callback function
Tsadc has a tshut pin which is designed to reset the pmic or soc,
when the temperature inside soc is too high. we should switch off
the tshut function and change the pin to gpio function in reboot
process, eg, software reset. If not, the tsadc module will WRONGLY
pull high the tshut pin during its reset process and then WRONGLY
reset the pmic or soc, which incurred a hardware reset. The hardware
reset will reset everything inside soc, even includes the power on
reason flag, which is set by software before reboot process.

we also change over-temperature protection mode to cru mode,
since the tshut pin have be changed to gpio function.

Change-Id: Iac3dacf55a4b5536fccd2eb05a6a9e6923a082c0
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 17:25:05 +08:00
Elaine Zhang
aa026b7cf8 thermal: rockchip: add tsadc support for rk1808
Change-Id: Icc0bb8a076a3fbd5f8ab70db8d7e032165528ae8
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 17:25:05 +08:00
Elaine Zhang
0e37cc4574 ARM: dts: rockchip: remove regulator-xxx-microvolt for SWITCH pmic node on rk3288-vyasa
Switch is just a function of switching. There is no voltage setting
function. Voltage getting is the supply voltage.

Fixes: aea6cb9970 ("regulator: resolve supply after creating
regulator")
Change-Id: I22ff04b59b9b051052348420f25999dae424d4ac
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:50:20 +08:00
Elaine Zhang
a3da190248 dt-bindings: power: add binding for rv1126 power domains
Add binding documentation for the power domains
found on Rockchip RV1126 SoCs.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Icf38d7a8fa44abf119e57a66ceddc1a01872facf
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:45:00 +08:00
Elaine Zhang
c060385630 dt-bindings: rockchip: add the power domains for rk1808 SoCs
Change-Id: I6da9acfddfae1ecfa66adb1deba46b6de448ef35
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:44:38 +08:00
Elaine Zhang
ba3959aef3 dt-bindings: regulator: Document Rockchip RK860X regulators
Document the regulator and add a rockchip vendor-prefix.

Change-Id: I3084f2083644e30145ccda2e13e2e81c6470797a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:42:38 +08:00
Elaine Zhang
8a55843716 clk: rockchip: rk3036: add cru regs dump for panic
Add cru regs dump when system panic.
It's just for debug.

Change-Id: Ic60f491d549e030490c14ea78f4857a8cead596d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:29:17 +08:00
Elaine Zhang
40a55dc2a4 clk: rockchip: rk3128: add cru regs dump for panic
Add cru regs dump when system panic.
It's just for debug.

Change-Id: I7f9bc78deef60b1fa48bada5b1a6203185ddce48
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:29:12 +08:00
Elaine Zhang
562e25f49e clk: rockchip: rv1108: add cru regs dump for panic
Add cru regs dump when system panic.
It's just for debug.

Change-Id: Ic4efc985892cbcc5e561203fe8e00dba116439e7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:29:07 +08:00
Elaine Zhang
d6dd9a5f48 clk: rockchip: rk3228: add cru regs dump for panic
Add cru regs dump when system panic.
It's just for debug.

Change-Id: Ide2c3e8add083934672f6d22d8182bcfde046783
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:29:02 +08:00
Elaine Zhang
080a0407fb clk: rockchip: rk3288: add cru regs dump for panic
Add cru regs dump when system panic.
It's just for debug.

Change-Id: I86ff4f12ed932431d131d22a307360418e2e9f40
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:28:56 +08:00
Elaine Zhang
e952ee0800 ARM: dts: rockchip: mark xin32k clk as fixed clk on rk3036-kylin
Change-Id: I5bf0a64502a7dd7b36545437b1675bb896c97bce
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:28:20 +08:00
Elaine Zhang
26e7afc9d3 arm64: dts: rockchip: mark xin32k clk as fixed clk on rk3328 boards
Change-Id: I25ab72ba7af64b7031fb02d30d0cb5cb6798d692
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-19 14:26:55 +08:00
Elaine Zhang
c325887a73 clk: rockchip: add support for pvtm clk
add pvtm 32K internal clock setting and select enable.

Change-Id: I60225d29e16c5b96f285623260bea475c78a026a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:37 +08:00
Elaine Zhang
560a4400a0 clk: rockchip: rk3036: fix up the sclk_sfc parent error
Change-Id: I0903161f34de8f309392bec6926348ffe37ba2f6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:37 +08:00
Elaine Zhang
e328740e28 clk: rockchip: rk3308: Use MUXTBL to cover Mux selects priorities
Change-Id: I14d08f3b98b1dcaf1c9e4b9114ebd103e2dc51c9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:37 +08:00
Elaine Zhang
35e637b1a5 clk: rockchip: rk3128: add hclk_sfc
Change-Id: I20d0975156dc73bcdd02c09b7ecb815d5aca6bc6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:37 +08:00
Elaine Zhang
4124fe9936 clk: rockchip: rk3128: fix up the hclk_vio clk description
set hclk_vio_niu as critical clock.

Change-Id: Ib9e182ac93038df34eadae502fc18df5c0854ef9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:37 +08:00
Elaine Zhang
987f984d07 clk: rockchip: rk3288: add the condition of the call register_syscore_ops
The pwm clk parent is GPLL,PWM clk not allowed to change freq,
so the GPLL not allowed change mode and freq  when pwm is used.
If have trust is need't rk3288_clk_suspend and rk3288_clk_resume.

Change-Id: I4845fda89d7ae7713e8c0e94747c3f4dfd140c6a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:37 +08:00
Elaine Zhang
b4f6be2aa3 clk: rockchip: rk3288: mark pclk_peri as critical clk
Avoid disable the parent clock after the child clock has disabled.

Change-Id: I1ea91afe0b6bbefd3a5d8e88641e4a3af5a368a4
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
6ef83c562e clk: rockchip: rk3288: fix up the 594M pll vco
Modify VCO within safe limits(600M-3200M).
mark refdiv = 1

Change-Id: I76b69091ee1ff9a0d88f17a1e4dabda6e267caad
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
acc21855ff clk: rockchip: rk3288: mark the aclk_dmac1 as critical clk
crypto and dmac share the same noc clk,
so mark the aclk_dmac1 as critical clk.

Change-Id: I34a4a7cc532a385086679fafb961a47b0a6abc3b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
9322b4700a clk: rockchip: rk3288: export PCLK_PD_PMU and PCLK_PD_ALIVE clock id
Change-Id: Ie0550d9528367fa070328562fad2e597a5d6d7f7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
9f6d1e6688 clk: rockchip: rk3328: Update the h264 and h265 clocks
fixed up the h264 and h265 clk tree change:
old:
aclk_rkvenc-->
        --> aclk_h265
        --> aclk_h264
        --> aclk_axisram
        --> hclk_rkvenc -->
       		 --> hclk_265
                 --> hclk_264
new:
sclk_venc_core-->
	--> aclk_h265
	--> aclk_h264
	--> aclk_axisram
	--> hclk_venc -->
		 --> hclk_265
		 --> hclk_264

Change-Id: I3d4b61fe545ecfc2353cb2993245fc813739084a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
81ec72e4a5 clk: rockchip: rk3328: add flag CLK_IGNORE_UNUSED for hclk_vop_niu
Change-Id: I770a83ad357f18d3258755b6c1d43ef82248951e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
9804ea0266 clk: rockchip: rk3228: fix up the description error
Change-Id: I439314c590a7144fab6e33d1fb4f325530669842
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
43ee3bb5a0 clk: rockchip: rk3228: Perfect clock description
1 Add some necessary clk ID.
2 some clks add CLK_IGNORE_UNUSED flag
3 add some critical clk

Change-Id: If52699b4d5f430413b06084b7d21fb1afd4539dd
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
c86aa0a6b3 clk: rockchip: rk3368: use COMPOSITE_DCLK for dclk_vop
Change-Id: I45ce9a2e404acb7eae885fbca0b4703ec67176e9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
2145f9dccb clk: rockchip: rk3368: mark the aclk_dmac_bus as critical clk
crypto and dmac share the same noc clk,
so mark the aclk_dmac_bus as critical clk.

Change-Id: Ib0b70bbed3fdefeab7b6f2b5f88350a416e66787
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
781056b84d clk: rockchip: rk3368: set clk parent npll to dummy_npll
npll is just for dclk_vop, others clk not allowed to set npll as parent.

Change-Id: I11e1770acab5486acaebafd56a0c57847f7f533c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
e2def67cb9 clk: rockchip: rk3368: fix NPLL with NB parameter types RK3066_PLL_RATE_NB
with the NB parameter,can adjust the jitter of the output PLL.
make the npll jitter is better,make it more suitable for DCLK display.

Change-Id: I9d819bdc2b520205a7d63ee8ed83643601ccc821
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
b1d64bdb31 clk: rockchip: rk3368: add aclk_cci_pre ID
Change-Id: I855e79023a9e244c2db37af88a075a4ef4c36aec
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
e7ebb13742 clk: rockchip: rk3368: add CLK_SET_RATE_PARENT flag for dclk_vop
dclk_vop only allowed on NPLL.

Change-Id: I5325a530d3052de1e8685c39b90357291f0f4fb3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:36 +08:00
Elaine Zhang
a3ddb728c4 clk: rockchip: rk3368: add CLK_IGNORE_UNUSED flag for mcu clk
Change-Id: I27856c9523ac3bffd4b509f016a659a1e3094b41
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:35 +08:00
Elaine Zhang
8ac4c812c2 arm64: dts: rockchip: rk3399: set dummy_cpll and dummy_vpll as fixed clk
to fix up :
[    0.000000] clk: couldn't get clock 4 for /clock-controller@ff760000
[    0.000000] rockchip_clk_of_add_provider: could not register clk provider
The cause of the error:
struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
			     const char *con_id, bool with_orphans)
{
	/* This is to allow this function to be chained to others */
	if (!hw || IS_ERR(hw))
		return (struct clk *) hw;

	if (hw->core->orphan && !with_orphans)
		return ERR_PTR(-EPROBE_DEFER);

	return clk_hw_create_clk(hw, dev_id, con_id);
}
if clk is orphan and not have the with_orphans flag, it will
register clk provider failed.

Change-Id: I87ca9ec087611a5425545bfc857b09d8438218b5
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-18 20:33:35 +08:00
Jianqun Xu
14afd34332 arm64: dts: rockchip: add reboot-mode node for rk3399
Rockchip RK3399 SoCs support reboot with modes, such as recovery mode,
loader mode and normal mode.

Change-Id: I96ed872f849c2b3b06d236248995db18be070960
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-05-18 11:00:49 +08:00
Tao Huang
b07446675b arm64: rockchip_defconfig: Disable DVB/TV/Radio media drivers
According to gki commit 13c6a5e993 ("ANDROID: Re-enable menus
hidden by disabling MEDIA_SUPPORT_FILTER").

-CONFIG_MEDIA_CAMERA_SUPPORT=y
-CONFIG_MEDIA_CEC_SUPPORT=y
-CONFIG_MEDIA_ANALOG_TV_SUPPORT
-CONFIG_MEDIA_DIGITAL_TV_SUPPORT
-CONFIG_MEDIA_RADIO_SUPPORT
-CONFIG_MEDIA_SDR_SUPPORT
-CONFIG_MEDIA_TEST_SUPPORT

Change-Id: Id001fbc110e165e63249fc597f0681c3ce44ea2d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-05-17 15:16:29 +08:00
Tao Huang
2220c3f613 mfd: rk808: Call rk808_i2c_driver_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y
Change-Id: I03947c16b7a31579a1bce54ea1ce114541432b2f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-17 14:49:07 +08:00
Tao Huang
3a8467548d regulator: rk808: Call rk808_regulator_driver_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y
Change-Id: Iae4d3bf9bc24c1be3789b261fcec3bace5f122c3
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-17 14:22:42 +08:00
Tao Huang
451b327661 soc: rockchip: Add ROCKCHIP_THUNDER_BOOT config
This option make the kernel boot faster.
Default n.

Change-Id: I918523621044e16953d5611ef9b0f2773746dae9
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2021-05-17 14:16:00 +08:00
Shawn Lin
855b2834d4 mmc: dw_mmc: Fix thunder boot support
Migrate to use new properties.

Fixes: af02b05e59 ("mmc: add thunder boot support")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I26e1c5b65a994522fdfd5cbc54ed17909bbaa95f
2021-05-17 14:14:43 +08:00
Elaine Zhang
c44e5e04a4 rtc: rtc-rk808: use flag to distinguish chip differences
RK808\RK818 have November 31st,Other chips fixed the problem.

Fixes: f076ef44a4 ("rtc: rk808: Compensate for Rockchip calendar
deviation on November 31st")
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I8977a14abcc3973728b5941951d17d493b3955d4
2021-05-14 17:36:53 +08:00
shengfei Xu
b3eba31466 rtc: rk808: check the rtc is available
Change-Id: I383c08cd5ad7cb282c0ec0aa12e9e84c9df52ba3
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2021-05-14 17:36:25 +08:00