Commit Graph

1080411 Commits

Author SHA1 Message Date
Guochun Huang
613e5c0710 drm/rockchip: dsi2: havle dsc pps pic_width in dual channel dsi
two dsc encoder slices which is equal to pic_width / slice_width
will also halve whith pic_width

 <-HxV->  <------------- H/2 x V -------------->  <-H x V->
          ┌───────┐    ┌───────┐   ┌───────────┐
          │  DSC0 ├───►│dsi0 tx├──►│lcd dsi0 rx│\ ┌───────┐
 ┌─────┐ /└───────┘    └───────┘   └───────────┘ \│       │
 │     │/                                        /│lcd DSC│
 │  VP │\ ┌───────┐    ┌───────┐   ┌───────────┐/ │       │
 └─────┘ \│  DSC1 ├───►│dsi1 tx├──►│lcd dsi1 rx│  └───────┘
          └───────┘    └───────┘   └───────────┘

Change-Id: I65e65f969f9b1e81bee1a7343b386f577255a2f5
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2023-08-16 17:35:02 +08:00
William Wu
e45322a926 ARM: dts: rockchip: disable hs park mode for usb dwc3 controller
Some high speed devices performance drop drastically on
Rockchip platforms when connected with DWC3-xHCI controller.
It's because that the DWC3 controller enable high speed
park mode by default, it aims to improve performance with
pipelining of multiple packet. However, for some devices
(such as UVC with bulk transfer VID:04b4, PID:02f9),
when an IN request is sent within 900ns of the ACK of the
previous packet, these devices NAKs more than 3 times, it
could decrease the performance.

These slow devices include:
1. idVendor=04b4, idProduct=02f9, Product: IRay UVC
2. idVendor=1921, idProduct=21863, Product: Sandisk
3. idVendor=3744, idProduct=8552, Manufacturer: Flex Drive

In order to improve compatibility with high speed devices,
this patch disable HS park mode for USB DWC3 controller on
all arm64 SoCs.

With this patch, we test RK3588 with one slow device
(IRay UVC VID:04b4, PID:02f9) and three fast devices
(U2 disk VID:058f, PID:6387; U2 disk VID:0781, PID:557c;
 U3 disk VID:174c, PID:55aa), all of these device have
no performance loss.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I0ac37e7af429392f65f339cf1448cf2958e03b57
2023-08-16 15:29:15 +08:00
William Wu
d04353d002 arm64: dts: rockchip: disable hs park mode for usb dwc3 controller
Some high speed devices performance drop drastically on
Rockchip platforms when connected with DWC3-xHCI controller.
It's because that the DWC3 controller enable high speed
park mode by default, it aims to improve performance with
pipelining of multiple packet. However, for some devices
(such as UVC with bulk transfer VID:04b4, PID:02f9),
when an IN request is sent within 900ns of the ACK of the
previous packet, these devices NAKs more than 3 times, it
could decrease the performance.

These slow devices include:
1. idVendor=04b4, idProduct=02f9, Product: IRay UVC
2. idVendor=1921, idProduct=21863, Product: Sandisk
3. idVendor=3744, idProduct=8552, Manufacturer: Flex Drive

In order to improve compatibility with high speed devices,
this patch disable HS park mode for USB DWC3 controller on
all arm64 SoCs.

With this patch, we test RK3588 with one slow device
(IRay UVC VID:04b4, PID:02f9) and three fast devices
(U2 disk VID:058f, PID:6387; U2 disk VID:0781, PID:557c;
 U3 disk VID:174c, PID:55aa), all of these device have
no performance loss.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I9037143fa2553317ad7ae55abeafad3b106cafcb
2023-08-16 15:29:04 +08:00
Stanley Chang
35db5a9e94 UPSTREAM: usb: dwc3: core: add support for disabling High-speed park mode
Setting the PARKMODE_DISABLE_HS bit in the DWC3_USB3_GUCTL1.
When this bit is set to '1' all HS bus instances in park mode are disabled

