5 years agoarm64: dts: rockchip: add mmc dt-bindings for rk3328 and evb board
Shawn Lin [Thu, 15 Dec 2016 01:06:23 +0000 (09:06 +0800)]
arm64: dts: rockchip: add mmc dt-bindings for rk3328 and evb board

Add dt-bindings for sdio/sdmmc(+ext)/emmc controllers

Change-Id: I1c52b803110c499c58c2c27a1c7488a98b0ca870
Signed-off-by: Shawn Lin <>
5 years agoUPSTREAM: drm: Introduce DRM_DEV_* log messages
Sean Paul [Mon, 15 Aug 2016 23:18:04 +0000 (16:18 -0700)]
UPSTREAM: drm: Introduce DRM_DEV_* log messages

This patch consolidates all the various log functions/macros into
one uber function, drm_log. It also introduces some new DRM_DEV_*
variants that print the device name to delineate multiple devices
of the same type.

Change-Id: Ic213cce1d775cc7b820473ee5263458a001f9558
Reviewed-by: Chris Wilson <>
Reviewed-by: Eric Engestrom <>
Signed-off-by: Sean Paul <>
Signed-off-by: Huang, Tao <>
(cherry picked from commit c4e68a5832021cf8c2f9a2f3419452470ca60bd8)

5 years agoUPSTREAM: drm: Add ratelimited versions of the DRM_DEBUG* macros
Lyude [Sat, 6 Aug 2016 00:30:38 +0000 (20:30 -0400)]
UPSTREAM: drm: Add ratelimited versions of the DRM_DEBUG* macros

There's a couple of places where this would be useful for drivers (such
as reporting DP aux transaction timeouts).

Change-Id: I027648bacec5e23890f6743207d66858f91c05df
Signed-off-by: Lyude <>
Reviewed-by: Christian König <>
Signed-off-by: Daniel Vetter <>
Signed-off-by: Huang, Tao <>
(cherry picked from commit 27528c667a210845b35a1f49c810dba469bced52)

5 years agoARM64: dts: rk3399: add bq25700 support for tve1205g
Shunqing Chen [Thu, 15 Dec 2016 12:53:00 +0000 (20:53 +0800)]
ARM64: dts: rk3399: add bq25700 support for tve1205g

Change-Id: I74119a51d2557e86f3c579645db2b2b8dc71989c
Signed-off-by: Shunqing Chen <>
5 years agoarm64: rockchip_defconfig: enable bq25700
Shengfei xu [Mon, 19 Dec 2016 08:15:21 +0000 (16:15 +0800)]
arm64: rockchip_defconfig: enable bq25700

Change-Id: I96edac95110516c6f6747128fd50251cb3e37e7b
Signed-off-by: Shengfei xu <>
5 years agousb: ehci/ohci-platform: assigned hcd phy phandle at platform probe
Frank Wang [Thu, 15 Dec 2016 02:50:54 +0000 (10:50 +0800)]
usb: ehci/ohci-platform: assigned hcd phy phandle at platform probe

In ehci/ohci-platform, phy_power_on() gets called twice at probe time,
one is at pdata->power_on(); another is in usb_add_hcd(). However,
phy_power_off() is only invoked one time when ehci/ohci-platform goes
to PM suspend. As a result, the phy power count become inconsistent.

This adds assigned phy phandle to hcd-phy at ehci/ohci-platform probe
time to prevent hcd invoking generic phy methods again when phy-cells
is 0 in DT.

Change-Id: I2f0cca622d31a46dea0b805b83b676cc78e4d67c
Signed-off-by: Frank Wang <>
5 years agocpufreq: dt: fix the warning when use opp_v1
Finley Xiao [Thu, 15 Dec 2016 11:54:07 +0000 (19:54 +0800)]
cpufreq: dt: fix the warning when use opp_v1

Change-Id: I02c7a3cc68536b707baaa8a61f21ac4961184dda
Signed-off-by: Finley Xiao <>
5 years agoarm64: dts: rockchip: fix gic node name for rk3328
Huang, Tao [Mon, 19 Dec 2016 07:14:29 +0000 (15:14 +0800)]
arm64: dts: rockchip: fix gic node name for rk3328

The unit-address should be ff811000.

Change-Id: Id363731458bf2210ca5d92d679c00bbfdd3f9de4
Signed-off-by: Huang, Tao <>
5 years agoARM64: dts: rockchip: add max-link-speed for rk3399
Shawn Lin [Fri, 16 Dec 2016 09:27:59 +0000 (17:27 +0800)]
ARM64: dts: rockchip: add max-link-speed for rk3399

Per the errata of TRM, rk3399 won't support gen2 from
now on, so let's set max-link-speed to 1 in order not
to doing training for gen2.

Change-Id: I3fd455dc2427f2c67dc2dce8e8fabc4b521a49dd
Signed-off-by: Shawn Lin <>
5 years agousb: gadget: composite: fix double freeing of freed memory
William Wu [Fri, 16 Dec 2016 08:39:47 +0000 (16:39 +0800)]
usb: gadget: composite: fix double freeing of freed memory

The following message can be observed on rk3399 nougat board
when switch MTP/charge mode with KASan backported :

BUG kmalloc-192 (Not tainted): Object already free

Disabling lock debugging due to kernel taint
INFO: Allocated in dwc3_gadget_ep_alloc_request+0x2c/0xf4 age=977 cpu=4 pid=1
INFO: Freed in dwc3_gadget_ep_free_request+0x84/0xbc age=4 cpu=4 pid=1
Hardware name: Rockchip RK3399 Evaluation Board v3 edp (Android) (DT)
Call trace:
[<ffffff9008088490>] dump_backtrace+0x0/0x1c8
[<ffffff900808866c>] show_stack+0x14/0x1c
[<ffffff900835cbe4>] dump_stack+0x8c/0xac
[<ffffff900819f840>] print_trailer+0x188/0x198
[<ffffff900819f9bc>] object_err+0x3c/0x4c
[<ffffff90081a1fb8>] free_debug_processing+0x27c/0x36c
[<ffffff90081a2108>] __slab_free+0x60/0x388
[<ffffff90081a2c88>] kfree+0x210/0x27c
[<ffffff9008645a58>] composite_dev_cleanup+0x74/0xfc
[<ffffff900864789c>] configfs_composite_bind+0x2b8/0x2d8
[<ffffff900864953c>] udc_bind_to_driver+0x38/0xcc
[<ffffff9008649650>] usb_udc_attach_driver+0x80/0xa8
[<ffffff900864835c>] gadget_dev_desc_UDC_store+0xa0/0xe4
[<ffffff9008218144>] configfs_write_file+0xfc/0x14c
[<ffffff90081ac958>] __vfs_write+0x38/0xfc
[<ffffff90081ad290>] vfs_write+0xac/0x174
[<ffffff90081adc4c>] SyS_write+0x54/0xa4
[<ffffff90080826f0>] el0_svc_naked+0x24/0x28

This patch sets the usb_request pointer to NULL after the
free the usb_request buf. And the composite_dev_cleanup()
will check if the usb_request pointer is NULL before do
kfree and avoid double freeing freed menory.

Change-Id: I69df57553cb14d046b8b8206becd342a5e5fb7ba
Signed-off-by: William Wu <>
5 years agopower_supply: Add support for TI BQ25700 charger chip
Shengfei xu [Fri, 9 Dec 2016 07:27:11 +0000 (15:27 +0800)]
power_supply: Add support for TI BQ25700 charger chip

Change-Id: I362b5bb06455c2ddb9583bb5882ee349438ba799
Signed-off-by: Shengfei xu <>
5 years agomfd: fusb302: add USB_FAST to notify PD information
Shunqing Chen [Wed, 7 Dec 2016 08:57:35 +0000 (16:57 +0800)]
mfd: fusb302: add USB_FAST to notify PD information

