Commit Graph

839499 Commits

Author SHA1 Message Date
Finley Xiao
9c8373f109 clk: rockchip: rk3368: add ddrc clock support
Add a ddrc clock into clk branches, so we can do ddr frequency
scaling on rk3368 platform in future.

Change-Id: Ie7fd2e8d8bdf8b9ff843ca13e848f772adaa109a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 09:09:37 +08:00
Finley Xiao
66d5f36439 clk: rockchip: support setting ddr clock via SCPI APIs
On rk3368, let a mcu scaling ddr clock via SCPI (System Control and
Power Interface) APIs.

Change-Id: I95342b876caad991e6d1319c5e4ec793365c7981
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 09:09:26 +08:00
Frank Wang
22d7b0e780 clk: rockchip: rk3288: add gate id of hclk_usb_peri for usb otg
Change-Id: Ib45f6d97ec81329ec9a4a19e9e836efa0ea61fe2
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 09:09:17 +08:00
Elaine Zhang
821e83c98b 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>
2019-03-06 08:54:38 +08:00
Mark Yao
57eb2dfc42 clk: rockchip: rk3368: remove the flag ROCKCHIP_PLL_SYNC_RATE
CPLL and NPLL is used for vop dclk, sync rate flag would cause
loader display abnormal.

Change-Id: Ia170a8d0b7d1f39e2c9dcbc10b5d33fd1886d5f7
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 08:54:38 +08:00
Jianqun Xu
79f18c47d5 clk: rockchip: rk3368 add 1296M\216M\126M support to freq table
Change-Id: I6cff0d8820401c36c98f54a9777629dc1d37fba8
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 08:54:38 +08:00
Finley Xiao
0a64261970 clk: rockchip: use rk3368-efuse clock ids
Reference the newly added efuse clock-ids in the clock-tree.

Change-Id: Ibbef52bcc44d006ab48e6f1f874e3bc88c681bd6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-03-06 08:54:38 +08:00
Elaine Zhang
b7f4ad4320 clk: rockchip: fix up the rockchip_rk3066_pll_clk_set_by_auto func
Change-Id: Id7c561a50a16918c2943f79701ab72c6eaccdc41
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 08:54:38 +08:00
Elaine Zhang
b710757ef0 clk: rockchip: rk3368: add CLK_IGNORE_UNUSED flag for mcu clk
Change-Id: I27856c9523ac3bffd4b509f016a659a1e3094b41
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 08:54:38 +08:00
Elaine Zhang
eebf0ebb51 clk: rockchip: rk3328: fix up the describe error for aclk_usb3otg
Change-Id: Ie323c8934205bf71360d779717bb3e34c36a9dc6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-03-06 08:54:38 +08:00
Will Deacon
16c79bac8e UPSTREAM: arm64: kpti: Whitelist Cortex-A CPUs that don't implement the CSV3 field
While the CSV3 field of the ID_AA64_PFR0 CPU ID register can be checked
to see if a CPU is susceptible to Meltdown and therefore requires kpti
to be enabled, existing CPUs do not implement this field.

We therefore whitelist all unaffected Cortex-A CPUs that do not implement
the CSV3 field.

Change-Id: I1af7495be64d40a1e05a201f19e5f066b0d4bcc7
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 2a355ec257)
2019-03-04 19:31:26 +08:00
Yifeng Zhao
c299ce6019 soc: rockchip: mmc: add emmc vendor storage
Change-Id: I3996cccaed265af2295dbc1ee77746928e1beec5
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2019-03-01 09:36:30 +08:00
Tao Huang
136fb3d83e soc: rockchip: cpu: rename menu prompt
From "CPU selection" to "Rockchip CPU selection".

Change-Id: I5d9368ca6eb9ba60cd4c33fdd703775a328e9da0
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2019-03-01 09:27:50 +08:00
Finley Xiao
16e9353f89 arm: dts: rockchip: Change cpu opp-microvolt form one entry to three
Single entry is for target voltage and three entries are for
<target min max> voltages. Change cpu opp-microvolt form one entry to
three entries and set maximum acceptable voltage to a high value so that
regulator device can supply multiple consumers at the same time.

Change-Id: I3a0dc4e161bae33e36b232c36a0a05a3102359ef
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
e46a06270b arm64: dts: rockchip: rk3399: Add specification serial number for cpu
Change-Id: Ie48b09944ae3b294e3c7666bd9aa68706bdd4ba5
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Hu Kejun
e08c5bc9e0 arm64: dts: rockchip: rk3399: add interrupt name for rkisp
Change-Id: If942773bb18b55463cdd2137493f6573ce747893
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2019-02-28 20:22:04 +08:00
Weixin Zhou
990796fbed arm64: dts: rockchip: rk3399: add gpio drive strength 10ma
Change-Id: Iff6303af2e87425b0509fd962b9e6b2fca8eb896
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2019-02-28 20:22:04 +08:00
Huibin Hong
e759baa233 arm64: dts: rockchip: rk3399 fix uart3 cts and rts pinctl config
Change-Id: I2549e2a2e1913e9d9430087b9fc0009ec28a4c8f
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
b4b084f506 arm64: dts: rockchip: rk3399: Add wide-temperature configure
Change-Id: I5e8cca3de8b671f04d9fdf07f6c566ebb8b7988a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
YouMin Chen
3509ed3d18 arm64: dts: rockchip: rk3399: fix VDD_CENTER to 0.9V
Change-Id: I1226b92fd96be7a86208a9363cc38060115043be
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
a95306e198 arm64: dts: rockchip: rk3399: add pvtm resets
Change-Id: I1250a5193bd44b164d62d918401e60c7c4d31c59
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
e181776b90 arm64: dts: rockchip: rk3399: add nvmem-cells property for gpu
Change-Id: If538d1f8085dc686a25563a9eb891b79565a1c8d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
5f19e6737b arm64: dts: rockchip: rk3399: add gpu pvtm voltage table
stress test:
1. Antutu, use governor simpleondemand
2. Need for Speed, use governor simpleondemand
3. Glmark2, use userspace, scanning frequency