For some USB wifi devices, if enable this feature it will reduce the
performance. Therefore, add an option for disabling HS park mode by
device-tree.

In Synopsys's dwc3 data book:
In a few high speed devices when an IN request is sent within 900ns of the
ACK of the previous packet, these devices send a NAK. When connected to
these devices, if required, the software can disable the park mode if you
see performance drop in your system. When park mode is disabled,
pipelining of multiple packet is disabled and instead one packet at a time
is requested by the scheduler. This allows up to 12 NAKs in a micro-frame
and improves performance of these slow devices.

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
Link: https://lore.kernel.org/r/20230419020044.15475-1-stanley_chang@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry-pick from commit d21a797a3e)
Change-Id: I43ee416e54779a073a0ba4057edf4be8bd7886de
2023-08-16 15:27:25 +08:00
Weixin Zhou
c75ca4c583 spi: rockchip: Add spi thread priority configuration
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Change-Id: Ie66572bb129b7221f4c908869a402db3d229e464
2023-08-16 15:23:39 +08:00
Jun Zeng
0bc5a00c65 arm64: dts: rockchip: rk3588-vehicle change the format of car_rk3308_sound to tdm8
Change-Id: I8ac6e5ffdfe8f00b204265acb0b82d40017621e0
Signed-off-by: Jun Zeng <jun.zeng@rock-chips.com>
2023-08-16 14:18:34 +08:00
LiuDiMing Lin
26bfb0dec0 ARM: dts: rockchip: add rv1106g-evb2-v12-wakeup.dts
Change-Id: Iba82df1d5696ba0c232e5d966c1d43ea129e5f19
Signed-off-by: LiuDiMing Lin <fenrir.lin@rock-chips.com>
2023-08-16 14:17:49 +08:00
Cai YiWei
4ce5cb8b0f media: rockchip: isp: add lock to save tb info
multi sensor share same tb info buf, and this buf will
overwrittern when first sensor stream on but second fast_work
schedule slowly. So to save tb info for all dev at first read.

Change-Id: I335b9e3bd317202a348be17965be112a1259bb3e
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2023-08-15 20:38:54 +08:00
Cai YiWei
3ba7441b0d media: rockchip: isp: remove __isp_config_hdrshd
config store in reg buf, no need to record

Change-Id: I7b789ca514925175daca89528e711d6b61340026
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2023-08-15 20:38:54 +08:00
Lin Jinhan
c2a9ac0f23 media: i2c: add sc1346 support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I21f6e1ac11850666fb56960af6ef9d13c5907ba4
2023-08-15 20:33:38 +08:00
Weiwen Chen
9f27599976 ARM: dts: rockchip: disable rv1103g battery ipc dvfs
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
Change-Id: I41e968b9b181d2e8890750a858a67c59f2f826c0
2023-08-15 20:19:03 +08:00
Jake Wu
6879d26cf8 arm64: dts: rockchip: rk3588s-evb2-lp5: fix usb2.0-only
Signed-off-by: Jake Wu <jake.wu@rock-chips.com>
Change-Id: I1505f3ab997f4ee815c440b38bb42df8e8c0424f
2023-08-15 20:18:05 +08:00
Yandong Lin
8e8158deff video: rockchip: mpp: fix access null task issue
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ie5f6b38f4be0276cca6f982205e59428f79650ce
2023-08-15 20:17:29 +08:00
Sugar Zhang
6a8c650aea ASoC: rockchip: pdm: Fix register access in probe
MUST: after pm_runtime_enable step, any register R/W
should be wrapped with pm_runtime_get_sync/put.

Another approach is to enable the regcache true to
avoid access HW registers.

Alternatively, performing the registers R/W before
pm_runtime_enable is also a good option.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ib3d5daecad8491f05a3612a2cb02742ec31e4899
2023-08-15 18:47:20 +08:00
Sugar Zhang
08f416da20 ASoC: rockchip: i2s: Fix register access in probe
MUST: after pm_runtime_enable step, any register R/W
should be wrapped with pm_runtime_get_sync/put.

