Commit Graph

1065941 Commits

Author SHA1 Message Date
Liang Chen
b6c7d8fb46 soc: rockchip: opp_select: calibrate opp-table by pvtpll
Change-Id: I790cd008707fff37bc158bcca8c8255ce13db987
Signed-off-by: Liang Chen <cl@rock-chips.com>
2022-04-25 19:52:56 +08:00
Jianqun Xu
a0cc9df97e dma-buf: rk_heaps: default to disable print
Add a config to on/off the driver print, default to be off.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I2f2ec608547bca06d12238d13a8824dc651404c0
2022-04-25 18:57:00 +08:00
Huibin Hong
560564a794 fiq_debugger: tty_write skips console_lock when console thread enable
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Change-Id: I9f6d8f161dbba75efa0a9beb9ea94d26c0c27945
2022-04-25 18:04:32 +08:00
Jianqun Xu
64fd7f2a7a video: rockchip: mpp: return error code
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ie5953efe044c67cb9b7d352f3297d14c6da7496b
2022-04-25 15:25:44 +08:00
Sugar Zhang
a08bad447d ARM: configs: rv1106: Enable VIDEOBUF2_{CMA_SG|VMALLOC} default
+CONFIG_VIDEOBUF2_CMA_SG=y
+CONFIG_VIDEOBUF2_VMALLOC=y

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I7b8e6c89f5db6791628d0f681dc161a6a2879d01
2022-04-25 15:24:22 +08:00
Sugar Zhang
0a016f0c0e media: common: videobuf2: Kconfig: Export buf type config
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I4bb4aab61e240a6aafecb7c06387ba53f430bab0
2022-04-25 15:18:31 +08:00
Sugar Zhang
1b7d5f592e ARM: configs: rv1106-uvc-spi-nor.config: Update by diffconfig
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I8a5edeff367de158b1be31daca03286abe1f2d5e
2022-04-25 10:52:40 +08:00
Cai YiWei
6c1cb27543 media: rockchip: isp for sdmmc lock
Change-Id: Ia7fe16edae775cd41dadd4ae3681df6365b8c62f
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-04-24 17:20:14 +08:00
Zefa Chen
97e6a821bb media: rockchip: rv1106 vicap compatible with sdmmc
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: Id8bc9ab9cad17b34b4d0288f10b0eff31854e2e9
2022-04-24 16:15:10 +08:00
Weiwen Chen
2f5b6d4bb7 ARM: configs: rv1106-ipc: Enable mount vfat filesystem
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: Ic95aa23e983d26fabd6e2159b99ab702e86e7796
2022-04-24 15:19:25 +08:00
Shawn Lin
6eca689b99 mmc: dw_mmc: Workaround for RV1106/1103 sdmmc
1. We always use dma for sdmmc, and it could not be used as SDIO
2. restore affected registers includes ctype and timeout
3. expose API for ISP/VICAP usage
4. remove SD3.0 support which won't affect write throughput
5. limit ffaa0000 controller only be used as sd card before ECO
6. reserve a descriptor for dirty data, in order to let DMA finish
the prior descriptors and the dirty data in the last descriptor will
not be sent at all.
7. use CMD12 + reset to clean the remain dirty data and recovery IP

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ib1456c8f399cdeda391ba459b22097b0f5820e53
2022-04-24 15:07:16 +08:00
Ziyuan Xu
d2786053e4 driver: rknpu: close pd stuff until iommu disabled
Test on RV1106
Before:
initcall rknpu_init+0x1/0x10 [rknpu] returned 0 after 66724 usecs
After:
initcall rknpu_init+0x1/0x10 [rknpu] returned 0 after 2579 usecs

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I382c55ed7df3aab6974c025a8871fa25905d622e
2022-04-24 14:31:50 +08:00
Jianqun Xu
61756ba5e9 soc: rockchip: rk_dmabuf_procfs fix segment error for dma debug
[  951.963848][ T2104] ------------[ cut here ]------------
[  951.963901][ T2104] DMA-API: platform dmabuf: mapping sg segment longer than device claims to support [len=262144] [max=65536]
[  951.963936][ T2104] WARNING: CPU: 3 PID: 2104 at kernel/dma/debug.c:1174 debug_dma_map_sg+0x1d4/0x3f8
[  951.963944][ T2104] Modules linked in:
[  951.963966][ T2104] CPU: 3 PID: 2104 Comm: cat Not tainted 5.10.66 #264
[  951.963974][ T2104] Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
[  951.963987][ T2104] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[  951.963997][ T2104] pc : debug_dma_map_sg+0x1d4/0x3f8
[  951.964006][ T2104] lr : debug_dma_map_sg+0x1d4/0x3f8
[  951.964013][ T2104] sp : ffffffc0153bbab0
[  951.964023][ T2104] x29: ffffffc0153bbad0 x28: ffffff81013abd80
[  951.964035][ T2104] x27: 000000000000000e x26: 0000000000010000
[  951.964047][ T2104] x25: ffffffffffffffff x24: ffffff81420a2968
[  951.964058][ T2104] x23: ffffff814b13dc00 x22: ffffff8104515810
[  951.964069][ T2104] x21: ffffffc011d7f000 x20: 000000000000000e
[  951.964081][ T2104] x19: ffffffc011b99000 x18: ffffffc01a5e5080
[  951.964091][ T2104] x17: 0000000000000000 x16: 00000000000000d8
[  951.964102][ T2104] x15: 0000000000000004 x14: 0000000000003fff

