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)
1.improve handwrite rate
2.fix auto mode refresh uncompletely last version
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I8416d03d01b15196c71df440c34212a57aea793c
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>
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>
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>
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
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
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
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
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
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>
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
Add register and unregister for crypto driver.
Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I406776514374bb460875ce8bd71a3031cd110587
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
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
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
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
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
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>
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>
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
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