Commit Graph

1064791 Commits

Author SHA1 Message Date
Yu Qiaowei
db0f336d88 video: rockchip: rga3: Add judgment on support core.
Added policy to disable RGA2 when memory larger than 4G.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I5f4d9ee0d77709fbf350123bf16dc42f0b7abbe7
2022-01-14 16:01:26 +08:00
Lin Jinhan
031470058a crypto: rockchip: change hardware crypto driver's priority
Decrease RK_CRYPTO_PRIORITY from 300 to 0.Hardware driver
will only invoked by user layer through the driver name.

Change-Id: Ifeda13a2b9ce6fec6be60a2422b7507f91eedbb5
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-01-14 15:51:04 +08:00
Lin Jinhan
77ef9507ad crypto: rockchip: cryptodev_linux: add rk algo support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I1d1f4214b29546eed2d1c29da8f375ec30a9bac3
2022-01-14 15:51:00 +08:00
Lin Jinhan
0ff0eff24d crypto: rockchip: cryptodev_linux: add rk_cryptodev_ioctl
RIOCCRYPT_FD         : used to support dma_fd crypt.
RIOCCRYPT_FD_MAP     : used to map dma_fd to phys_addr.
RIOCCRYPT_FD_UNMAP   : used to unmap between dma_fd and phys_addr.
RIOCCRYPT_CPU_ACCESS : for cpu access after dma_fd map
RIOCCRYPT_DEV_ACCESS : for DEV access after dma_fd map

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ifa016c0009fde3d6909fb4e2313af341d808f793
2022-01-14 15:40:52 +08:00
Lin Jinhan
d5cea8f2c7 crypto: rockchip: core: register crypto device into rk_cryptodev
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I29364e0b5dd82a227dc74567dc12565e3b97ad1c
2022-01-14 14:56:26 +08:00
Lin Jinhan
f27ce7a700 crypto: rockchip: cryptodev_linux: add rk_cryptodev.c
Add register and unregister for crypto driver.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I406776514374bb460875ce8bd71a3031cd110587
2022-01-14 14:56:13 +08:00
Lin Jinhan
4304feb241 arm64: rockchip_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP_DEV
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ieb4cdbda11c166467f86f1b442043a6c2fc60a35
2022-01-14 14:47:43 +08:00
Tao Huang
e05d2d55e1 crypto: rockchip: cryptodev_linux: rename global func name
Add cryptodev_ prefix.

Replacements are done by the following command:
for i in kcaop_from_user kcaop_to_user adjust_sg_array release_user_pages sg_advance sg_copy; do sed -i "s/$i/cryptodev_$i/g" *.c *.h; done
sed -i -e "s/ get_userbuf(/ cryptodev_get_userbuf(/g" -e "s/ __get_userbuf(/ __cryptodev_get_userbuf(/g" *.c *.h

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I7a3aee655427faffac6baad0e155bd76638ae040
2022-01-13 19:50:25 +08:00
Lin Jinhan
e398bee2a0 crypto: rockchip: add cryptodev_linux driver
provide crypto api to user space, you can open
"/dev/crypto" to use it.

cryptodev-linux source repository:
  https://github.com/cryptodev-linux/cryptodev-linux.git

use commit 356a45e63bbce94b9cea73b8c1e20d0d8ec02f04
  Author: cristian-stoica <cristianmarian.stoica@nxp.com>
  Date:   Thu Nov 11 09:30:19 2021 +0200

Change-Id: I91ca3660060f4adcf531e3efb8e720308bbd9f0e
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-01-13 19:49:38 +08:00
Wang Jie
32bf18bcd3 arm64: dts: rockchip: rk3588s-tablet-rk806-single: configured as usb2.0 for Type-C0
The rk3588s bbk tablet Type-C0 hardware design does not
support usb3.0 and dp functions, so it is configured as
usb2.0 and disable usbdp phy to reduce power consumption.