Change-Id: I1d0e244ad087d83935953efb3fff095e5d36cc24
Signed-off-by: Shunqing Chen <>
5 years agoUPSTREAM: clk: rockchip: validity should be checked prior to cpu clock rate change
Elaine Zhang [Tue, 8 Nov 2016 09:10:14 +0000 (17:10 +0800)]
UPSTREAM: clk: rockchip: validity should be checked prior to cpu clock rate change

If validity is not checked prior to clock rate change, clk_set_rate(
cpu_clk, unsupported_rate) will return success, but the real clock rate
change operation is prohibited in post clock change event. Alough post
clock change event will report error due to unsupported clock rate is
set, but this error message is ignored by clock framework.

Signed-off-by: Elaine Zhang <>
Tested-by: Rocky Hao <>
Signed-off-by: Heiko Stuebner <>
(am from mmind/linux-rockchip.git branch v4.10-clk/next
 commit a554bb5fb01804a38fde3782831c9567d997939e)

Change-Id: I521700f86fe1d9bf2d1bef4ebe0350cd6f558c0a
Signed-off-by: Jianqun Xu <>
5 years agoARM64: dts: rk3399: add some device support for tve1205g
Zhou weixin [Wed, 14 Dec 2016 12:08:11 +0000 (20:08 +0800)]
ARM64: dts: rk3399: add some device support for tve1205g

1.add hid i2c toucpad
2.add hid i2c keyboard
3.add battery fuel gauge
4.add hall sensor
5.modify backlight polarity

Change-Id: I648d568a595324505f08684308197350a73d763e
Signed-off-by: Zhou weixin <>
5 years agoARM64: dts: rk3399-tve1205g: use simple-panel for edp panel
Mark Yao [Thu, 15 Dec 2016 02:34:04 +0000 (10:34 +0800)]
ARM64: dts: rk3399-tve1205g: use simple-panel for edp panel

Edp controller support get timing from edid, so we can simple use
a dummy panel for display, so bootloader and kernel all can use same
timing from edid

Change-Id: I0cf19817aa1c38cae25603814c3605e6c16fe0f6
Signed-off-by: Mark Yao <>
5 years agodrm/panel: support get bus_format from device-tree
Mark Yao [Thu, 15 Dec 2016 02:27:20 +0000 (10:27 +0800)]
drm/panel: support get bus_format from device-tree

copy include/uapi/linux/media-bus-format.h to include/dt-bindings/display/media-bus-format.h
So we can use media bus format on device-tree.

Change-Id: I8f63856c4d61c77958c24cd5a4436050b85a093c
Signed-off-by: Mark Yao <>
5 years agoARM64: dts: rk3399: fix coding style for tve1205g
Zhou weixin [Wed, 14 Dec 2016 07:26:50 +0000 (15:26 +0800)]
ARM64: dts: rk3399: fix coding style for tve1205g

Change-Id: I88ec89d500142f4292fba6cd94fb8802d960dcc1
Signed-off-by: Zhou weixin <>
5 years agodrm/rockchip: update pre dither down config
Huang Jiachai [Mon, 12 Dec 2016 07:18:44 +0000 (15:18 +0800)]
drm/rockchip: update pre dither down config

between vop big and hdmi/edp/dp connect mode is 10bit, so we disable
pre dither down, otherwise enable pre dither down.

Change-Id: If18ed05647d2eb3c6d5c159dd365ea66e55cd408
Signed-off-by: Huang Jiachai <>
5 years agodrm/rockchip: boot_logo: add vop loader power protect
Mark Yao [Wed, 14 Dec 2016 10:30:24 +0000 (18:30 +0800)]
drm/rockchip: boot_logo: add vop loader power protect

Change-Id: I018aef21831b7df05393cfe6dd4782bc1f4a8938
Signed-off-by: Mark Yao <>
5 years agoarm64: dts add Rockchip RK3328 core dtsi and dts for EVB board
Chen Liang [Mon, 5 Dec 2016 12:18:52 +0000 (20:18 +0800)]
arm64: dts add Rockchip RK3328 core dtsi and dts for EVB board

Change-Id: I7b0af1eff050262d38716ce83ec7debb6538b010
Signed-off-by: Chen Liang <>
Signed-off-by: Elaine Zhang <>
Signed-off-by: David Wu <>
5 years agophy: rockchip-inno-usb2: usb remote wakeup support
Frank Wang [Sun, 18 Sep 2016 07:07:37 +0000 (15:07 +0800)]
phy: rockchip-inno-usb2: usb remote wakeup support

This adds support usb remote wakeup both host-port and otg-port,
each port can detect linestate irq then wakeup the whole system.

Change-Id: I5efcf958131827548954deb9360b9e98aa4bd0bc
Signed-off-by: Frank Wang <>
5 years agodrm/rockchip: fix compile warning unused private
Mark Yao [Wed, 14 Dec 2016 03:47:21 +0000 (11:47 +0800)]
drm/rockchip: fix compile warning unused private

Fix warning:
drivers/gpu/drm/rockchip/rockchip_drm_fb.c: In function 'rockchip_drm_fb_destroy':
      warning: unused variable 'private' [-Wunused-variable]

Change-Id: Id120d86173823a68b9136a99f17fe5415041e471
Signed-off-by: Mark Yao <>
5 years agodrm/panel: simple: Add support for INNOLUX N125HCE-GPA 1920x1080 panel
WeiYong Bi [Mon, 12 Dec 2016 08:36:07 +0000 (16:36 +0800)]
drm/panel: simple: Add support for INNOLUX N125HCE-GPA 1920x1080 panel

The INNOLUX N125HCE-GPA is a 12.5' TFT Liquid Crystal Display NB module
with LED Backlight unit and 30 pins eDP interface. This module supports
1920x1080 FHD mode and can display 16.7M colors.

Change-Id: I72318ac3317cd03e2301a1cab61cf126cd2a401b
Signed-off-by: WeiYong Bi <>
5 years agophy: rockchip-inno-usb2: support otg vbus always powered on
William Wu [Tue, 13 Dec 2016 09:29:24 +0000 (17:29 +0800)]
phy: rockchip-inno-usb2: support otg vbus always powered on

Some platforms (e.g. RK3399 BOX board) otg port connector
interface is not standard, that is a Type-A connector with
vbus always powered on, looks like to work as host mode,
however, the otg port still need to support DRD mode.

In the current code, if otg vbus is always powered on, it
will cause USB2 PHY to detect a floating charger in error
case and power off USB2 PHY. This patch adds a new property
"rockchip,vbus-always-on" to fix this issue. With this patch,
we handle this case as otg host only mode, and avoid to do
charger detection and power off USB2 PHY.

Change-Id: I69e5e87021f3f2d654793e547264aec55ac664ef
Signed-off-by: William Wu <>
5 years agoARM64: dts: rockchip: move rk3399 pmu-io-domain nodes to the pmugrf
Jianqun Xu [Tue, 13 Dec 2016 09:29:34 +0000 (17:29 +0800)]
ARM64: dts: rockchip: move rk3399 pmu-io-domain nodes to the pmugrf

Afer the "PM / AVS: rockchip-io: make io-domains a child of the GRF",
the pmu-io-domains should be a sub-node of the pmugrf simple-mfd.

Change-Id: Iebfe9041a604580ce3e5b028d7a143fcdbbdff25
Signed-off-by: Jianqun Xu <>
5 years agoARM64: dts: rockchip: move rk3399 io-domain nodes to the grf
Jianqun Xu [Fri, 9 Dec 2016 10:59:34 +0000 (18:59 +0800)]
ARM64: dts: rockchip: move rk3399 io-domain nodes to the grf

Afer the "PM / AVS: rockchip-io: make io-domains a child of the GRF",
the io-domains should be a sub-node of the grf simple-mfd.

