Commit Graph

610607 Commits

Author SHA1 Message Date
William Wu
e46fe08c85 usb: dwc2: add pm runtime support
Adds pm_runtime support for dwc2, so that power domain is
enabled only when there is a transaction going on to help
save power.

Change-Id: I318552774d20eeaed521ff179f99b2551ee24183
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-07-27 15:19:06 +08:00
Xing Zheng
85a3a104a2 arm64: dts: rockchip: rk3308-evb: switch to multicodecs for bluetooth_sound
Dues to the loading order of multiple sound cards is
not constant, we need to specify bluetooth pcm sound
as the slave card via 'rockchip,wait-card-locked'
property. It looks like this:

========
From
[    1.180441] ALSA device list:
[    1.180458]   #0: rockchip,rk3308-pcm
[    1.180467]   #1: rockchip,rk3308-vad

To
[    1.175590] ALSA device list:
[    1.175606]   #0: rockchip,rk3308-vad
[    1.175614]   #1: rockchip,rk3308-pcm
========

Change-Id: Ic4d7625ca3b06106a317a59defcc45bab190ae95
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-27 14:59:05 +08:00
Xing Zheng
94b7e1a99e ASoC: rockchip: add property 'rockchip,wait-card-locked'
Change-Id: I6c81abfe3f57c5db8c547c74929202bd7484ca9a
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-27 14:57:40 +08:00
Xing Zheng
49950d606a ASoC: rockchip: multicodecs: add support property 'rockchip,wait-card-locked'
Some times, we would like to specify the order of
loading sound card, and can use this property to
wait other sound cards are locked. Therefore, this
sound card with the property should be slave card.

Change-Id: I3dcd77a527ad902a5a3c00bcce2c81cf6e782549
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-27 14:56:50 +08:00
Liang Chen
d6742a2bf1 cpufreq: rockchip: correct the offset of bin flag in efuse for rk3288w
Change-Id: I15154876e3b54d64b63c9659cfe2548d19ccb7a9
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-07-27 14:52:39 +08:00
Xing Zheng
533311c112 ASoC: rockchip: update properties for daifmt
Change-Id: Id10b0280c43f941f81afaa8b979903053975f7f9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-27 14:48:56 +08:00
Xing Zheng
97555c6a0a ASoC: rockchip: multicodecs: add support sound daifmt
This patch supports parse sound daifmt dynamically.

Change-Id: I63761499dd9e1c16a84a1aba8a04e6dff67a70cc
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-27 14:48:45 +08:00
Hu Kejun
6bd928b249 media: rk-isp10: update to v0.2.0
Change-Id: I81dbc96a5464a266fbb5adc753a18f433fa58bc7
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-27 11:33:53 +08:00
Hu Kejun
bdf361007e media: rk-isp10: fix the issue cannot set exposure by mp path device
Change-Id: Id057859035356b52e9538df14b908ca631df836c
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-27 11:33:53 +08:00
Hu Kejun
6ac96e1bec media: rk-isp10: get correct isp out width/height
Change-Id: I7d5b9fae16c56ebe108673ba46faa10d9a962b10
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-27 11:33:53 +08:00
Hu Kejun
12a0f8c529 media: rk-isp10: support stream on/off/on/off...
Change-Id: Ia4683924cfdd5cdc3b15ff3cef1a78b36cb6420f
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-27 11:33:53 +08:00
Hu Kejun
018f73607d media: rk-isp10: add check of iommu status
Change-Id: I31057963bff7d51ef0c208b5cc24797f4384e59f
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-27 11:33:53 +08:00
huweiguo
69b01aa897 mac80211: add p2p interface
Change-Id: Id17f68b9ccae0e216dd1892a3a841c3fe2e03acd
Signed-off-by: Weiguo Hu <hwg@rock-chips.com>
2018-07-27 11:17:35 +08:00
Weiguo Hu
e654e0bd6a net: wireless: rockchip_wlan: ssv6051 solve parser-conf.sh permission problem
Change-Id: I57853c091246cc7664568b79f6efb807d076e48c
Signed-off-by: Weiguo Hu <hwg@rock-chips.com>
2018-07-27 11:09:24 +08:00
Xing Zheng
48cd822978 ARM: dts: rockchip: rk3308-voice-module: enable 200ms delay play property
Due to the PA CS8509 on rk3308 voice module startup time
is ~200ms, we need to hold it some times, avoid lossing
audio data during start playback.