Change-Id: Id69964d18e31a12f240f792ea04e60e1e28d794d
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2022-01-13 18:26:25 +08:00
Lin Jinhan
c8876aae83 crypto: rockchip: core: add scatterlist from dmafd support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ie9eed5a785ad027a9c4dd134be904c3064754c09
2022-01-13 15:42:35 +08:00
Lin Jinhan
ca5dd883fe crypto: rockchip: core: add CRYPTO_ALG_KERN_DRIVER_ONLY for cra_flag
CRYPTO_ALG_KERN_DRIVER_ONLY means the algorithm provided is hardware
 accelerated but not available to userspace via instruction set or so.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ia4265944a058aaaa4aeb7e6f1adc3bd1b8d4af5d
2022-01-13 15:42:10 +08:00
Yu Qiaowei
b8e561206b video: rockchip: rga3: Modify the mapping process of virt_addr in rga_mm
When using RGA2, import buffer will map it to dma.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I1d8d2e35e5d55acefb7825adfbee13a3808213b4
2022-01-13 15:39:23 +08:00
Yu Qiaowei
2a15a22522 video: rockchip: rga3: default flush cache of virt_addr when using RGA3
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I95bacf1948d24c50eb03231de5cea12797d0c0a9
2022-01-13 15:39:23 +08:00
Yu Qiaowei
8913f323ca video: rockchip: rga3: Remove the static of get_scheduler()
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ic1daff651a04493bc460f4532079d02cae94685e
2022-01-13 15:39:23 +08:00
Yu Qiaowei
e8bd611086 video: rockchip: rga3: Avoid unnecessary error printing
When the error caused by software interruption is not printed.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I05e4498391be07bd5381c9cf17dabbe1c827417e
2022-01-13 15:39:23 +08:00
Yu Qiaowei
73a04928cb video: rockchip: rga3: Virt_addr uses the sgt of rga_mm.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I44bdd543b708a3d868896527df7d2745b994fa6f
2022-01-13 15:39:23 +08:00
Yu Qiaowei
cb6eb4a53f video: rockchip: rga3: Support using handle
It will be used by finding the memory corresponding to the handle
in rga_mm.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I6bd09a3641671c69aa903010c0aa4e518cf9b5af
2022-01-13 15:39:23 +08:00
Yu Qiaowei
11b10c87c3 video: rockchip: rga3: rga_mm supports virtual addresses
Support mapping virtual address to sgt and verify whether the memory
is greater than 4G.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Iae958cd1ac408e3d72a184dc9fd92fd41259ea38
2022-01-13 15:39:23 +08:00
Frank Wang
76ad9a5fd2 arm64: dts: rockchip: rk3588: add quirk-skip-phy-init for usb otg0
Adds "quirk-skip-phy-init" property for USB OTG0 on RK3588 SoC that
reject managing the PHY state in HCD core and fix the PHY exit failed
in "usb_phy_roothub_exit()" at PM suspend stage.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I508069f6836921e2f4717aee5f3baedffb9f9add
2022-01-13 15:34:30 +08:00
Frank Wang
a811f07f45 usb: host: xhci: skip phy init quirk can configure in dt
The "skip_phy_initialization" property in usb_hcd structure means
that do not manage the PHY state in the HCD core and handle it by
the controller's driver. This commit adds "quirk-skip-phy-init"
quirk which can configure the property in DT to support it.

For Rockchip DWC3 dual role scheme, we enabled the device wakeup
capability in dwc3 runtime resume that would cause the PHY exit
failed in "usb_phy_roothub_exit()" at PM suspend stage. So this
commit is also a workaround to fix it.