Another approach is to enable the regcache true to
avoid access HW registers.

Alternatively, performing the registers R/W before
pm_runtime_enable is also a good option.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I9c495361fcb7fb0a06fe1538d05b94617e332756
2023-08-15 18:22:00 +08:00
Shawn Lin
4e6c17be0a PCI: rockchip: dw: fix compliance mode set
Fixes: 02ee7a133e ("PCIe: dw: rockchip: rework compliance test settings")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: Ibdec2f90616eeb84f26932cdbbb0ac8fde6ca6f0
2023-08-15 18:01:27 +08:00
Jon Lin
72986913fc mtd: spinand: Enable HWP_EN for skyhigh devices
HWP_EN must be enabled first before block unlock region is set.

Change-Id: I6b107d97de48bb2644da865f353d2adace95224e
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-15 17:39:33 +08:00
Jon Lin
cb0b9bc78c mtd: spinand: esmt: Support new device F50L2G41KA
Change-Id: I12c40bfdd3fced2543723c03ec1291af6c3c178d
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-15 17:38:49 +08:00
Jon Lin
cf0f63fbfc arm64: dts: rockchip: rk3528: Set default value with level2 for spi
Change-Id: I7f14eb9438998660b85f09fb11f7006be420c4e1
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-15 17:37:31 +08:00
Lin Jianhua
83cd5cd9b4 ARM: configs: add rk3308bs_aarch32_mipi_display.config for rk3308bs support mipi display
Change-Id: Idf3c935ab1dfbcae4095d0c3e45dfcaeb81e8956
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
2023-08-15 17:37:14 +08:00
XiaoDong Huang
2ae2bc1582 ARM: rockchip: rv1106: sleep: support hpmcu fast wakeup
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: I4a34e33fd267a54c4df0a5b158e28837e3a28051
2023-08-15 16:17:13 +08:00
LiuDiMing Lin
956c9209ad ARM: rockchip: Locate kernel at 0x00208000 for RV1106 when CONFIG_RV1106_HPMCU_FAST_WAKEUP=y
The memory layout for rv1106 hpmcu fast wake up feature:

SPL:       0 ~ 256KB
RTOS:      256KB ~ 512KB
SPL S & H: 512KB ~ (2MB - 8KB)
ATAGS:     (2MB - 8KB) ~ 2MB
KERNEL_R:  (2MB + 0x8000) ~ (8MB - 128KB)
FDT:       (8MB - 128KB) ~ 8MB
META:      8MB ~ (8MB + 384KB)
ISP:       (8MB + 384KB) ~ (8MB + 384KB + ceil(w*10/8/256)*256*h*(buf_num))

Change-Id: I80c2d31d6e2f16d81ed7eb4bd8010df23bb7efc4
Signed-off-by: Fenrir Lin <fenrir.lin@rock-chips.com>
2023-08-15 15:02:22 +08:00
LiuDiMing Lin
4e4541690e ARM: configs: rockchip: add rv1106-wakeup.config
Change-Id: I4ff379589b0a0b99a71a372cf8b74282f6f355a9
Signed-off-by: Fenrir Lin <fenrir.lin@rock-chips.com>
2023-08-15 15:01:58 +08:00
XiaoDong Huang
292bd239a4 ARM: rockchip: support RV1106_HPMCU_FAST_WAKEUP config
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: Id16c8013cf9456cecaa75fbc49b7c7ddd55fb4dd
2023-08-15 15:01:05 +08:00
Damon Ding
9759ccc368 arm64: dts: rockchip: rk3308-evb: add rgb display board
RGB panel FX070-DHM11BOE-A supports RGB666 and RGB888 mode.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: If0b70fad4587e0c1bb908f3f493bfff809baef8f
2023-08-15 12:05:26 +08:00
Zefa Chen
8bd1123ed7 media: rockchip: vicap fixes crop sync error
while two camera link to a device tree, if the link relationship is switched from one sensor to another,
there may be error messages in crop information

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I6b6aa3efcf8f862b5b1b6e41fb2b4c2fcead2282
2023-08-15 12:04:21 +08:00
Jon Lin
e4bbd1b7a1 mtd: spinand: xtx: Support new device XT26Q04DWSIGA
Change-Id: Icb44af2383585484cd8c4fdc310d8ca4f55166f4
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-14 19:13:23 +08:00
Jon Lin
9e520dcc31 mtd: spinand: gigadevcie: Add 3rd flash id for GD5F1GQ5RExxG
Add 3rd flash id for GD5F1GQ5RExxG to make distinguish with
F50L2G41KA.

