Commit Graph

2978 Commits

Author SHA1 Message Date
Shawn Lin
865523b715 BACKPORT: FROMLIST: clk: rockchip: Restore the clock phase after the rate was changed
There are many factors affecting the clock phase, including clock
rate, temperature, logic voltage and silicon process, etc. But clock
rate is the most significant one here, and the driver should be aware
of the change of the clock rate. As mmc controller need a fixed phase
after tuning was completed, at least before explicitly doing re-tune,
so this patch try to restore the clock phase by monitoring the event
of rate change.

Change-Id: Id1ccdfd2e8d4e2eb9f6a1923b3813138dbaf99f7
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10269525/)
2018-03-15 11:31:58 +08:00
Finley Xiao
0e7eba3141 clk: rockchip: rk3308: Rename gmac to mac
Change-Id: I31e9fddcffde824c2b41bd3eddccf3a995cfb913
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-14 14:42:20 +08:00
Finley Xiao
ec51d82bdc clk: rockchip: rk3308: Add CLK_IGNORE_UNUSED for clocks with div50
Change-Id: I3b01a93741af7e66f57b5c93c33746d8cbe21bfe
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-14 14:05:04 +08:00
Tao Huang
5b30e653ca clk: rockchip: build depends on CPU config
Change-Id: Ia35e7bba3eb7bd37f8f291d7501681a6ccea421f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-03-13 18:38:21 +08:00
Finley Xiao
d65b1d2ec8 clk: rockchip: rk3308: Add dmac clocks
Change-Id: I63e30bb23f6bc61f1dcc189e3bc43a6f1bb57f3f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-13 13:56:09 +08:00
Finley Xiao
e0b38fccd1 clk: rockchip: Fix armclk parent error
There are two clocks between armclk and pll_apll on px30,
but there may be only one clock on some Socs, so it will
get a error pll clock.

Change-Id: I34116a1ec824b884d3745082f3546cd9ab4c0d21
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-09 16:47:58 +08:00
Shawn Lin
c420c1e4db FROMLIST: clk: rockchip: Prevent calculating mmc phase if clock rate is zero
The MMC sample and drv clock for rockchip platforms are derived from
the bus clock output to the MMC/SDIO card. So it should never happens
that the clk rate is zero given it should inherits the clock rate from
its parent. If something goes wrong and makes the clock rate to be zero,
the calculation would be wrong but may still make the mmc tuning process
work luckily. However it makes people harder to debug when the following
data transfer is unstable.

Change-Id: Ifeb4c063cb73e0a444fd8819ef3128256331cd7a
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from https://patchwork.kernel.org/patch/10258071/)
2018-03-09 14:07:09 +08:00
Liang Chen
2e0c97d607 clk: rockchip: px30: add more setting of cpu-clk
Change-Id: Ie3f22964f16a636c33c5b215afb6ac8ddd653918
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-08 14:42:26 +08:00
Finley Xiao
158114da5c clk: rockchip: px30: Make pll_npll critical
Change-Id: I14c44b2a467c58f2285afe6219add2c51e1c66eb
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-07 16:49:18 +08:00
Finley Xiao
8e7a8732e3 clk: rockchip: px30: Make hclk_usb_niu critical
Change-Id: Id54f2d3fe123faf92a323a78390e4d0d84c15d6c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-07 15:45:57 +08:00
Finley Xiao
539fd81fc6 clk: rockchip: Add clock controller for the RK3308
Add the clock tree definition for the new RK3308 SoC.

Change-Id: I1c0794b290207d28102e8d30cca13bbbf54ccfb8
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-06 18:17:49 +08:00
Finley Xiao
9d6d0e8f7e clk: rockchip: px30: Add clock id and CLK_SET_RATE_NO_REPARENT for uart1
Change-Id: I1115c5cdeca962b3281297eec0c1d56a1fa7d023
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-05 14:54:02 +08:00
Finley Xiao
1a36349dcc clk: rockchip: px30: leave cpll for VOP only
We will need a pll to support all kinds of clock rate requirement
for display. In order not to affect other clocks, remove the cpll
from the parent list of other clocks and only DCLK_VOP can select
cpll as parent.