Fixes: f1636eb0fd ("usb: dwc3: fix failed to enter suspend")
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Ibc9885669f25d2aeea18a9d22d49a204eb346ea1
2022-01-13 15:33:47 +08:00
Frank Wang
1a83ca3a08 dt-bindings: usb: xhci: add quirk-skip-phy-init property
Adds "quirk-skip-phy-init" property that can configure in DT to
support skip PHY initialization quirk in HCD core.

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: Ifd85bbfc5a39a28961e551d2ded5ddb1a904a7f5
2022-01-13 15:33:39 +08:00
Wu Liangqing
9a4fd17a91 rtc: hym8563: fix rtc init time error
Fixes: 815c9a084e ("rtc: hym8563: set init time")
Change-Id: Ic303169494007bc22a374ba11a2b553de22f747b
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2022-01-13 15:27:43 +08:00
William Wu
b50ae2d265 phy: rockchip: inno-usb2: support pipe phystatus sel for otg port
The RK3588 usb3 otg controller connected with one usb2 phy
and one usb3 phy. The usb2 phy used UTMI+ interface, and
the usb3 phy used PIPE interface. The usb3 otg controller
initialization depends on the pipe phystatus which from
usb3 phy by default. If the usb3 phy is disabled, it needs
to select the pipe phystatus from usb grf with the property
"rockchip,sel-pipe-phystatus".

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I5015a18a19c14ccb43530fbae15200c8cb3ab242
2022-01-13 15:16:22 +08:00
William Wu
8811ab7f35 arm64: dts: rockchip: rk3588: add usbctrl-grf for usb otg0/1
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ib49a5cfb4522d02b9744b83347fb2855e92e72fc
2022-01-13 15:15:02 +08:00
William Wu
70474e9633 dt-bindings: phy: rockchip-inno-usb2: add properties for pipe sel
The rk3588 usb otg0/1 controllers depend on the pipe
phystatus which from usb3 phy by default. When the usb3
phy is disabled, it needs to select the pipe phystatus
from usb grf. This patches add new properties to select
pipe phystatus if needed.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I50b6c7ece87913af3152204da60727140d82bc3d
2022-01-13 15:14:43 +08:00
Zhen Chen
c7ac8c9aa3 MALI: bifrost: fix bug that GPU is not powered off after idle
The bug was found in the case of that system suspend process was broken off
for USB ADB being connected.

This fix is provided by Zhigang.Yao@arm.com of support_mali.

Related RK redmine case:
https://redmine.rock-chips.com/issues/334539

Change-Id: I4772ed901a7fe54884a79a53b3ca9f6fd7beed40
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2022-01-13 15:12:48 +08:00
Shawn Lin
47af17528d PCI: rockchip: dw: Add support for skipping waiting for training
Some devices need rescan devices by its function drivers, because it
need special IO settings before finish training. So controller's
resume for waiting for link up must be failed at this stage. Add a
property for this kind of device to skip waiting for training.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I45787cbd41a07f2f80cb712b896021d1367cb9dc
2022-01-13 15:04:20 +08:00
shengfei Xu
277361df6a arm64: dts: rockchip: rk3588: fix pmic_int pull-up on rk3588
RK806 INT pin is connected to pmic_int(gpio0a7).
the pmic_int sets low-level interrupt, which requires pull-up
voltage(VCC_1V8_S0). but the pull-up voltage is powered off
in system suspend, causing the system to wake up immediately.

Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: Id85b441c9ce7f9837e3c61647b39f03dd4c63e53
2022-01-13 14:13:39 +08:00
XiaoDong Huang
dacb124d50 arm64: dts: rockchip: rk3588s-tablet-rk806-single: enable rockchip-suspend node
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: I660c2f92ae687f83be4c1afe5e252c52c8ad7e20
2022-01-13 14:10:42 +08:00
Wu Liangqing
d393ba132c arm64: dts: rockchip: rk3588s-evb1: disabled spdif_tx1
The GPIO4_B1 is reused by spdif_tx1 and PCIE20x1, and the hardware
is conneted to PCIE20x1

Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
Change-Id: Ibeaec0b16add9c8dbeb91b06a667fd0bea10f0ce
2022-01-13 11:37:52 +08:00
XiaoDong Huang
f9f1545d56 arm64: dts: rockchip: rk3588s-tablet: enable rockchip-suspend node
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: I954bcdf12891012e423adaf6ee9dbf96f4d0c847
2022-01-13 10:46:29 +08:00
XiaoDong Huang
0fe4030af2 arm64: dts: rockchip: rk3588s-evb: enable rockchip-suspend node
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: Ide5cfa10b58c6e60cd492b9056fbbb2090a33f64
2022-01-13 10:46:04 +08:00
XiaoDong Huang
a6ae305e4f arm64: dts: rockchip: rk3588-evb: enable rockchip-suspend node
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: I1552788ffc7a10938eafa173216456ba790cdbb6
2022-01-13 10:45:45 +08:00
XiaoDong Huang
ed9eb4b06d arm64: dts: rockchip: rk3588: add rockchip-suspend node
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: I977f43bdc0a4b13202d15dc276ec82db4e1b5e0d
2022-01-13 10:44:15 +08:00
Sugar Zhang
3e990e4794 rk: kbuild: Use standard lz4 format for Image.lz4 on ARM64
Uboot use the Standard Lz4 format to decompress kernel Image.lz4,
So, we should use the standard one for lz4 compression.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ic299314a6377e68fac477f451d1ffcae9e8466ce
2022-01-13 10:08:58 +08:00
Sugar Zhang
48e21360ab Revert "Use standard lz4 format for Image.lz4 on ARM64"
This reverts commit aa5ccab207.

