Commit Graph

865238 Commits

Author SHA1 Message Date
Dongbo Yang
ea77184511 media: i2c: add strobe control & fix expsoure for ov9281.
Signed-off-by: Dongbo Yang <db.yang@rock-chips.com>
Change-Id: I12ba55000c1814b4aeedc414b9ce7f6ddfb8ed19
2021-07-30 20:26:05 +08:00
Dongbo Yang
25db7b2bb4 media: i2c: modify ov9281 driver for thunderboot.
Signed-off-by: Dongbo Yang <db.yang@rock-chips.com>
Change-Id: I17defb2b02913de0a1e70479068cec244b554593
2021-07-30 20:25:58 +08:00
Jianqun Xu
6863a5d24a staging: android: ion: fix partial sync for iommu
Fixes: 975372e2cb ("staging: android: ion: support partial cpu access")
Change-Id: Iabf3b04dbc838ca5c60fa1a0592bbb5aac496090
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-07-30 19:36:26 +08:00
Ziyuan Xu
d206db3376 ARM: configs: disable tb_isp as default for rv1126-tb
THUNDER_BOOT_ISP is used for snapshot first frame in risc-v, it's
useless for most of products.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: Id64c514f9d21671dfae43b7eff927cae861ce733
2021-07-30 16:15:10 +08:00
Jon Lin
02cb79c93b drivers: rk_flash: set dma mask to 32bits
The nandc's DMA only supports 32bits. When the DDR capacity exceeds 4GB,
It need to configure DMA mask to 32bits and use API dma_map_single to
get the physical address.

Change-Id: I1510f7bbe2779ea20ff83a93e3a4dabb941263e3
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-07-30 16:06:00 +08:00
Simon Xue
912b48e870 PCI: rockchip: fix subsys_irq_handler logic
Clear irq status first then handle the udma interrupt.

Change-Id: I3638524b7bd09ad21a431bfebd3ba0b5bfbe7b8e
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-07-29 19:25:01 +08:00
William Wu
9697ead7cc arm64: dts: rockchip: rk3568: disable receiver detection in P3 for usb
RK3568 USB DWC3 controllers require to disable receiver detection
in P3 for correct detection of USB devices. And this quirk to set
the GUSB3PIPECTL.DISRXDETINP3, then the DWC3 core will change the
PHY power state to P2 and then perform receiver detection. After
receiver detection, the DWC3 core will change the PHY power state
to P3 state.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Iaad3f7ce2c4dee1788539781e3bcfbb39458f5d6
2021-07-29 12:15:31 +08:00
William Wu
7b641cbfff usb: gadget: uvc: fix NULL pointer dereference when usb hotplug
When do uvc hotplug test on RV1126 EVB, it may crash in the
uvc_v4l2_streamon() with the following error log. Because
it tries to enable the video stream after usb disconnect.