Change-Id: I69e5e3ca1af66eba5b4cc92b792077ec64f67054
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-28 11:06:44 +08:00
Finley Xiao
e9c977b797 clk: rockchip: px30: Remove div50 clk
Change-Id: I86bffd8706b501c1f156d52392c445a0dad1e06f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-28 11:06:44 +08:00
Finley Xiao
4951fda4dc clk: rockchip: px30: Remove clk_uartx_np5
Change-Id: I03bfebe4a85c55c93b0bd91c6d1f1b2334fee74f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-28 11:06:44 +08:00
Finley Xiao
882c5c7dc7 clk: rockchip: px30: Add support to set parent rate for vopb dclk
Change-Id: I3160abc500be473c6cf4893bd26fd22b3ec95a85
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-26 17:08:53 +08:00
Shawn Lin
a123f47b6c clk: rockchip: px30: correct the parent of sdmmc/sdio/emmc sample and drv clks
Phase calculation should be based on the clock rate of these clk,
which inherits the clock rate from their parents. If the parent
goes wrong, it would be orphan node leading all the clk rate to
be zero. This breaks the normal tuning process whilist probing
the card. Fix them!

Change-Id: I7b64748e90684f8ca9710b63f10205d50d24f6d0
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2018-02-25 19:47:51 +08:00
Liang Chen
810497ff78 clk: rockchip: Add adaptive frequency scaling for pll_rk3036
Change-Id: Ifd035967afc1852df81daa2b15afea764c5b851d
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-25 19:28:56 +08:00
Finley Xiao
9775a70bc8 clk: rockchip: px30 Add CLK_SET_RATE_NO_REPARENT for clk_sdmmc
Change-Id: Id97acec017f2fb2e1363733200a683b1a3ad9dac
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-25 19:15:47 +08:00
Finley Xiao
0d5b78c345 clk: rockchip: px30: Fix dclk_vopl_src parent
Change-Id: I24304460ae29ecc203ba8bef57ada4926947a1ea
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-24 15:10:40 +08:00
Finley Xiao
14aba8d378 clk: rockchip: Fix cpu frequency overflowing
If change parent to alternate parent and the old parent clock speed is less
than the clock speed of the alternate parent, add dividers first and then
select alternate parent.

If change parent to primary parent, select primary parent first and then
remove dividers.

Change-Id: Ib82de9a936effe5c885639799f3bb5629dc89f8d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-22 15:30:40 +08:00
Finley Xiao
73403cf5b2 clk: rockchip: px30: fix gpll enable_cnt and prepare_cnt error
The gpll clock has not yet been created when its children do enable and
prepare in cru critical talbe, so move its children into pmucru critical
talbe that the gpll clock has been created before its children do enable
and prepare.

Change-Id: If5243326bf1d3c926bb1bb12e56e4b9fc9282762
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-22 10:57:17 +08:00
Finley Xiao
fda77d7005 clk: rockchip: px30: Add clock id for aclk_bus_src and aclk_peri_src
Change-Id: I3467b4f799a6f5402eed3d20e4bd2c02ae30c92f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-22 10:55:21 +08:00
Finley Xiao
0813f9a09a arm64: dts: rockchip: px30: Change clock id for gpu
Change-Id: I04ccacc3f60c7a1e4b0fa854680564963ec110fd
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-13 17:34:58 +08:00
Finley Xiao
dd6270d4da clk: rockchip: px30: Fix gpu frequency overflowing
It needs to contains rate and mux clk for gpu composite clk, so that
the clk_composite_set_rate_and_parent function can be called.

