Commit Graph

598262 Commits

Author SHA1 Message Date
Finley Xiao
418b0dbdc4 dt-bindings: add binding document for Rockchip pvtm
This patch documents the Rockchip pvtm device tree binding.

Change-Id: I7edcd1d57ff2852eb6e6897680566abb7f9e76a9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-10 15:27:55 +08:00
Finley Xiao
e2157f4f10 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>
2016-11-10 14:55:52 +08:00
Elaine Zhang
c923b0141d 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>
2016-11-10 14:44:07 +08:00
Jacob Chen
5de1e85d03 arm64: dts: rockchip: add power button for rk3399 excavator linux
Change-Id: I5c69940b93dec8a04f72e7240fc732071d0187ed
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-10 14:43:25 +08:00
Jacob Chen
414d7ed094 arm64: dts: rockchip: add reset unit in saradc for rk3399
Change-Id: Iee831c8b4bc39cb324ee31ace9d98d235aaf7555
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-10 14:43:08 +08:00
Zikim,Wei
ff788a2811 rockchip/rga: rga driver fix compat ptr from u64
Change-Id: I23cff21aab9af09989b8b2332e7a2ef3ffc8bfb8
Signed-off-by: Zikim,Wei <wzq@rock-chips.com>
2016-11-10 14:31:48 +08:00
Finley Xiao
8c0aa0e3a3 soc: rockchip: pm_test: add driver handling Rockchip pm_test
Add /sys/pm_tests/ node, only for internal testing.

Change-Id: I1fe9f09e6d410c9ed939666255111d2a8865466c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-10 14:29:29 +08:00
Mark Yao
e85cf602c3 video: rockchip: sysfs: fixup dump_buf node
Change-Id: Ie2e86d65b3db58f45c8c49894f506ab52b125c25
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-09 16:49:48 +08:00
wjh
a68a6ab313 arm64: dts: rockchip: add dp defaule mode for rk3399 discrete vr
Change-Id: Icc25da3598d9a7475817aebdc101f5d77f58624c
Signed-off-by: wjh <wjh@rock-chips.com>
2016-11-09 16:36:54 +08:00
wjh
eacfb327ea video: rockchip: dp: get edid for discrete vr
Change-Id: Id791e838e37e76f72202731e53afd2533e653069
Signed-off-by: wjh <wjh@rock-chips.com>
2016-11-09 16:36:42 +08:00
Mark Yao
28fc1091f4 video: rockchip: rk322x: use htotal to adjust fps
Use dclk to adjust fps may effect many things, some display
controller also need to know dclk update, such as mipi.
So if we change fps by dclk, we need update mipi or other
display controller, it waste time and screen would flash

From the fps formula: fps = dclk / htotal * vtotal

Instead change dclk, we also can modify fps by htotal or vtotal.

On testing, vtotal would effect display, use htotal is more safe.

Change-Id: I67d58a815eae150b4e6390b6608557b87d43a27b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-09 11:31:05 +08:00
Mark Yao
d05c5b242b video: rockchip: rk322x: keep vop standby before enable iommu
Vop may access illegal address and cause bus error with:
    1, vop iommu is disable
    2, vop is enable and its window use a iommu mapping address

The illegal memory access may cause bus abnormal.

Change-Id: I17d52ae12140b9bf85d37123765f7163422ec8f5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-09 08:50:22 +08:00
Chris Zhong
7b3f45710e UPSTREAM: arm64: dts: rockchip: add powerdomain for typec on rk3399
The tcpc power domain will try to power up/down the power of Type-C PHY.
Hence, we need control it in Type-C PHY driver with the pm_runtime helper.

Change-Id: I7697c50bb8538c00bb0fa14c92cc1e55bcdd4025
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from git.kernel.org next/linux-next.git master
 commit 06ad4b2fad)
2016-11-08 16:00:48 +08:00
Chris Zhong
b98860c4d2 FROMLIST: phy: rockchip-typec: add pm_runtime_disable in err case
Add pm_runtime_disable in err case to make the pm_runtime_enable/disable
is invoked balanced.

BUG=chrome-os-partner:52872
TEST=Check DP display and USB3