[ 1748.947755] configfs-gadget gadget: uvc_function_disable
[ 1748.947947] android_work: sent uevent USB_STATE=DISCONNECTED
[ 1748.955347] Unable to handle kernel NULL pointer dereference at virtual address 00000003
[ 1748.956158] pgd = ef2a7e72
[ 1748.956550] [00000003] *pgd=6dde7835
[ 1748.956893] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[ 1748.957381] Modules linked in: galcore(O) bcmdhd
[ 1748.957819] CPU: 3 PID: 2706 Comm: uvc_gadget_pthr Tainted: G        W  O      4.19.111 #9
[ 1748.958567] Hardware name: Generic DT based system
[ 1748.959218] PC is at uvcg_video_enable+0xb8/0x228
[ 1748.959775] LR is at vb2_core_streamon+0x11c/0x15c
......
[ 1749.041063] [<b056a2cc>] (uvcg_video_enable) from [<b0569968>] (uvc_v4l2_streamon+0x28/0x70)
[ 1749.041906] [<b0569968>] (uvc_v4l2_streamon) from [<b0590b54>] (__video_do_ioctl+0x1c8/0x3a0)
[ 1749.042681] [<b0590b54>] (__video_do_ioctl) from [<b0594288>] (video_usercopy+0x200/0x494)
[ 1749.043475] [<b0594288>] (video_usercopy) from [<b0220c38>] (do_vfs_ioctl+0xac/0x798)
[ 1749.044178] [<b0220c38>] (do_vfs_ioctl) from [<b0221358>] (ksys_ioctl+0x34/0x58)
[ 1749.044843] [<b0221358>] (ksys_ioctl) from [<b0101000>] (ret_fast_syscall+0x0/0x4c)

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I6bb58133aaade0ff389fa4af2cfc05fe598de250
2021-07-28 20:46:26 +08:00
Sandy Huang
7751fcdc18 drm/rockchip: vop: Deal with display area out of display mode
Some linux display framework will set display area out of display mode,
this is incorrect config and will lead vop iommu pagefault, we add this
commit to avoid vop pagefault and output error info.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I50f9c93d807858b8939038aae9915b4895fe35e2
2021-07-26 10:01:06 +08:00
William Wu
3e74187d73 phy: rockchip: inno-usb2: support usb wakeup for rk3568
RK3568 usb phy0 and phy1 linestate irq can be set as
wakeup source, but the default linestate filter time
is based on the usb phy grf pclk 100MHz. So it needs
to reconfigure the linestate filter time base on 32KHz
clk when enter deep sleep.

In addition, it needs to enable the host port (usb3
host1 and usb2 host1) wakeup irq because of legacy
reason.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I9151d49721e8e9d917fdb51228f3ca2627090156
2021-07-23 17:26:54 +08:00
Guochun Huang
d83146c216 drm/rockchip/rk628: combtxphy: reducing DUAL LVDS power consumption
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I831dc7879f8f4656e9db63c629c37cc5709d3e35
2021-07-23 17:17:10 +08:00
Xu Hongfei
2e7a96b5d0 media: rockchip: ispp: fix bug that ispp register isn't included in SEI
Signed-off-by: Xu Hongfei <xuhf@rock-chips.com>
Change-Id: Icfc0e722c2ea4734c863b0ea478df312ddbb826f
2021-07-23 16:45:14 +08:00
Shawn Lin
4dd2e70089 mmc: sdhci-of-dwcmshc: Adjust DLL_TXCLK_TAPNUM_DEFAULT to 0x10
This value is better to be 0x10 instead of 0x16 by new test report
to keep all RK356x work consistently.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I87a22f6e02a6206981fe484db353613ac9a3ede6
2021-07-23 16:40:52 +08:00
Yu Qiaowei
cc56c4b78f video/rockchip: rga2: Fix MMU base not shift forward.
Since the MMU base is not shifted forward, when the sync/async mode
is called together, the same memory is used to store the page table,
resulting in data errors.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: If4807da8159e98a8d807cc24b4d6533793eeefa8
2021-07-23 11:18:56 +08:00
Yu Qiaowei
557096465c video/rockchip: rga2: adapt to kernel 5.10
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Id7854aaa8bf39c272d9e29f721e38d49d2222727
2021-07-23 11:18:56 +08:00
Jon Lin
a6cf6aca12 drivers: rkflash: Ajudst the dll strategy
1.max_dll_cells is 0x1FF when sfc_ver_4
2.sfc_set_delay_lines to zero means disable dll
3.bypass dll training when there is no device
4.Adjust the dll_value to from the middle of the dll window to
the better one
5.Change RKSFC_DLL_THRESHOLD_RATE to ">50MHz"