Change-Id: Ic2a40726bccee8b795b5249e07f2537fd30b3f7b
Signed-off-by: Jianqun Xu <>
5 years agork: ignore memcontrol.c:5355
Huang, Tao [Tue, 13 Dec 2016 11:08:20 +0000 (19:08 +0800)]
rk: ignore memcontrol.c:5355

Change-Id: Ic55a0e167d8158069efe136b5af61d49be17c17d
Signed-off-by: Huang, Tao <>
5 years agoARM64: dts: rockchip: remove isp support for rk3399 evb3
Jianqun Xu [Tue, 13 Dec 2016 09:12:20 +0000 (17:12 +0800)]
ARM64: dts: rockchip: remove isp support for rk3399 evb3

Enable isp will cause system to halt on android booting, which
is caused by wrong voltage for vdd_gpu.

isp will set gpio directly, unfortunatly, it sets the enable gpio
of dc-dc for gpu.

There has no good solution for isp to fix this issue, so let's
disable the isp node for rk3399 evb3 firstly to make board works

Change-Id: I5dd8c367a192ce793ed388aaf143125550e90621
Signed-off-by: Jianqun Xu <>
5 years agodrm/panel: simple: Add support for AUO B125HAN03.1 1920x1080 panel
WeiYong Bi [Mon, 12 Dec 2016 08:40:21 +0000 (16:40 +0800)]
drm/panel: simple: Add support for AUO B125HAN03.1 1920x1080 panel

The AUO B125HAN03.1 panel is a 12.5' FHD 16:9 Color TFT-LCD
and 30 pins eDP interface.

Change-Id: Ic2be5f1d5a3e25d805e0752c1c1fad0decc4f2d0
Signed-off-by: WeiYong Bi <>
5 years agodrm/panel: simple: Add support for BOE NV124FHM-N73 1920x1080 panel
WeiYong Bi [Mon, 12 Dec 2016 08:46:21 +0000 (16:46 +0800)]
drm/panel: simple: Add support for BOE NV124FHM-N73 1920x1080 panel

The BOE NV125FHM-N73 panel is a 12.5' FHD 16:9 Color TFT-LCD
and 30 pins eDP interface.

Change-Id: Idc15fb7126bf778fd23a766b01c2d5cf9760d4f3
Signed-off-by: WeiYong Bi <>
5 years agoARM64: dts: rk3399: add new dts for tve1205g
Zhou weixin [Tue, 6 Dec 2016 03:53:31 +0000 (11:53 +0800)]
ARM64: dts: rk3399: add new dts for tve1205g

Change-Id: I698a0cb3efa998c3c5cd53e238c656fba82e15cc
Signed-off-by: Zhou weixin <>
5 years agoiommu/rockchip: Ignore isp reset when isp mmu attach
Simon [Thu, 1 Dec 2016 01:40:28 +0000 (09:40 +0800)]
iommu/rockchip: Ignore isp reset when isp mmu attach

Reset isp mmu would failed when attach,just ignore reset operation

Change-Id: Ib323db151e7313635524526d5304e16b9b504201
Signed-off-by: Simon <>
5 years agocpufreq: dt: fix the warning occurred when upped cpu5 before cpu4
Finley Xiao [Mon, 12 Dec 2016 01:46:29 +0000 (09:46 +0800)]
cpufreq: dt: fix the warning occurred when upped cpu5 before cpu4

root@rk3399:/ # echo 0 > /sys/devices/system/cpu/cpu4/online
CPU4: shutdown
psci: CPU4 killed.
root@rk3399:/ # echo 0 > /sys/devices/system/cpu/cpu5/online
IRQ17 no longer affine to CPU5
CPU5: shutdown
psci: CPU5 killed.
root@rk3399:/ # echo 1 > /sys/devices/system/cpu/cpu5/online
Detected PIPT I-cache on CPU5
CPU5: found redistributor 101 region 0:0x00000000fefa0000
CPU5: update cpu_capacity 1024
CPU5: Booted secondary processor [410fd082]
cpu cpu5: opp_list_debug_create_link: Failed to create link
cpu cpu5: _add_opp_dev: Failed to register opp debugfs (-12)
cpu cpu5: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)

Change-Id: I9b066f9712b7f8426561e03a538a9a5c45138ab0
Signed-off-by: Finley Xiao <>
5 years agodrm/rockchip: vop: fix win ext config offset
Mark Yao [Mon, 12 Dec 2016 10:19:58 +0000 (18:19 +0800)]
drm/rockchip: vop: fix win ext config offset

Use win->offset for window ext config is wrong,
cause yuv color space display abnormal.

Change-Id: I425c412767ad1014cff0707e549d17534fa8059b
Signed-off-by: Mark Yao <>
5 years agoUPSTREAM: dt-bindings: add bindings for Rockchip grf
Jianqun Xu [Tue, 23 Feb 2016 07:01:01 +0000 (15:01 +0800)]
UPSTREAM: dt-bindings: add bindings for Rockchip grf

Add devicetree bindings for Rockchip grf which found on
Rockchip SoCs.

Change-Id: Iac0913b71925f7ddc0edd10b34024b049aace964
Signed-off-by: Jianqun Xu <>
Acked-by: Rob Herring <>
Signed-off-by: Heiko Stuebner <>
(cherry picked from commit fe95effb4c381355e38f5bffced4917a2b6dc7d3)

5 years agovideo: rockchip: fb: add more debug message
Huang Jiachai [Mon, 14 Nov 2016 01:07:17 +0000 (09:07 +0800)]
video: rockchip: fb: add more debug message

Change-Id: Id096dec3a60cee14fecd16f37407fa10f8d8b90e
Signed-off-by: Huang Jiachai <>
5 years agopinctrl: rockchip: Add rk3328 pinctrl support
David Wu [Fri, 9 Dec 2016 03:38:17 +0000 (11:38 +0800)]
pinctrl: rockchip: Add rk3328 pinctrl support

Change-Id: I3b5b69e46b555ab3578d611e5d480ced9c493666
Signed-off-by: David Wu <>
5 years agoPM / AVS: check initial rate only once
Finley Xiao [Fri, 9 Dec 2016 03:41:02 +0000 (11:41 +0800)]
PM / AVS: check initial rate only once

The patch fixes the warring when rk3399-vr resume:

CPU4: found redistributor 100 region 0:0x00000000fef80000
CPU4: update cpu_capacity 1024
CPU4: Booted secondary processor [410fd082]
rk3x-i2c ff3c0000.i2c: timeout, ipd: 0x10, state: 1
rk3x-i2c ff3c0000.i2c: timeout, ipd: 0x10, state: 1
rk3x-i2c ff3c0000.i2c: timeout, ipd: 0x10, state: 1
cpu cpu4: _set_opp_voltage:
failed to set voltage (800000 800000 800000 mV): -110
cpu cpu4: failed to set volt 800000
CPU4 is up
Detected PIPT I-cache on CPU5
CPU5: found redistributor 101 region 0:0x00000000fefa0000
CPU5: update cpu_capacity 1024
CPU5: Booted secondary processor [410fd082]
CPU5 is up

Change-Id: I36f1b5d23c8d2436e20765d699dfde9eb8cf74fa
Signed-off-by: Finley Xiao <>
5 years agoPM / OPP: fix the errors occurred during getting or setting voltage
Finley Xiao [Fri, 9 Dec 2016 03:34:03 +0000 (11:34 +0800)]
PM / OPP: fix the errors occurred during getting or setting voltage

Change-Id: Iae0695d780b7f8f75c6d49bde5ee09beb04e1d80
Signed-off-by: Finley Xiao <>
5 years agoarm64: dts: rk3399-android-next: Use original rga
Zikim,Wei [Wed, 7 Dec 2016 04:34:08 +0000 (12:34 +0800)]
arm64: dts: rk3399-android-next: Use original rga