Linux kernel still use Legacy lz4 format for self-decompression.
So, we should use the legacy one('lz4 -l') for lz4 compression.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ic10f9cb65bcc7fadd2071b97f8effb958f54d0a4
2022-01-13 10:08:39 +08:00
Liang Chen
da7abc05ea arm64: dts: rockchip: rk3588: add cacheinfo
little cpu:
console:/ # ls /sys/devices/system/cpu/cpu0/cache/
index0  index1  index2  index3  uevent
console:/ # ls /sys/devices/system/cpu/cpu0/cache/index0/
coherency_line_size  shared_cpu_list  type
level                shared_cpu_map   uevent
number_of_sets       size             ways_of_associativity
console:/ # cat /sys/devices/system/cpu/cpu0/cache/index*/{level,size,type}
1
1
2
3
32K
32K
128K
3072K
Data
Instruction
Unified
Unified

big cpu:
console:/ # cat /sys/devices/system/cpu/cpu4/cache/index*/{level,size,type}
1
1
2
3
64K
64K
512K
3072K
Data
Instruction
Unified
Unified

Change-Id: I59158db95b4f8345805db05e4cce2e97dc73e724
Signed-off-by: Liang Chen <cl@rock-chips.com>
2022-01-12 21:16:08 +08:00
Algea Cao
8e6b342cd5 drm/bridge: synopsys: dw-hdmi-qp: Increase the delay time when change resolution
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I720b6b9938aa485301049760589bb73733d060bc
2022-01-12 20:22:18 +08:00
Sugar Zhang
5d53a6553d rk: ARM: Fix zboot.img pack err
mkbootimg: error: argument --kernel: can't open './arch/arm/boot/zImage':
[Errno 2] No such file or directory: './arch/arm/boot/zImage'
make: *** [__sub-make] Error 2

Fixes: 9bd46a1ff2 ("rk: ARM: support make image with script mkimg")
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ifd669a9c0465c77a55d07adc2267726ffe81db35
2022-01-12 16:07:01 +08:00
Wang Jie
a63525909c arm64: dts: rockchip: rk3588s-tablet-rk806-single: add orien switch config for Type-C0
Change-Id: I9c45fede5a5c724e35d6965a73b0691c7f2d1e55
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2022-01-12 16:02:48 +08:00
Weixin Zhou
66ebd88f4f arm64: dts: rockchip: rk3588s-tablet-rk806-single: enable kernel logo display
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Change-Id: I9873392c2d0d578f0f32aed75805e375aacf1709
2022-01-12 16:02:23 +08:00
Frank Wang
099b4bc7c8 phy: rockchip: inno-usb2: add orien switch for u2 type-c
The usb2-phy driver needs to know the plug-in and plug-out information
from TCPM (Type-C Port Manager) for USB2.0 Type-C scheme, so adds the
orientation switch support in usb2-phy driver, and the corresponding
DT nodes is required, please refer to the following example.

[...]

