Commit Graph

839463 Commits

Author SHA1 Message Date
Xing Zheng
e04b0bc907 clk: rockchip: rk3399: export 480M_SRC clock id for usbphy0/usbphy1
Change-Id: Icd566864d3651e7b64ee8209b66e8a326011422f
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:26:59 +08:00
Elaine Zhang
d856a9e4a5 clk: rockchip: rk3399: add pll up and down when change pll freq
set pll sequence:
	->set pll to slow mode or other plls
	->set pll down
	->set pll params
	->set pll up
	->wait pll lock status
	->set pll to normal mode

To slove the system error:
rockchip_rk3399_wait_pll_lock: timeout waiting for pll to lock
rockchip_rk3399_pll_set_params: pll update unsucessful,
				trying to restore old params

Change-Id: I62aecd9f292de5a3c7bcd8a87231785bf115159d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:26:59 +08:00
Elaine Zhang
11ce3bc6e4 clk: rockchip: rk3399: support pll setting by auto
If setting freq is not support in rockchip_pll_rate_table rk3399_pll_rates[],
It can set pll params by auto.

Change-Id: I5016cece64dca4c2efec18d552ee6be426f6b95a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:26:59 +08:00
Heiko Stuebner
df80a68487 FROMLIST: clk: rockchip: make rk3399 vop dclks keep their rate on parent rate changes
The rk3399 hdmi phy is supplied by the vpll directly and needs to adapt
that frequency depending on the selected resolution on the hdmi output.
For the hdmi-phy the vpll frequency is supplied unchanged without
any dividers being present there.

The vpll also is one of the sources the general display clock of the
visual output processor (vop) and as it is somewhat special for
display operations possibly also the preferred pll source. Here a divider
is available between the pll-mux and the vop clock, so that this part
can adapt the resulting frequency if needed.

So to keep the vop clock in line with the target rate, set the newly
introduced CLK_KEEP_REQ_RATE flag for the dclk_vop clocks on rk3399.