Change-Id: Ie3d5de2158e888546102bf131a9bd16f8701693e
Signed-off-by: Zikim,Wei <>
5 years agoi2c: rk3x: Add i2c support for rk3328
David Wu [Fri, 9 Dec 2016 03:41:20 +0000 (11:41 +0800)]
i2c: rk3x: Add i2c support for rk3328

Change-Id: I04597a8acde38699b910cd7f3a688c501a0cf571
Signed-off-by: David Wu <>
5 years agoclk: rockchip: add clock controller for rk3328
Elaine Zhang [Wed, 7 Dec 2016 07:23:35 +0000 (15:23 +0800)]
clk: rockchip: add clock controller for rk3328

Add the clock tree definition for the new rk3328 SoC.
Fix up the pll setting to support rk3328 SoC.

Change-Id: Icf887625697515cf3e2cd2f7da7956a57c7e558a
Signed-off-by: Elaine Zhang <>
5 years agoclk: rockchip: add dt-binding header for rk3328
Elaine Zhang [Wed, 7 Dec 2016 07:15:24 +0000 (15:15 +0800)]
clk: rockchip: add dt-binding header for rk3328

Add the dt-bindings header for the rk3328, that gets shared between
the clock controller and the clock references in the dts.
Add softreset ID for rk3328.

Change-Id: I8e6301fd854fe5c9a820fe76d7826db2c1c08b4e
Signed-off-by: Elaine Zhang <>
5 years agoarm64: dts: rk3399-android-next: add iommu_enabled property in vpu&rkvdec node
Jung Zhao [Fri, 9 Dec 2016 13:11:25 +0000 (21:11 +0800)]
arm64: dts: rk3399-android-next: add iommu_enabled property in vpu&rkvdec node

camera will query this property, this is historical issue!!!

Change-Id: Ida221e9f5781dcc5562cad69e2ac437290b946bb
Signed-off-by: Jung Zhao <>
5 years agovideo: rockchip: fb: add dataspace for hdr
Huang Jiachai [Thu, 20 Oct 2016 08:23:05 +0000 (16:23 +0800)]
video: rockchip: fb: add dataspace for hdr

Change-Id: I65fb95a550d6afecf6b45f65afbd24047e8d5097
Signed-off-by: Huang Jiachai <>
5 years agoUPSTREAM: ARM: dts: rockchip: Setup rk3288 ethernet0 alias for u-boot
Jacob Chen [Fri, 9 Dec 2016 06:43:36 +0000 (14:43 +0800)]
UPSTREAM: ARM: dts: rockchip: Setup rk3288 ethernet0 alias for u-boot

Add an ethernet0 alias for the RK3288 mac interface so
that u-boot can find the device-node and fill in the mac address on
boards that support a wired network interface.

Signed-off-by: Sjoerd Simons <>
Signed-off-by: Heiko Stuebner <>
Change-Id: Ie8c4e0d90b62278485446f614fce0c95145432d9
(cherry picked from commit 85ef8d611f4b0216bc4f96487a0408d5c887f6f9)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: add interrupt for Wake-on-Lan on RK3288
Jacob Chen [Fri, 9 Dec 2016 06:43:22 +0000 (14:43 +0800)]
UPSTREAM: ARM: dts: rockchip: add interrupt for Wake-on-Lan on RK3288

In order to use Wake-on-Lan on RK3288 integrated MAC, we need to wake-up
the CPU on the PMT interrupt when the MAC and the PHY are in low power mode.
Adding the interrupt declaration.

Signed-off-by: Vincent Palatin <>
Signed-off-by: David S. Miller <>
Change-Id: Iec2637cc0448b6d93b895ca8f4176bab0a1f2dfb
(cherry picked from commit d5bfbeb80973010dc87c82dc56f66e99c3e8c4da)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: drop unneeded properties from mipi node
Jacob Chen [Fri, 9 Dec 2016 06:43:07 +0000 (14:43 +0800)]
UPSTREAM: ARM: dts: rockchip: drop unneeded properties from mipi node

The mipi controller node does contain an unused reg property as well as
unnecessary #address-cells and #size-cells properties for subnodes
not using addresses, so remove those to also make dtc happy.

Signed-off-by: Heiko Stuebner <>
Acked-by: Rob Herring <>
Change-Id: I48166c93f7746fa88fe2b35c3a040048926cadf7
(cherry picked from commit 6b241fcccb42ab96b3cdca7066cebd0f5cdd44e0)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: add mipi_dsi to VIO power domain on rk3288
Jacob Chen [Fri, 9 Dec 2016 06:42:53 +0000 (14:42 +0800)]
UPSTREAM: ARM: dts: rockchip: add mipi_dsi to VIO power domain on rk3288

The MIPI controllers are part of the VIO power domain so add the
necessary property to indicate this for the controller we support.

Signed-off-by: John Keeping <>
Signed-off-by: Heiko Stuebner <>
Change-Id: I1d51ba1b91dcacb4dfbd6a23d3e609cb66b9426e
 (cherry picked from commit 1946a201b3963b78a9e2123aedbdd11c4c4849dd)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: add channels properties for i2s
Jacob Chen [Fri, 9 Dec 2016 06:42:36 +0000 (14:42 +0800)]
UPSTREAM: ARM: dts: rockchip: add channels properties for i2s

add playback and capture properties to compatible various chips.

Signed-off-by: Sugar Zhang <>
Signed-off-by: Heiko Stuebner <>
Change-Id: I7bc186f631212b0b2f3355aa2e371c52a0a99ede
 (cherry picked from commit e241657de0ced9b40cad126f461b23a8d6c1b563)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: move the rk3288 thermal data into rk3288.dtsi
Jacob Chen [Fri, 9 Dec 2016 06:42:21 +0000 (14:42 +0800)]
UPSTREAM: ARM: dts: rockchip: move the rk3288 thermal data into rk3288.dtsi

In order to be standard to manage for rockchip SoCs,  move the thermal
data into rk3288 dtsi, we needn't to add a new file for thermal.

Signed-off-by: Caesar Wang <>
Cc: Zhang Rui <>
Cc: Eduardo Valentin <>
Cc: Heiko Stuebner <>
Signed-off-by: Heiko Stuebner <>
Change-Id: I2b11b46d1cfb9b70882d1062dedc5b8ff1bd5adf
(cherry picked from commit f87305fa00b1d0633d2dc5fd7fb4995bed6a59e8)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: fix rk3288 power-domain unit names
Jacob Chen [Fri, 9 Dec 2016 06:42:03 +0000 (14:42 +0800)]
UPSTREAM: ARM: dts: rockchip: fix rk3288 power-domain unit names

The power-domain sub-nodes do have reg properties, but so far are
missing the expected unit names. So add the missing ones.

Signed-off-by: Heiko Stuebner <>
Acked-by: Rob Herring <>
Change-Id: I03d82afdc2f170c7ecce9685e15b418ca5d30d5a
(cherry picked from commit 95cface95b6a6a8de6e95de2c8a25a64fd0f3558)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: fix missing usbphy unit-names
Jacob Chen [Fri, 9 Dec 2016 06:41:36 +0000 (14:41 +0800)]
UPSTREAM: ARM: dts: rockchip: fix missing usbphy unit-names

The usbphy subnodes do have a reg property but no unitname, add them.

Signed-off-by: Heiko Stuebner <>
Acked-by: Rob Herring <>
Change-Id: I5b48e289b332397ab7c383b839b875aeefa9f114
 (cherry picked from commit a8f0fa2764626d2dd808cfbe1a160f2939a36c88)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: phy: rockchip-usb: should be a child device of the GRF
Jacob Chen [Fri, 9 Dec 2016 06:41:10 +0000 (14:41 +0800)]
UPSTREAM: phy: rockchip-usb: should be a child device of the GRF