Change-Id: Ibe27380e582b193d900b0d55da3567ce553c32df
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
59d87c96d7 arm64: dts: rockchip: rk3399: add cpu pvtm voltage table
stress test:
1. reboot
2. antutu, use governor performance
3. antutu, use governor interactive
4. Thomas-sRoomIII, use governor interactive
5. Thomas-sRoomIII, use governor userspace and sweep frequency

Change-Id: If12d2bd72ce3bba01021314265eba4f83a0072e1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
eb2a71ddf7 arm64: dts: rk3399: add leakage nvmem-cells properties for cpu
Change-Id: Id156f2a9a3871747d9379b49d09034238d204670
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
425399a399 arm64: dts: rockchip: Rename OPP nodes as opp-<opp-hz>
Compiling the DT file with W=1, DTC warns like follows:

Warning (unit_address_vs_reg): Node /opp_table0/opp@1000000000 has a
unit name, but no reg property

Fix this by replacing '@' with '-' as the OPP nodes will never have a
"reg" property.

Change-Id: I5748be7888db149633c3980c3f5e9715cd256a52
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
654ad2c999 arm64: dts: rk3399: remove 297MHz and add 300MHz for dmc
Only 200MHz, 300MHz, 400MHz, 528MHz, 600MHz, 666MHz, 732MHz and
800MHz are available at present.

Change-Id: I48ed7e6e6f636389fbc239b1cca201f5c5f19d7a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Finley Xiao
17004d9ad6 arm64: dts: rockchip: rk3399: Rename OPP nodes as opp@<opp-hz>
It would be better to name OPP nodes as opp@<opp-hz> as that will ensure
that multiple DT nodes don't contain the same frequency. Of course we
expect the writer to name the node with its opp-hz frequency and not any
other frequency.

And that will let the compile error out if multiple nodes are using the
same opp-hz frequency.

Change-Id: I8c77646329e39390fb135d4d75d34893a8168876
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2019-02-28 20:22:04 +08:00
Jianqun Xu
696d1ad811 ARM64: dts: rk3399: move opp tables to rk3399-opp.dtsi
Add a new dtsi file - rk3399-opp.dtsi, to configure opp-tables
for cpu, gpu and dmc.

Add rk3399-early-opp.dtsi for board with ES1, which need limit
frequency for cpu, gpu and dmc.

Change-Id: Ib57761fd5f405b0e79039d7a01e6e023d6f5dc2c
Reviewed-by: Finley Xiao <finley.xiao@rock-chips.com>
Reviewed-by: Huang, Tao <huangtao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2019-02-28 20:22:04 +08:00
Elaine Zhang
80f56a2fa8 clk: rockchip: rk3399: remove the flag ROCKCHIP_PLL_SYNC_RATE for VPLL and CPLL
to slove the display shaking, when uboot logo display to kernel show.

Change-Id: I804aa09f24bc4fa7b6314a7a5487f0ee1a321724
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
Elaine Zhang
168ead39aa clk: rockchip: rk3399: fix up the pr_err for debug
Change-Id: I16eeacaf0307146ebf8db745621ef57e5ab16fec
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
Elaine Zhang
9a0256dba4 clk: rockchip: rk3399: Mark some grf clock as critical
pclk_perihp_grf and pclk_vio_grf is for some grf regs read and write,
mark it as critical and it never turns off.

Change-Id: If9465334b9168b4376a7ac95d5f08e389048409f
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
Elaine Zhang
2d399082b2 clk: rockchip: rk3399: make the cpll as parent just for vop
others clk change it's parent from cpll to dummy_cpll.
the vop's parent just vpll and cpll,
make sure each vop have it's own pll as parent.

Change-Id: Ia61e10918e14a69c053455018ddf0183ff15ea19
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
Finley Xiao
39d35a584c clk: rockchip: rk3399: delete the CLK_IGNORE_UNUSED for pvtm clks
These clks will be enabed and disabled in pvtm driver.

Change-Id: I742a8c4ef5877486fb21c014f1e4ab27f72e468d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
Elaine Zhang
a976a5c95e clk: rockchip: rk3399: fix up the spi softrst ID
fix up the spi3 and spi5 softrst ID.

Change-Id: Ib8870ef765284e04674ce80acf0b4702ed77cebc
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
Elaine Zhang
e122942c9e clk: rockchip: rk3399: fix up the dclk_vop1_div parents
if the dclk_vop0_div allow CLK_SET_RATE_PARENT for VPLL,
the dclk_vop1_div parent is not allowed in vpll.

Change-Id: I9973014e8ed2fcf1c351e3f62c00040677391ff7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2019-02-28 17:49:02 +08:00
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