Commit Graph

854315 Commits

Author SHA1 Message Date
Sandy Huang
b5e8a5bae5 drm/rockchip: EXPORT_SYMBOL(rockchip_drm_crtc_send_mcu_cmd)
rockchip_drm_crtc_send_mcu_cmd will be used by panel-simple.ko

Change-Id: I463e52335244564b5a837ff045cff0ab005ea25d
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-07-02 10:21:15 +08:00
Sandy Huang
627c56fdda drm/rockchip: remove drm_atomic_set_property calls
drm_atomic_set_property isn't export function, so we set default prop
vale to instead of it.

Change-Id: I4acc6ddd045415aa180d467b45085609408e2447
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-07-02 10:21:15 +08:00
Sandy Huang
e9c13d8669 drm/rockchip: remove unused logo_y_mirror
all bmp file have been set to no y mirror file.

Change-Id: I6b8b5362ff0f5bb6d2e9930e23987d133749357d
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-07-02 10:21:15 +08:00
Jianqun Xu
8d1e1e2de4 mm/cma: support to set CMA area status
Add an optional empty property - 'inactive' for reserved memory,
only do effect for regions with reusable property.

CMA area in 'inactive' status means that the operating system can't
alloc pages from the regions.

Change-Id: I34ecde9bc9c2e3cec175e6c032911c1bae21295c
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-07-02 10:21:15 +08:00
Elaine Zhang
069bb25961 ARM: dts: rv1126: move the tsadc parameters
This patch moves the tsadc default parameters to the rv1126.dtsi.
When the hardware changes, the tsadc parameters need to be
reconfigured in DTS.(Rockchip_Developer_Guide_Thermal_CN 3.2)

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I6ff427e703006135e32e5748e89b3a1367a035c9
2020-07-02 10:21:15 +08:00
Elaine Zhang
96008856e6 regulator: fan53555: fix up the tcs en\disable failed
TCS452x registers are special and different from others.

Fixes: eb1731965c ("regulator: fan53555: add support for Rockchip RK860X regulators")
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I7694defe4f090ff846dbdb88bad51efd07fa241c
2020-07-01 11:21:27 +08:00
Nickey Yang
fd713aac5a media: i2c: ov2718: update new version
1.update the new get regulator method
2.correct initialization sequence
3.fix the level setting of reset gpio
4.support raw12bit linear/hdr mode
5.implement RKMODULE_SET/GET_HDR_CFG

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: Ie9b38ce69b4eb239aec34fa91c3e59ab872ac8c5
2020-06-30 18:41:44 +08:00
Jianqun Xu
99fc5eea94 dt-bindings: reserved-memory: introduce 'inactive' property
Add a new property 'inactive' for reserved memory node, which used for
reserved memory region with 'reusable' property.

When a reserved memory region with 'reusable' property, the operating
system can allocate pages from the CMA region and move outside of CMA
region when cma allocate happend.

The new property 'inactive' can set the CMA region to seperate from the
operating system pages, make the region only used by cma allocate, and
not need to do isolate range.

Change-Id: Id99a1433fb9c36cc10b3293436292efff28cac25
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-06-30 18:34:17 +08:00
Jianqun Xu
96b2bffcd5 ARM: dts: rv1126-evb-ddr3-v10-tb: inactive isp reserved memory
Change-Id: I1d644420bca0a241c716de92dc19ddbb28e99f6a
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2020-06-30 18:29:47 +08:00
Ding Wei
c0540b1b5e video: rockchip: mpp: issue for device attach service
when taskqueue-node not set, it should be considered a new taskqueue.
But when resetgroup-node not set, consider it not need reset asynchronous.

Change-Id: I603df406faaecc46cadef30947230c387e8538cd
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-06-30 16:51:04 +08:00
Ding Wei
ae6f03a436 video: rockchip: mpp: reset relative code refactoring
tips:
1. it should not use reset->rw_sem when reset is not shared.
2. if hardware is combo, and work is time sharing, which
   reset_group in the same taskqueue, the reset->rw_sem
   is also should turn off.

