Commit Graph

867970 Commits

Author SHA1 Message Date
Wyon Bi
e8bbfb9fb2 arm64: dts: rockchip: rk3568: Add edp phy grf node
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I0ee522627cc057bd5b0be2c862e56f020dae57a2
2022-02-17 10:23:59 +08:00
Fabrice Gasnier
2031ba0fc1 UPSTREAM: mfd: syscon: Add optional clock support
Some system control registers need to be clocked, so the registers can
be accessed. Add an optional clock and attach it to regmap.

Change-Id: If23c2fc31b5d32b496b964a1c628b8be2bc2bc68
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry picked from commit a00406b71c)
2022-02-16 11:32:47 +08:00
Zorro Liu
f9dc5f6f2f arm64: dts: rockchip: update wacom touch i2c clock frequency for
rk3566-rk817-eink-w103 board

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I24037b12a3a071ecccb618abd2b680a55dc79664
2022-02-16 10:05:46 +08:00
Zorro Liu
add2a4f115 drm/rockchip: ebc_dev: release version v3.00
1.improve handwrite rate
2.fix auto mode refresh uncompletely last version

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I8416d03d01b15196c71df440c34212a57aea793c
2022-02-16 10:05:46 +08:00
Zorro Liu
88f2f6b782 drm/rockchip: ebc_dev: release version v2.28
revert handwrite improve last version

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I99f0ef5a39943d14b0df41b21b5b65f2d361cca4
2022-02-16 10:05:46 +08:00
Yu Qiaowei
82801bc14d video: rockchip: rga3: Fix compile warning about 'make W=1 ...'
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Idc6656489051ff75abcca19acd362c52d5513226
2022-02-15 14:58:19 +08:00
Eric Biggers
3558721d95 UPSTREAM: crypto: ofb - fix handling partial blocks and make thread-safe
Fix multiple bugs in the OFB implementation:

1. It stored the per-request state 'cnt' in the tfm context, which can be
   used by multiple threads concurrently (e.g. via AF_ALG).
2. It didn't support messages not a multiple of the block cipher size,
   despite being a stream cipher.
3. It didn't set cra_blocksize to 1 to indicate it is a stream cipher.

To fix these, set the 'chunksize' property to the cipher block size to
guarantee that when walking through the scatterlist, a partial block can
only occur at the end.  Then change the implementation to XOR a block at
a time at first, then XOR the partial block at the end if needed.  This
is the same way CTR and CFB are implemented.  As a bonus, this also
improves performance in most cases over the current approach.

Fixes: e497c51896 ("crypto: ofb - add output feedback mode")
Cc: <stable@vger.kernel.org> # v4.20+
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit b3e3e2db7d)

Change-Id: I5b9174ef596f72cb295d931217d6132f8c9ec820
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-02-14 17:11:49 +08:00
Gilad Ben-Yossef
66b7c56bf4 UPSTREAM: crypto: ofb - add output feedback mode
Add a generic version of output feedback mode. We already have support of
several hardware based transformations of this mode and the needed test
vectors but we somehow missed adding a generic software one. Fix this now.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit e497c51896)

Change-Id: Iffac55d5830ee1c0df5acffd82fbd01d6dcafa31
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-02-14 17:11:37 +08:00
Zheng Yang
f6bbf076bb drm/bridge: synopsys: dw-hdmi: fixed an error in setting the avi quantization range
According CEA-861 and HDMI2.0 spec, if EDID indicate the sink
support hdmi2.0 or support quantization range, setting the avi
quantization range to non-zero value.

Change-Id: I866d2e5c3c8e1e3eb73b7a8ebddd5a86aa477e63
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2022-02-14 15:26:09 +08:00
Lin Jinhan
73159fe2be crypto: rockchip: v2: modify the length limit under user_ptr
When using user buffer, hardware crypto is used regardless of
 whether the data length is greater than 32K.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I3228910def265765e772da1ab4eda3b54d9927cb
2022-02-14 14:12:40 +08:00
Lin Jinhan
851a745238 crypto: rockchip: v2: modify the length limit under dma_fd
When using DMA_fd, hardware crypto is used regardless of
 whether the data length is greater than 32K.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ifcc78bca17beb99ae7eae73f3def6ebf55f5cf1b