Change-Id: Ifc66a3e80d7b580963e609d2f14cea239104724c
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
(am from https://patchwork.kernel.org/patch/9321849/)
Reviewed-on: https://chromium-review.googlesource.com/382723
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: William Wu <wulf@rock-chips.com>
2016-11-08 15:58:36 +08:00
Chris Zhong
c0fb43a77e UPSTREAM: phy: rockchip-typec: add pm runtime support
Adds pm_runtime support for rockchip Type-C, so that power domain is
enabled only when there is a transaction going on to help save power.

BUG=chrome-os-partner:52872
TEST=Check DP display and USB3

Change-Id: I072fd06eaa4dfc4b4f598c4a6a3972ee458b833f
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
(cherry picked from git.kernel.org kishon/linux-phy.git next
 commit 15ab5499bd837b1d70287da747dc3d9762ab320a)
Reviewed-on: https://chromium-review.googlesource.com/382113
Reviewed-by: Brian Norris <briannorris@chromium.org>
2016-11-08 15:58:29 +08:00
Jacob Chen
143485ffe9 arm64: configs: enable drm rga in linux config
Change-Id: I92985f4e1f8cf18d2f0f578e3d039b45e5f445fb
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-08 14:27:23 +08:00
Jacob Chen
897e41e011 arm64: configs: enable extcon in linux config
Change-Id: I071fa1e075a5495be58315d47cc2a767ae09bd75
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-08 14:27:04 +08:00
Peter Zijlstra
9b4f68fbb4 UPSTREAM: sched/preempt: Fix preempt_count manipulations
Vikram reported that his ARM64 compiler managed to 'optimize' away the
preempt_count manipulations in code like:

	preempt_enable_no_resched();
	put_user();
	preempt_disable();

Irrespective of that fact that that is horrible code that should be
fixed for many reasons, it does highlight a deficiency in the generic
preempt_count manipulators. As it is never right to combine/elide
preempt_count manipulations like this.

Therefore sprinkle some volatile in the two generic accessors to
ensure the compiler is aware of the fact that the preempt_count is
observed outside of the regular program-order view and thus cannot be
optimized away like this.

x86; the only arch not using the generic code is not affected as we
do all this in asm in order to use the segment base per-cpu stuff.

Change-Id: I13da06ddb17c533b8150f008514a4c74723b1742
Reported-by: Vikram Mulukutla <markivx@codeaurora.org>
Tested-by: Vikram Mulukutla <markivx@codeaurora.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: a787870924 ("sched, arch: Create asm/preempt.h")
Link: http://lkml.kernel.org/r/20160516131751.GH3205@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 2e636d5e66)
2016-11-08 10:21:07 +08:00
Huang, Tao
3b316acdc4 arm64: rockchip_defconfig: enable HARDENED_USERCOPY
e41543b2d1 ("ANDROID: android-base: CONFIG_HARDENED_USERCOPY=y")

Change-Id: I4d2805c318f2fb65ae3c780aac26672bfc41be34
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-08 10:17:41 +08:00
Huang, Tao
582a8ca38f arm64: rockchip_defconfig: enable CC_STACKPROTECTOR_STRONG
df9e01a6c5 ("android-recommended.cfg: enable fstack-protector-strong")

If compiler has stack protector support, set
CONFIG_CC_STACKPROTECTOR_STRONG.

Change-Id: Icd3535b88fb7d62c135da72ae0921f7f4949efe4
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-08 10:17:26 +08:00
Yunlei He
7b9a87094a UPSTREAM: f2fs: avoid hungtask problem caused by losing wake_up
The D state of wait_on_all_pages_writeback should be waken by
function f2fs_write_end_io when all writeback pages have been
succesfully written to device. It's possible that wake_up comes
between get_pages and io_schedule. Maybe in this case it will
lost wake_up and still in D state even if all pages have been
write back to device, and finally, the whole system will be into
the hungtask state.

                if (!get_pages(sbi, F2FS_WRITEBACK))
                         break;
					<---------  wake_up
                io_schedule();

Change-Id: I8a60393c91343d75b7d48df2ca19d1735d69cc51
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Biao He <hebiao6@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 0ff21646f2)
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
2016-11-08 10:13:01 +08:00
Jacob Chen
95c5fe3978 arm64: configs: add missing usb config in rockchip linux
Change-Id: I39f908c4427799a2728f7bc5f39e20accd126901
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-08 09:25:52 +08:00
Jacob Chen
56fb33d873 arm64: configs: rockchip: enable configfs usb gadget and otg in rockchip_linux_defconfig
Change-Id: I3d260fe97fe3dad2101a4cc54a604f8eca7ed248
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-08 09:25:20 +08:00
Jacob Chen
90960093e8 Revert "arm64: dts: rk3399-sapphire: add vbus-5v gpio control in fusb302 node."
This reverts commit cb3e42dc8c.

This will make usb port in my board can't work, no 5v voltage.
Is it no issues in android?

Change-Id: I95fbd957d0ddb5fddf215d3b00ef74aae8af08d3
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2016-11-08 09:24:04 +08:00
Mark Yao
d5b8a8a44c drm: support ignore drm ioctl permission
Change-Id: I269766a9f3f844933bd294ce681466f5a97b1d43
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-11-07 15:00:17 +08:00
Caesar Wang
6842426ce0 UPSTREAM: arm64: dts: rockchip: add the tcpc for rk3399 power domain
The tcpc is the Type C Port Controller and Type C Port Delivery (tcpd)
is part of it, we haven't used them now, add it to save power consumption.