Change-Id: I9d89e3118997cc8d1871ac77799faf85043743d3
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-06-30 16:50:51 +08:00
Ding Wei
8ec4aa8c3b video: rockchip: mpp: mark task->state via set_bit
1. each bit mark task had reached instead of state changed.
2. irq and timeout are ambiguous, if irq reach, timeout_work can not
response. Thus, there use TASK_STATE_HANDLE to handle it.

Change-Id: I1723b49b12abdf6bf1746b3e59431decab928c44
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-06-30 16:50:30 +08:00
Zefa Chen
2dcb987515 media: i2c: camera driver support enum sensor work format
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Ia5d0b804a85ce9947183c651395798910e4566bc
2020-06-30 16:49:48 +08:00
Hu Kejun
ef3ee92e16 media: i2c: gt9760s: update dlc move time
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I059e56aecafc1a87351cd11775f84fe5580e8982
2020-06-30 16:45:14 +08:00
Sandy Huang
1058778507 drm/rockchip: remove repeated function calls
drm_vblank_cleanup will be called as following path, so delete it here:
drm_dev_put(drm_dev);
    ->drm_dev_release
        ->drm_dev_fini(dev);
            -> drm_vblank_cleanup(dev);

Change-Id: Ie7d31c19f00cdf8bb331bf069ce09046e6fe6ea4
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-06-30 15:37:29 +08:00
Sandy Huang
97407f1db3 drm/rockchip: vop: fix rb swap error when deal with rgb888 format
1. VOP full need to do rb swap to show rgb888 format color correctly
2. uboot change bmp decoder result from BGR565 to RGB565 format;

so this commit depend on uboot commit:
    59cf3802954 ("drm/rockchip: fix rgb888 format color incorrect")
    f4e3a173323 ("drm/rockchip: change 8bit bmp decoder result")

Change-Id: I2e0329b8c3f35d4ec1e224f0570575934c889dca
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2020-06-30 15:37:29 +08:00
Wu Liangqing
085c5ba4a7 arm64: dts: rockchip: rk3368a-817-tablet: disable auto-freq-en
Change-Id: I40613c3ba296918d50c92534f464d780cbce43ff
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-06-30 15:36:43 +08:00
Zhenke Fan
f6b6c4c402 media: i2c: gc4c33: modify dpcc to adjust single and multiple bad point
Signed-off-by: Zhenke Fan <fanzy.fan@rock-chips.com>
Change-Id: Iaf12ded3604ec26e9b61833e1fd4004e03acb110
2020-06-30 15:34:41 +08:00
Lin Jinhan
20c43992f8 crypto: rockchip - add rv1126 crypto des/des3_ede support
cipher mode list:
      des/des3_ede: ecb/cbc

Change-Id: I0b8a75f3f67892988982ea7b52380eb847758af4
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-06-30 14:43:39 +08:00
Lin Jinhan
05c9559e5a ARM: rockchip_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP
merge CONFIG_CRYPTO_DEV_ROCKCHIP_V1 & CONFIG_CRYPTO_DEV_ROCKCHIP_V2
into CONFIG_CRYPTO_DEV_ROCKCHIP.

Change-Id: Ided2e0f7ed78b8f98ad8491055c91c76caee3f6f
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-06-30 14:41:47 +08:00
Lin Jinhan
5f155bc358 arm64: rockchip_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP
merge CONFIG_CRYPTO_DEV_ROCKCHIP_V1 & CONFIG_CRYPTO_DEV_ROCKCHIP_V2
into CONFIG_CRYPTO_DEV_ROCKCHIP.

Change-Id: Ic983f6a5d7eb80462a44fcf12b89e66d46bb341b
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-06-30 14:40:59 +08:00
Lin Jinhan
cfa5f18187 crypto: rockchip: add module compile support
Change-Id: I661fe4e75b77b7995bc0303773c992d6d93ddf7e
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-06-30 14:38:08 +08:00
Hu Kejun
ff3ba38a27 media: rockchip: isp: fix compile error when config with module
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: Icdedf22cfe30674107e72293dca80711c2c4a548
2020-06-30 14:34:02 +08:00
Wu Liangqing
be64802e6b arm64: dts: rockchip: rk3368a-817-tablet-bnd: adjust dcdc4 3.0v
Change-Id: Ic643d00b730f5d64fea75d676c9993d2fc9d0694
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-06-30 14:32:51 +08:00
Wu Liangqing
48c2e86e9c arm64: dts: rockchip: rk3368-817-tablet: dmc set vop-dclk-mode = <1>
enable vop clk shakes

