Commit Graph

853619 Commits

Author SHA1 Message Date
Caesar Wang
726602e766 arm64: dts: rockchip: remove edp_hpd pinctrl for rk3399 linux
The edp_hpd pin had the conflict with the hdmi cec, enable the hdmi-cec
by default.

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: Id129364c352377c59f2b2ff48dd97ffefaf6af11
2020-05-25 18:19:49 +08:00
Caesar Wang
c3f028f9df arm64: dts: rockchip: reasonable alllcation of VOP on rk3399 linux
Most users used 4K monitors with HDMI on RK3399/RK3399PRO platform, but no
more than 2K monitors on EDP/DSI panels.

So the reasonable that HDMI connected to VOPB control, and EDP/DSI shound
be connected to VOPL.

Change-Id: Id97efc5d6d534c302aa52ad00e705c093457f41e
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2020-05-25 18:19:49 +08:00
William Wu
eda2124949 usb: dwc3: gadget: properly skip over trbs on ep_dequeue
There is a problem that incorrectly advances the TRB dequeue
pointer if more than one request in the started_list need to
be dequeue. If the request was already started, we issue the
END_TRANSFER command, then wait for END_TRANSFER completion
and only after that jump over the TRBs of the request by
clearing HWO and incrementing the TRB dequeue pointer. But we
don't skip over the TRBs of the rest started request, this
cause we to get incorrect TRB dequeue pointer on completion
next time.

We can easily reproduce this problem on RK3399 EVB Android Q
platform. Use MTP/PTP to transfer a big file, and then cancel
the transition, check if it can transfer again. If retransmission
fails, the problem happens. And if you enable the DWC3 trace
via tracing interface:

echo 1 > /sys/kernel/debug/tracing/events/dwc3/enable

You can get the error log:
irq/71-dwc3-1591  [000] d..1   389.337189: dwc3_complete_trb: ep1out: trb 00000000213b87d9 buf 00000000a84c0000 size 16384
irq/71-dwc3-1591  [000] d..1   389.337195: dwc3_gadget_giveback: ep1out: req 00000000d8c093a2 length 4294951424/512 zsI ==> 0
...
kworker/u12:2-111   [003] ....   389.337380: dwc3_free_request: ep1out: req 00000000d8c093a2 length 4294951424/512 zsI ==> 0

The req actual length is error. It's because that it get the
incorrect TRB dequeue pointer that belong to previous request.

Change-Id: I123ff779d5e2933449581f8b570e2e6ad6b75458
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-05-25 18:19:49 +08:00
Finley Xiao
d424a00590 video: rockchip: mpp: Add devfreq support for rkvenc
Change-Id: If962062014670471d6e7e18fdde5d6a5c2e9cc11
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 18:19:49 +08:00
Hu Kejun
3f34c6b39f media: i2c: add gt9760s vcm driver
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I766e9678d7dd0f30a3888b4b320e995cc9b5f9da
2020-05-25 18:19:48 +08:00
Elaine Zhang
ebb67a7240 dt-bindings: regulator: Document Rockchip RK860X regulators
Document the regulator and add a rockchip vendor-prefix.

Change-Id: I3084f2083644e30145ccda2e13e2e81c6470797a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-05-25 18:19:48 +08:00
Zefa Chen
07f2d39135 media: v4l2: add subdev support for ir-cut
Change-Id: Ib39a2e918d0e41574c1f368275a8787a31b5b800
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2020-05-25 18:19:48 +08:00
Zefa Chen
96ccebdd23 media: add rockchip ir_cut driver
Change-Id: Ie29c235e22e19fb5a0cd5c080f46eaba32ec57fc
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2020-05-25 18:19:48 +08:00
Elaine Zhang
eb1731965c regulator: fan53555: add support for Rockchip RK860X regulators
Rockchip RK860X regulators share the exact same functionality and
register layout as the Fairchild FAN53555 regulators.
Therefore extend the driver to add support for them.

Both types use the same vendor id in their ID1 register, so it's not
possible to distinguish them automatically.

