Commit Graph

853649 Commits

Author SHA1 Message Date
YouMin Chen
e87d167ae0 dt-bindings: devfreq: rockchip_dmc: add rv1126 support
Change-Id: Icd022777e380490f83d3101e69878736cc7e2131
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-05-25 18:19:52 +08:00
YouMin Chen
eebda71aa7 PM / devfreq: rockchip-dfi: add support for rv1126 dfi
Change-Id: I65a403424b68804022025309f9af82b55c044192
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-05-25 18:19:52 +08:00
YouMin Chen
5d32461b28 dt-bindings: devfreq: rockchip_dfi: add rv1126 support
Change-Id: Ie210fd8aa9fd686590385d3377540cd02a7dc867
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2020-05-25 18:19:52 +08:00
Jon Lin
73ebde0530 ARM: dts: Add NANDC node for RV1126
Change-Id: I246d7f54aa2fe128729d855515f9ece8a5c652e6
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-25 18:19:52 +08:00
Jon Lin
810663a974 ARM: dts: Add SFC node for RV1126
Change-Id: I5061418f5469989ec878a40202c3132115efe9e9
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-05-25 18:19:52 +08:00
Sugar Zhang
d014dc26b8 ARM: dts: Adds support for RV1126 SoC
RV1126 is a high-performance vision processor SoC, especially
for AI related application. RV1109 is much similar to RV1126,
except for the number of cpu cores and some features.

Change-Id: I4834387c94f7b4d7536232e3b53ad7e716431e3e
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:52 +08:00
David Wu
079f2fb573 ARM: dts: Enable gmac at dts level for rv1109-evb-v10
Change-Id: I89e49318e5c328c3c54bc6991bb67f0a6cc8d15b
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-05-25 18:19:52 +08:00
David Wu
d8b8decc24 net: ethernet: stmicro: stmmac: dwmac-rk: Add RV1126 support
Add constants and callback functions for the dwmac on RV1126 soc.
As can be seen, the base structure is the same, only registers
and the bits in them moved slightly.

Because the gmac driver does not know whether pinctrl is
configured with m0 or m1 at this time, so we configure the
delayline of m0 and m1 at the same time.

Change-Id: I3bf58f30584f91c53dd98f747b2d5a2e3f32c505
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
2020-05-25 18:19:52 +08:00
Cai YiWei
5d4c3d2b2f media: rockchip: isp: fix release buf error
Change-Id: Ice2b0722121a8a687570a84d7b0ffc660042153b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-05-25 18:19:52 +08:00
Cai YiWei
a1473fa729 media: rockchip: isp: add isp2.0 rawrd read back API
Change-Id: I0ffab0e90b3eaebfad949826eee8601f80e01caf
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-05-25 18:19:52 +08:00
Cai YiWei
e631e47fe7 media: rockchip: isp: support 3a part of isp2.0
Change-Id: I5650286494b09e9d0dbda651d84761327621de11
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-05-25 18:19:52 +08:00
Elaine Zhang
b0835d67c8 thermal: rockchip: Add new functions for rV1126
RV1126 tsadc bandgap chopper function should be configed,
add a new initialize function to handle this for RV1126 SoCs.
RV1126 tshut mode also need select the tshut type in GRF regs,
add a new set mode function to handle this for RV1126 SoCs.

Change-Id: I81106539362bc32e0d8aaeeb0398d1bcb33b6b60
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2020-05-25 18:19:51 +08:00
Elaine Zhang
64838fe9ec thermal: rockchip: Support the RV1126 SoC in thermal driver
RV1126 SOC has two independent Temperature Sensors for CPU and NPU.
RV1126 TSADC clock design has been updated, added the PHY clock,
using the group managed clocks.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I395daa3b591390980a11ea7eed827c0e297f6ebe
2020-05-25 18:19:51 +08:00
Cai YiWei
8d2efa7f5e media: rockchip: isp: init isp2.0
Change-Id: Ia22c5eefc931280dca77201dea420aff622f1e82
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-05-25 18:19:51 +08:00
Sugar Zhang
83a87f4aac ARM: dts: Adds support for rv1109 evb boards
Change-Id: I1e191024eb76871138a4f1da2e788459ad8ecd52
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:51 +08:00
Elaine Zhang
dffeb6465b dt-bindings: rockchip-thermal: Support the RV1126 SoC compatible
Add a new compatible for thermal founding on RV1126 SoC.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I84e7ca521f4edce9516575bd54709326e62fc85c
2020-05-25 18:19:51 +08:00
Sugar Zhang
d05327e4e4 dt-bindings: pinctrl: Adds binding for rv1126 pinctrl
Change-Id: I601da0ec4f6e78470bfb18c3f459f5bf91907e77
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:51 +08:00
Sugar Zhang
a6c2651c59 dt-bindings: soc: rockchip: Adds binding for rv1126 grf/pmugrf
Change-Id: I62306881b7dd27c7fc691ee7b38361454a3eb2d9
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:51 +08:00
Elaine Zhang
231ff8eb4a soc: rockchip: power-domain: add power domain support for rv1126
This driver is modified to support RV1126 SoC.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I1a3c87d9b17b198e5cf5408b732b2a53363f4ef1
2020-05-25 18:19:51 +08:00
Elaine Zhang
5b929126d8 dt-bindings: power: add binding for rv1126 power domains
Add binding documentation for the power domains
found on Rockchip RV1126 SoCs.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Icf38d7a8fa44abf119e57a66ceddc1a01872facf
2020-05-25 18:19:51 +08:00
Jianqun Xu
b9d2f63157 pinctrl: rockchip: add support for rv1126
Change-Id: Icf6b6b1291cbc5a6116451ac6280e497bf59318f
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:50 +08:00
Jianqun Xu
e7cff239ab pinctrl: rockchip: support gpio version 2.0
The gpio v2 has some new features:
- Use mask bit for register write;
- Both edge intterupt supported;
- longer debounce time for input intterupt.