Change-Id: I7f087ccd6e9d0f734c2af9338f9fad8672517952
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-06-30 14:32:33 +08:00
Ren Jianing
68c654fa7a phy: phy-rockchip-naneng-usb2: add Rref calibrate in tuning
This patch can change phy internal 45 Ohm resistance accord to
reference resistance. The larger the reference resistance, the
greater the internal resistance, and accordingly, high speed
eye diagram amplitude will become lower.

The maximum adjustable range of the reference is +-20% of the
default value (200 Ohm).

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ibd746283c06609b944fa2a148066ba0a661e761a
2020-06-30 14:30:35 +08:00
Jianing Ren
8b73d9a650 dt-binding: phy: add dt doc for Rockchip USB 2.0 PHY
This patch adds a binding that describes the Rockchip USB 2.0
PHY designed by Naneng.

Change-Id: I7cca8bbf0a395baaebb4867681acd4f73004c1b0
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-06-30 14:30:35 +08:00
Jianing Ren
05960109c0 phy: phy-rockchip-naneng-usb2: add vup_gpio for swing calibration
The USB2.0 OTG PHY of RV1126/1109 which is designed for lower power
consumption provides only 8.8mA current source on DM. Multiplied
by 45 Ohm host termination resistance, voltage is about 400mV.
If the threshold voltage of host is greater than 400mV, the high
speed handshake will fail and SoC communicate at full speed. So
swing calibration is necessary.

We use gpio to control the 220 Ohm pull-up resistor to provide additional
current. Experiments show that the voltage of chirpK can be increases
to about 600mV.

Change-Id: I8b41054af4732569dbc8185bc3d3d4a2ba83cd6a
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-06-30 14:30:35 +08:00
Jianing Ren
913d3c8e4f usb: dwc3: gadget: add phy calibration during chirpk state
The USB2.0 OTG PHY of RV1126/1109 which is designed for lower power
consumption provides only 8.8mA current source on DM at chirpK state.
Multiplied by 45 Ohm host termination resistance, voltage is about 400mV.
If the threshold voltage of host is greater than 400mV, the high speed
handshake will fail and SoC communicate at full speed. So swing
calibration is necessary.

Because we use this interface for swing calibration. This patch also
disable phy calibration in setting host mode for rockchip platform.

Change-Id: Ic1c8bb6aac95b3d0d61d99becb4facea1bbecb25
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-06-30 14:30:35 +08:00
Nickey Yang
bbd4383092 ARM: dts: rockchip: rv11xx-evb-v10: add GT917S tp support
Gt917s is a panel adapter board with ili9881d matching touch IC.

At the same time, init delay Ms 80 instead of 10, is to solve the
problem of high probability of not displaying due to incomplete
reset when the hardware of the panel adapter board is changed.

Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: I17eff7fdd140a7d6f82e8991ad2bdd7765d43a73
2020-06-30 14:19:48 +08:00
William Wu
1f056007af Revert "phy: add cp_test callback"
This reverts commit 955bb70bf1.

Fix the following changed report by build_abi.sh for GKI

'struct phy_ops at phy.h:56:1' changed:
  type size changed from 512 to 576 (in bits)
  1 data member insertion:
    'int (phy*)* phy_ops::cp_test', at offset 448 (in bits) at phy.h:70:1
  there are data member changes:
    'module* phy_ops::owner' offset changed from 448 to 512 (in bits) (by +64 bits)
  17 impacted interfaces

Change-Id: I5f163b804aaff2fe9c6e3a7c054de3f8df0c791c
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-06-29 16:53:21 +08:00
William Wu
4b955357a9 phy: rockchip-inno-usb3: remove rockchip_u3phy_cp_test
The rockchip_u3phy_cp_test() is used for USB3 compliance
test, and it depends on the cp_test of phy_ops which will
be dropped later, so we remove rockchip_u3phy_cp_test()
directly.

As a side effect, we need to use io commands to set the
USB3 enter compliance test mode instead of host_testmode
for RK3328 USB3 PHY.