Fixes: 61a59410bf ("soc: rockchip: Add a dmabuf procfs for rockchip")

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I9eec7b5a1ccefed5a4d7e485cbb2e263ce7da970
2022-04-24 14:27:27 +08:00
William Wu
8f245236c4 usb: gadget: f_fs: kmalloc size align to cache line for ROCKCHIP_MINI_KERNEL
For ROCKCHIP_MINI_KERNEL, it set the kmalloc min size lower than
arch dma min alignment. So the f_fs driver needs a guaranteed
cache line alignment for DMA buffer.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I5bbf9a099f2c03bbcfc50af6949b185502ce9be9
2022-04-24 14:16:18 +08:00
Zefa Chen
c43d84d921 media: rockchip: vicap optimize interrupt of toisp
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I260f092e7c78d4ff36bb8eca17072840461de0a5
2022-04-24 14:13:54 +08:00
Simon Xue
18762023bb iommu/rockchip: add rockchip_iommu_is_enabled api
Change-Id: I07ee2a1998322acec525868552c5626081bd8137
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2022-04-24 11:44:37 +08:00
Kever Yang
c231916b68 arm64: dts: rockchip: rk3588s: Init PPLL to 1.1G
PPLL 1.1G with pcie2 comboPHY TS3 can get better signal.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I6af09906be88e7568b474b806161c3e1d6cd936e
2022-04-24 10:30:44 +08:00
Kever Yang
de7d060208 clk: rockchip: rk3588: add PLL 1.1G parameter
1.1G may used for PPLL.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I77b539ca94a5a51efa34ad2ea4b355b27b21ed0b
2022-04-24 10:30:44 +08:00
Kever Yang
b9c18b2b3a phy: rockchip: naneng-combphy: ADD T0_1 for pcie internal 24M clock
This is the best setting for internal clock which enable SSC mode.