Change-Id: I44ac3caa0ceddbe7720d8eb63179ae56baa168a9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-26 18:48:52 +08:00
Xing Zheng
5693bc3e7e ASoC: rk3308_codec: add 'rockchip,delay-start-play-ms' property
Change-Id: I7e2c6737899bb44ccf453a68ae5ca20335d513b1
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-26 18:48:52 +08:00
Xing Zheng
4f4d129d68 ASoC: rk3308_codec: add support 'rockchip,delay-start-play-ms' property
It may be that many amplifiers have a long startup delay.
If the playback is too early before the amplifier is
turned on and stable, it may cause loss of audio data.
Therefore, we need to delay playback according to
different amplifier performance.

Change-Id: I7d54f89217df560a68c080e82313eb2399d44b0a
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-07-26 18:48:52 +08:00
Jianqun Xu
d6f0e7b388 ARM64: rockchip: rk3399 reorder codes in rk3399-cdn-dp
Sync with upstream codes.

Change-Id: Ic5306bdf16125e46892b5a85339afec67ad85482
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-07-26 18:41:37 +08:00
Jianqun Xu
6bc17c0755 ARM64: dts: rockchip: rk3399 reorder nodes
Sync with upstream

Change-Id: I24aa7e127c21d1b4f2516a70b6d2c27339da0bbc
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-07-26 15:44:39 +08:00
Tao Huang
2fc8501e44 Revert "ARM: dma-mapping: silence warning if atomic_pool_size=0"
This reverts commit 234d421421.
We do not use coherent_pool=0 anymore.

Change-Id: I3b05f15955c8f4b156cf8a4dfd8c0977e33a24b9
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-07-26 15:25:04 +08:00
Tao Huang
d97bada31e ARM: rk3308_linux_aarch32[_debug]_defconfig: coherent_pool=4k
If coherent_pool size is zero, kernel will panic when arm_dma_free.
It seems kernel do not like without atomic_pool, so keep this pool
as small as possible.

Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = deb70000
[00000004] *pgd=1e571835, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP THUMB2
Modules linked in:
CPU: 2 PID: 674 Comm: sh Not tainted 4.4.138 #187
Hardware name: Generic DT based system
task: deb89540 task.stack: df37a000
PC is at addr_in_gen_pool+0x10/0x3c
LR is at addr_in_gen_pool+0xf/0x3c
pc : [<c0154b24>]    lr : [<c0154b23>]    psr: 00000033
sp : df37be80  ip : df37a07c  fp : 000686ec
r10: debc6f48  r9 : 1e406000  r8 : 00000000
r7 : e091d000  r6 : e091d000  r5 : e091efff  r4 : 00000000
r3 : 00000001  r2 : deb89540  r1 : e091d000  r0 : 00000000
[<c0154b24>] (addr_in_gen_pool) from [<c0064a55>] (arch_free_from_atomic_pool+0x19/0x54)
[<c0064a55>] (arch_free_from_atomic_pool) from [<c0064ae3>] (__arm_dma_free+0x53/0xb0)
[<c0064ae3>] (__arm_dma_free) from [<c0064b61>] (arm_dma_free+0xf/0x12)
[<c0064b61>] (arm_dma_free) from [<c017f1a7>] (serial8250_release_dma+0x71/0xd2)
[<c017f1a7>] (serial8250_release_dma) from [<c017dda1>] (serial8250_do_shutdown+0x23/0x98)
[<c017dda1>] (serial8250_do_shutdown) from [<c017ad6b>] (uart_shutdown+0x87/0xba)
[<c017ad6b>] (uart_shutdown) from [<c017b543>] (uart_close+0x8b/0x116)
[<c017b543>] (uart_close) from [<c0174539>] (tty_release+0x20d/0x318)
[<c0174539>] (tty_release) from [<c00db5af>] (__fput+0x8b/0x120)
[<c00db5af>] (__fput) from [<c007b83b>] (task_work_run+0x6b/0x7c)
[<c007b83b>] (task_work_run) from [<c005f551>] (do_work_pending+0x65/0x66)
[<c005f551>] (do_work_pending) from [<c005d301>] (slow_work_pending+0x9/0x18)