Change-Id: Ibd669420899925272c74e190fee8c62c09db8d14
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-07-22 20:01:59 +08:00
Sandy Huang
81633ee291 drm/rockchip: vop2: enable dither up when input rgb565
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I554924b979735e2377b1e9d06b22b2d9b35450a4
2021-07-22 11:12:40 +08:00
Ziyuan Xu
f5d4d3c289 ARM: configs: add rv1126-snapshot.config
Change-Id: If17c72edc26526c4d4e697b09b9db971827c760a
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2021-07-22 11:10:28 +08:00
Ziyuan Xu
1e4601090a ARM: dts: rockchip: add rv1126-snapshot.dts
The rv1126-snapshot products aim to capture the camera frames as soon
as possible, that use RISC-V to get the camera frames after 'fastae'.

Change-Id: I62fc197279e9188c87616f0cbbaa747b05042e1b
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2021-07-22 11:09:02 +08:00
Ziyuan Xu
410876acbd ARM: dts: rockchip: separate common device node to rv1126-bat-evb-v10.dtsi
Change-Id: I50b0e7f69f2b03bbb3c9987fdc10b0c2c19376d6
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2021-07-22 10:47:14 +08:00
Algea Cao
1dd8f442b8 drm/bridge: synopsys: dw-hdmi: Remove dw_hdmi_setup when atomic_check
There is no need to call dw_hdmi_setup() when atomic_check.
dw_hdmi_color_changed() will check if color format changed and
call a mode_set.
If call dw_hdmi_setup() to enable hdmi when the first plug in
atomic_check, HPLL has not been configured in rk356x, there will
be display err in some monitor.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I83f3d1d3ff45e3e07910449d8d03f94b82fc0abe
2021-07-22 09:38:30 +08:00
Cai YiWei
293999cf8f media: rockchip: isp1: add 150m isp clk for rk3326
Change-Id: Ia87c9274f1dce6667b0c3aba3d009cf99191a353
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-22 09:21:30 +08:00
Cai YiWei
404b75f3b2 media: rockchip: isp1: fix buf done state
Change-Id: Idc2fc19c3972935d6991bd6d6af10e1f9cdbd7e7
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-22 09:21:30 +08:00
Binyuan Lan
93b6df5c15 ASoC: rockchip: rk817-codec: Solve pop problems
DIGEN_CLKE can only be controlled when the amplifier is turned off

Signed-off-by: Binyuan Lan <lby@rock-chips.com>
Change-Id: I5758cab8f20bd2ede008d1ad138cdadcaa55e39d
2021-07-21 17:45:10 +08:00
Sandy Huang
f26aeace67 Revert "drm/rockchip: gem: fix dma_free_attrs() parameter error"
This reverts commit 42256c1a8f will lead to
DMA buffer + IOMMU free buffer error:

when we use DMA continue buffer, we have the following two use case:
case 1: DMA + IOMMU, we have two addr
    alloc:
	dma_handle = dma_alloc_attrs()
	dma_addr = rockchip_gem_iommu_map() --> config to vop register
    free:
	rockchip_gem_iommu_unmap(dma_addr)
	dma_free_attrs(dma_handle)

case 2: DMA + no IOMMU, we have one addr
    alloc:
	dma_handle = dma_alloc_attrs()
	dma_addr = dma_handle  --> config to vop register
    free:
	dma_free_attrs(dma_handle)

After convert this commit, we still fix the dma_free_attrs() parameter
error at rockchip_gem_alloc_dma(), detail:
...
        dma_free_attrs(drm->dev, obj->size, rk_obj->kvaddr,
old:                      rk_obj->dma_addr, rk_obj->dma_attrs);
new:                      rk_obj->dma_handle, rk_obj->dma_attrs);

...

Change-Id: I3c05d632b42e09b082d7e378dc7510548a794727
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-07-21 16:16:47 +08:00
Ziyuan Xu
7884aefdda media: rockchip: isp/ispp: declare slab.h for kmalloc/kfree
Change-Id: I515dfc032819df9c4dfb235a413403567392d9d0
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2021-07-21 14:23:10 +08:00
Cai YiWei
3045aa8922 media: rockchip: isp: dmarx support yuv format
Change-Id: I0375e0defa96bb3d3b1573170b203ecfce33219e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-21 11:18:54 +08:00
Cai YiWei
05ef3436f7 media: videobuf2-v4l2: copy user image sequence for output video
Video output device is images from user space to the driver,
Sequence set to 0 default when fill vb2 buffer. For driver maybe
need image sequence information.