Similarly, the types also do not match. Type 8 used by the RK8603
and RK8604 start at 500mV and increment in 6.25mv steps,
while the FAN53555 type 8 starts at 600mV and increments in 10mV steps.
And the en register is also differences.

Change-Id: Id93f85de91b79a1922b1efc27771f30dd7bc8bcb
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-05-25 18:19:48 +08:00
Ding Wei
6b8ae289fa video: rockchip: mpp: fix error for pop twice
when wait time out twice, it may wait recursion, and then
trigger pop twice.

Change-Id: I6c689f4267e0c03e8cf1e41d68796a6d042afce7
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-05-25 18:19:48 +08:00
Wang Panzhenzhuan
c227825078 media: i2c: gc0312: fix vsync config error
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I2ab99ff58aea76ffe09ae162e873cf7d7574f91f
2020-05-22 10:01:12 +08:00
Ding Wei
879330b36d video: rockchip: mpp: re-write mpp_wait_result
1. use task->state to mark the state of task in taskqueue.
2. add delay work in case of hardware dead, then abort current task.
3. if wait timeout, set task->abort_requet for work thread to abort it.

relative dump stack:
<4>[84461.189906]  __list_del_entry_valid+0x30/0x9c
<4>[84461.190616] cc60  00000000 00000000 00000000 00000048 00014b0e
00000550 00000598 00000620
<4>[84461.191018]  mpp_task_finish+0x108/0x15c
<4>[84461.191735]
<4>[84461.191735] X29: 0xffffff800e0cba50:
<4>[84461.192100]  vdpu_isr+0x60/0xbc
<4>[84461.192536] ba50  00000000 ffffff80 f153c4c0 ffffffc0 08109fe0
ffffff80 0e0cba68 ffffff80
<4>[84461.192828]  mpp_dev_isr_sched+0x4c/0x94
<4>[84461.193545] ba70  0e0cba68 ffffff80 b8a42e00 04d029b0 f0401000
ffffffc0 00000000 00000000

Change-Id: I2391a97fca4b6a7fddbf88a05cedf6f2fe564be0
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-05-22 09:25:15 +08:00
Wu Liangqing
8a72cad21e arm64: dts: rockchip: modify backlight levels value for rk3368-tablet
Change-Id: Ic4256893beabd7cbc32800db79f72fd515122d62
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-09 18:17:13 +08:00
Elaine Zhang
22fac96c52 soc: rockchip: power-domain: use DOMAIN_RK3399_PROTECT for pd_hdcp
Make pd_hdcp keep on during startup, to handle the hdmi display
which used hdcp.

Change-Id: I3c12fd5b6aa242bb658c19f5571cd45d3c245b5f
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-05-09 17:16:34 +08:00
Wu Liangqing
125d754e00 arm64: dts: rorkchip: emmc no set pinctrl for rk3368 board
for nand and emmc compatibility

Change-Id: If335031c084d87677de366123198dc9455959ca4
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-09 17:13:00 +08:00
Caesar Wang
13f5535ab2 arm64: dts: rockchip: move the common things to the rk3399-linux.dtsi
In order to reduce the duplication of code, let's move the common things
to the rk3399-linux.dtsi.

Change-Id: I066d99642190cfcbe1c8d16d05849297176f9e6b
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2020-05-09 16:58:08 +08:00
Sandy Huang
3399763e20 arm64: dts: rockchip: enable rga for rk3399-linux.dtsi
Change-Id: I55389b59f54ba4195e9532d00d9a1f54a767f2fd
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-05-09 16:58:08 +08:00
Caesar Wang
9a11c3675f arm64: dts: rockchip: enable ramoops for rk3399-linux.dtsi
This patch enables the ramoops to fetch some logs for debugging and
testing, the log will save on /sys/fs/pstore/console-ramoops*.