2022-02-14 14:12:40 +08:00
Li Huang
3999666d09 arm64: rockchip_defconfig: Enable CONFIG_ROCKCHIP_MULTI_RGA
Signed-off-by: Li Huang <putin.li@rock-chips.com>
Change-Id: I95fbef30eb87fc69379cfce7feb976bfc261ab8c
2022-02-14 11:04:23 +08:00
Li Huang
9f95b5fc62 video: rockchip: rga3: Init multi rga
Signed-off-by: Li Huang <putin.li@rock-chips.com>
Change-Id: Ib19d2d141e6b0eefa9d67b062e564559f58fb0b4
2022-02-14 11:03:45 +08:00
Jianwei Fan
80eac8dcf1 media: i2c: gc0312: fix flip and mirror register
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: Ibc7ebf2de267022497808f61fb5719797ba3b789
2022-02-12 10:36:10 +08:00
Zefa Chen
80152a3dcd include: rk-camera-module: add control for sensor adapter driver
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I2d434a4b608bf6e6168237280e75c933fc192df3
2022-02-10 17:12:34 +08:00
Lin Jinhan
2991ef890f arm64: dts: rockchip: px30: support enable rng and crypto module at the same time
Change-Id: If3c289629a265e678bdfdb57a084d67b241da4a8
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-02-09 10:16:20 +08:00
Lin Jinhan
67994eb6c1 ARM: rockchip_linux_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP_DEV
CONFIG_CRYPTO_DEV_ROCKCHIP_DEV is used to export kernel crypto interface
 into user space.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I06e49ba8c430eaa06315c4b549c939a73bdb7c4c
2022-02-09 10:16:19 +08:00
Lin Jinhan
8acd934a54 ARM: rockchip_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP_DEV
CONFIG_CRYPTO_DEV_ROCKCHIP_DEV is used to export kernel crypto interface
 into user space.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I3d1069b83ba1d29304deccda0392ac5b27e6fd0f
2022-02-09 10:16:19 +08:00
Lin Jinhan
140fef0411 arm64: rockchip_linux_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP_DEV
CONFIG_CRYPTO_DEV_ROCKCHIP_DEV is used to export kernel crypto interface
 into user space.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Id7f33508567fc3c55704a8325774c3f4c57c187f
2022-02-09 10:16:19 +08:00
Lin Jinhan
ca8394bfa5 arm64: rockchip_defconfig: enable CONFIG_CRYPTO_DEV_ROCKCHIP_DEV
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ieb4cdbda11c166467f86f1b442043a6c2fc60a35
2022-02-09 10:16:19 +08:00
Lin Jinhan
8ce924b9c4 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-02-09 10:16:19 +08:00
Lin Jinhan
8f6c27d9fc crypto: rockchip: cryptodev_linux: add rk algo support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I1d1f4214b29546eed2d1c29da8f375ec30a9bac3
2022-02-09 10:16:18 +08:00
Lin Jinhan
5f283800ca 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-02-09 10:16:18 +08:00
Lin Jinhan
290e947ae0 crypto: rockchip: core: register crypto device into rk_cryptodev
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I29364e0b5dd82a227dc74567dc12565e3b97ad1c
2022-02-09 10:16:18 +08:00
Lin Jinhan
bf0b14dceb 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-02-09 10:16:18 +08:00
Tao Huang
c408b3ebfd 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-02-09 10:16:17 +08:00
Lin Jinhan
f0fb767f43 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-02-09 10:16:17 +08:00
Lin Jinhan
540afe9573 crypto: rockchip: core: add scatterlist from dmafd support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Ie9eed5a785ad027a9c4dd134be904c3064754c09
2022-02-09 10:16:17 +08:00
Lin Jinhan
930e74044d 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-02-09 10:16:17 +08:00
Lin Jinhan
a4de57fdac crypto: rockchip: add DMA32 addressing range limits
Crypto only supports DMA32 address addressing and behaves
 abnormally on more than 4G DDR.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I5b6b5c9eb5f00698d25e47a778f358380f4121eb
2022-02-09 10:16:17 +08:00
Lin Jinhan
7407c3a5eb crypto: rockchip: v2: modify to pass crypto selftest case
Compared to 4.19, there are many new algorithm boundary
 condition tests in 5.10. Drivers need to be fixed to
 pass these tests and increase driver robustness.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I597a478a5cfff5fa6c5389f45adec21acb63c68e
2022-02-09 10:16:16 +08:00
Lin Jinhan
661322d864 crypto: rockchip: add rk3588 support
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: If2f94bd8a57028a77df2f53f58bb117b4adc797a
2022-02-09 10:16:16 +08:00
Lin Jinhan
b9eca4f12e crypto: rockchip: core: modify buffer addr_vir size to 8 PAGES
Increase the buffer size from 1 to 8 pages. Data can be copied to
 the buffer for hardware crypto calculation when the scatter list
 does not meet the alignment requirement and data length less than
 8 pages.

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: Id5e36f4fa7fc042ea4d117071ae9fee16ebb3494
2022-02-09 10:16:15 +08:00
Lin Jinhan
a548b4bb5b crypto: rockchip: v1&v2: switch ablkcipher to skcipher API
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I2936c26d1a9600ecbdb86ab2821a502371e9c2bc
2022-02-09 10:16:15 +08:00
Ard Biesheuvel
4bf4cd6b66 UPSTREAM: crypto: des/3des_ede - add new helpers to verify keys
The recently added helper routine to perform key strength validation
of triple DES keys is slightly inadequate, since it comes in two versions,
neither of which are highly useful for anything other than skciphers (and
many drivers still use the older blkcipher interfaces).