&u2phy0 {
	orientation-switch;

	port {
		#address-cells = <1>;
		#size-cells = <0>;
		u2phy0_orientation_switch: endpoint@0 {
			reg = <0>;
			remote-endpoint = <&usbc0_orien_sw>;
		};
	};
};

Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I51ca0999dcecaf4aa9f21be453dce2fddb6f9c9f
2022-01-12 11:33:35 +08:00
Jon Lin
9dbc49dafa arm64: dts: rockchip: rk3588: Redefine np 32-bit and pref 64-bit mmio bus address
Change-Id: I086bae698819616795b90f85699d30a2a4e73022
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2022-01-12 11:23:44 +08:00
Rob Herring
7cfa3628f5 UPSTREAM: PCI: dwc: Support multiple ATU memory regions
The current ATU setup only supports a single memory resource which
isn't sufficient if there are also prefetchable memory regions. In order
to support multiple memory regions, we need to move away from fixed ATU
slots and rework the assignment. As there's always an ATU entry for
config space, let's assign index 0 to config space. Then we assign
memory resources to index 1 and up. Finally, if we have an I/O region
and slots remaining, we assign the I/O region last. If there aren't
remaining slots, we keep the same config and I/O space sharing.

Link: https://lore.kernel.org/r/20201026181652.418729-1-robh@kernel.org
Tested-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Vidya Sagar <vidyas@nvidia.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Cc: Vidya Sagar <vidyas@nvidia.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Change-Id: Ib945de723c29a80f055227474a01806283bd1873
(cherry picked from commit 9f9e59a480)
2022-01-12 11:23:33 +08:00
shengfei Xu
1defae22f5 arm64: dts: rockchip: rk3588: add gpio aliases for rk3588
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I4f0749cc2d6dd67145e599946080ea0024554901
2022-01-12 11:20:35 +08:00
shengfei Xu
b8eabc8f0f arm64: dts: rockchip: rk3588-rk806: fix the pinctrl for pmic
the pmic_pins(gpio0a2,gpio0a3,gpio0a7,gpio0c1,gpio0c2,gpio0c3,gpio0d6)
are used for pmic dvs and interrupt.

Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Change-Id: I0f749e01d2ba7716b705fba8489f0040ae88ac7f
2022-01-12 10:54:09 +08:00
XiaoDong Huang
2b09ff5901 soc: rockchip: support rk3588 pm config
Signed-off-by: XiaoDong Huang <derrick.huang@rock-chips.com>
Change-Id: Ib8c67bd94336fddeebc9f9fd02e5c58f9fb043fd
2022-01-12 09:51:56 +08:00
William Wu
32e1cf0df2 arm64: dts: rockchip: support otg mode for rk3588 evb2 and nvr
The RK3588 USB OTG controller already supported to switch
Device/Host mode by software, so set dr_mode to otg for
RK3588 EVB2/NVR and RK3588S EVB2.

With this patch, the USB OTG controller still works as
Device mode by default. You can use the following two
methods to switch Device/Host mode.

Method 1.[Legacy]
1. Switch to Host mode
   echo 1 > /sys/devices/platform/fd5d0000.syscon/fd5d0000.syscon:usb2-phy@0/otg_mode
or
   echo host > /sys/devices/platform/fd5d0000.syscon/fd5d0000.syscon:usb2-phy@0/otg_mode

2. Switch to Device mode
   echo 2 > /sys/devices/platform/fd5d0000.syscon/fd5d0000.syscon:usb2-phy@0/otg_mode
or
   echo peripheral > /sys/devices/platform/fd5d0000.syscon/fd5d0000.syscon:usb2-phy@0/otg_mode

Methed 2.[New]
1. Switch to Host mode
   echo host > /sys/kernel/debug/usb/fc000000.usb/mode

2. Switch to Device mode
   echo device > /sys/kernel/debug/usb/fc000000.usb/mode

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I291ac53cb5920c71a631cb76d1167eea8bbf4ee2
2022-01-11 16:54:55 +08:00
Simon Xue
a22edac69e ANDROID: dma-buf: system_heap: dynamic get ddr map info for reorder page
Change-Id: I5be4acca08ecdf0db8cbaa762339aa2fb0cc6e4b
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2022-01-11 14:23:27 +08:00