Change-Id: Ie756b22f5bb89e146ad971f2668111a4733ff892
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-06-29 16:53:21 +08:00
William Wu
35ec91bf3a phy: rockchip-inno-combphy: remove combphy_u3_cp_test
The combphy_u3_cp_test() is used for USB3 compliance test,
and it depends on the cp_test of phy_ops which will be
dropped later, so we remove combphy_u3_cp_test directly.

As a side effect, we need to use io commands to set the
USB3 enter compliance test mode instead of host_testmode
for RK1808 USB3 combphy.

Change-Id: Iac7d9a4c6b0d2a74c284586f5dcbb48925691a91
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-06-29 16:53:21 +08:00
William Wu
9b2b3773bc usb: dwc3: rockchip-inno: remove debugfs directory and host_testmode
This patch remove debugfs directory and host_testmode which
cause the following error:

ERROR: "xhci_set_link_state" [drivers/usb/dwc3/dwc3-rockchip-inno.ko] undefined!

We remove the code of host_testmode directly, because it
depends on the phy_cp_test() which will be dropped later.

As a side effect, we need to use io commands to set the
DWC3 Host enter compliance test mode instead of host_testmode
for RK3328 USB3.

Change-Id: Ie0b1fac63fd6458f07ad30edadc7c4c27486e894
Signed-off-by: William Wu <william.wu@rock-chips.com>
2020-06-29 16:53:21 +08:00
XiaoDong Huang
5f48c4e68e regulator: tps549b22: read voltage-step from device-tree
Change-Id: I4de8a54b8475af073ed51ced0959a4e93590563d
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
2020-06-29 14:23:11 +08:00
Hu Kejun
9342eb601f media: rockchip: isp: fix ae window is not correct
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: Ie98897c7e63bbaac724357d1ee4b6964071a9346
2020-06-29 11:59:21 +08:00
Lin Jinhan
018299265d ARM: dts: rockchip: rv1126: add crypto node
Change-Id: If9e8f868e6d917ced387622c16e81e29d56a40db
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2020-06-29 11:16:10 +08:00
Ren Jianing
ca2d5e4f59 usb: dwc3: gadget: fix isoc out transfer issue
When I test the uac gadget function, I find that the uac
gadget out transfer may stop expectedly and the alsa buffer
will be empty which results to input/output error.

In some cases, we will get an endpoint event
DWC3_DEPEVT_XFERINPROGRESS and the event status is
DEPEVT_STATUS_MISSED_ISOC, and the original code try to issue
an EndTransfer command. After the EndTransfer is completed,
we will get a XferNotReady event. However, it will fail to
giveback the req to the udc gadget driver due to an additional
request unmap operation.

To fix this problem, this patch return directly in kick transfer
if there are isochronous endpoints and retry to transfer next time.

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I80a8e7c0caa9129e5736bbf89909662c2f3ed4fe
2020-06-29 11:06:51 +08:00
Wu Liangqing
62da2b7c48 arm64: dts: rockchip: rk3368a-817-tablet: compatible add rockchip,rk3368a
Change-Id: Iaa9633ec7c302353d735d4ed3d72c9bbbee844a1
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-06-29 08:52:59 +08:00
Jon Lin
082cbe0f6d drivers: rkflash: Remove bbt option property if scan fail
Change-Id: Ice861d20077152174d4d407a40239a9142cf3355
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2020-06-29 08:52:31 +08:00
Sugar Zhang
cee61f3e32 video: rockchip: mpp: Fix panic when mpp service is omit or disabled
[    4.239358] Unable to handle kernel NULL pointer dereference at virtual address 00000050
[    4.263110] pgd = (ptrval)
[    4.269464] [00000050] *pgd=00000000
[    4.285610] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[    4.291283] Modules linked in:
[    4.294795] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.111 #1960
[    4.301399] Hardware name: Generic DT based system
[    4.306660] PC is at mpp_set_grf+0x8/0x3c
[    4.311054] LR is at mpp_add_driver+0x24/0x44
[    4.315713] pc : [<b03d7b44>]    lr : [<b03d50d8>]    psr: 20000153
[    4.322250] sp : bf039ee8  ip : 00000d8c  fp : bf7ffd80
[    4.327740] r10: b0b3003c  r9 : 00000007  r8 : 00000000
[    4.333260] r7 : b0b15914  r6 : b0f21788  r5 : 00000006  r4 : b1022a2c
[    4.340094] r3 : 00000048  r2 : bf5d1e24  r1 : b0f21788  r0 : 00000048
[    4.346947] Flags: nzCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment user
[    4.354487] Control: 10c5387d  Table: 6000406a  DAC: 00000055