The usb-phy is fully enclosed in the general register files (GRF).
Therefore as seen from the device-tree it shouldn't be a separate
platform-device but instead a sub-device of the GRF - using the
simply-mfd mechanism.

As the usb-phy is part of the kernel for some releases now, we keep
the old (and now deprecated) binding for compatibility purposes.

Signed-off-by: Heiko Stuebner <>
Signed-off-by: Kishon Vijay Abraham I <>
Change-Id: I747a18fba361d6c6f161b6572e43955e18593a34
 (cherry picked from commit a0da445aabe49c31093ecf3930f531e3c63e0b83)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: phy: rockchip-dp: should be a child device of the GRF
Jacob Chen [Fri, 9 Dec 2016 06:40:51 +0000 (14:40 +0800)]
UPSTREAM: phy: rockchip-dp: should be a child device of the GRF

The displayport-phy is fully enclosed in the general register files (GRF).
Therefore as seen from the device-tree it shouldn't be a separate platform-
device but instead a sub-device of the GRF - using the simply-mfd mechanism.

The driver entered the kernel in the current merge-window, so we can still
adapt the binding without needing a fallback, as the binding hasn't been
released with a full kernel yet.

While the edp phy is fully part of the GRF, it doesn't have any separate
register set there, so doesn't get any register-area assigned.

Signed-off-by: Heiko Stuebner <>
Acked-by: Rob Herring <>
Reviewed-by: Yakir Yang <>
Signed-off-by: Kishon Vijay Abraham I <>
Change-Id: I44a857051be195386fc888b2c713bedc948d5c95
Signed-off-by: Jacob Chen <>
 (cherry picked from commit 0311c76e4722b8d6e5fa47eaee63c6552bcc74f5)

5 years agoUPSTREAM: PM / AVS: rockchip-io: make io-domains a child of the GRF
Jacob Chen [Fri, 9 Dec 2016 06:40:33 +0000 (14:40 +0800)]
UPSTREAM: PM / AVS: rockchip-io: make io-domains a child of the GRF

IO-domain handling is part of the general register files, so should live
under the grf directly. This change allows the grf to be a simple-mfd and
the io-domains fetching the syscon regmap from that parent-node.

The old binding is of course preserved, though deprecated.

Signed-off-by: Heiko Stuebner <>
Acked-by: Kevin Hilman <>
Tested-by: David Wu <>
Signed-off-by: Rafael J. Wysocki <>
Change-Id: I562e293fc96283edc868771851f15dba0e80d3bc
(cherry picked from commit bc19b9a81da009fd1d797d756d41b518ac7e5f14)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: arm: dts: rockchip: add reset node for the exist saradc SoCs
Jacob Chen [Fri, 9 Dec 2016 06:40:18 +0000 (14:40 +0800)]
UPSTREAM: arm: dts: rockchip: add reset node for the exist saradc SoCs

SARADC controller needs to be reset before programming it, otherwise
it will not function properly.

Signed-off-by: Caesar Wang <>
Acked-by: Heiko Stuebner <>
Cc: <>
Signed-off-by: Jonathan Cameron <>
Change-Id: Iaafd41b163ebd853278baea5c1c10dc82c54792b
 (cherry picked from commit 3d4267a5a3a4b7619b80ad1839d8b3bedd8b7a8d)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: move rk3288 usbphy under the GRF node
Jacob Chen [Fri, 9 Dec 2016 06:40:03 +0000 (14:40 +0800)]
UPSTREAM: ARM: dts: rockchip: move rk3288 usbphy under the GRF node

The rk3288 usbphy is completely enclosed in the general register files
and the updated binding allows it to be a subnode of the GRF now.
So move the node appropriately.

Signed-off-by: Heiko Stuebner <>
Change-Id: I85ca27786da0cd388ef6b4fddb11747761a579a3
(cherry picked from commit 546a3521f251462128d877e48fb3544c74976ce4)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: move rk3288 io-domain nodes to the grf
Jacob Chen [Fri, 9 Dec 2016 06:39:47 +0000 (14:39 +0800)]
UPSTREAM: ARM: dts: rockchip: move rk3288 io-domain nodes to the grf

io-voltage control is actually part of the grf, so move the node under the
newly available grf simple-mfd.

To minimize duplicate code, the core node and compatible property
gets placed in the core rk3288.dtsi while the individual boards
now only need to enable it and add the necessary supply properties.
cherry picked from commit 4b91545072ad7ca1963d2a89c8b42fc2eb561484)

Signed-off-by: Heiko Stuebner <>

Change-Id: I4f5ecc16524c52e8ac6f04cf8b9cdc0e1b7d937f
 (cherry picked from commit 3445b2fae55f1a232e6e4843f4f74de074d8c07f)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: move rk3288 edp phy under the GRF
Jacob Chen [Fri, 9 Dec 2016 06:39:34 +0000 (14:39 +0800)]
UPSTREAM: ARM: dts: rockchip: move rk3288 edp phy under the GRF

The edp-phy control is a part of the General Register Files and
with a recent patch in 4.6 the phy driver can now also handle this
correctly, so move the dts node under the GRF as well.

Signed-off-by: Heiko Stuebner <>
Change-Id: I6be6270739520f758dbe388cdbd50896c1d7d6f1
(cherry picked from commit 4b91545072ad7ca1963d2a89c8b42fc2eb561484)
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: ARM: dts: rockchip: make rk3288-grf a simple-mfd
Jacob Chen [Fri, 9 Dec 2016 06:39:20 +0000 (14:39 +0800)]
UPSTREAM: ARM: dts: rockchip: make rk3288-grf a simple-mfd

Similar to the pmu, the general register files contain a lot of different
setting bits grouped into general registers, but also some somewhat special
entities like the controls for some phy-blocks or the io-voltage control.
To be able to move these blocks under the grf node where they actually
belong, make it a simple-mfd.

Signed-off-by: Heiko Stuebner <>
Change-Id: I2c7f9d6f4411ea05520515a45acbaa689814c872
(cherry picked from commit 6e38e6b26e590b21247c1dd5238be35e7b056ef9)
Signed-off-by: Jacob Chen <>
5 years agoarm64: dts: rk3399: enabled rkvdec and vpu on android next board
wlq [Fri, 9 Dec 2016 07:55:41 +0000 (15:55 +0800)]
arm64: dts: rk3399: enabled rkvdec and vpu on android next board

Change-Id: I418b1065de8e078f1cf25f24889ca78006a98a4e
Signed-off-by: huang zufang <>
Signed-off-by: zhangjun <>
Signed-off-by: liangqing wu <>
5 years agovideo: rockchip: rkvdec: add drm&ion allocator support
Randy Li [Mon, 31 Oct 2016 08:58:28 +0000 (16:58 +0800)]
video: rockchip: rkvdec: add drm&ion allocator support

Now vpu driver support both drm and ion allocator. And have
test on rk3399-mid(drm android 7.1), rk3399-mid(ion android
6.0), rk3288(linux mini arm) platform.

Change-Id: I0096c3928849b1f11a62378675f4559b4f101445
Signed-off-by: Jung Zhao <>
Signed-off-by: Mark Yao <>
Signed-off-by: Randy Li <>
5 years agoARM64: dts: rockchip: add rkvpu & vpu node in rk3399 android next dtsi
Jung Zhao [Thu, 8 Dec 2016 06:43:24 +0000 (14:43 +0800)]
ARM64: dts: rockchip: add rkvpu & vpu node in rk3399 android next dtsi

Change-Id: I8151e5dbc428c6a0eb2bcdba5edb193ca304249c
Signed-off-by: Jung Zhao <>
5 years agoarm64: dts: rockchip: add allocator type inside vpu & rkvdec for rk3399-android
Jung Zhao [Thu, 8 Dec 2016 06:39:26 +0000 (14:39 +0800)]
arm64: dts: rockchip: add allocator type inside vpu & rkvdec for rk3399-android