Change-Id: If3fc962e4e936132fee021f5e6932cdabfd5ffda
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-07-26 15:24:36 +08:00
Hu Kejun
cb6cdc8c7d media: rk-isp10: fix compile warning
Change-Id: Ie4c1c04d20d53528430dbde33920bbe340e2b926
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-26 14:23:03 +08:00
Brian Norris
300437d7dc UPSTREAM: arm64: dts: rockchip: Arch counter doesn't tick in system suspend
The "arm,no-tick-in-suspend" property was introduced to note
implementations where the system counter does not quite follow the ARM
specification that it "must be implemented in an always-on power
domain".

Particularly, RK3399's counter stops ticking when we switch from the
24MHz clock to the 32KHz clock in low-power suspend, so let's mark it as
such.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit e6186820a7)

Change-Id: Ib1d54426c985235ba0a383012a6e4437a9fae80c
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-07-26 14:17:16 +08:00
Masahiro Yamada
a2938f6042 UPSTREAM: arm64: dts: drop "arm,amba-bus" in favor of "simple-bus" part 2
Tree-wide replacement was done by commit 2ef7d5f342 (ARM, ARM64:
dts: drop "arm,amba-bus" in favor of "simple-bus"), but we have some
new users of "arm,amba-bus" at Linux 4.7-rc1.  Eliminate them now.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Chanho Min <chanho.min@lge.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
(cherry picked from commit 15b7cc78f0)

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Conflicts:
	arch/arm64/boot/dts/lg/lg1312.dtsi

Change-Id: I249c73ade56946fa0548b9f36889abaa7e77d3df
2018-07-26 14:11:15 +08:00
huweiguo
ad56b4cbe8 arm: dts: rk3128h-box: add ssv6051 wifi
Change-Id: Ice915d2ad532eead129627a410f23ea2f0f290be
Signed-off-by: huweiguo <hwg@rock-chips.com>
2018-07-26 11:27:42 +08:00
huweiguo
101d35e3f6 arm: rockchip_defconfig: add ssv6051
Change-Id: I1746973993b4c8980036e305fcdada1afefe4ddb
Signed-off-by: huweiguo <hwg@rock-chips.com>
2018-07-26 11:27:42 +08:00
Jianqun Xu
b99697297f ARM64: dts: rockchip: rk3399 sync codes with upstream
Change-Id: Idcefe76d4b823593a7f316e0e24d740ead46c7a0
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-07-26 11:03:07 +08:00
Jianqun Xu
639880b498 ARM64: dts: rockchip: rk3399 efuse node sync with upstream
Modify "efuse_id" to "cpu_id"

Change-Id: Iac229325d611c2db86b075eb47d6fe84dbbc0020
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-07-26 09:39:57 +08:00
Caesar Wang
bda0252702 UPSTREAM: arm64: dts: rockchip: update dynamic-power-coefficient for rk3399
This patch updates the dynamic-power-coefficient for big cluster on
rk3399 SoCs.

The dynamic power consumption of the CPU is proportional to the square of
the Voltage (V) and the clock frequency (f). The coefficient is used to
calculate the dynamic power as below -
Pdyn = dynamic-power-coefficient * V^2 * f
Where Voltage is in uV, frequency is in MHz.

As the following is the tested data on rk3399's big cluster.
frequency(MHz)  Voltage(V)  Current(mA) Dynamic-power-coefficient
24              0.8         15
48              0.8         23          ~417
96              0.8         40          ~443
216             0.8         82          ~438
312             0.8         115         ~430
408             0.8         150         ~455
So the dynamic-power-coefficient average value is about 436.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Conflicts:
	arch/arm64/boot/dts/rockchip/rk3399.dtsi