Change-Id: I9818df2adbbcf40f616d2ca230cd83ea1ef2c14f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-13 17:34:57 +08:00
Finley Xiao
093bfc848c clk: rockchip: rk3328: Fix clk_cif_src parent
Change-Id: I0ea209224880b8c51a385ed46827bb0d8f7dd219
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-11 19:15:16 +08:00
Finley Xiao
0cb664eb76 clk: rockchip: px30: Remove clk_gpu_divnp5
Change-Id: I67f47f5fdd7873c22b1349e3aeb80b7157c7844c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-11 19:12:19 +08:00
Finley Xiao
f457f16cd2 clk: rockchip: px30: Fix clk_gmac_rmii_sel parent
Change-Id: Idf1bd416a3879048afd3763d4a6d056c34171bbb
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-11 19:10:15 +08:00
Finley Xiao
aed92d3f61 clk: rockchip: px30: Fix clk_i2s0_rx parent
Change-Id: Ia523234cf5b210bbfe51cbf075943e7f44123ca9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-11 12:08:25 +08:00
Finley Xiao
884b0673a7 clk: rockchip: rk3288: Add TSP clock
Change-Id: I02185c5ab7a1072d271cd51161f6d4b05d327673
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-10 09:04:17 +08:00
Finley Xiao
a250f09aff clk: rockchip: rk3128: Add sclk_hsadc_tsp
Change-Id: I842869a7ea79730daa6616f1cf2a8f5db7165ceb
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-10 09:04:17 +08:00
Finley Xiao
ea8b9e13c2 clk: rockchip: rk3328: Fix aclk_gmac select register
Change-Id: Ie800d876644f1a7abac3f7d7f8352ba405a9537a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-09 11:09:56 +08:00
YouMin Chen
326d6f59d1 clk: rockchip: px30: Add SCLK_DDRCLK for dmc
Change-Id: I03d6c18829f8895c28bbaef883e187304c48f9aa
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-02-08 14:52:26 +08:00
Finley Xiao
8ee4287ff7 clk: rockchip: px30: Make pclk_top_pre critical
Change-Id: I86081f6dbd85ab36e0e83b5b22fdd7b686a2cf9d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-08 14:10:58 +08:00
Liang Chen
adbf52abda clk: rockchip: rk3228: add clk_ddrc for devfreq of ddr
Change-Id: I3771e2ef68ab3fa8ad1b7d61a84c7181c693c60f
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-08 09:35:17 +08:00
Finley Xiao
f6128506aa clk: rockchip: px30: Fix i2s out mclk
Change-Id: I1f90747c780c867e172168e8c877915477a66e59
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-07 19:47:28 +08:00
Liang Chen
f283252018 clk: rockchip: px30: make clk_gpu_divnp5 critical
If disable clk_gpu_divnp5, we will get error below:

[    3.699114] rockchip-pm-domain ff000000.power-management:power-controller: failed to get ack on domain
 'pd_gpu', val=0x43c443c4