Change-Id: Idad72d462da59a8af53fd038ceda973da1f4139d
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2020-06-29 08:47:57 +08:00
Cai YiWei
2fa88ab89a media: rockchip: ispp: fix tnr 3to1 frame order
Change-Id: I44dbaf12819111a09d38a7685f1aaf53afc84777
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2020-06-28 15:02:51 +08:00
Nickey Yang
a7898428fc ARM: dts: rv11xx-evb-v12: support rv1109/rv1126 evb ddr3 v12 board
There are some differences between hardware V12 and v10
1.Power:
    The buck1 of rk809 supplies power to NPU and vepu
    The discrete power supplies power to logic
2.Reset signal of camera:
    The reset signal of csi rx0 is control by gpio1_D5,
    The reset signal of csi rx1 is control by gpio2_A0.

Change-Id: Ib290939c9a3a47efaeabfbadbc796126e0cbf279
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2020-06-28 15:02:16 +08:00
Wu Liangqing
6edb4a2e3f arm64: dts: rockchip: rk3368a-817-tablet: rk817 buck2 adjust voltage by hardware
Change-Id: Ide3287096e881e5b763adf240a843813ec4d8924
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2020-06-28 10:28:34 +08:00
Ren Jianing
3a4f755124 ARM: dts: rockchip: add vup_gpios in u2phy0 for rv11xx-ai-cam
The USB2.0 OTG PHY of RV1126/1109 which is designed for lower power
consumption provides only 8.8mA current source on DM. Multiplied
by 45 Ohm host termination resistance, voltage is about 400mV.
If the threshold voltage of host is greater than 400mV, the high
speed handshake will fail and SoC communicate at full speed. So
swing calibration is necessary.

We use gpio to control the 220 Ohm pull-up resistor to provide additional
current. Experiments show that the voltage of chirpK can be increases
to about 600mV.

Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I387ae1840959540ff9ca22db26896def0e890619
2020-06-24 19:26:40 +08:00
Ren Jianing
ef65767d42 ARM: dts: rockchip: change dr_mode to peripheral for rv11xx-ai-cam
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ieedc7480173ff9c1d575643d1dea2f09e5528945
2020-06-24 19:26:21 +08:00
Jianing Ren
a35ff85301 phy: phy-rockchip-naneng-usb2: enable id irq when vbus always on
This patch will enable id interrupt for otg port when the property
vbus-always-on is set in dts.

If vbus is always on, bvalid interrupt won't make sense and be
disabled. But we cat change id state to switch drd mode by software.

Change-Id: I69fc3f00430dfd73835c6e99694d8d7c72c60c8c
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-06-24 18:59:01 +08:00
Jianing Ren
d65989c056 phy: phy-rockchip-naneng-usb2: add low power function for rv1126
By bypass charge detect module, about 140uA current can be saved
on USB_AVDD_1V8 power supply when suspend. Notice that bandgap
current can not be turned off, so there is still about 165uA
current.

This patch also remove the tuning in phy resuming, because the power
of phy is always on and registers does not need to be configured
again.

Change-Id: If13d3741e3b01289c1bd0294d6e6d88278c4654c
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-06-24 18:59:01 +08:00
Jianing Ren
65b48186c4 phy: phy-rockchip-naneng-usb2: cancel the dynamic management of clks
This patch remove the clks manegement in phy operations and keep the
clks always on. Keep the clks on can avoid many errors such as USB480M
clk abnormal output and EHCI controller error.

Change-Id: If201106d432d05e8fc5f63d595a67524e2183b5c
Signed-off-by: Jianing Ren <jianing.ren@rock-chips.com>
2020-06-24 18:59:01 +08:00
Andy Yan
bc592f16c7 drm/rockchip: rv1126: Fix vop version number
According to VOP_VERSION register on rv1126, the
major is 0x2, minor is 0x0b.

Change-Id: Ie8f3a91d839bcd042a655881302e9b43f6f297d5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2020-06-24 14:49:51 +08:00