Commit Graph

593883 Commits

Author SHA1 Message Date
Shawn Lin
1deaaa33b1 Revert "clk: rockchip: reset init state before mmc card initialization"
This reverts commit 7a03fe6f48.

We need a new patch for dw_mmc to deal with phase policy in case of
new register layout, otherwise it will break phase stuff for some
case

Change-Id: Iffb7a6dbe0b17d27c2cca4b2b99ddbc4e0736f18
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-05-13 10:45:43 +08:00
Shawn Lin
cb8fedfd82 ARM64: dts: rockchip: add ctrl-base for rk3399
Add ctrl-base for rk3399 to make emmc-phy work.

Change-Id: Iffb7a6dbe0b17d27c2cca4b2b99ddbc4e0736f15
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-05-13 10:41:59 +08:00
Shawn Lin
f3a4365038 phy: rockchip-emmc: enable ctrl-base before waiting pll
Need to control phy's digital block before enabling pll and
waiting for it into locked state.

Change-Id: I04037f5496fd5c1ef4e24853eb32b43ce326ff01
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-05-13 10:39:40 +08:00
Shawn Lin
12119b8fdd Documentation: rockchip-emmc-phy: add ctrl-base support
This patch adds ctrl-base which points to the digital block
to setup phy pll enabling.

Change-Id: I922dd7574229fda6b2ee51ca6ed1d7852ef87d30
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-05-13 10:38:00 +08:00
Shawn Lin
4583509b45 HACK: mmc: core: disable sending status when switching to hs from hs200
To slove the issue found on evb2 for hs400

[    1.526008] sdhci: Secure Digital Host Controller Interface driver
[    1.526558] sdhci: Copyright(c) Pierre Ossman
[    1.527899] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.529967] sdhci-arasan fe330000.sdhci: No vmmc regulator found
[    1.530501] sdhci-arasan fe330000.sdhci: No vqmmc regulator found
[    1.568710] mmc0: SDHCI controller on fe330000.sdhci [fe330000.sdhci]
using ADMA
[    1.627552] mmc0: switch to high-speed from hs200 failed, err:-84
[    1.628108] mmc0: error -84 whilst initialising MMC card