Change-Id: I05a573eb7e0a74301f35fdeb2517f7fe3be9b8fb
2018-07-26 09:36:00 +08:00
Brian Norris
efaa77053d UPSTREAM: arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
Provide the dynamic power coefficient of the big and little CPU
clusters. These numbers are currently in use on the Samsung Chromebook
Plus ("Kevin").

The power allocator thermal governor doesn't know how to do anything if
it doesn't get power parameters from its cooling devices (in this case,
CPUfreq). So this effectively enables the power-allocator governor.

Signed-off-by: Brian Norris <briannorris@chromium.org>
[set the property in each core node]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(Cherry-picked from f4697bd702)

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>

Conflicts:
	arch/arm64/boot/dts/rockchip/rk3399.dtsi

Change-Id: I8899a2224fe6cbf6e6f874006bf115eee62b7041
2018-07-26 09:36:00 +08:00
Jianqun Xu
dc368751a3 ARM64: dts: rockchip: reorder some codes
Patch reorder some codes to sync with upstream codes

Change-Id: Iba1971dcee9b5cfb25b62e8bfa2135f0576398e9
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2018-07-26 09:34:26 +08:00
Heiko Stuebner
00ef2e68af UPSTREAM: clk: rockchip: convert manually created factor clocks to the new type
Clean up the init code and move the creation of factor clocks to the
appropriate positions coming from the clock architecture diagrams.

This also unifies the artificial separation of the hclk_vcodec etc clocks
again.

We do keep the separate definition of some watchdog and usb480m pseudo
clocks for now, as they're not real factor clocks from the clock-tree
but placeholders for fixes to come (usb480m gets supplied by the
missing driver for the new usbphy type and the watchdog-gate is sitting
somewhere else together which we cannot model currently).

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 36714529f8)

Change-Id: I43b579b4d0b16b191e220a1748b6d11c7a30b4be
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-26 09:33:50 +08:00
Hu Kejun
c59e589ac4 media: soc_camera: add "rockchip,pwr-2nd-gpio"/"rockchip,pwr-3rd-gpio"
Change-Id: I742f85643f6c324b0ef1a9f55b15f73787eaaa1d
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-26 09:20:52 +08:00
Shawn Lin
2bcfc1b1f4 UPSTREAM: clk: rockchip: don't return NULL when failing to register ddrclk branch
rockchip_clk_register_ddrclk should not return NULL when failing
to call clk_register, otherwise rockchip_clk_register_branches
prints "unknown clock type". The actual case is that it's a known
clock type but we fail to register it, which may makes user confuse
the reason of failure. And the pr_err here is pointless as
rockchip_clk_register_branches will also print the similar message.

Change-Id: Id09f496979ab839d04b5ec4cf5c623fde9215440
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 4a262b14c5)
2018-07-25 18:23:57 +08:00
huweiguo
22099e51c7 net: wireless: rockchip_wlan: support ssv6051 wifi
Change-Id: I936a05f2c2b6b29298f1a1eb945ec3a2fedc5262
Signed-off-by: huweiguo <hwg@rock-chips.com>
2018-07-25 18:17:45 +08:00
Cai YiWei
f03f0892aa ARM64: config: enable cif and gc2155 for rk3326_linux_defconfig
Change-Id: I2d09fd1025bfbe9dec93e25598d3dd38f07748a5
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2018-07-25 16:16:13 +08:00
Cai YiWei
b2def18653 ARM64: dts: rockchip: add cif and gc2155 for rk3326-evb-lp3-v10-linux
Change-Id: I96aa0405ea7c0a71587d14306c5c23d594ec42f3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2018-07-25 16:16:13 +08:00
Cai YiWei
ed6f3f2568 media: rockchip/cif: match px30 and modif resets
Change-Id: Ic8e6899064a6b19f23542af128d20f89d319a5f6
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2018-07-25 16:16:13 +08:00
Hu Kejun
9e93e6ba45 camera: rockchip: merge modification of rv1108 isp11
camera: rockchip: add sensor ioctl and max gain.
1. add RK_VIDIOC_SENSOR_CONFIGINFO;
2. add RK_VIDIOC_SENSOR_REG_ACCESS;
3. add max_exp_gain_h/max_exp_gain_l;