Change-Id: Ia1046fd3bb7382498811159d8280ee46b3753ebd
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 4a3a3d32c7)
2016-11-07 15:00:04 +08:00
Caesar Wang
279fd58b58 UPSTREAM: soc: rockchip: power-domain: avoid infinite loop
In some cases, we have met the infinite loop in
rockchip_pmu_set_idle_request() or rockchip_do_pmu_set_power_domain().

As the crosbug.com/p/57351 reported, the boot hangs right after this
[1.629163] bootconsole [uart8250] disabled
[1.639286] [drm:drm_core_init] Initialized drm 1.1.0 20060810
[1.645926] [drm:drm_get_platform_dev] Initialized vgem 1.0.0 20120112..
[1.654558] iommu: Adding device ff8f0000.vop to group 0
[1.660569] iommu: Adding device ff900000.vop to group 1
<hang>

This patch adds the error message and timeout to avoid infinite loop if
it fails to get the ack.

Change-Id: Ia1e2edbdb48de3ec776f1304a941136d3e7a1854
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from git.kernel.org mmind/linux-rockchip.git
 v4.10-armsoc/drivers commit e4c8cd82d5)
2016-11-07 14:40:32 +08:00
tony.xie
815a9e704b 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>
2016-11-07 11:12:04 +08:00
chenzhen
1729873f60 MALI: midgard: ARM: patch for fence timeout in monkey test
comes from mali support case [TAC674871].

Change-Id: I5e7c54190e24eea0306a9d64545482c6209a2c0d
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2016-11-07 11:05:32 +08:00
Huang, Tao
a1d4fafab5 rk: gcc-wrapper.py ignore memcontrol.c:5346
Change-Id: I19b5f58f395cce934fe2efbb01267576b7772c02
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-07 10:47:20 +08:00
Finley Xiao
a626d4bbd6 arm64: rockchip_defconfig: enable cpu avs
Change-Id: I626d1d238ea8efa38763fb6360936ce13c0c17fe
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-04 19:49:46 +08:00
Finley Xiao
574b2e2aff PM / AVS: rockchip-cpu-avs: add driver handling Rockchip cpu avs
This patch supports adjusting opp's voltage according to leakage

Change-Id: Ifbb6b6fec03abe0c7708a148affe4d7646ce38fa
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-04 19:49:17 +08:00
Finley Xiao
efde62a999 arm64: dts: rockchip: add cpu-avs node for rk3399
Change-Id: Ibfcda65b6b97af453942888cf07e8f08b06768c2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-04 19:48:54 +08:00
Finley Xiao
21b5ccaf85 dt-bindings: add binding document for Rockchip cpu avs
This patch documents the Rockchip cpu avs device tree binding.

Change-Id: I4a86cd384f304a5d77ff2763b2347804699b9b93
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-04 19:48:33 +08:00
Finley Xiao
d471e018c0 PM / OPP: Support adjusting OPP voltages at runtime
On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention. Add an API to the OPP library for
the former case, so that AVS type devices can update the voltages
for an OPP when the hardware determines the voltage should
change. The assumption is that drivers like CPUfreq or devfreq
will register for the OPP notifiers and adjust the voltage
according to suggestions that AVS makes.

Change-Id: Ia6dddc0976f116555965f784794b8eca37582737
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-04 19:48:23 +08:00
Luo wei
b675a6dc93 arm64: dts: rockchip: rk3399: add discrete vr support for box hardware
Change-Id: I64078f3ab5730a451df05e64bee779fe99051af0
Signed-off-by: Luo wei <lw@rock-chips.com>
2016-11-04 18:19:59 +08:00
wuliangqing
8ea1c3c569 arm64: dts: rk3399-vr: enable rk_headset on rk3399 vr
Change-Id: I4e078c586e6654c3a4711d0b0108d28360db9453
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2016-11-04 14:52:45 +08:00
Huang, Tao
85e7a1d463 arm64: rockchip_defconfig: enable DEFAULT_USE_ENERGY_AWARE
Same as before merge last lsk.

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-04 14:33:48 +08:00
Huang, Tao
f9ae5d202b Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (1362 commits)
  Linux 4.4.30
  Revert "fix minor infoleak in get_user_ex()"
  Revert "x86/mm: Expand the exception table logic to allow new handling options"
  Linux 4.4.29
  ARM: pxa: pxa_cplds: fix interrupt handling
  powerpc/nvram: Fix an incorrect partition merge
  mpt3sas: Don't spam logs if logging level is 0
  perf symbols: Fixup symbol sizes before picking best ones
  perf symbols: Check symbol_conf.allow_aliases for kallsyms loading too
  perf hists browser: Fix event group display
  clk: divider: Fix clk_divider_round_rate() to use clk_readl()
  clk: qoriq: fix a register offset error
  s390/con3270: fix insufficient space padding
  s390/con3270: fix use of uninitialised data
  s390/cio: fix accidental interrupt enabling during resume
  x86/mm: Expand the exception table logic to allow new handling options
  dmaengine: ipu: remove bogus NO_IRQ reference
  power: bq24257: Fix use of uninitialized pointer bq->charger
  staging: r8188eu: Fix scheduling while atomic splat
  ASoC: dapm: Fix kcontrol creation for output driver widget
  ...