Change-Id: I47c9efbd1a0e17228e07fd6ad87a446babb265ab
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2020-05-09 16:58:08 +08:00
Caesar Wang
9855e0c16e arm64: dts: rockchip: update vcodec dts for rk3399 linux
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I9ce2b1322c0c7b5d1f2a52eb164366e1c084c6e2
2020-05-09 16:58:08 +08:00
Caesar Wang
051c9276b9 arm64: dts: rockchip: support ov13850 camera on rk3399 evb ind with linux
This patch enables the rkisp and mipi camera for rk3399 evb ind board,
enable the ov13850 board with mipi'rx0 by default.

Change-Id: I2e4949088073fc8032abefd852666f14860552c8
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2020-05-09 16:58:08 +08:00
Caesar Wang
c2395e6617 arm64: dts: rockchip: add rk3399 evb ind v11 board support for linux
Evb ind is part of a family of boards called rk3399 Industry development.
As best as possible, the properties shared by the rk3399 family are placed
in rk3399-evb-ind.dtsi, while Evb-linux specific bits are in
rk3399-evb-ind-lpddr4-linux.dts. This does not add full support for the base
Evb ind board.

Working and tested (to some extent):
* cluster cpu/gpu support -- including frequency, performance
* DVFS: included cpu/gpu/ddr
* UART / console
* LPDDR4
* TF cards
* USB2/USB3
* Thermal
* Touchscreen
* EDP
* Backlight
* System Key (ADC and Power keys, including the reset/vol+/recovery/maskrom)
* Wifi
* Bluetooth / Webcam
* eMMC
* VIDEO: tested the h264 video source
* AUDIO: play and mic music
* HDMI Out
* GMAC
Not tested:
* RS485
* CIF
* Mini Pcie
* IR Receive
* Sensor
* CAMERA

Note: this patch had *not* verified the all functions, it can bringup for
v11 board and some basic functions.
(included wifi/bt, camera, display, video, usb...and so on.)

Change-Id: Ibae4853f4c11d3a269cd3aa96478c45cdb126597
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2020-05-09 16:58:08 +08:00
Caesar Wang
0d423cbb03 arm64: dts: rockchip: rk3399-evb-ind: move the configure for right place
Move the common configure are used for rk3399-evb-ind.dtsi.

Change-Id: Ia42ed2bb823d3d30c8433be5bfc07ed48e6b0015
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2020-05-09 16:58:08 +08:00
William Wu
9bb842fa92 usb: gadget: uvc: configfs: fix the desc of framebased format
Refer to the spec "USB_Video_Payload_Frame_Based_1.1", we
set the bBitsPerPixel of framebased format descriptor to 16,
it means that 16 bits per pixel used to specify color in the
decoded video frame. And set bVariableSize of framebased format
descriptor to 1, it means that the data within the frame is of
variable length from frame to frame is variable.

With this patch, the uvc H264 format can work normally on
Linux OS platform.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ibc25b5f67efb8cfcae9d66a509399cfe896f7943
2020-05-09 16:51:50 +08:00
Finley Xiao
fd315abb67 soc: rockchip: opp_select: Add support to adjust leakge
Change-Id: Ie209113abac74660014a6dc4984fd13ef76e02e2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-09 16:45:10 +08:00
Finley Xiao
746b4c8606 arm64: dts: rockchip: rk3368: Add leakage temperature and voltage for cpu
Change-Id: I4228a3d5787e29ea697cd022575132cca31c4fb5
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-09 16:32:09 +08:00
Alex Zhao
f70750b3b4 arm64: rockchip_defconfig: enable CONFIG_RTL8821CS
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
Change-Id: Ib01765c0a0ae54565af008ea4c5ccc75f0d0c2bd
2020-05-09 15:23:27 +08:00
Alex Zhao
5fd52cc320 net: rockchip_wlan: add rtl8821cs driver: v5.8.1.2_35313.20191016_COEX20191014-4141
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
Change-Id: Icca896b4f64a7caa348b5f488ee49ce910033ddc
2020-05-09 15:23:12 +08:00
Tao Huang
9451c0bf46 arm64: dts: rockchip: rk3399-sapphire-excavator-edp: remove isp node
Fixes: 5ea0aa0609 ("arm64: dts: rockchip: rk3399-android: remove isp node")
Change-Id: Idfecde016a7bfb78008c3d67223b0d8568d35f02
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-05-09 15:10:46 +08:00
shengfei Xu
70282202ba regulator: rk809 & rk817: correct enable/disable for runtime
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I4b4b29c6f31b3c877a3d74d791e14879620c6ff3
2020-05-09 14:53:21 +08:00
Tao Huang
5572fc7fe8 nvmem: rockchip-otp: refactor rockchip_data
Add clocks and reg_read to rockchip_data, allow support more SoCs.