camera: rockchip: merge isp11: rockchip: v0.1.7
isp11: rockchip: v0.1.7
1. Direct config isp lsc table size in cifisp_lsc_config.
   Because active_lsc_width is not same with isp register
   after isp reset.
2. Support separate config sensor gain and shutter time
   for some sensor which gain and shutter isn't valid at
   the same time. for example ov2710.
   ov4689:v0.1.0;
   ov2710:v0.1.1;
   imx323:v0.1.0;

camera: rockchip: Support v4l2 subdev api
ov2710: v0.1.2
ov4689: v0.1.1
imx323: v0.1.2

camera: rockchip: add lock for stream/aec
hold reg in AEC will affect stream reg, if asynchronous.

camera: rockchip: fix sensor timing
if fps changed, vts changed, update to timing.

camera: rockchip: support set flip api

camera: rockchip: support get flip api

camera: rockchip: fix release bug
should be free pdata at the end

camera: rockchip: imx323
fix s_fmt failed for imx323 v0.1.2;

camera: rockchip: fix s_frame_interval failed

fix s_frame_interval failed when frame interval is match
active config frame interval.

camera: rockchip: imx,aptina,ov
Check xxx_camera_module_init return value in PLTFRM_CIFCAM_ATTACH

camera: rockchip: release sensor if init fail

camera: rockchip: imx,aptina,ov
support mirror/flip conifg in dts for imx323/ov4689

camera: rockchip: add s_frame_interval/g_frame_interval
camera: rockchip: ov, aptina, imx
add s_frame_interval/g_frame_interval

camera: rockchip: imx,ov,aptina
1.imx,ov: fix g_timing error if s_frame_interval before stream_on,
  because vts_cur is update in stream_on;
2.aptina: fix compile error;

camera: rockchip: imx,ov,aptina
1. fix calc vts wrong in xxx_camera_module_s_stream

Change-Id: I5a6e75f2ce3c50d69c51af9792232c60b6982128
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-25 14:52:52 +08:00
Hu Kejun
6ffc8e398a media: rk-isp10: update to v0.1.f
fix MI_CTRL and MI_XTD_FORMAT_CTRL register is not correct
merge isp11: rockchip: v0.2.4 and isp11: rockchip: v0.2.5
merge isp11: Support Y8 for AEC
merge isp11: rockchip: v0.2.7
merge isp11: rockchip: v0.2.9 & v0.2.8
merge isp11: print version
merge isp11: rockchip: v0.2.b
merge isp11: rockchip: v0.2.c
merge isp11: rockchip: v0.3.2
merge isp11: rockchip: v0.3.4
merge isp11: rockchip: modify for debugfs
merge isp11: rockchip: v0.1.7
merge isp11: rockchip: v0.1.8
merge isp11: rockchip: v0.1.9
merge isp11: rockchip: v0.1.d
merge isp11: send afm meas data alone

Change-Id: I00c9181849addf5dd44c0deea2bb39ac02ff999d
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-07-25 14:52:52 +08:00
Eddie Cai
244bf7dea0 UPSTREAM: clk: rockchip: add ids for rk3399 testclks used for camera handling
clk_testout1 and clk_testout2 are used for camera handling, so add their ids.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 25fb42b1cf)

Change-Id: I8000e84264b032835cc3d11a6810264967f4248e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:46:43 +08:00
Eddie Cai
109d953e7c UPSTREAM: clk: rockchip: add ids for camera on rk3399
we use SCLK_TESTCLKOUT1 and SCLK_TESTCLKOUT2 for camera, so add those ids.

Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit f22e4359cd)

Change-Id: Ibbdb8e9dabd8c955ef3745c0f49c20f4c763e870
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:46:35 +08:00
Chris Zhong
7738401fb0 UPSTREAM: clk: rockchip: fix rk3399 aclk_vio gate bit
Fix incorrect rk3399 aclk_vio gating bit, it should be 0, not 10.

Fixes: 115510053e ("clk: rockchip: add clock controller for the RK3399")
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Xing Zheng <zhengxing@rock-chips.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit a3f457d963)