2016-11-04 14:30:24 +08:00
Huang, Tao
1429ad62be Revert "ARM64: cpufreq_sched: implement event CPUFREQ_GOV_LIMIT for governor"
This reverts commit d94634b0ab.

Fixed by commit 24884e5434
("sched/cpufreq_sched: Consolidated update")

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-04 14:12:11 +08:00
Huang, Tao
d77be0b5f8 Revert "ARM64: sched: cpufreq_sched: fix bug: init data before use it in thread"
This reverts commit 0ac5bfd6d9.

Fixed by commit ac6f9bad52
("FIXUP: sched: scheduler-driven cpu frequency selection")

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-04 14:12:10 +08:00
Huang, Tao
965f147fae Revert "ARM64: sched: fix bug: avoid infinite loop"
This reverts commit d4773e1407.

Fixed by commit abdb60d816
("FIXUP: sched/fair: Fix hang during suspend in sched_group_energy")

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-04 14:12:09 +08:00
Huang, Tao
7928ad4718 Revert "ROCKCHIP: sched: enable the feature ENERGY_AWARE"
This reverts commit a9ad2b25a0.

Fixed by commit fc1d6c8c6a
("sched: Add Kconfig option DEFAULT_USE_ENERGY_AWARE to set ENERGY_AWARE feature flag")

Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-11-04 14:11:34 +08:00
William Wu
eca4625c95 Revert "UPSTREAM: usb: dwc3: core: Move the mode setting to the right place"
This reverts commit 1047560640.

This commit 1047560 will reinit dwc3 controller mode
when resuming dwc3 core. Generally, this patch can be
used for "dr_mode = host", "dr_mode = peripheral" and
"dr_mode = otg".

However, rockchip dwc3 core don't support otg function,
but only support DRD mode. So on rockchip platform, we
set dr_mode to otg for DRD mode, then switch host and
peripheral dynamically by extcon notifier. Also, we will
enable dwc3 to be a wakeup source and enable usb3 power
domain in suspend mode if usb device is pluged in. So
dwc3 controller will not lost the mode when resuming dwc3
core.

Change-Id: I0ee4f5b02d4504e853d8ef81df3df9a8a4ac284f
Signed-off-by: William Wu <wulf@rock-chips.com>
2016-11-03 18:26:35 +08:00
Finley Xiao
143cafb285 nvmem: rockchip-efuse: Change initcall to subsys
We will add a avs driver to adjust opp's voltage according to leakage.
As it need register a notifier before cpufreq starts, and make cpufreq
defer probe is probably not really easy, so avs should probe earlier
than cpufreq, efuse should probe earlier than avs.

Change-Id: I817aa44c3b34d2fdf44148e6b9649ceed76d8f1f
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-11-03 10:23:26 +08:00
Randy Li
1532702894 UPSTREAM: phy: Add reset callback
The only use for this is for solving a hardware design problem in
usb of Rockchip RK3288.

Change-Id: I40b17f5c33125c77759808720763d2694dfc25f2
Signed-off-by: Randy Li <ayaka@soulik.info>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit cac18ecb6f)
2016-11-03 09:51:43 +08:00
Jianhong Chen
a3bb010cad firmware: rockchip: sip: add rockchip SIP runtime service
Change-Id: I996a90b3f6cb471f255566dfab0059a55da8866d
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2016-11-02 09:41:22 +08:00
Huang Jiachai
2c21d4842f video: rockchip: 3399 vop: fix pwm config done lead to iommu pagefault
Change-Id: Ia8e8a3ccaf9a713d96e93a435503d8b55b794f3b
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-11-01 16:17:34 +08:00
zhangjun
6e28ffac2b arm64: dts: rockchip: enable rk_headset on rk3399 mid
Change-Id: I8ef75283727152e7c5fa7380813296bc7220ed91
Signed-off-by: zhangjun <zhangjun@rock-chips.com>
2016-11-01 14:59:54 +08:00
Alex Shi
79df8fa79b Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2016-11-01 12:01:20 +08:00