Note for use this setting:
- Enable ssc in dts;
- modify to use 24M clock in dts.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: Ia6db793dd8bf016985f4771ee1baac14449ae5b1
2022-04-24 10:30:44 +08:00
Kever Yang
2accc53726 phy: rockchip: naneng-combphy: update to use T3 for PCIe TRIM
According to HW signal test, the T3 parameter is the best setting for
non-SSC mode, need to co-work with PPLL and DIV PF10.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I3b701f714bd63e08bb5d47046c37bba6701c4f8a
2022-04-24 10:30:44 +08:00
Cai YiWei
94f439584b media: rockchip: isp: lock for buf alloc and free
Change-Id: I94f01e3d8a24ec11a6b853416421e7f5d6323a8a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-04-22 17:39:38 +08:00
Wyon Bi
7d88934a96 drm/bridge: analogix_dp: Fix link train adjust request
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I031ecd4747ad3023e5d9cb7bd7519d0f94662d7c
2022-04-22 17:15:38 +08:00
Wyon Bi
c1fa358173 arm64: dts: rockchip: rk3588s-evb1-lp4x: Add custom training table for edp
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I93d5a8c936bc5df6b04fdfba874485fb9b954532
2022-04-22 17:15:00 +08:00
Wyon Bi
298ec87bd0 arm64: dts: rockchip: rk3588s-tablet: Add custom training table for edp
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I3a734a68383f86ffd0a24a34b99bc0f9e3575ec9
2022-04-22 17:14:29 +08:00
Wyon Bi
3b3254cfec phy/rockchip: samsung-hdptx: Support DT specified training table
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I70680470ecc7aecb79cc5d35820cf8c983b542c3
2022-04-22 17:07:34 +08:00
Wyon Bi
50e757f7cb phy/rockchip: samsung-hdptx: Disable TX jitter EQ for power reduction
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Ia5a0901182deb47b1a8599922efbcf60101ce15c
2022-04-22 16:55:41 +08:00
Finley Xiao
b6b135b2f6 driver: rknpu: Change clock rate and read margin only when pd is on
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I4b4d0c8a79224afe8dbc8cd336c790e782ac6193
2022-04-22 16:12:14 +08:00
Yiqing Zeng
739f8acfec media: i2c: add sc401ai sensor driver
Signed-off-by: Yiqing Zeng <zack.zeng@rock-chips.com>
Change-Id: Ic8cdd26d811af32eb0ada5ac88630a6a03720bd2
2022-04-22 15:37:38 +08:00
David Wu
bde32557c5 ethernet: stmmac: Dynamically change limit to fit dma size
First, ensure that limit cannot exceed dma size, and rx cannot clear the
over dma_size buffers. Second, ensure that dirty is not equal to 0, if
really need to clean rx at this time.