[PATCH reviewing: https://patchwork.kernel.org/patch/9010851/]

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I7641a3c095bb893a56f18fa3faa88ca179f3dae3
2016-05-13 10:36:03 +08:00
Javi Merino
8985e0cc58 UPSTREAM: thermal: power_allocator: req_range multiplication should be a 64 bit type
req_range is declared as a u64 to cope with overflows in the
multiplication of two u32.  As both req_power and power_range are u32,
we need to make sure the multiplication is done with u64 types.

Change-Id: I1aea92f12e48338be2681a9b2ba84756b6cc8cf8
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
(cherry picked from commit f9d038144a)
2016-05-13 10:34:42 +08:00
Leo Yan
33d117f2af UPSTREAM: thermal: use %d to print S32 parameters
Power allocator's parameters are S32 type, so use %d to print them.

Change-Id: Iae45ef17e4375320a0f4b2fdeab034ae76763ff6
Acked-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
(cherry picked from commit 15333e3af1)
2016-05-13 10:33:16 +08:00
Wei Ni
acb72fede6 UPSTREAM: thermal: consistently use int for trip temp
The commit 17e8351a77 consistently use int for temperature,
however it missed a few in trip temperature and thermal_core.

In current codes, the trip->temperature used "unsigned long"
and zone->temperature used"int", if the temperature is negative
value, it will get wrong result when compare temperature with
trip temperature.

This patch can fix it.

Change-Id: I4b31f577a6142bc02f8e0deae79ab2ff7c8bd978
Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
(cherry picked from commit 1d0fd42fa3)
2016-05-13 10:10:21 +08:00
Punit Agrawal
a772af0b70 UPSTREAM: devicetree: bindings: Add optional dynamic-power-coefficient property
The dynamic power consumption of a device is proportional to the
square of voltage (V) and the clock frequency (f). It can be expressed as

Pdyn = dynamic-power-coefficient * V^2 * f.

The coefficient represents the running time dynamic power consumption in
units of mw/MHz/uVolt^2 and can be used in the above formula to
calculate the dynamic power in mW.

Change-Id: Ib208ff2f83ee45911e846f940952d765ae8c974e
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
(cherry picked from commit 3be3f8f36e)
2016-05-13 10:01:52 +08:00
xiaoyao
89ef579454 ARM64: dts: rk3399-evb: add sd3.0 support
Change-Id: I4a7c440a6ca8026b7aed5aa26b9ef2624cc7afd0
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2016-05-12 16:07:31 +08:00
Huang Jiachai
e9eb853bd0 video: rockchip: fb: add DUAL_LCD mode
this mode is used for the case just like two LCD output and display
kernel logo when power on.

Change-Id: I188b95bc638a66338de3401fd7b9eec049d7071a
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-05-11 11:08:02 +08:00
Huang Jiachai
b1062bcc26 video: rockchip: fb: don't set vop win state when switch screen
because hwc will open fb0 to fb5, so the logic state is enable,
this will lead to iommu page fault when switch screen.

Change-Id: I8bc34887a62338049d1d526e37a2595122265046
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-05-11 11:04:58 +08:00
Xing Zheng
92cfd751b4 clk: rockchip: rk3399: To prevent the dclk_vopx below the FRAC clock
In most case, we use the VPLL directly for HDMI or DP, and the
the frac dclk will bring the big jitter for dclk. So we don't need
to use the dclk_vopx_frac.

Change-Id: I0d27e5fcb8b4c9a28c0102074c1d6da9426386f4
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-05-10 19:13:12 +08:00
Heiko Stuebner
bdba697e30 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>
2016-05-10 19:12:08 +08:00
Heiko Stuebner
b7a2aa66b2 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>
2016-05-10 19:11:30 +08:00
Heiko Stuebner
dd7fe1d5e1 FROMLIST: clk: fix inconsistent use of req_rate
The req_rate property seems to be made to hold the rate requested through
clk_set_rate. Currently it gets initialized in clk_init to the clocks
current rate and then adapted in clk_set_rate calls. Orphan clocks and
their children get initialized to a rate of 0 and req_rate never gets
re-set when these lose their orphan-status.

Initializing req_rate to the clocks rate also is unintuitive as it just
copies the value that is already in the rate property and also looses the
information if a component actually requested a specific rate.

So separate the requested rate and only set it in clk_core_set_rate_nolock
when a real rate gets requested. The users of the req_rate __clk_put and
clk_set_rate_range that adjust a clock based on that value use req_rate
at first and fall back to rate if no rate had been requested now.

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

Change-Id: I9e345e1e9d0c101d5c3c7064b6c2d2724f9eac4f
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-05-10 19:11:09 +08:00
Caesar Wang
0bc13c72ec arm64: dts: rk3399: disabled the edp on evb2 cros
As the pervious discussed, disabled the edp node for dts. Otherwise
you connected the mipi panel will show white since the edp will force
to use the extend screen.

Change-Id: I3e716f4a9d92d4faae5d7a12d792c71fe16f489e
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-10 18:28:35 +08:00
Caesar Wang
85c1722608 ARM64: rockchip_cros_defconfig: enable the regulator LP8752
The gpu can't work with chromeos since the regulator has not enabled.
Okay, the gpu can work for chromeos with rk3399 evb2 on now.

Change-Id: If23affff151a99206b86c2a3f40c21752bdc2d54
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-10 18:28:06 +08:00
Finley Xiao
9781d414b4 ARM64: rockchip_defconfig: enable THERMAL_GOV_USER_SPACE
Change-Id: I572ef6030ec1e72b7f46bc00d887d91e94c12c0c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-05-10 18:27:37 +08:00
Zheng Yang
49665d106f video: rockchip: hdmi: fix compile warning
Change-Id: I3573f4d42074b656420cc5567d73e660232f2b84
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-05-10 18:27:08 +08:00
Mark Yao
cb794081c6 drm/rockchip: vop: fix compile warning
fix warning:
    warning: 'ret' may be used uninitialized in this function

Change-Id: I743ed9788366322beeceddd556fae0c2a7cdd463
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-10 18:05:36 +08:00
Yakir Yang
09e82f8935 drm/rockchip: rga: fix 'ret' may be used uninitialized in probe time
Change-Id: I3eeb2abf2b5f098d3c2298673eeecd130ad99cb7
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-05-10 16:10:47 +08:00
xuhuicong
2dde9ade48 video: rockchip: hdmi: v2: solve 480i/576i 10bit output abnormal
Change-Id: I60ee3b8882bc16bab48a51530635f50958bacfd3
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:35:13 +08:00
xuhuicong
4295210b03 ARM64: dts: rk3399-android: add HDMI device node support
Change-Id: I29b46d097351c55df66782d55c004c356049fb37
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:34:12 +08:00
xuhuicong
c06b84a124 ARM64: dts: rk3399: add HDMI DDC/CEC pinctrl
Change-Id: Ic3417a5153ceabad3f9c69ffe5b6fa542e7a84c1
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:31:51 +08:00
xuhuicong
972bdf6aef video: rockchip: hdmi: misc clean up to hdmi driver
remove unused dts properties parsed code and print an error message
when enable hdmi clk error

Change-Id: I92f37f5c1dc2cd8dbf18744f4fd17a52bc25080f
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:28:06 +08:00
xuhuicong
e659022b93 video: rockchip: hdmi: support rk3399 hdmi
RK3399 hdmi register layout is similar with rk3288 and rk3368, so most
code can reuse. but hdmi resign is upgrade from 20 to 21 so it has a
little diffrence. and the hdmi phy clk is Independent from dclk too.

Change-Id: I83b30c92d9572fc9ceaf52777d224e5cec1823be
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:27:18 +08:00
Elaine Zhang
fb1738eb00 regulator: rockchip: lp8752: fix up the compile warning
fix up the warning:
drivers/regulator/lp8752.c: In function 'lp8752_buck_set_mode':
drivers/regulator/lp8752.c:93:2: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: Iee9f69791bbcea2e6b3a16713b76e93cfc0a2b67
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2016-05-10 09:20:40 +08:00
Huang Jiachai
e295c725bd video: rockchip: fix compile warning: may be used uninitialized
Change-Id: Ia162b79443e8361d93575963c6603999ffc3e405
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-05-09 17:10:14 +08:00
Zhiqin Wei
a3926cf98e drivers: video: rockchip: rga2: Fix compile warning
Change-Id: I3622b70a5b15014ccb5fb9fc09bced97db194dc8
Signed-off-by: Zhiqin Wei <wzq@rock-chips.com>
2016-05-09 16:43:56 +08:00
Simon
ad8d04570c iommu: rk-iommu: fix build warning when enable CONFIG_CC_OPTIMIZE_FOR_SIZE
Change-Id: Iff20759a625df9f6c6138eaa8d963d67a483c01d
Signed-off-by: Simon <xxm@rock-chips.com>
2016-05-09 16:32:37 +08:00
Sugar Zhang
5cd1658890 ASoC: es8316: fix warning: 'val' may be used uninitialized
Change-Id: If7bdba3cd7a23879a2cf41202d21fadaef614f23
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2016-05-09 14:15:50 +08:00
Alpha Lin
4e6f3ce852 rockchip/vcodec: seperate power-on timer for independent hw
Seperate power-on timer for rkvdec and vpu when they are not
in combo mode (definitly independence).

Before this patch, h/w power off schedule will be interrupted
by the other h/w, and power off will be triggered when h/w
still running a task.

Change-Id: I29124e90afccc727d2e7a04098727aa4a2c3e8bb
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
2016-05-06 09:29:46 +08:00
Caesar Wang
9be1984799 ARM64: rockchip_cros_defconfig: enable the GOV_POWER_ALLOCATOR
Enable the GOV_POWER_ALLOCATOR for rk3399.

Change-Id: I8f7e457a09543d730e30c1ce74a9b5dffba57e10
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-05 19:24:02 +08:00
Caesar Wang
b7f56e4165 ARM64: config: enable the devfreq_thermal for rockchip
It will enable the devfreq thermal that's generic devfreq cooling
mechanism through frequency reduction for devices using devfreq.
This will throttle the device by limiting the maximum allowed DVFS
frequency corresponding to the cooling level.

Change-Id: Ia017ecf46599700382b9604e375193135f7d1d24
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-05 19:22:51 +08:00
chenzhen
4f613eb82e MALI: rockchip: add "platform specific code" of rk platform
Change-Id: Ia58cba15b43f875ac572a3b35807b5ec48e3df01
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2016-05-05 19:20:46 +08:00
Wu Liang feng
a5bf8df9a7 ARM64: dts: rk3399-android: set usbdrd_dwc3_0 in peripheral mode
Change-Id: I775283d3b3c8180e352281568d1b77ab5c5a544c
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-05-05 18:41:01 +08:00
Shawn Lin
a7a3b1a72d mmc: sdhci-of-arasan: fix using sleep function whthin spinlock
Let's use unlock/lock around phy APIs as them will call
mutex which is sleepable casuing failure of kernel debug
check.

Change-Id: Ic7670bfc9ed763cc9bdec53f85f553bc0be1416c
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-05-05 14:47:31 +08:00
Mark Yao
c1b1c53c7e drm/rockchip: vop: fix pin_pol config
rgb/edp/hdmi/mipi pin_pol is removed after (e5683dd FROMLIST:
drm/rockchip: get rid of rockchip_drm_crtc_mode_config), that
is wrong.

This patch re-add those pin_pol config.

Change-Id: I46f3e32ad405f4b6e2f76110757248e8516693c4
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-05 11:09:29 +08:00
Zain Wang
6423c41361 regulator: mp8865: update mp8865 enable_time
enable_time is controlled by capacitance connected to Pin SS,
it described more detailedly in mp8865 datasheet Page 15.
Capacitance is 12nF now.

Change-Id: Ib604a4e109db7ab125104e5cf3067864fefb6fe0
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2016-05-04 19:29:54 +08:00
xiaoyao
0de499f937 ARM64: dts: rk3399: support bluetooth for rk3399-evb
Change-Id: Id1eb05cc4cc39d026b6c26f1635760eed38c8968
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2016-05-04 18:51:32 +08:00
Mark Yao
47510f4818 drm/rockchip: vop: Initialize vskiplines to zero
There is a path that use vskiplines with non-initialize.
That would cause vop abnormal behavior.

Change-Id: I53c6c575d6acc16aeae761dbb4867f3bc8bfe5ce
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:29:14 +08:00
Mark Yao
9bde4e671f drm/rockchip: vop: fix iommu crash with async atomic
On Async atomic_commit callback, drm_atomic_clean_old_fb will
clean all old fb, but because async, the old fb may be also on
the vop hardware, dma will access the old fb buffer, clean old
fb will cause iommu page fault.

Reference the fb and unreference it when the fb actuall swap out
from vop hardware.

Change-Id: I585786884295060efdaef0a00c3cbd75244399d7
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:27:54 +08:00
Mark Yao
ed547bb16f drm/rockchip: vop: support plane zpos property
Change-Id: Idd0265020a591ce5b34d117442104f625e331119
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:24:59 +08:00
Mark Yao
751837be5e drm/rockchip: vop: rk3399: add area plane
Change-Id: Ia6f77353363e25423ac29129372bc510565682f8
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:24:13 +08:00
Mark Yao
574b3c4c2a drm/rockchip: vop: rk3288: add area plane
Change-Id: Iac8fde019020d8f1a671d52c1a4d91ad2d050d43
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:22:57 +08:00
Mark Yao
6c060b5946 drm/rockchip: vop: support multi area plane
The series vop of VOP_FULL framework support area plane, such as
RK3288 and RK3399, one group of area planes share same hardware,
reuse the hardware on different scanout time, this design is
useful to support mulit planes with low hardware consume.

Change-Id: Ie53211ce9ed22d03f7668637efbb7c95d9a8eb5b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:19:10 +08:00
Mark Yao
eaf6764dee drm: introduce share plane
The plane hardware is used when the display scanout run into plane active
scanout, that means we can reuse the plane hardware resources on plane
non-active scanout.

Because resource share, There are some limit on share plane: one group
of share planes need use same zpos, can't not overlap, etc.

We assume share plane is a universal plane with some limit flags.
people who use the share plane need know the limit, should call the ioctl
DRM_CLIENT_CAP_SHARE_PLANES, and judge the planes limit before use it.

Change-Id: Iecc3d8e7f1ce29d567cdbad689ba4dbad3d594e1
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:16:50 +08:00
Mark Yao
e5683dd6c1 FROMLIST: drm/rockchip: get rid of rockchip_drm_crtc_mode_config
We need to take care of the vop status when use
rockchip_drm_crtc_mode_config, if vop is disabled,
the function would failed, that is terrible.

Save output_type and output_mode into rockchip_crtc_state,
it's nice to make them into atomic.

Conflicts:

	drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
	drivers/gpu/drm/rockchip/dw-mipi-dsi.c
	drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
	drivers/gpu/drm/rockchip/inno_hdmi.c
	drivers/gpu/drm/rockchip/rockchip_drm_drv.h
	drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Change-Id: I43c49a92b2b9df02ce8a055bd16948b400ab0f47
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/8844321/)
2016-05-04 18:15:26 +08:00
Caesar Wang
629b58a49a UPSTREAM: arm64: Enable the timer on Rockchip architecture
On the RK3368 SoC, support the APB timers for rockchip platform.

Change-Id: I2bee09c4140994d3d2e23f1820663230d82547de
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit c840f28bbf)
2016-05-03 17:48:47 +08:00