So let's add a new helper and, considering that this is a helper function
that is only intended to be used by crypto code itself, put it in a new
des.h header under crypto/internal.

While at it, implement a similar helper for single DES, so that we can
start replacing the pattern of calling des_ekey() into a temp buffer
that occurs in many drivers in drivers/crypto.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 6ee41e5420)

Change-Id: Ib150d48baceb4e9baf2c9b405e06a389e90aeef5
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
2022-02-09 10:16:15 +08:00
Ziyuan Xu
f272db932d soc: rockchip: thunderboot_mmc: make sense of the *free_reserved_area*
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I5470dadd845c706cae305f8f60b721b9904a7ddb
2022-02-08 15:08:39 +08:00
Ziyuan Xu
b734816503 mmc: free the available reserved memory of escd when CONFIG_ROCKCHIP_THUNDER_BOOT=y
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I77c69d579c9121adde94ffc2e68514a9fd34e870
2022-02-08 14:57:53 +08:00
Wang Jie
fd43d50b2c usb: typec: tcpm: husb311: disable i2c timeout reset function
According to the description of the I2C_RESET(0x9E) register in
the husb311 datasheet, the main configuration is enable/disable
i2c timeout reset function(bit[7]) and i2c timeout time(bit[3:0]).

If the i2c timeout reset function is enabled, the husb311 will perform
a soft reset in some cases, such as system hibernation, and close the
i2c bus (SCL and SDA are low at the same time). So we disable the i2c
timeout reset function.

Change-Id: Id9169f3ecf65725a959aadda9d2f8f60f20c87a3
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2022-02-08 09:40:41 +08:00
Wyon bi
42e2d4c27b drm/bridge: analogix_dp: Correct phy status in loader_protect
Signed-off-by: Wyon bi <bivvy.bi@rock-chips.com>
Change-Id: Ia0c62ae6ed411200b539e33c797bc8d0b1c7e14b
2022-01-27 19:30:48 +08:00
Wyon bi
9852468421 phy/rockchip: naneng-edp: Check if PHY need configured during startup
Signed-off-by: Wyon bi <bivvy.bi@rock-chips.com>
Change-Id: Icf5aeb751401d0ab2c2e02443f6316b49b6b23c3
2022-01-27 19:30:48 +08:00
Hu Kejun
cc7396d042 media: spi: ms41908: fix timer error in find pi
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: Ie78e37494a1b27fe5a5779869938d0c5c05414a8
2022-01-27 10:31:44 +08:00
Hu Kejun
74962274ed media: spi: ms41908: add reback ctrl
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I44fd0d3b589f02a16b3fcd4430b6820e72b1b10f
2022-01-27 10:06:59 +08:00
Hu Kejun
634f851ac9 media: spi: ms41908: fix get time failed by compat_ioctl
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
Change-Id: I6e95c19d8ed48136c9ee994a6b0f1f7896255469
2022-01-27 09:45:00 +08:00
William Wu
e9ef27fa36 usb: gadget: f_hid: fix zero length packet transfer
If the hid transfer with size divisible to EPs max packet
size, it needs to set the req->zero to true, then the usb
controller can transfer a zero length packet at the end
according to the USB 2.0 spec.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ia63060b4551d30821beaf494c1ccd7dfb3b6ca22
2022-01-24 20:41:56 +08:00
Zorro Liu
8247cacdf4 drm/rockchip: ebc_dev: release version v2.27
ebc: improve handwrite rate
pvi: add version 0x48

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I3b4646e5a4b2932309fa71d9fd4438bc96155907
2022-01-22 16:50:19 +08:00
Jianqun Xu
4464333fca arm64: dts: rockchip: px30 set io drive-strength-s for px30s
Set drive-strength for px30, and set drive-strength-s for px30s.

If only drive-strength, that means both for px30 and px30s.
If only drive-strength-s, that means only for px30s.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Idd2437626a28c03624ce0fb41bedf56ec61dabb0
2022-01-21 18:26:41 +08:00
Wesley Yao
2acbfa596f arm64: dts: rockchip: px30s: Adjust drv and odt of LPDDR4 CA
Signed-off-by: Wesley Yao <wesley.yao@rock-chips.com>
Change-Id: I4124305ff100d0dcb66f6cc0851413e0157265e8
2022-01-21 18:25:04 +08:00
Jianqun Xu
9e991e822a pinctrl: rockchip: fix rk3568 slew rate to 2bit per pin
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I5cb7d6fbb26f5bcdc6ab181d1ad33547259163ab
2022-01-21 15:54:51 +08:00
Finley Xiao
2546df521a thermal: rockchip: Add conversion time for px30s
Change-Id: I48dc8f82a3d1f05d613812a8c169f3cbec4f0d74
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2022-01-21 14:23:43 +08:00
Tao Huang
218dfa33d2 Merge branch 'develop-4.19-px30s'
Change-Id: I5c3e5e4d477cb439bee3dde09978e4380799ffe7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2022-01-20 14:46:25 +08:00