Change-Id: Idecb0b1f360173955531fed0eac32407eeb33366
Signed-off-by: Jung Zhao <>
5 years agodrm/rockchip: fb: allow big framebuffer
Mark Yao [Fri, 9 Dec 2016 07:07:54 +0000 (15:07 +0800)]
drm/rockchip: fb: allow big framebuffer

Change-Id: I2893ebbd616b79dfa6a1fcd1b98576097cbe4cb3
Signed-off-by: Mark Yao <>
5 years agodrm/rockchip: add dither config for connected panel
Huang Jiachai [Thu, 8 Dec 2016 13:03:54 +0000 (21:03 +0800)]
drm/rockchip: add dither config for connected panel

Change-Id: Ia57d2ab75718d0a7a8b386a7d50e2e23011baeb2
Signed-off-by: Huang Jiachai <>
5 years agodrm/rockchip: fix iommu_map_sg check
Mark Yao [Fri, 9 Dec 2016 01:03:10 +0000 (09:03 +0800)]
drm/rockchip: fix iommu_map_sg check

The return value of iommu_map_sg is size_t, it's unsigned

Change-Id: Ib06f61c020510673bc513e1a8fde6fd3980a7ca3
Signed-off-by: Mark Yao <>
5 years agodrm/rockchip: fix iommu page fault when use boot logo
Mark Yao [Thu, 8 Dec 2016 09:00:30 +0000 (17:00 +0800)]
drm/rockchip: fix iommu page fault when use boot logo

Since (cacb6f5 FROMLIST: drm/rockchip: Use common IOMMU API to attach
devices), rockchip drm use common IOMMU API, the boot logo buffer
mapping need change to new api.

Change-Id: Ifa2c886e05d2de65de53a868458c56859519a0f2
Signed-off-by: Mark Yao <>
5 years agopower: reset: reboot-mode: treat unrecognized reboot mode as normal mode
Andy Yan [Thu, 8 Dec 2016 08:58:07 +0000 (16:58 +0800)]
power: reset: reboot-mode: treat unrecognized reboot mode as normal mode

Some bootloader will check the reboot mode to take different action, so
we treat unrecognized reboot mode as normal mode to prevent the system
run into abnormal case.

Change-Id: I88063a5b41e4e645443229fa490b2b55db5ccf27
Signed-off-by: Andy Yan <>
5 years agovideo/rockchip: rga2 support dma fd
Zikim,Wei [Wed, 7 Dec 2016 02:21:48 +0000 (10:21 +0800)]
video/rockchip: rga2 support dma fd

in drm mode ion is not support dma fd, in order
to support drm fd rga driver need fix, and user
also need set the buf type by the macro

Change-Id: I3d0eaf7fbefda5aaf715772649d972b9a9d5c06d
Signed-off-by: Zikim,Wei <>
5 years agoARM: dts: rk3288: add isp node
Jacob Chen [Thu, 8 Dec 2016 04:34:16 +0000 (12:34 +0800)]
ARM: dts: rk3288: add isp node

Change-Id: Iadb1bb9afae66a935b0498986c3ee83a0fb487c9
Signed-off-by: Jacob Chen <>
5 years agoclk: rockchip: rk3288: export isp and cif clk
Jacob Chen [Thu, 8 Dec 2016 04:31:06 +0000 (12:31 +0800)]
clk: rockchip: rk3288: export isp and cif clk

Change-Id: I2d9e46383f94cbd8023ad042f3921364c191f852
Signed-off-by: Jacob Chen <>
5 years agousb: dwc3: gadget: change detemination method of connect status
Meng Dongyang [Fri, 2 Dec 2016 10:27:09 +0000 (18:27 +0800)]
usb: dwc3: gadget: change detemination method of connect status

In current code, the connect status will be set to connected state when
reset interrupt occur and change to disconnected state in disconnect

But the usb charger may bring about reset signal in accident if we
connect and disconnect quickly. In this case, the dwc3 controller will
change link state and set to connect status, yet not change to
disconnected state when disconnect. So the dwc3 controller suspend
fail and result in a mistake when quick reconnect.

This patch set connect status to connected state when transfer complete
to make sure that usb is connect to PC exactly.

Change-Id: I8e5894d2e08b88bb5434222100d8f5c91c9f1a9d
Signed-off-by: Meng Dongyang <>
5 years agousb: dwc3-rockchip: delay suspend until gadget finish transfer
Meng Dongyang [Thu, 24 Nov 2016 07:59:40 +0000 (15:59 +0800)]
usb: dwc3-rockchip: delay suspend until gadget finish transfer

DWC3 controller still need to read or write memory after dwc3
rockchip receive disconnect notify, the dwc3 controller will not
suspend immediately and the clock is still enabled even if we put
dwc_rockchip sync. So if we reconnect to PC quickly, the transer
will start before dwc3 rockchip receive connect notify and the dwc3
controller will reset during normal transer which result in the gadget
function break.

In order to suspend dwc3 controller and disable clock when transfer
finish immediately, this patch wait for usage_count of dwc3 controller
change to 1 and disconnect interrupt occur then suspend dwc3 controller
and disable clock, make the dwc3 continue transfer after dwc3 rockchip
receive connect notify, otherwise do not reset and get or put dwc3
controller if timeout.

Change-Id: If65344557d77370e9b6cf4bfea84175c37f00057
Signed-off-by: Meng Dongyang <>
5 years agophy: rockchip-inno-usb2: set floating charger type as DCP
William Wu [Thu, 8 Dec 2016 03:00:45 +0000 (11:00 +0800)]
phy: rockchip-inno-usb2: set floating charger type as DCP

Floating charger is a kind of special USB charger that
dp/dm not shorted, which is incompatible with BC1.2 spec.

However, we need to support this floating charger, and
consider that the max charge current of floating charger
is the same as standard USB charger (dp/dm is shorted),
so we set the charger type as DCP for floating charger.

Change-Id: Ifaca7269a3d4660ac095c59776d7e935fe6126df
Signed-off-by: William Wu <>
5 years agodrivers: video: rockchip: hdmi: modify RAYKEN5.46 pixclock
wjh [Thu, 8 Dec 2016 07:57:16 +0000 (15:57 +0800)]
drivers: video: rockchip: hdmi: modify RAYKEN5.46 pixclock

Change-Id: Ic2e003d6da16939a95a1c3e844d72b9566aefa4b
Signed-off-by: wjh <>
5 years agoinput: touchscreen: fix tp gslxxxx irq number bug
Bin Yang [Wed, 7 Dec 2016 02:53:08 +0000 (10:53 +0800)]
input: touchscreen: fix tp gslxxxx irq number bug

gslxxxx wrong irq number with the same vopb, may cause vopb abnormal.

ts->irq is gpio number, gslxxxx irq number is ts->client->irq
ts->client->irq = gpio_to_irq(ts->irq)

Change-Id: Ic1f6a46437a2a185f3218d3f0406deeddd9d670a
Signed-off-by: Bin Yang <>
5 years agoarm: configs: enable dsi for rockchip linux
Jacob Chen [Thu, 27 Oct 2016 09:44:54 +0000 (17:44 +0800)]
arm: configs: enable dsi for rockchip linux

Change-Id: I9c8673adbf858b27e0d1bc06c629030a33f6c982
Signed-off-by: Jacob Chen <>
5 years agoUPSTREAM: phy: rockchip-inno-usb2: fix uninitialized tmout variable
Arnd Bergmann [Wed, 16 Nov 2016 14:22:38 +0000 (15:22 +0100)]
UPSTREAM: phy: rockchip-inno-usb2: fix uninitialized tmout variable

The newly added OTG support has an obvious uninitialized variable
access that gcc warns about:

