Commit Graph

601518 Commits

Author SHA1 Message Date
Mark Yao
5589d1a47e dt-bindings: rockchip: vop: add gamma_table range
Change-Id: Iafbff319d33c9436963572e05911ccfe676a4852
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-11 15:55:39 +08:00
Ander Conselvan de Oliveira
398e38d802 FROMLIST: drm: Pass CRTC ID in userspace vblank events
With the atomic API, it is possible that a single commit affects
multiple crtcs. If the user requests an event with that commit, one
event will be sent for each CRTC, but it is not possible to distinguish
which crtc an event is for in user space. To solve this, the reserved
field in struct drm_vblank_event is repurposed to include the crtc_id
which the event is for.

The DRM_CAP_CRTC_IN_VBLANK_EVENT is added to allow userspace to query if
the crtc field will be set properly.

[daniels: Rebased, using Maarten's forward-port.]

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
(am from https://patchwork.kernel.org/patch/9662099/)

Change-Id: Ibe6949782e5df5363d4eaa3e98b3ff413239cf26
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-05-11 15:38:50 +08:00
zain wang
e469f94ad8 mfd: fusb302: ignored the timeout if vdm got the message.
The PD spec define the source should ensure that a message requesting
a response is responded within 30ms(tSenderResponse). But if the
message responded is received close to 30ms, we may hit the case:

tcpm_get_message(); //get the data and close to 30ms
	... takes about 600us, meanwhile the 30ms timer came.
auto_vdm_machine
	vdm_send... //we get the message, but timeout.

So, let's ignored the timeout if we get the message.

Change-Id: I64ced1bd2d32d8ef996dcec27cf35c3e333386f8
Signed-off-by: zain wang <wzz@rock-chips.com>
2017-05-11 15:34:17 +08:00
Mark Yao
b0dcb82bd1 arm: dts: rockchip: add gamma table support for rk322x
Change-Id: I9aa8af01bd989ff244153d53c8b9b8ca06d3f834
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-11 15:32:43 +08:00
Mark Yao
ab04072538 arm: dts: rockchip: add gamma table support for rk3288
Change-Id: Idb4cd93b8a696925ac56b98c1619999949e6fd84
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-11 15:32:29 +08:00
Mark Yao
1134899a90 arm64: dts: rockchip: add gamma table support for rk3368
Change-Id: Ia0390aa0ffe99a2c2b6ba82ecd83610683d49eac
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-11 15:31:24 +08:00
Mark Yao
0a0e4a68b8 arm64: dts: rockchip: add gamma table support for rk3399
Rk3399 vopb's gamma table size is 1024, vopl's gamma
table size is 256

Change-Id: Iea9cd70f82dfa9c9c8ae53a24c8153eebb981e7a
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-11 15:31:09 +08:00
Mark Yao
4a361fa5d4 drm/rockchip: add support for gamma table
Introduce support for rockchip gamma table,

Rockchip have two version gamma table design:
The old version design was introduced by Dominik Behr's gamma patch
(https://chromium-review.googlesource.com/272209):
 Gamma table has to be uploaded when the LUT is disabled which only takes
 effect at the end of a frame, therefore actual hardware updates is done
 from a worker and can take more than one frame.

In order to solve gamma table switch issues, after rk3399,
H/W add a gamma table update mechanism, can update without lut disable.

And gamma table's size also has two version:
  one is 10 bit per component, 1024 entries,
  the other one is 8 bit per component, 256 entries

Change-Id: I8145d1c42a28d57f11e95d24be2341011360334d
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-11 15:31:04 +08:00
Finley Xiao
0a22588c5e PM / devfreq: rockchip_dmc: avoid waiting for vop line flag indefinitely
It may disable vop_crtc when scaling frequency, in this case,
devfreq thread will wait for vop line flag indefinitely, the
system will crash.

Change-Id: I7043b285c329ff23e2fc9c5b5f3a165c37ef6378
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-05-11 14:47:27 +08:00
Finley Xiao
f0c414b095 drm/rockchip: vop: export rockchip_drm_register_notifier_to_dmc
This function registers a notifier to dmc devfreq, devfreq thread will
lock the mutex of vop when scaling frequency, so vop_crtc will not be
disabled when it is waiting for line flag.

Change-Id: I886e5dc5d36a0f14f35662cec3423a2c5550a7a6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-05-11 14:47:15 +08:00
Finley Xiao
30d22f86ef drm/rockchip: vop: add vop enable/disable mutex lock
It may disable vop_crtc when waiting for line flag, in this case,
we would not get line flag any more. So the lock should be added
to prevent rockchip_wait_line_flag() from vop_crtc_disable();

Change-Id: I312fd46e64006bf69e3c57f54513230b90866e21
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-05-11 14:47:09 +08:00
zhangyunlong
3df3989b1a camera: rockchip: camsys driver v0.0x21.0xf
add reference count for marvin

Change-Id: Ic410da2524a8972d782ccfdcb121e1727b02e9d8
Signed-off-by: zhangyunlong <dalon.zhang@rock-chips.com>
2017-05-10 19:02:45 +08:00
xcq
c8770955ed camera: rockchip: fix some compiled errors and warn
fix spin_unlock error use and some potential problems.

Change-Id: I860c225f2acb5e28827ad3f6b702b0dc7828bb0f
Signed-off-by: xcq <shawn.xu@rock-chips.com>
2017-05-10 18:33:37 +08:00
Tang Yun ping
3e026659b0 ARM: rockchip_defconfig: default to enable rockchip dmc
Change-Id: Ia52708079d41379d0c530b08d6a3a6bf109ee98c
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-10 18:28:13 +08:00
Tang Yun ping
dc114f5754 PM / devfreq: rockchip_dmc: add support for rk3288
This adds the necessary data for handling dmcfreq on the rk3288.

Change-Id: I042222f899d03ec1832ac47b48db8c6c46c3b0d3
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-10 18:23:51 +08:00
Tang Yun ping
9eecb17512 PM / devfreq: event: add support for rk3288 dfi
This adds the necessary data for handling dfi on the rk3288.
Access the dfi via registers provided by GRF (general register
files) module.

Change-Id: Ic7241af3c20a269ab362055dea04d260e01c50de
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-10 18:22:41 +08:00
Tang Yun ping
764e893ee8 clk: rockchip: support setting ddr clock via SIP Version 2 APIs
1. Add support setting ddr clock via SIP Version 2 APIs
2. RK3288 using SIP Vision 2.

Change-Id: I935e43b1885a96650dc86e3eb6d79de6795062a9
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-10 16:17:22 +08:00
Tang Yun ping
40204ab0fd sip: rockchip: fix bus about make kernel failure
When undefine "CONFIG_ROCKCHIP_SIP", define an empty sip function
to avoid make kernel failure.

Change-Id: Id6bcf1cec1c11f09511852e015631d14279ca8bc
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-10 16:17:21 +08:00
Mark Yao
c21d27bafc drm: add drm_device_get_by_name support
Change-Id: Ifbd0f403ca2302e9329a16d7b69db5ee056cadf7
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-10 15:28:18 +08:00
Huibin Hong
9b6a090325 Revert "fiq debugger: add resume for debug uart"
This reverts commit 0e7d751d6c.

If enable no console suspend, it will do resume when printing log,
which causes problem. Remove resume of kernel, and add resume of
trust firmware or other power management code.

Change-Id: I3e8e704140134a6aad5c0eb2f14fde36fb108ad3
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-05-10 11:59:35 +08:00
Frank Wang
ad972dedbe arm: dts: add vdd_arm and vdd_log regulator for rk3229-evb
Change-Id: I1a0bbee3e5b9a43f2a79285c04497ec598697404
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-05-10 11:28:47 +08:00
Xu Jianqun
4d81e6715c arm64: dts: rk3368-android: revert to use uart2 for debug
Change-Id: I5e6c88e185a2ad39b082ad4b989589cd46ecb874
Signed-off-by: Xu Jianqun <jay.xu@rock-chips.com>
2017-05-10 09:21:04 +08:00
David Wu
b9ca500f21 net: stmmac: The netif_device_attach() should be called after napi_enable()
If the netif_device_attach() is called earlier, the state of dev_queue is
waked, txtimer might be modified, and the txtimer is added at same time.
It might make run_timer_softirq crashed, because the timer is be detached
twice together.

Change-Id: I31dde4e940bddcc36372ca1f4a8313c0389d4e6b
Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-05-09 20:10:19 +08:00
Frank Wang
ddb9616d29 arm: dts: simplified rk3229 board configs.
Move EMMC and UART configs from every board DTS to a DTSI file.

Change-Id: If2fd49b9243b879ae89e172f55903eedfd4f3981
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-05-09 20:06:57 +08:00
Frank Wang
23de1f8c34 arm: dts: add watchdog and uart2 related for rk322x SoC
Add another GPIO sets for UART2 since the old ones are conflict
with SDMMC, also add watchdog support.

Change-Id: Ib0f1472b9a7760e15e1b83e103f65f43e3642643
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-05-09 20:06:35 +08:00
Randy Li
646cd86cb8 ARM: dts: rockchip: remove dev_mode from rk3288
Since there is no combo device at RK3288, no need to
use this property anymore.

Change-Id: I56434161c4167fc048e4956e97b29617367e28f6
Signed-off-by: Randy Li <randy.li@rock-chips.com>
2017-05-09 09:40:30 +08:00
Tang Yun ping
f8c67c5e9b clk: rockchip: rk3288: always enable gpll_ddr for ddrc.
When ddr frequency scanning, need to switch to gpll for saving
times.

Change-Id: Ibb7e4ed1fa4babaf65e1d98c8a0891766cea63de
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-08 17:54:43 +08:00
Tang Yun ping
c5ed4570f0 sip: rockchip: add SHARE_PAGE_TYPE_DDR for ddr frequency scanning.
Change-Id: I7b9c81912e15bf2cea6739a051e5f466ba759d77
Signed-off-by: Tang Yun ping <typ@rock-chips.com>
2017-05-08 17:54:38 +08:00
William Wu
81f3ef435d phy: rockchip-inno-usb2: increase otg sm work first schedule time
In rockchip inno usb2 phy driver, we use otg_sm_work to
dynamically manage power consumption for phy otg-port.
If the otg-port works as peripheral mode and doesn't
communicate with usb host, we will suspend phy.

But once suspend phy, the phy no longer has any internal
clock running, include the utmi_clk which supplied for
usb controller. So if we suspend phy before usb controller
init, it will cause usb controller fail to initialize.

Specifically, without this pathch, the observed order is:
 1. unplug usb cable
 2. start system, do dwc2 controller probe
 3. dwc2_lowlevel_hw_enable()
    - phy_init()
     - rockchip_usb2phy_init()
      - schedule otg_sm_work after 2s
        put phy in suspend, and close utmi_clk
 4. dwc2_hsotg_udc_start() - fail to initialize the usb core

Generally, dwc2_hsotg_udc_start() can be called within 5s
after start system on rockchip platform, so we increase the
the first schedule delay time to 6s for otg_sm_work afer usb
controller calls phy_init(), this can make sure that the usb
controller completes initialization before phy enter suspend.

Change-Id: I40a7f6b24620e49a1273cb9c5051d62efb62810d
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-05-08 17:34:25 +08:00
Xu Jianqun
f111309c6a mailbox: rk3368: fix error setting if mbox_msg is null
Fix the error dump:

[19252.682822] Unable to handle kernel NULL pointer dereference at
virtual address 00000020
[19252.682834] pgd = ffffff800935d000
[19252.682844] [00000020] *pgd=0000000077ffe003, *pud=0000000077ffe003,
*pmd=0000000000000000
[19252.682852] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[19252.682863] Modules linked in: pvrsrvkm(O)
[19252.682872] CPU: 1 PID: 59 Comm: irq/32-ff6b0000 Tainted: G        W
O    4.4.55 #34
[19252.682875] Hardware name: Rockchip rk3368 p9 board (DT)
[19252.682880] task: ffffffc074cf8c40 ti: ffffffc074d04000 task.ti:
ffffffc074d04000
[19252.682894] PC is at mbox_chan_received_data+0xc/0x20
[19252.682901] LR is at rk3368_mbox_isr+0xb0/0xd0

Change-Id: I1873d6a7e7d1390d2c2c44a77c120d1a02614fdc
Signed-off-by: Xu Jianqun <jay.xu@rock-chips.com>
2017-05-08 15:46:26 +08:00
William Wu
e759aa4172 phy: rockchip-inno-usb2: add a delay after phy resume
When resume phy, it need about 1.5 ~ 2ms to wait for
utmi_clk which used for USB controller to become stable.

Change-Id: I319a28069b4b3381f22cc34567226f341e948bd4
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-05-08 15:45:37 +08:00
Huibin Hong
3639eea28a ARM64: dts: rk3368-android: enable fiq mode
If this patch is used, dedicated trust firmwart is necessary.

Change-Id: I72ca3b1b722c4076f589341e40efcbeeb5a07a58
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-05-08 11:12:33 +08:00
Huibin Hong
cf5579f97d rk_fiq_debugger: remove "read signal irq from dts directly"
Change-Id: I1f531ce2f58b33d5501f8446ad393e7ac4f27ef0
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-05-08 11:12:28 +08:00
William Wu
842bf8ea5a arm: dts: rk322x-android: enable usb otg controller and its phy
Change-Id: Ie03c7fe388360b0285d2a6eb0a455f5ed28e74c4
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-05-08 10:14:07 +08:00
William Wu
e0aba42215 phy: rockchip-inno-usb2: add otg-port support for rk322x SoC
This patch adds USB 2.0 PHY otg-port configuration for rk322x
SoC, this otg-port can be used for USB 2.0 OTG interface.

Change-Id: I7f2e362292edb45078a16d1a9665e3bdccc54814
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-05-08 10:11:49 +08:00
William Wu
e183dc8bfd arm: dts: rockchip: add u2phy otg-port and dwc2 ctrl nodes for rk322x SoC
This patch adds dwc2 controller and its phy nodes for rk322x SoC.

Change-Id: I29779baf92c28154ad342e234e8a5582984b8a12
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-05-08 10:11:37 +08:00
Mark Yao
333afcb8a3 ARM: dts: rk322x: add vop display node
Change-Id: Ic26431540260c758b6872020c36a41efdb2d82f2
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-05-08 10:11:04 +08:00
Huang, Tao
3ee0d9f2b7 OP-TEE: use sema_init instead of __SEMAPHORE_INITIALIZER
Fix lockdep warning:
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU:rk3288:/ $  0 PID: 234 Comm: tee-supplicant Not tainted 4.4.64 #51
Hardware name: Rockchip (Device Tree)
[<c0110018>] (unwind_backtrace) from [<c010c048>] (show_stack+0x10/0x14)
[<c010c048>] (show_stack) from [<c04194a8>] (dump_stack+0x9c/0xd4)
[<c04194a8>] (dump_stack) from [<c018321c>] (__lock_acquire+0x638/0x1c10)
[<c018321c>] (__lock_acquire) from [<c01850ec>] (lock_acquire+0x1d0/0x29c)
[<c01850ec>] (lock_acquire) from [<c0bc0f3c>] (_raw_spin_lock_irqsave+0x50/0x64)
[<c0bc0f3c>] (_raw_spin_lock_irqsave) from [<c017e148>] (down_interruptible+0xc/0x48)
[<c017e148>] (down_interruptible) from [<c03cd72c>] (tee_supp_read+0x74/0x154)
[<c03cd72c>] (tee_supp_read) from [<c025d638>] (__vfs_read+0x2c/0xf0)
[<c025d638>] (__vfs_read) from [<c025de30>] (vfs_read+0x84/0x134)
[<c025de30>] (vfs_read) from [<c025e720>] (SyS_read+0x4c/0xa4)
[<c025e720>] (SyS_read) from [<c01072c0>] (ret_fast_syscall+0x0/0x1c)

Change-Id: I09335112bed6efb30e60a22b471d4467eecaf520
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-08 09:44:37 +08:00
Huang, Tao
cf1df1b161 arm64: rockchip_defconfig: enable MODVERSIONS
353a964727 ("ANDROID: android-base.cfg: add CONFIG_MODULES option")

Change-Id: I8e85dfd6c7fedf797066e5e707eba7595dc2c123
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:57:54 +08:00
Huang, Tao
28f4152aad arm64: rockchip_defconfig: enable CONFIG_IKCONFIG
6286b142ae ("ANDROID: android-base.cfg: add CONFIG_IKCONFIG option")

Change-Id: I68b0dc00a68a3eb885eb32d8c82b326067a438dc
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:57:53 +08:00
Huang, Tao
54567d06f8 arm64: rockchip_defconfig: disable CONFIG_USELIB
1c634ee26b ("config: disable CONFIG_USELIB and CONFIG_FHANDLE")

Change-Id: I1518e974427572d941b982db3896eb72822872f8
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:57:53 +08:00
Huang, Tao
cc8e6930a4 arm64: rockchip_defconfig: rename UID_CPUTIME to UID_SYS_STATS
2ea16502ca ("ANDROID: uid_sys_stats: rename uid_cputime.c to uid_sys_stats.c")

Change-Id: I11ad23129722f87111a5c6f3881b4bdcc5626f66
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:57:52 +08:00
Huang, Tao
802cc05239 arm64: rockchip_defconfig: enable ARM64_SW_TTBR0_PAN
536bf705c5 ("ANDROID: configs: CONFIG_ARM64_SW_TTBR0_PAN=y")

Change-Id: I49f562d81d8f354dfbeb545618bc6c907256d60b
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:57:52 +08:00
Huang, Tao
f94605aa75 ARM: rockchip_defconfig: enable MODVERSIONS
353a964727 ("ANDROID: android-base.cfg: add CONFIG_MODULES option")

Change-Id: Ia85709d1dc711f1ed8632e6299f121b4e6fbedc2
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:29:27 +08:00
Huang, Tao
b90c069d1e ARM: rockchip_defconfig: enable CONFIG_IKCONFIG
6286b142ae ("ANDROID: android-base.cfg: add CONFIG_IKCONFIG option")

Change-Id: I4d0369b990f9f9d707b672c6959e668307be700b
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:28:01 +08:00
Huang, Tao
888ba17ea8 ARM: rockchip_defconfig: disable CONFIG_USELIB
1c634ee26b ("config: disable CONFIG_USELIB and CONFIG_FHANDLE")

Change-Id: I617db2524c604e732d9d3f4eae0b8566efd82e98
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:26:09 +08:00
Huang, Tao
28ac4628e5 ARM: rockchip_defconfig: rename UID_CPUTIME to UID_SYS_STATS
2ea16502ca ("ANDROID: uid_sys_stats: rename uid_cputime.c to uid_sys_stats.c")

Change-Id: I345f44e510cb0168e9816f7d9adecf5772cdb092
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 17:23:51 +08:00
Huang, Tao
986d4e4637 Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
* linux-linaro-lsk-v4.4-android: (521 commits)
  Linux 4.4.66
  ftrace/x86: Fix triple fault with graph tracing and suspend-to-ram
  ARCv2: save r30 on kernel entry as gcc uses it for code-gen
  nfsd: check for oversized NFSv2/v3 arguments
  Input: i8042 - add Clevo P650RS to the i8042 reset list
  p9_client_readdir() fix
  MIPS: Avoid BUG warning in arch_check_elf
  MIPS: KGDB: Use kernel context for sleeping threads
  ALSA: seq: Don't break snd_use_lock_sync() loop by timeout
  ALSA: firewire-lib: fix inappropriate assignment between signed/unsigned type
  ipv6: check raw payload size correctly in ioctl
  ipv6: check skb->protocol before lookup for nexthop
  macvlan: Fix device ref leak when purging bc_queue
  ip6mr: fix notification device destruction
  netpoll: Check for skb->queue_mapping
  net: ipv6: RTF_PCPU should not be settable from userspace
  dp83640: don't recieve time stamps twice
  tcp: clear saved_syn in tcp_disconnect()
  sctp: listen on the sock only when it's state is listening or closed
  net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given
  ...

Conflicts:
	drivers/usb/dwc3/gadget.c
	include/linux/usb/quirks.h

Change-Id: I490f766b9a530b10da3107e20709538e4536a99d
2017-05-06 14:23:00 +08:00
Huang, Tao
7afca43604 ARM: rockchip_defconfig: update by savedefconfig
Change-Id: I96ee84cfa4b40b10f5fb273044a81b22f20f4efb
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 14:21:26 +08:00
Huang, Tao
075d03af42 arm64: rockchip_defconfig: update by savedefconfig
Change-Id: I4aa6538762060d62da3da56065abee4d42134da2
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2017-05-06 14:17:39 +08:00