Change-Id: I61f3974d2e0cf0e93c686aa11cd35162e59f393b
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-05-25 18:19:50 +08:00
Sugar Zhang
d41061eefc ARM: dts: rockchip: Adds dts for rv1109 fpga board
Change-Id: Id7294812c0f4147b9c4c124437a8b8897578bc9f
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:50 +08:00
Sugar Zhang
67a9bae411 ARM: dts: rockchip: Adds core dtsi for rv1109
rv1109 is a high-performance vision processor soc for
ipc/cvr/smart doorbell, especially for AI related application.

Change-Id: I4f5ed7dddd12a82d0aa006374bed0f5341132993
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:50 +08:00
Finley Xiao
7f7d18ba2d clk: rockchip: Add clock controller for the RV1126
Add the clock tree definition for the new RV1126 SoC.

Change-Id: I4a329d27d3a84f43a0ae956bce16597706eeb1ae
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 18:19:50 +08:00
Sugar Zhang
722fe56fb6 ARM: configs: Adds rv1126_defconfig
Enable CONFIG_VMSPLIT_3G_OPT
Allows for 1GB systems to have their RAM entirely mapped as low memory.

IMX347 is for RV1126 sphericalipc ddr3 v10 board.
OS04A10 is for RV1126 ipc2 ddr3 v10 board.
gc4c33 is for RV1126 ai camera board

Enable CONFIG_PSTORE_PMSG
Allow user space log to pstore.

Enable CONFIG_USB_STORAGE
For support u disk.
You can disable it if you don't need it.

Enable CONFIG_RK_CONSOLE_THREAD
For better boot time and low irq latency.

Change-Id: I53139a76a0e5a95c401efe31cc7bf793b554c036
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
Signed-off-by: Cody Xie <cody.xie@rock-chips.com>
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Signed-off-by: Zhenke Fan <fanzy.fan@rock-chips.com>
Signed-off-by: Zhibao Huang <hzb@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:50 +08:00
Sugar Zhang
a9d3b3d537 soc: rockchip: Adds CPU_RV1126 config
Change-Id: I7669e309a6fa663d04f50d1032f2c9054c82d90a
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2020-05-25 18:19:49 +08:00
Finley Xiao
2652e6302a clk: rockchip: implement the composite brother branch type
There is a new clock branch have a form like
            |--\
---[GPLL]---|   \                        |--\
---[CPLL]---|mux|-----[GATE]--[DVI]------|   \
---[HPLL]---|   /  |                     |mux|--[GATE]--
            |--/   |--[GATE]--[HALFDVI]--|   /
                                         |--/
This patch registers two composite clocks for this branch type,
and make them become brother clock for each oher.

Change-Id: I46aeab26e478f341600114014db1c7d58e234f11
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 18:19:49 +08:00
Finley Xiao
8001749f9c clk: composite: Add support to change brother clock rate
Some composite clocks may have the same parent clock, if one clock change
the parent clock rate, the other clock rate may too large, so add a
brother clock in composite that the other clock also can be changed when
parent rate is changed.

Change-Id: I2c6749e578b76d6780cecdcd9ff1b5fd4f25a0ba
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 18:19:49 +08:00
Finley Xiao
f5463b5262 Revert "clk: fractional-divider: check parent rate only if flag is set"
This reverts commit d13501a2be.

This patch causes 32768Hz can't be divided from 24MHz.

Change-Id: I1e86c2b0c96be0d1a80de83d1ac5e5909becbde1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2020-05-25 18:19:49 +08:00
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