Change-Id: I45271d69dae808d741c953ce61b921b9a3d21202
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-05-09 14:51:50 +08:00
Finley Xiao
d821f78322 nvmem: rockchip-efuse: Update driver to use clk_bulk array APIs
Change-Id: I0489a992ed7edb3317b1b5a57522df3a5374cec2
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-09 14:08:55 +08:00
Finley Xiao
3758737250 nvmem: rockchip-otp: Add support to initialize otp when probe
Change-Id: I6ae99f68394787fc2e8e6868d788390f271073ed
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-09 10:30:14 +08:00
Wu Liangqing
04e6b38f51 net: wireless: rockchip_wlan: bcmdhd enabled CONFIG_BCMDHD_OOB
Fixes: 9d5a7a9c5a ("net: wifi: rockchip_wlan: add wifi6 support for bcmdhd chipset")
Change-Id: I16e0ede9ce03a5f19c7bdfa78db3051ff20c02b1
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-09 10:29:40 +08:00
Wu Liangqing
5ea0aa0609 arm64: dts: rockchip: rk3399-android: remove isp node
Change-Id: Ia89c18b3c5957980c5a17991effc93250771db6f
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-09 10:25:04 +08:00
Allon Huang
e081456171 drivers: media: platform: rockchip: cif: reconstruct register's reading and writing
Signed-off-by: Allon Huang <allon.huang@rock-chips.com>
Change-Id: I47e6e118a066a7740a34645cc9736a9a3f5f6afb
2020-05-08 21:52:17 +08:00
Wu Liangqing
b6906fc97d arm64: rockchip_defconfig: enable CONFIG_TOUCHSCREEN_HYN_CST2XX and CONFIG_GS_SC7A30
For rk3368a tablet.

Change-Id: I588802e3ee785cd55327c5b5edb7d256b41403ef
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-08 20:59:27 +08:00
Wu Liangqing
ce45b3c0d1 input: touchscreen: add hyn_cst2xx support
Change-Id: I57e6bd1ec989cf8c803a3648f24cb3fd834940b2
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-08 20:43:58 +08:00
Wu Liangqing
844ba815a5 intput: sensors: accel: add sc7a30 support
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Change-Id: I7727b6bf642b9f2f2a1ee53e7de283c4f818d7f9
2020-05-08 20:34:48 +08:00
Shunqing Chen
1e5052252d arm64: dts: rockchip: rk3368-xikp: add extcon for rk818
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I9f96a6548cdd8111e309a167bba370429ae205c0
2020-05-08 20:02:29 +08:00
Wu Liangqing
42c9a9370d arm64: dts: rockchip: add rk3368-tablet.dts
Change-Id: I8ff1ea45b9de1f9f6497aff158491a352a441bb6
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-05-08 14:57:15 +08:00
Andy Yan
159b2c4d15 arm64: dts: rockchip: Remove data-sync property for px30-ad-d6-anx6345 rgb interface
The data-sync is enabled by default, so we don't need
this property.

Change-Id: I3cfbb051368a2065cf6db5d0bcc91b8e77e77d10
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-05-08 09:12:45 +08:00
Andy Yan
802974d4f2 drm/rockchip: rgb: Fix data-sync logic
According to IC designer:
For RGB screen: The data-sync should enabled to get better SI.
For MCU screen: The data-sync must bypassed, otherwise the mcu signal
can't output.