drivers/phy/phy-rockchip-inno-usb2.c: In function 'rockchip_chg_detect_work':
drivers/phy/phy-rockchip-inno-usb2.c:717:7: error: 'tmout' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This replaces the use of the uninitialized variable with what
the value was in the previous USB_CHG_STATE_WAIT_FOR_DCD

Change-Id: Ibeed4872e1168e135a332a0978d85a4e48083267
Fixes: 0c42fe48fd23 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
Signed-off-by: Arnd Bergmann <>
Signed-off-by: Kishon Vijay Abraham I <>
Signed-off-by: William Wu <>
(cherry picked from kishon/linux-phy next
 commit dd796e921ea571624fcd8685f214fdfd4406101f)

5 years agousb: rockchip-inno-usb2: pull down dp/dm for rk3399 u2phy otg-port
Meng Dongyang [Tue, 6 Dec 2016 09:06:40 +0000 (17:06 +0800)]
usb: rockchip-inno-usb2: pull down dp/dm for rk3399 u2phy otg-port

The linestate change interrupt may occur during suspend if port is
not connected. This patch pull down dp/dm when suspend.

Change-Id: I31e992727ea63efbda4ecec7ad3af02626eceb44
Signed-off-by: Meng Dongyang <>
5 years agoARM64: dts: rk3399: adjust idle-cost-data of EAS with idle state
Chen Liang [Thu, 8 Dec 2016 03:40:13 +0000 (11:40 +0800)]
ARM64: dts: rk3399: adjust idle-cost-data of EAS with idle state

Change-Id: I994371c6a3c2aa99ffd666047a1707754ac96290
Signed-off-by: Chen Liang <>
5 years agoFROMLIST: usb: dwc2: assert phy reset when waking up in rk3288 platform
Jacob Chen [Wed, 7 Dec 2016 09:29:06 +0000 (17:29 +0800)]
FROMLIST: usb: dwc2: assert phy reset when waking up in rk3288 platform