[    3.700579] W : [File] : drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c; [Line] : 134; [Fu
nc] : kbase_platform_rk_init(); power-off-delay-ms not available.
[    3.700880] Unhandled fault: synchronous external abort (0x96000010) at 0xffffff8009620000
[    3.700897] Internal error: : 96000010 [#1] PREEMPT SMP
[    3.703090] Modules linked in: bifrost_kbase(+)
[    3.703524] CPU: 0 PID: 1 Comm: init Not tainted 4.4.112 #578
[    3.704034] Hardware name: Rockchip rk3326 evb board (DT)
[    3.704515] task: ffffffc00a308000 task.stack: ffffffc00a310000
[    3.705362] PC is at kbase_reg_read+0xd0/0x1c8 [bifrost_kbase]
[    3.706173] LR is at kbase_backend_gpuprops_get+0x24/0x20c [bifrost_kbase]

Change-Id: I481cdaa60b5174ae6763e11fb42f79ed9208c120
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-02-07 15:33:17 +08:00
Xinhuang Li
1cfda2f55e clk: rockchip: rk3228: Add clock id for pclk_acodecphy
Change-Id: I289f2c2681e187eaed0cda1561544581409ffd07
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-07 12:03:35 +08:00
Finley Xiao
263f468566 clk: rockchip: px30: Add clk_ddrmon_timer
Change-Id: I41cd72bb89b06e7239582f35a1e5455745b764d9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-06 11:44:20 +08:00
Finley Xiao
36726233ea clk: rockchip: px30: Fix some clock div_width
Fix uart, tsadc and saradc div_width.
Fix saradc clksel_con.

Change-Id: Iafc4e4436e7d273a1cfc80d1d8ada3fce8239912
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-06 11:44:05 +08:00
Finley Xiao
2a37a264e9 clk: rockchip: px30: Fix softrst register number
Change-Id: Ieefc9cedb56fbe7dc6810135e87592c6f65b7124
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-06 10:58:33 +08:00
tony.xie
4a56c8edc7 mfd: RK817 & RK809: Add new mfd driver for RK817 & RK809
The RK817 & RK809 chip is a power management IC for multimedia and handheld
devices. It contains the following components:

- Regulators
- RTC
- Clkout
- Pinctrl
- Powerkey

The RK817 & RK809 core driver is registered as a platform driver and provides
communication through I2C with the host device for the different
components.

The following is the different between the RK817 and the RK809.
1、The dcdc-buck5 is a boost dcdc for RK817 and is a buck for RK809.
2、The RK817 have one switch but The Rk809 have two.
3、The RK817 have a charger and powerpatch function but RK809 not.

Change-Id: I132029c5b28978db7ae06e13c327a1edf70f5b69
Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
2018-02-05 16:18:20 +08:00
Finley Xiao
a198c95b94 clk: rockchip: rk3228: Fix armclk parent
Change-Id: I09830d96b37cca600f1782b9013b25e043467f97
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-05 10:05:24 +08:00
Finley Xiao
6cd300f795 clk: rockchip: rk3128: Fix aclk_peri_src parent
Change-Id: Id679e7235f78635233dc4d6bd59c75ce05dfc99e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-02 19:09:29 +08:00
Finley Xiao
588ae5977e clk: rockchip: Adjust the order of cpu boost
Change-Id: I5fe78b451f9afaff276aeb251d68daf780c1eecf
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-02 18:36:40 +08:00
Finley Xiao
fe53e62332 clk: rockchip: px30: Fix boost mask
Change-Id: I507efe5bf432556a9e603275f03c81a5a8ef96ed
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-02 18:33:59 +08:00
Finley Xiao
f1ae3d9c5a clk: rockchip: px30: Fix wait boost recovery idle
Change-Id: If407926c5fedd1e91b1223a3926f3bb98f4cb17c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-02 18:33:36 +08:00
Finley Xiao
b503ff5697 clk: rockchip: rk3368: Add clock id for tsp
Change-Id: I79a423f93f991aab43922e58ce34eac1754304e2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-02 09:46:34 +08:00
Finley Xiao
401c07e068 clk: rockchip: px30: Fix div_core_mask
Change-Id: I985d27841de00ec7e6f9ca3454c0c4c4f8debacb
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-01-31 16:05:50 +08:00
Tao Huang
640193f76b Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (733 commits)
  LSK-ANDROID: memcg: Remove wrong ->attach callback
  LSK-ANDROID: arm64: mm: Fix __create_pgd_mapping() call
  ANDROID: sdcardfs: Move default_normal to superblock
  blkdev: Refactoring block io latency histogram codes
  FROMLIST: arm64: kpti: Fix the interaction between ASID switching and software PAN
  FROMLIST: arm64: Move post_ttbr_update_workaround to C code
  FROMLIST: arm64: mm: Rename post_ttbr0_update_workaround
  sched: EAS: Initialize push_task as NULL to avoid direct reference on out_unlock path
  fscrypt: updates on 4.15-rc4
  ANDROID: uid_sys_stats: fix the comment
  BACKPORT: tee: indicate privileged dev in gen_caps
  BACKPORT: tee: optee: sync with new naming of interrupts
  BACKPORT: tee: tee_shm: Constify dma_buf_ops structures.
  BACKPORT: tee: optee: interruptible RPC sleep
  BACKPORT: tee: optee: add const to tee_driver_ops and tee_desc structures
  BACKPORT: tee.txt: standardize document format
  BACKPORT: tee: add forward declaration for struct device
  BACKPORT: tee: optee: fix uninitialized symbol 'parg'
  BACKPORT: tee: add ARM_SMCCC dependency
  BACKPORT: selinux: nlmsgtab: add SOCK_DESTROY to the netlink mapping tables
  ...

Conflicts:
	arch/arm64/kernel/vdso.c
	drivers/usb/host/xhci-plat.c
	include/drm/drmP.h
	include/linux/kasan.h
	kernel/time/timekeeping.c
	mm/kasan/kasan.c
	security/selinux/nlmsgtab.c

Also add this commit:
0bcdc0987c ("time: Fix ktime_get_raw() incorrect base accumulation")
2018-01-26 19:26:47 +08:00