Because we use much more rgb screen than MCU screen, so it's better
to enable data-sync by default. And for MCU screen, add the
data-sync-bypass property to bypass data-sync.

Fixes: c8f3ab90c0 ("drm/rockchip: rgb: Allow to configure data sync from DT")
Change-Id: Iacb0f7813ea038a210c2bbb88126356381509bf6
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-05-08 09:11:07 +08:00
Caesar Wang
8f427fc73c arm64: configs: update defconfig for rockchip_linux_defconfig
1. clean rockchip_linux_defconfig for kernel 4.19.
2. update codec configs:
 add configs:
        CONFIG_ROCKCHIP_MPP_RKVDEC
        CONFIG_ROCKCHIP_MPP_VDPU1
        CONFIG_ROCKCHIP_MPP_VDPU2
        CONFIG_ROCKCHIP_MPP_VEPU1
        CONFIG_ROCKCHIP_MPP_VEPU2
3.enable CONFIG_ROCKCHIP_VENDOR_STORAGE_UPDATE_LOADER
4.enable CONFIG_REGULATOR_TPS65132
  Enable TPS65132 regulator driver to support dual output power
supply used in LCD panels for RK3399 M series tablet board.
5.add FIQ_DEBUG and RK_CONSOLE
CONFIG_FIQ_DEBUGGER_TRUST_ZONE=y
CONFIG_RK_CONSOLE_THREAD=y

Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Change-Id: I1de5e663541987e166b661b7c43b4c9b00e4233f
2020-05-07 15:43:09 +08:00
shengfei Xu
9516a7b1a8 mfd: rk808: use REGCACHE_RBTREE cache_type for rk817/809
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I83d6f5f3db906b74760fd32a1c072ac9e4fb956f
2020-05-07 14:14:58 +08:00
xuhuicong
89b50da9d4 drm/rockchip: fix hdmi no display when resume or switch resolution
spelling mistake cause hdmi phy configure error, now correct it

Change-Id: I548d76dd44e8d39e35b95138ec3d25b358cf3376
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2020-05-07 11:07:52 +08:00
Wang Panzhenzhuan
da6c923d97 media: rockchip: cif: fix front/back camera switch green issue
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Signed-off-by: Allon Huang <allon.huang@rock-chips.com>
Change-Id: I70b30bdbf6321a3f6f60b68f76f711c65a10534b
2020-05-07 11:05:50 +08:00
Zhaoyifeng
c9c13e83df driver: soc: vendor storage support realloc
To rewrite the same id with the data size large than first alloc size,
it`s will write fail. This commit will support realloc new memory
for rewrite.

Change-Id: I3345fc9e4a12d0f61f88cfb944b7efc5a4b5e215
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
2020-05-07 09:37:10 +08:00
Elaine Zhang
024ecfe711 clk: rockchip: rk3368: use COMPOSITE_DCLK for dclk_vop
Change-Id: I45ce9a2e404acb7eae885fbca0b4703ec67176e9
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-05-06 16:09:54 +08:00
Elaine Zhang
840eb062cc clk: rockchip: add a COMPOSITE_DCLK clock-type
The CLK_SET_RATE_PARENT flag make the parent clock and the child clk is 1:1.
If the DCLK frequency is too low, the PLL frequency will be very
low, which will affect the output waveform quality of PLL, and PLL
locking may be abnormal, so add a new COMPOSITE_DCLK clock-type to handle
that.

Change-Id: If9bee9ebf157fcf034aed246b3aa1cff503ef9cf
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-05-06 16:09:33 +08:00
Tao Huang
2778018fd8 rk: arm: do not build Image.gz/lz4 when build img
Sometimes Image is not ready when build Image.gz. Do not know why.

Fixes: 6bec2128bb ("rk: arm: support build Image.gz and Image.lz4")
Change-Id: Iafa7a7cd138d7169f5f198977be0c9d01765a5fc
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2020-05-06 15:37:50 +08:00