On the rk3288 USB host-only port (the one that's not the OTG-enabled
port) the PHY can get into a bad state when a wakeup is asserted (not
just a wakeup from full system suspend but also a wakeup from

We can get the PHY out of its bad state by asserting its "port reset",
but unfortunately that seems to assert a reset onto the USB bus so it
could confuse things if we don't actually deenumerate / reenumerate the

We can also get the PHY out of its bad state by fully resetting it using
the reset from the CRU (clock reset unit) in chip, which does a more full
reset.  The CRU-based reset appears to actually cause devices on the bus
to be removed and reinserted, which fixes the problem (albeit in a hacky

It's unfortunate that we need to do a full re-enumeration of devices at
wakeup time, but this is better than alternative of letting the bus get

Change-Id: I3120a38a7f646a9d244f04bd2dcfef7474a4a6d1
Signed-off-by: Randy Li <>
Signed-off-by: Jacob Chen <>
(am from

5 years agoFROMLIST: phy: rockchip-usb: use rockchip_usb_phy_reset to reset phy during wakeup
Jacob Chen [Wed, 7 Dec 2016 08:37:42 +0000 (16:37 +0800)]
FROMLIST: phy: rockchip-usb: use rockchip_usb_phy_reset to reset phy during wakeup

It is a hardware bug in RK3288, the only way to solve it is to
reset the phy.

Change-Id: Iad8f52b623df3c4460dc321bb55e9c3111455590
Signed-off-by: Randy Li <>
Acked-by: Rob Herring <>
Signed-off-by: Jacob Chen <>
 (am from

5 years agoFROMLIST: ARM: dts: rockchip: Point rk3288 dwc2 usb at the full PHY reset
Jacob Chen [Wed, 7 Dec 2016 08:34:39 +0000 (16:34 +0800)]
FROMLIST: ARM: dts: rockchip: Point rk3288 dwc2 usb at the full PHY reset

The "host1" port (AKA the dwc2 port that isn't the OTG port) on rk3288
has a hardware errata that causes everything to get confused when we get
a remote wakeup.  We'll use the reset that's in the CRU to reset the
port when it's in a bad state.

Note that we add the reset to both dwc2 controllers even though only one
has the errata in case we find some other use for this reset that's
unrelated to the current hardware errata.  Only the host port gets the
quirk property, though.

Change-Id: I472d33fb1db8b1a6b0c4fcea9ab31fd85b61af40
Signed-off-by: Randy Li <>
Signed-off-by: Jacob Chen <>
(am from

5 years agoarm64: dts: rk3399: add a opp-suspend property for cpu opp table
Finley Xiao [Wed, 30 Nov 2016 03:43:26 +0000 (11:43 +0800)]
arm64: dts: rk3399: add a opp-suspend property for cpu opp table

The opp who contains a opp-suspend property will be configured
during suspend or reboot.

Change-Id: I6b2eede43216435f568db6959127a6e84c8cd4c8
Signed-off-by: Finley Xiao <>
5 years agocpufreq: dt: change frequency to a specific value when cpufreq exits
Finley Xiao [Tue, 29 Nov 2016 12:23:13 +0000 (20:23 +0800)]
cpufreq: dt: change frequency to a specific value when cpufreq exits

Sometimes all cpus of big cluster are closed and its frequency
keep a high value, in order to reduce power and reset normally,
set frequency to a specific value after close all the cpus.

Change-Id: I88bce25812d1b0ff3f78a898cb161642a65cc523
Signed-off-by: Finley Xiao <>
5 years agoarm64: dts: rockchip: rk3399: add dp default mode for rk3399 box discrete vr
Luo wei [Mon, 5 Dec 2016 07:22:16 +0000 (15:22 +0800)]
arm64: dts: rockchip: rk3399: add dp default mode for rk3399 box discrete vr

Change-Id: If1af58e1654786ece68ed24c115ebca78462f62d
Signed-off-by: Luo wei <>
5 years agosoc: rockchip: power-domain: export idle request
Caesar Wang [Fri, 18 Nov 2016 08:24:20 +0000 (16:24 +0800)]
soc: rockchip: power-domain: export idle request

We need to put the power status of HEVC IP into IDLE unless
we can't reset that IP or the SoC would crash down.
rockchip_pmu_idle_request(dev, true)---> enter idle
rockchip_pmu_idle_request(dev, false)---> exit idle

Change-Id: I76733efd2de4f7ee183c1b6bd1545d60038ee31b
Signed-off-by: Caesar Wang <>
Signed-off-by: Jeffy Chen <>
Signed-off-by: Randy Li <>
5 years agoCHROMIUM: drm/rockchip: Respect page offset in IOMMU mmap
Ørjan Eide [Mon, 5 Sep 2016 11:49:12 +0000 (13:49 +0200)]
CHROMIUM: drm/rockchip: Respect page offset in IOMMU mmap

When mapping buffers through the PRIME DMA-buf mmap path we might be
given an offset which has to be respected. The DRM GEM mmap path already
takes care of zeroing out the fake mmap offset, so we can just make the
IOMMU mmap implementation always respect the offset.


Change-Id: Iec83e720b24ddd35a92f3df8312015bc5af798f0
Signed-off-by: rjan Eide <>
Signed-off-by: Tomasz Figa <>
Reviewed-by: Daniel Kurtz <>
Signed-off-by: Randy Li <>
5 years agoCHROMIUM: drm/rockchip: Respect page offset for PRIME mmap calls
Ørjan Eide [Mon, 5 Sep 2016 11:49:12 +0000 (13:49 +0200)]
CHROMIUM: drm/rockchip: Respect page offset for PRIME mmap calls

When mapping external DMA-bufs through the PRIME mmap call, we might be
given an offset which has to be respected. However for the internal DRM
GEM mmap path, we have to ignore the fake mmap offset used to identify
the buffer only. Currently the code always zeroes out vma->vm_pgoff,
which breaks the former.

This patch fixes the problem by moving the vm_pgoff assignment to a
function that is used only for GEM mmap path, so that the PRIME path
retains the original offset.


Change-Id: Iec6e996707b0fe7e95a019423a944d98c80beaab
Signed-off-by: rjan Eide <>
Signed-off-by: Tomasz Figa <>
Reviewed-by: Daniel Kurtz <>
Signed-off-by: Randy Li <>
5 years agoCHROMIUM: drm/rockchip: Call drm_gem_object_release() to destroy GEM base
Tomasz Figa [Wed, 14 Sep 2016 11:50:29 +0000 (20:50 +0900)]
CHROMIUM: drm/rockchip: Call drm_gem_object_release() to destroy GEM base

When converting the driver to use shmem-backed GEMs for IOMMU-enabled
systems, we forgot to add calls to drm_gem_object_release(), which gave
us a quite nice memory leak. This patch adds the missing calls.

Fixes: f11d5f0 ("FROMLIST: drm/rockchip: Do not use DMA mapping API if
attached to IOMMU domain")

TEST=while true; do backlight_dbus_tool --set --percent=0 && sleep 8 &&
 backlight_dbus_tool --set --percent=100 && sleep 3 ; done

Signed-off-by: Tomasz Figa <>
Reviewed-by: Douglas Anderson <>
Reviewed-by: Daniel Kurtz <>

Change-Id: I3c7b21ed22cfb38f512150f76fced3b0cc2b296d
Signed-off-by: Randy Li <>
5 years agoCHROMIUM: drm/rockchip: Fix the call to drm_gem_put_pages()
Tomasz Figa [Thu, 8 Sep 2016 09:52:00 +0000 (18:52 +0900)]
CHROMIUM: drm/rockchip: Fix the call to drm_gem_put_pages()

When freeing the buffer we don't have any means of determining if the
buffer was read or written, so we must assume both and pass true for
both arguments of drm_gem_put_pages(). Let's fix the code which
currently passes false.

TEST=while true; do backlight_dbus_tool --set --percent=0 && sleep 8 &&
 backlight_dbus_tool --set --percent=100 && sleep 3 ; done

Change-Id: I7da2fd81e7e728e0ef242837b70819c4a3aee7bf
Signed-off-by: Tomasz Figa <>
Reviewed-by: Daniel Kurtz <>
Signed-off-by: Randy Li <>
5 years agoFROMLIST: drm/rockchip: Use common IOMMU API to attach devices
Shunqian Zheng [Tue, 21 Jun 2016 04:34:40 +0000 (13:34 +0900)]
FROMLIST: drm/rockchip: Use common IOMMU API to attach devices

Rockchip DRM used the arm special API, arm_iommu_*(), to attach
iommu for ARM32 SoCs. This patch convert to common iommu API
so it would support ARM64 like RK3399.

Since previous patch added support for direct IOMMU address space
management, there is no need to use DMA API anymore and this patch wires
things to use the new method.

Signed-off-by: Shunqian Zheng <>
Signed-off-by: Tomasz Figa <>
(am from

TEST=boot to ui on Gru

Commit-Ready: Tomasz Figa <>
Tested-by: Tomasz Figa <>
Reviewed-by: Tomasz Figa <>

Change-Id: Ide4ce9f74fd431f0b7cd480e38b683f833733b40
Signed-off-by: Randy Li <>
5 years agoUPSTREAM: drm/rockchip: support non-iommu buffer path
Mark Yao [Tue, 19 Apr 2016 02:13:27 +0000 (10:13 +0800)]
UPSTREAM: drm/rockchip: support non-iommu buffer path

Some rockchip vop not support iommu, need use non-iommu
buffer for it. And if we get iommu issues, we can compare
the issues with non-iommu path, that would help the debug.


Change-Id: I843f087281300359b07faac1de156cd648325b45
Signed-off-by: Mark Yao <>
(cherry picked from commit 2d90d477430d3a20df74f2d11c21378e64e1d508)

5 years agoUPSTREAM: drm/rockchip: don't leak iommu mapping
John Keeping [Tue, 5 Apr 2016 13:50:32 +0000 (14:50 +0100)]
UPSTREAM: drm/rockchip: don't leak iommu mapping

arm_iommu_attach_device() takes its own reference to the mapping we give
it.  Since we do not keep a reference to the mapping ourselves, we must
release it before returning.

Also fix the error path, which fails to release the mapping if it has
called arm_iommu_detach_device() since that clears archdata.mapping.


Change-Id: Ia20334afbce08ece5a3238a7b0786547ec0cafb2
Signed-off-by: John Keeping <>
Signed-off-by: Randy Li <>
Signed-off-by: Huang, Tao <>
(cherry picked from commit 69b007968e7519cf1e44920f4578054c9e0fbdc3)

5 years agoUPSTREAM: drm/rockchip: remove redundant statement
John Keeping [Tue, 5 Apr 2016 13:50:31 +0000 (14:50 +0100)]
UPSTREAM: drm/rockchip: remove redundant statement

The call to arm_iommu_detach_device() on the previous line sets
dev->archdata.mapping to NULL so this call is always a no-op.

Change-Id: I09b41c284c61885fb4b989a64839e96bcc316aa6
Signed-off-by: John Keeping <>
Signed-off-by: Huang, Tao <>
(cherry picked from commit aa1ac27f48de0ed94d5a104e15b5ab62b5deb236)

5 years agoCHROMIUM: rockchip: support prime import sg table
Haixia Shi [Fri, 29 Jan 2016 00:23:04 +0000 (16:23 -0800)]
CHROMIUM: rockchip: support prime import sg table

The prime fd to handle ioctl was not used with rockchip before. Support
was added in order to pass graphics_Gbm and to support potential uses
within Chrome OS (e.g. zero-copy video decode, camera).

Difference from kernel 3.14 implementation:
- prime_import_sg_table passes dma-buf as argument instead of size
- need to handle import sg_table for both DMA and IOMMU paths

TEST=test_that graphics_Gbm on kevin

Tested-by: Haixia Shi <>
Commit-Queue: Haixia Shi <>
Trybot-Ready: Haixia Shi <>
Reviewed-by: Haixia Shi <>
Reviewed-by: Stéphane Marchesin <>

Change-Id: I7aae5b0e227de61ac17adf98996152da8db097d2
Signed-off-by: Randy Li <>
5 years agoFROMLIST: drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain
Tomasz Figa [Tue, 21 Jun 2016 04:34:39 +0000 (13:34 +0900)]
FROMLIST: drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain

The API is not suitable for subsystems consisting of multiple devices
and requires severe hacks to use it. To mitigate this, this patch
implements allocation and address space management locally by using
helpers provided by DRM framework, like other DRM drivers do, e.g.

This patch should not introduce any functional changes until the driver
is made to attach subdevices into an IOMMU domain with the generic IOMMU
API, which will happen in following patch. Based heavily on GEM
implementation of Tegra DRM driver.

Signed-off-by: Tomasz Figa <>
Signed-off-by: Shunqian Zheng <>
(am from

TEST=boot to ui on Gru

Commit-Ready: Tomasz Figa <>
Tested-by: Tomasz Figa <>
Reviewed-by: Tomasz Figa <>
Reviewed-by: Daniel Kurtz <>

Change-Id: I599b2551e8e8000024894426e4e19d7543af3b0a
Signed-off-by: Randy Li <>
5 years agoRevert "drm/rockchip: rewrite IOMMU support code"
Jeffy Chen [Fri, 18 Nov 2016 13:04:59 +0000 (21:04 +0800)]
Revert "drm/rockchip: rewrite IOMMU support code"

This reverts commit b435f1a281e8a9ff1f1013318a1147949e55130a.


Change-Id: I15d2d598514c2878a574219fe2268ee8d530d6e2
Signed-off-by: Randy Li <>