Change-Id: I6e962f61a7f918e7945ac93dca6a039e90a0df3c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:46:09 +08:00
Yakir Yang
5e64ddee62 UPSTREAM: clk: rockchip: use the dclk_vop_frac clock ids on rk3399
Export the dclk_vop_frac out, so we can set the dclk_vop as the
child of dclk_vop_frac, and then we can start to take use of
the fractional dividers.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 7b0f9e357a)

Change-Id: I08686f8ecbcfb5de7bc99aadd314f6e35ac22995
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Yakir Yang
c39ba9451b UPSTREAM: clk: rockchip: add dclk_vop_frac ids for rk3399 vop
Export the dclk_vop_frac out, so we can set the dclk_vop as the
child of dclk_vop_frac, and then we can start to take use of
the fractional dividers.

Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit e33075db73)

Change-Id: I3d47c6aecc338de45b48414f0d0327c17e6d2b15
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Douglas Anderson
8bef41f00c UPSTREAM: clk: rockchip: drop CLK_SET_RATE_PARENT from rk3399 fractional dividers
Currently the fractional divider clock time can't handle the
CLK_SET_RATE_PARENT flag. This is because, unlike normal dividers,
there is no clk_divider_bestdiv() function to try speeding up the parent
to see if it helps things.

Eventually someone could try to figure out how to make fractional
dividers able to use CLK_SET_RATE_PARENT, but until they do let's not
confuse the common clock framework (and anyone using it) by setting the
flag.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 29edeccb44)

Change-Id: Ic7fa067ed80767c937dd9c8506d2d1e86ee1c93a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Xing Zheng
49d2f9f2a7 UPSTREAM: clk: rockchip: add 533.25MHz to rk3399 clock rates table
We need to get the accurate 533.25MHz for the DP display.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 5c1c63f634)

Change-Id: Ib945c80451d52081683488fe410c5200622fb1c3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Xing Zheng
25c7cb783d UPSTREAM: clk: rockchip: optimize 800MHz and 1GHz pll rates on RK3399
Usually, the 800MHz and 1GHz are supplied for CPLL and NPLL in the RK3399.
But dues to the carelessly copying from RK3036 when the RK3399 bringing up,
the refdiv == 6, it will increase the lock time, and it is not an optimal
configuration.

Let's fix them for the lock time and jitter are lower:
800 MHz:
- FVCO == 2.4 GHz, revdiv == 1.
1 GHz:
- FVCO == 3 GHz, revdiv == 1.

Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 1dfbec3905)

Change-Id: I725e8cb542afa7caf7cbb5ff6f747f65d48c5ced
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Xing Zheng
913ae6b724 UPSTREAM: clk: rockchip: fix the incorrect pclk_edp div width for RK3399
The range of the  pclk_edp_div_con is [13:8] and 6 bits, not 5.

Reported-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Tested-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 3e1531dbc3)

Change-Id: Ieffcad3f6d44c71d83b7ed00dd30a4bd45995bb2
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:59 +08:00
Douglas Anderson
dee1e02869 UPSTREAM: clk: rockchip: Set "ignore unused" for PMU M0 clocks on rk3399
The PMU Cortex M0 on rk3399 is intended to be used for things like
DDRFreq transitions, suspend/resume, and other things that are the
purview of ARM Trusted Firmware and not the kernel.  As such, the
kernel shouldn't be messing with the clocks.  Add CLK_IGNORE_UNUSED to
these clocks.

Without this change, the following was observed on a Chromebook with a
rk3399 (using not-yet-upstream ARM Trusted Firmware code and
not-yet-upstream kernel code based on kernel-4.4):

1. We init the clock framework.

2. We start up "DDRFreq", which causes ATF to occasionally fire up the
   M0 for transitions.  Each time ATF fires up the M0 it will turn on
   these clocks and each time it is done it will turn them off.

3. We finally get to the the part of the kernel that calls
   clk_disable_unused() and we disables the clocks.

You can see the race above.  Basically everything is fine as long as
ARM Trusted Firmware isn't starting up the M0 at exactly the same time
that the kernel is disabling unused clocks.  ...but if the race
happens then we go boom.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 60aadea57e)

Change-Id: I2a78c74edc9bc5d5b4f26224ebdb34eb83afb022
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-07-25 14:43:24 +08:00