(am from https://patchwork.kernel.org/patch/8993771/)

Change-Id: Iba9a179b764472f22d7531eb0c662dcd982433d4
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:25:13 +08:00
Heiko Stuebner
12da448610 FROMLIST: clk: adjust clocks to their requested rate after parent changes
Given a hirarchy of clk1 -> [div] -> clk2, when the rate of clk1 gets
changed, clk2 changes as well as the divider stays the same. There may
be cases where a user of clk2 needs it at a specific rate, so clk2
needs to be readjusted for the changed rate of clk1.

So if a rate was requested for the clock, and its rate changed during
the underlying rate-change, with this change the clock framework now
tries to readjust the rate back to/near the requested one.

The whole process is protected by a new clock-flag to not force this
behaviour change onto every clock defined in the ccf.

(am from https://patchwork.kernel.org/patch/8993761/)

Change-Id: Ie2636710cb4e66815ee45b28ec86eeaaa47c55c7
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:25:12 +08:00
William Wu
679371c2f0 arm64: dts: rockchip: add usic node for rk3399
Add usic node for rk3399 USB 2.0 EHCI controller
with usic phy.

Change-Id: Ibb4179ff1479816daa3b8455b0229f8a7a05bbdf
Signed-off-by: William Wu <william.wu@rock-chips.com>
2019-02-28 15:15:37 +08:00
Hu Kejun
b9a7b77a8e arm64: dts: rockchip: add mipi_dphy_tx1rx1 and modify rkisp1_1 for rk3399
Change-Id: I94d01c6963dc5f2f9b61159df1b13fc0bb32a0f1
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-02-28 15:03:44 +08:00
CanYang He
4b354f3e22 arm64: dts: rockchip: increase mcu frequency to 97mhz for rk3399
mcu run at 97MHz to reduce lpddr4 scale frequency elapsed time

Change-Id: Ie2805eaf0d902c9531819217d05a86775d85f809
Signed-off-by: CanYang He <hcy@rock-chips.com>
2019-02-28 14:59:57 +08:00
Huicong Xu
ba7abca242 arm64: dts: rockchip: add hdmi hdcp2 node for rk3399
Change-Id: Ie78fbdc226d856a20c2da40e4166e7b23ed27aba
Signed-off-by: Huicong Xu <xhc@rock-chips.com>
2019-02-28 14:58:55 +08:00
Hu Kejun
e3b38bf4a2 arm64: dts: rockchip: Add rkisp1 for rk3399
Change-Id: Ie0eb7088d08f9c0cbd0443b6f9c635ade9b4cc8f
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-02-28 14:56:28 +08:00
Tao Huang
28632a5e2b arm64: dts: rockchip: fix dtc warnings of rk3399
Change-Id: I31fbab7d90e35ae47bbc6d54aad5e82b8902af7f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-28 14:52:46 +08:00
Rocky Hao
0e1ecbe0be ARM64: dts: rk3399: add dmc config for VOP
Change-Id: I1b07ca19c5f6529361630ac49ba8922ba0e32db2
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2019-02-28 14:49:05 +08:00
Mark Yao
d8a4f839b9 arm64: dts: rockchip: rk3399: add dclk pll sources
Change-Id: I0e29d67d5e3738b18a7407a049d216f8dcebb8e8
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 14:47:15 +08:00
Finley Xiao
92ac4e68b2 arm64: dts: rockchip: rk3399: Add nocp device node
Change-Id: I9ef68b69a263720aea3d51e854375b51027c94a2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 14:35:46 +08:00
Mark Yao
a4228aa5f4 arm64: dts: rockchip: rk3399: add cabc lut register
Change-Id: Ia4b47301b58141b24e75e35544beb903325e0a19
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-02-28 14:34:17 +08:00
Mark Yao
14112699fb arm: dts: rockchip: add names for vop register
Change-Id: I463cc2dc92f233b5b4b6f91b71cf78af92d4a2c1
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-02-28 14:33:17 +08:00
Mark Yao
83fd1bde66 arm64: dts: rockchip: add gamma table support for rk3399
Rk3399 vopb's gamma table size is 1024, vopl's gamma
table size is 256

Change-Id: Iea9cd70f82dfa9c9c8ae53a24c8153eebb981e7a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2019-02-28 14:29:36 +08:00
Shengfei xu
edc38a7122 arm64: dts: rockchip: add rockchip-suspend node for rk3399
Change-Id: I6af1f487f40c0775102d3b9951617c5d03b884ef
Signed-off-by: Shengfei xu <xsf@rock-chips.com>
2019-02-28 14:28:20 +08:00
Huang, Tao
f632877d6f arm64: dts: rockchip: move vpu/rkvdec to rk3399.dtsi
Right now only one driver support vpu and rkvdec,
so move the nodes from rk3399-android[-next].dtsi to rk3399.dtsi.

Change-Id: Id908843774ed8eede3aeddb24059ae92a35e5b98
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2019-02-28 14:26:35 +08:00
Finley Xiao
38ae16b5cb arm64: dts: rk3399: add a opp-suspend property for cpu opp table
The opp who contains a opp-suspend property will be configured
during suspend or reboot.

Change-Id: I6b2eede43216435f568db6959127a6e84c8cd4c8
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 14:20:26 +08:00
Finley Xiao
4cd5da2e76 arm64: dts: rockchip: add pvtm node for rk3399
Change-Id: Ic7becefeb7e7a1000b259c21fedda76794b7115c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 14:18:21 +08:00
Elaine Zhang
d98b328e44 arm64: dts: rockchip: rk3399: add aclk_gpu init freq
Make sure the aclk_gpu freq is safety.
After soft reset the vdd_gpu is maintain
the voltage value before reset.

Change-Id: I3509b211d74cf649067090d13ce20d5c62782fd7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 14:07:26 +08:00
tony.xie
8ea4689838 ARM64: dts: rk3399: support cluster idle feature
Add cluster sleep in cpu idle_states for RK3399 SoCs.

Change-Id: I85ea62f9af0d0c61e866a1937f79921d854fd1dc
Signed-off-by: tony.xie <tony.xie@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:27:51 +08:00
Finley Xiao
28e5496a4b arm64: dts: rockchip: add cpu-avs node for rk3399
Change-Id: Ibfcda65b6b97af453942888cf07e8f08b06768c2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 11:26:22 +08:00
Elaine Zhang
8df130821e arm64: dts: rockchip: rk3399: fix pd_sd as sub domain of pd_perihp
Change-Id: I62e53b85444f0f4bbb1d2e786a23ff1f91c89000
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:25:59 +08:00
Elaine Zhang
6919158470 arm64: dts: rockchip: add some pd nodes for rk3399 power domain
add emmc\gmac\usb3\sd\sdioaudio\perihp pd nodes

Change-Id: Ie5f65c19ebd87ef9ca25846674e17cb2018cfbf7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:23:09 +08:00
Lin Huang
2a2741c761 ARM64: dts: rk3399: add dmc and dfi node
To support ddr frequency scaling function, we need
enable dmc and dfi node.

Change-Id: I84ea6bff679365d86937ff10bcdf466ea31901fb
Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:12:08 +08:00
Wenping Zhang
74f449378d arm64: dts: rockchip: add dp 4 lanes + usb2.0 function for rk3399
Change-Id: Ia45dd31ebfe2c0c038a6102920eefb50fd512f36
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2019-02-28 11:10:59 +08:00
Kever Yang
1c735bcb8c arm64: dts: rockchip: add usb typec phy node for rk3399
Change-Id: I0313f7812bad02136abbd8868a201cf4409620d6
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:06:29 +08:00
Wu Liang feng
1948bffacb arm64: dts: rockchip: optimize clks for rk3399 dwc3
1. modify clock-names, according to Heiko's suggestion, clock names
should always be in the scope of the device block (named after what
it supplies), and clock-names are always meant from the perspective
of the individual ip-block.

2. remove unnecessary clocks, refer to rk3399 TRM, aclk_usb3 is the
parent of aclk_usb3otg0/1 and aclk_usb3_grf, and we will enable
aclk_usb3otg0/1 and aclk_usb3_grf, so don't need to enable aclk_usb3
again. In addition, the aclk_usb3_rksoc_axi_perf clk is used for usb3
performance monitor module which we don't use now, so don't need to
enable it.

Change-Id: I1d50a72d1523b8b70f1e5f388dc357807131dd7c
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:06:02 +08:00
Wu Liang feng
4fc57a8ca2 arm64: dts: rockchip: change dr_mode for rk3399 dwc3
The DesignWare USB3 integrated in rockchip SoCs is a configurable
IP Core which can be instantiated as Dual-Role Device (DRD), Host
Only (XHCI) and Peripheral Only configurations. For rk3399, it has
two DWC3 controllers, we set DRD for DWC3_0 and Host only for DWC3_1
by default.

Change-Id: Ia0063e04e48770d8d0ec7ec86cb621c5e9979fb9
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 11:05:32 +08:00
Tao Huang
bab2f28c28 arm64: dts: rockchip: add more reboot mode on rk3399
Add charging and fastboot mode support.

Change-Id: Ib66c0d8c36ae33eeef2672b2bb31f075f833dd87
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 10:59:44 +08:00
Jacob Chen
a2fb04c3cf dt-bindings: soc: rockchip: add ums mode
On upstream uboot, we use ums mode to update firmware.
Add this flag to help enter USB Mass Storage mode.

Change-Id: I0e515bfd8703bd48d950b72787b365226af11ce9
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2019-02-28 10:52:31 +08:00
Tao Huang
a24873eaf1 dt-bindings: soc: rockchip: add charging mode support
Change-Id: I66d5eb1813583aae37b2d19a2cf18dd9bbaf7125
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-02-28 10:50:58 +08:00
David Wu
b76dc6d89c arm64: dts: rockchip: add voppwm support for rk3399
Change-Id: I16b4f77083c05ffa71d569e378ea6e3cc9b1ee54
Signed-off-by: David Wu <david.wu@rock-chips.com>
2019-02-28 10:35:30 +08:00
Elaine Zhang
0ed27e4be1 arm64: dts: rockchip: add pd_perihp support for rk3399 usb2
Change-Id: I3a46d7dfb2846b332c81a5879a12853ce7423180
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 10:34:47 +08:00
Rocky Hao
0dada2f5ae arm64: dts: rk3399: ajust ipa parameters
Big cores' power consumption and gpu's are greatly reduced, ipa parameters
are ajusted accordingly.

Change-Id: Ibfdae1856c2f1c2cf80a0a2f963ec878053c6ef0
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 10:34:23 +08:00
Rocky Hao
bb9b7f4df2 arm64: dtsi: rk3399: optimize ipa parameters
Big cores' power consumption is as much as 8 times of little cores'.
Eas tends to bring tasks to big cores to assure the performance, and
this will make the temperature of soc out of control. To resolve this
issue, we set the power request weight of both little cores and gpu is
10 times of big cores, when temperature control occurs. Meanwhile, we
decrease passive polling interval to make temperature control more
accurate.

Change-Id: Ib01948c6a4f4383f03f1317b2397f07fbdc3487e
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 10:33:33 +08:00
Finley Xiao
e29e550bd0 ARM64: dts: rockchip: rk3399: add power-off-delay-ms for gpu
Change-Id: Ib050492f466b50a6937b3a43f63f27859619e3b4
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 10:32:55 +08:00
Rocky Hao
1c2d27a0e0 arm64: dts: rockchip: add the IPA needed parameters for rk3399 thermal
according to our testing results, added the ipa parameters for both cpu
big cores and cpu little cores, and updated the  parameters for gpu.

for now,the gpu thermal zone is used only to get the gpu's temperature.

Change-Id: Ifc7708de9d880e0f9cd5da0bb71a135b0c381b45
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 10:32:25 +08:00
Xing Zheng
6127316701 ARM64: dts: rk3399: remove the reference pmugrf and grf
We don't need to reference the pmugrf/grf in the clock driver any more.

Change-Id: Ibda203163c84ab4004e1225e5868267024069199
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2019-02-28 10:31:49 +08:00
Jianqun Xu
00ef7802c8 arm64: dts: rockchip: not to compile gru file temporary
Change-Id: Ib0aade35a4bf4bacee9dc75f8e00ca56aca73b19
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 10:30:30 +08:00
Yakir Yang
57405e0e10 ARM: dts: add 'support-emmcs' flag for RK3228 EVB board
Private flag of our downstream kernel.

Change-Id: I6dbfcb04748e9d54492df6df20382367ce1218b2
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2019-02-27 20:45:07 +08:00
Chen Liang
a6afe518a8 sched/fair: fix bug: remove printk while schedule is in progress
It will cause deadlock and while(1) if call printk while schedule
is in progress. The block state like as below:

cpu0(hold the console sem):
printk->console_unlock->up_sem->spin_lock(&sem->lock)->wake_up_process(cpu1)
->try_to_wake_up(cpu1)->while(p->on_cpu).

cpu1(request console sem):
console_lock->down_sem->schedule->idle_banlance->update_cpu_capacity->
printk->console_trylock->spin_lock(&sem->lock).

p->on_cpu will be 1 forever, because the task is still running on cpu1,
so cpu0 is blocked in while(p->on_cpu), but cpu1 could not get
spin_lock(&sem->lock), it is blocked too, it means the task will running
on cpu1 forever.

Change-Id: I60d02d8c957273872f97939632bdd235accdad4e
Signed-off-by: Chen Liang <cl@rock-chips.com>
2019-02-27 20:45:07 +08:00
Liang Chen
1cd709a71a arm64: dts: rockchip: rk3328: add gpu_power_model in gpu node
Indeed, the values of the model parameters are supplied by Rocky Hao.

Change-Id: I23edaa0ee104d07f79f5bf5bdbd393b4fb3c5120
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2019-02-27 20:45:07 +08:00
Liang Chen
f2ec640d04 arm64: dts: rockchip: add rk3328 Android Board
Change-Id: Ie91543ba45db6e3de0d30158c1b2922e740e97d7
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-02-27 20:39:53 +08:00
Liang Chen
4f4c17d765 arm64: dts: rockchip: rk3328: Disable 400MHz and 600MHz for dmc
400MHz and 600MHz aren't supported at present.

This had submitted in commit a8c497e79d
("arm64: dts: rockchip: rk3328: Disable 400MHz and 600MHz for dmc")
but was modified in commit 59af91b563
("arm64: dts: rockchip: auto select opp-table by leakage for rk3328")
by mistake.

Change-Id: I864453d16596798e063a2c3569b260fd1a95c209
Signed-off-by: Liang Chen <cl@rock-chips.com>
2019-02-27 20:39:53 +08:00
Xinhuang Li
a8e7e3ed63 arm64: dts: rockchip: rk3328: add aclk&hclk for h265e_mmu
Change-Id: I46bd3817219f80fddd097ec37e10a3a29209e21f
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2019-02-27 20:39:53 +08:00
Finley Xiao
173d5be301 arm64: dts: rockchip: rk3328: Avoid showing blurred screen
If show logo in uboot, can't change vop clocks.

Change-Id: Ia149b452e16dedcafaa15bfa5d5dc989b06737ff
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-27 20:39:53 +08:00
Finley Xiao
3a9fef5f7e arm64: dts: rockchip: rk3328: Add devfreq property for rkvdec
Change-Id: I819a2c950b8b0a31207f85029c61c5efb5afe622
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-27 20:39:53 +08:00