[  552.964089] Unable to handle kernel paging request at virtual address b8280000
[  552.971316] pgd = d04d5ca4
[  552.974019] [b8280000] *pgd=00000000
[  552.977594] Internal error: Oops - BUG: 5 [#1] THUMB2
[  553.014986] Hardware name: Generic DT based system
[  553.019780] PC is at memcpy+0xd6/0x2dc
[  553.023536] LR is at stmmac_napi_poll_rx+0x32f/0x744
[  553.028492] pc : [<b0185e8e>]    lr : [<b02329f3>]    psr: 6000a833
[  553.034748] sp : b0663e4c  ip : 00000002  fp : b1273900
[  553.039967] r10: 00000010  r9 : b09444e0  r8 : 00000000
[  553.045188] r7 : 00000000  r6 : 000005ea  r5 : b2693600  r4 : b09444e0
[  553.051709] r3 : 4c105000  r2 : 000005e6  r1 : b8280000  r0 : b0dbb7c2

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ie82acf7edf39835ac9bb4f13e599718d03550154
2022-04-22 14:44:29 +08:00
Zhen Chen
5f5ce518ca MALI: bifrost: treat "Could not get a valid AS for group ..." as a debug log not warning
In mail 'RE: <rock-chips>: G610: Valhall Android DDK r36:
Does device driver warning log "Could not get a valid AS for group ..." matter?',
zhigang.yao@arm.com declared that it should not be a warning:

"This is expected behavior.
GPU has a limited present HW address space resource,
max is 16, and is implementation specific, (8 on Odin?).
So if there are more than 16 (8 on Odin) process,
some of it might not get a valid present address space,
and the warning would be printed as you have observed."

Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
Change-Id: Ic8324c37461776672d516b472db66549d91fe552
2022-04-22 14:22:37 +08:00
Cai YiWei
e4fb9c7c15 media: rockchip: isp: api to free mesh buf for user
Change-Id: Ic651fa7655848badb8792a54a01703fc25c839d3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-04-22 14:21:05 +08:00
Cai YiWei
a1a35216e2 media: rockchip: isp: isp32 fix ae no working with af
should not to clean meas done during working for
af ae mode, if not ae will abnormal.

Change-Id: Id7353409cc8b79b3b3a59fe39df905344afacf7b
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-04-22 14:14:18 +08:00
Tao Huang
8b1cb4e1c4 init: defer free large memblock to Buddy allocator when CONFIG_ROCKCHIP_THUNDER_BOOT=y && CONFIG_SMP=y
It's not benefit on UP system.

Fixes: b6cd53a3a2 ("init: defer free large memblock to Buddy allocator when CONFIG_ROCKCHIP_THUNDER_BOOT=y")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I237208a21dc011695df998d546e4d28141ff41e6
2022-04-22 10:55:24 +08:00
Finley Xiao
c4fc841b36 arm64: dts: rockchip: rk3588s: change gpu opp table for stability
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I84feb93dd7403e57c8c358f07426a8f7886f376f
2022-04-22 10:54:53 +08:00
Lin Jinhan
b71bd8763d crypto: rockchip: v2&v3 add support gcm
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I7e63440c6f652b8939ade56d51957279310bec51
2022-04-22 10:52:53 +08:00
Wang Xiaobin
ba7429f655 crypto: rockchip: cryptodev_linux: add support for aead
Since the origin COP_FLAG_AEAD_*_TYPE are not applied to both
virt and fd API, we add a new type.

Change-Id: I1e896c7de90b2a4cd6053dac14bf20ab8d059ffd
Signed-off-by: Wang Xiaobin <xb.wang@rock-chips.com>
2022-04-22 10:52:53 +08:00
Jianwei Fan
afc82929cf media: i2c: jaguar1: add g_frame_interval ops
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: I6b95a23533cf131698000d5a88c07bf524661745
2022-04-22 09:41:06 +08:00
Yu Qiaowei
b44b46489e video: rockchip: rga3: Fix use of wrong dev when virtual address unmap
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I26428b56a897803e11d3c048fba47356d5648ce6
2022-04-22 09:33:28 +08:00
Ziyuan Xu
94704a2ab6 ARM: configs: rockchip: Add rv1106-tb.config
Update by:

make ARCH=arm rv1106_defconfig
cp .config rv1106.config
make ARCH=arm rv1106_defconfig rv1106-tb.config
make ARCH=arm menuconfig
./scripts/diffconfig -m rv1106.config .config > arch/arm/configs/rv1106-tb.config

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I10ed0af2d2189f275defbf1b79de4319ffe6c44a
2022-04-21 16:03:54 +08:00
Damon Ding
8c6227243e drm/rockchip: vop2: add atomic check of vp splice mode
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I9cab505bd48267ed64ebf0da52208ec4471c885c
2022-04-21 15:55:00 +08:00
Damon Ding
2cf63af67b drm/rockchip: logo: set support mode limit to 8k
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ife0b8e2a81e5327330e732b5bfc2abf25fdb6797
2022-04-21 15:55:00 +08:00
Sugar Zhang
05cc2b4fba dmaengine: pl330: Fix unbalanced runtime PM
This driver use runtime PM autosuspend mechanism to manager clk.

  pm_runtime_use_autosuspend(&adev->dev);
  pm_runtime_set_autosuspend_delay(&adev->dev, PL330_AUTOSUSPEND_DELAY);

So, after ref count reached to zero, it will enter suspend
after the delay time elapsed.

The unbalanced PM:

* May cause dmac the next start failed.
* May cause dmac read unexpected state.
* May cause dmac stall if power down happen at the middle of the transfer.
  e.g. may lose ack from AXI bus and stall.

Considering the following situation:

      DMA TERMINATE               TASKLET ROUTINE
            |                            |
            |                       issue_pending
            |                            |
            |                     pch->active = true
            |                       pm_runtime_get
  pm_runtime_put(if active)              |
    pch->active = false                  |
            |                      work_list empty
            |                            |
            |                     pm_runtime_put(force)
            |                            |

At this point, it's unbalanced(1 get / 2 put).

After this patch:

      DMA TERMINATE               TASKLET ROUTINE
            |                            |
            |                       issue_pending
            |                            |
            |                     pch->active = true
            |                       pm_runtime_get
  pm_runtime_put(if active)              |
    pch->active = false                  |
            |                      work_list empty
            |                            |
            |                   pm_runtime_put(if active)
            |                            |

Now, it's balanced(1 get / 1 put).

Fixes:
commit 5c9e6c2b2b ("dmaengine: pl330: Fix runtime PM support for terminated transfers")
commit ae43b32891 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12")

Change-Id: Ib1feb508c16afb4bc9ced0c3660f2b6b4a19c068
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2022-04-21 15:39:09 +08:00
Ziyuan Xu
c9c4664d3e ARM: dts: rockchip: add camera/isp devices support for RV1106G-EVB2
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I3748cc69d12c1ac81c34148c3ea3f2bcee8ad3c4
2022-04-21 14:55:47 +08:00
Ziyuan Xu
05810138d7 ARM: dts: rockchip: Add thunder support for RV1106G EVB2 Board
The RV1106 EVB2 board is designed for some products that's required
thunder-boot feature, and use spi-nor flash as default.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: Ie0543368c9536d820995313eca4f12529aa4d391
2022-04-21 14:26:04 +08:00
Ziyuan Xu
53374a4268 ARM: dts: rockchip: Add rv1106 thunder boot dtsi
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: Ia2f2e0f5d915e122ba13431aab152bf70eef929c
2022-04-21 14:22:16 +08:00
Shawn Lin
3954c83af6 mmc: dw_mmc: remove partial thunder boot
In preparation for adding new driver to support starting
decompress ramdisk.

And make the hclk_mmc is available before accessing the registers.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: Icbd51f2798367430443bae9af5656891b93ac3bd
2022-04-21 14:21:22 +08:00
David Wu
87f766b53a net: phy: RK630phy: Disable uaps and eee advertised for t22
For some MTK solution routers, there may be link up/down situation,
after disable these two function, the problem can be solved, and the
power consumption is tested, and there is no increase.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I46122188b2fcb67dc02630827b4b631ecfc0ec5e
2022-04-20 17:18:18 +08:00
Wang Xiaobin
f1148033d4 crypto: rockchip: pka: avoid optimizing custom memcpy/memset
SRAM accessed by PKA requires word alignment.
It will crash if optimized to memset/memcpy.

Change-Id: I0122ff7ffab3835c513c39d57aa5441655cd2b03
Signed-off-by: Wang Xiaobin <xb.wang@rock-chips.com>
2022-04-20 16:52:28 +08:00
David Wu
c61e7280aa ARM: dts: rockchip: rv1106: Split TX and RX DMA size
Set rx default size to 16, if not enough, please change board dts.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iab1812d1eb9b7156b58b39d8199d0b55ae329bd0
2022-04-20 16:10:15 +08:00
David Wu
905e1ec794 ethernet: stmmac: Split TX and RX DMA size
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Ia576efd1d413c44bb789b67151156ac0f2cf59d1
2022-04-20 16:09:38 +08:00