Change-Id: I54b65bf631ee5584119bc667f1f6b954789f0f8b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-14 14:53:30 +08:00
Jon Lin
2107aa0271 mtd: spinand: xtx: Support new device XT26Q02DWSIGA and XT26Q01DWSIGA
Change-Id: I7e32d54781684d2970ecc85effdd2fc07011a1d7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-14 14:53:30 +08:00
Jon Lin
a8fb036aea mtd: spinand: dosilicon: Support new device DS35Q1GD-IB
Change-Id: I98d7ef0b7b9a9323bbacce243d2ae49ccb9287e7
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2023-08-14 14:53:30 +08:00
Zefa Chen
684fcdf113 media: i2c: sc530ai change mipi data rate to 936Mbps/lane and vblank up to 6ms
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: If172f3b0036efb1ab437d04f05d80360c464a8ad
2023-08-14 14:39:58 +08:00
Elaine Zhang
7a72bc05dc clk: rockchip: rk3588: fix up the frac pll calculation
rk3588 frac pll:
FFVCO = ((m + k / 65536) * FFIN) / p
FFOUT = ((m + k / 65536) * FFIN) / (p * 2s)
k is the original code, but the K[15:0] is complement code
(6'b1000_0000_0000_0000 <= K[15:0] <= 16'b0111_1111_1111_1111),
need to be converted.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: I107d31d910d260c83891d5b6e927f119761d6fba
2023-08-11 18:57:20 +08:00
Jianwei Zheng
d0e6f8a073 phy: rockchip: naneng-combphy: fix U3 RX long cable test failed for RK3528
1.Set slow slew rate control for PI
2.Set CDR phase path with 2x gain

Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Change-Id: I2d0811b0be7b1d4764ecd738d069b06e4da5eaa2
2023-08-11 18:29:16 +08:00
Sugar Zhang
b59d476403 ASoC: rockchip: i2s-tdm: Fix register access in probe
MUST: after pm_runtime_enable step, any register R/W
should be wrapped with pm_runtime_get_sync/put.

Another approach is to enable the regcache true to
avoid access HW registers.

Alternatively, performing the registers R/W before
pm_runtime_enable is also a good option.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I69dd66230cba636d2ccb31ec01a21be1a482a0e3
2023-08-11 18:18:02 +08:00
Sugar Zhang
f8a6ea7388 ASoC: rockchip: sai: Fix register access in probe
MUST: after pm_runtime_enable step, any register R/W
should be wrapped with pm_runtime_get_sync/put.

Another approach is to enable the regcache true to
avoid access HW registers.

Alternatively, performing the registers R/W before
pm_runtime_enable is also a good option.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ife9b1a0e6f75e714bfb6e7c0d472e4603fa8cd8f
2023-08-11 18:17:10 +08:00
Damon Ding
f9a676b76c arm64: dts: rockchip: rk3308: update property logo,kernel
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ie9fc628b49634e68207629b443331293486f13e7
2023-08-11 18:13:29 +08:00
Damon Ding
fcbe35b5ec pwm: rockchip: add a little delay to make sure conlock works
The conlock can help to update period and duty when pwm
is working. It takes 10 dclk cycles to make sure lock
works before unlocking.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Id750580b409a24e660d208e80417d4169def02ed
2023-08-11 18:12:20 +08:00
Algea Cao
d76dbd3976 drm/bridge: synopsys: dw-hdmi-qp: filter hdmi 2.1 resolution when enable-gpio is not configured
Change-Id: I84e6a7f295441c9a9b6ae2cdb897d88c81582480
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2023-08-11 18:08:26 +08:00
Chen Shunqing
aa26c9fbd9 drm/bridge/synopsys: dw-hdmi-qp: fix color error in DVI mode
1. Only RGB output in DVI mode.
2. Only HDMI1.4 is supported in DVI mode.