Change-Id: I34f39a98c6fa8dfa1ea2c45cfa7e6b20114236a3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-21 11:18:54 +08:00
Cai YiWei
48d73c60c2 media: rockchip: isp1: clean list when stream failed
Change-Id: Ib9ebf27d7b3e7e3952f95e37dcaea90faf1411f8
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-21 09:51:54 +08:00
Ziyuan Xu
aff7f97251 ARM: dts: rv1126-thunder-boot: remove mipi_csi_mclk iomux declaration
The mclk iomux operation should be done on RISC-V stage.

Change-Id: I392ef059bae44e3432ac97dd40c644c43766a1ba
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2021-07-20 19:23:23 +08:00
Shawn Lin
e81fbbddde arm64: dts: rockchip: rk356x-evb: fix pcie supply to regulator-fixed
Commit 6de4caa7df ("arm64: dts: rockchip: rk356x-evb: fix pcie supply
to regulator-fixed") cleanup these stuff but we still have some left.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I29ebb92cc3dd0eaccfa610c7d526e46a0c33f320
2021-07-20 18:16:13 +08:00
Sugar Zhang
c0cb36f806 ASoC: rockchip: i2s-tdm: Add support for 16ch tdm mode
TDM_I2S_ONE_FRAME:
support: [4, 8, 12, 16] channels

TDM_I2S_HALF_FRAME:
support: [2, 4, 6, 8] channels

TDM_PCM_XXX:
support: [2, 4, 6, 8] channels

Change-Id: If9d4205977ee09b993d32759353794c101dc281e
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-07-20 14:43:06 +08:00
Sugar Zhang
b45d966014 ASoC: rockchip: i2s-tdm: Silence warning by adding parentheses
This patch place parentheses around 'x' to silence potential warning.

Change-Id: I7c6cd70c03f71e85bd39faa092f2d0eb61409431
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2021-07-20 14:34:17 +08:00
William Wu
016b6c5734 phy: rockchip-naneng-usb2: keep utmi clk on during charge detection
When do charge detection, the phy specification suggests that
it needs to holds the phy in reset state to avoid USB data
communication. However, the utmi clk60_30 will be disabled at
the same time, that's causing a synchronization issue between
the phy and the USB controller.

I test on RV1126 EVB Linux SDK, do usb device hot plug test
quickly. The USB dwc3 controller may fail to enable ep0 because
of no clk60_30 is supplied by the phy.

This patch sets the phy utmi in normal mode by GRF to keeps the
utmi clk on for USB controller.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I8958a491130faeb9ac361b8639e4c3d3190fad1b
2021-07-19 17:03:46 +08:00
Cai YiWei
f6569d395b media: rockchip: isp: disable params when it stream off
Change-Id: I534c6052217e3bec01d1abb9efd1eaf1c97a1f7b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-19 16:32:08 +08:00
Cai YiWei
29db17b825 media: rockchip: isp: add lock for isp stream
Change-Id: I25f128a59eaf953d8b8c42313ea8afd82e7229ae
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2021-07-19 16:32:08 +08:00
Tao Huang
ffb0dcfe50 iommu: remove unused rk-iommu/iovmm driver
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ieca1544f10c294303d0d40c6b4c5e1a797e577a2
2021-07-19 16:32:08 +08:00
Jon Lin
e867387ca2 drivers: rkflash: Notice it when the storage device is not support
When the related print appears, it means that the SDK is too old
and the storage driver needs to be updated.

Change-Id: I63f45fba4cf52108c628f225ee23aa0819ca256f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2021-07-19 16:32:07 +08:00
Jianqun Xu
12df382a94 staging: android: ion: fix error return for ion_sgl_sync_range
Fixes: 975372e2cb ("staging: android: ion: support partial cpu access")
Change-Id: I0517c42ec552d584d6961baa5ac0965d5f5c5650
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-07-19 16:32:07 +08:00
Jianqun Xu
e2b7ae56ad drm/rockchip: fix error return for rockchip_gem_prime_sgl_sync_range
Fixes: e68e6d1a35 ("drm/rockchip: add dmabuf sync partial to dma_buf_ops")
Change-Id: Iaeb2ec6ad605ed06c5f6cbad0705b7977a3f7cfa
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2021-07-19 16:32:07 +08:00
Sandy Huang
04725d0283 drm/rockchip: drv: enable power before direct close crtc
make sure vop power is enabled before use priv function crtc_close() to
close current crtc plane.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I928e5f0f38692fbb8a134e6938ec28f8c1f41285
2021-07-19 16:32:07 +08:00
Zorro Liu
bfbc1155ac drm/rockchip: ebc_dev: release version v2.08
add EPD_A2_DITHER different from EPD_A2

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I49954553452df6dbbf2b5fa885957c22053710bd
2021-07-19 16:32:07 +08:00
Zorro Liu
61050cb9e4 arm64: dts: rockchip: rk3566-eink: change dmc freq level
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I8b06eff47c6a7e07a375d818c9f4c1833dd77cd5
2021-07-19 16:32:07 +08:00
Zorro Liu
87c011cb82 drm/rockchip: ebc_dev: release version v2.07
overlay mode: black and white use du framecount,
to fix trailing smear when draw line on grey background

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: If02bd8edb0c02a159a5359a231b487b09dfd26d2
2021-07-19 16:32:07 +08:00
Yu Qiaowei
9310dee775 video/rockchip: rga2: Add format support
Add BGR565/BGRA5551/BGRA4444.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I248c739d96afa2ec65a7092c7b584fb4730fb0f3
2021-07-19 16:32:07 +08:00
Andy Yan
97e31ffa5d drm/rockchip: vop2: Disable all other multi area when disable area0
When area0 is disabled, all other sub multi area must be
disabled, or the win may run into unexpected situlation:
such as post_buf_empty or iommu fault.

Change-Id: I8a92e45849cfc31af029ba0e86562751be92ddbd
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-07-19 16:32:07 +08:00
Andy Yan
2c9cf24286 drm/rockchip: vop2: fix hdr delay number setting when port_mux is not at last
HDR window is fixed(not move in the overlay path with port_mux change)
and is the most slow window. And the bg is the fast. So other windows
and bg need to add delay number to keep align with the most slow window.
The delay number list in the trm is a relative value for port_mux set at
last level.

Change-Id: I731b909c0a3f483be081e16610536b4ce5b9b8b0
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-07-19 16:32:07 +08:00
Wyon Bi
939c0d8b5b drm/bridge: analogix_dp: Add HBR2 support for RK3399
Change-Id: I3999e4fa0b83ede5719f341d1e9a9a8797c7576b
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-07-19 16:32:07 +08:00
Wyon Bi
10aad71a4d drm/bridge: analogix_dp: Add support for SSC (Spread-Spectrum Clock)
DPTX implements the programmable SSC down-spreading with up to
0.5% modulation amplitude and 30k/33k modulation frequency.

Change-Id: I2c3eae8f27c84eb1b22eac8973691e0276c1588e
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-07-19 16:32:07 +08:00
YouMin Chen
d307d5d0d3 clk: rockchip: rk3568: remove sclk_ddrc
ddr clk using SCMI that it no longer need sclk_ddrc.

Change-Id: I5cee84896083610d9b1a5bc6bcd23ac628ec5c73
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2021-07-19 16:32:07 +08:00