Change-Id: If905a939cdc6602761b2fc235fec7af88e78d307
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
2023-08-11 15:43:48 +08:00
LongChang Ma
55e0b705bc ARM: dts: rockchip: support dual sc301iot for rv1106-evb-dual-cam.dtsi
Signed-off-by: LongChang Ma <chad.ma@rock-chips.com>
Change-Id: Ib53cd7bd6189099b737b6e916c02dbdedff4d5f7
2023-08-11 15:43:25 +08:00
Jianqun Xu
4324b23189 arm64: dts: rockchip: rk3588-vehicle-adsp-audio-s66: correct i2s3 iomux
This patch fixes the iomux error for i2s3 lrck and sclk pins.

Change-Id: I0065ab2bd51c9ddfb7f6ed749d1a99601b802260
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2023-08-11 11:03:55 +08:00
Lin Jianhua
8c9c0c25d5 arm64/configs: add rk3308bs_mipi_display.config for support mipi display
Change-Id: I0ab04c742134f96ba16587b8b9cf0684ba2de56b
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
2023-08-11 08:24:45 +08:00
Shunhua Lan
d449b25d6b arm64: dts: rockchip: rk3399-evb: use multicodecs instead simple card
Signed-off-by: Shunhua Lan <lsh@rock-chips.com>
Change-Id: Idb6c8165afcbe8264a7b12a00c8e0f790a61210b
2023-08-10 18:26:56 +08:00
Zefa Chen
f327669a8c media: rockchip: vicap: fixes create dummuy buffer fail with size 0
Some sensor drivers do not implement enum_frame_interval function, will cause this error

Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I63b8a52230b043d5c9ff29db9cb36faed02a7e8f
2023-08-10 16:56:31 +08:00
Chen Shunqing
0a62148e37 drm/bridge/synopsys: dw-hdmi-qp: Add support for external bridge
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: Ie6fe2e63f24a9c5656af7b7cd0f17ca484a099df
2023-08-10 16:47:53 +08:00
Wang Panzhenzhuan
bea46d648b video: rockchip: vehicle: remove vehicle dev when exit
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I7e64cc679b40f341601fc0085d1c548b99932913
2023-08-10 16:47:19 +08:00
Shawn Lin
02ee7a133e PCIe: dw: rockchip: rework compliance test settings
There are three types of compliance mode test requirement right
now, consolidate them together:
[1] SMA tool: rockchip,compliance-mode = <0 ANY_VALUE_FROM_0_TO_10>;
[2] Soldered board: rockchip,compliance-mode = <mode preset>;
    mode: 1->Gen1  2->Gen2  3->Gen3
    preset: 0->p0 1->p1 2->p2 .... etc.
[3] lookback: same as SMA tool case

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I180b4881d827e3c2f0fc22f0bab4ca165be44c19
2023-08-10 16:46:34 +08:00
Wang Panzhenzhuan
7d42e40890 drm/rockchip: direct_show: add cached buf cpu access begin & end
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I195bdf4594d0d260dae516a0f8544b0da4f08840
2023-08-10 09:50:32 +08:00
Cai YiWei
fcd4ffc474 media: rockchip: isp: add api get isp work mode for rockit
Change-Id: I279283df68deb3118f3971138d23c13d952de76d
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2023-08-10 09:17:57 +08:00
Jianwei Fan
0a477570d3 media: i2c: rk628: fix 5V detect event report
Change-Id: I35303abc9376c45233b06319bd618e394874ae71
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2023-08-10 09:14:45 +08:00