[arm64] Enable Crypto Extensions on rk3328 (like Rock64) and rk3399 (like RockPro64) devices as module
This enables the Crypto Extensions IP in Rockchip devices. Currently this works in RK3288, RK3328 and RK3399.
EDIT: and now it does work :-) EDIT2: I removed the patch set, so that this MR only enables the kernel module.
Old text:
Or at least that is what it ought to do, but my own tests on a Rock64 haven't been successful and I don't know why. Hence the RFC.
The kernel module also gets enabled in !484 (merged) but my guess is that won't do what is intended.
At https://lore.kernel.org/all/20220508185957.3629088-1-clabbe@baylibre.com/ is a (big) patch set titled crypto: rockchip: permit to pass self-tests and when applied should allow the Rockchip crypto modules to pass the selftest which allows them to actually be used. That patchset is what my 2nd commit is about.
I've (cross-)build a kernel and installed the resulting .deb file on a Rock64 and updated the rk3328-rock64.dtb
on that device and rebooted into my new kernel. After reboot I have a /proc/device-tree/crypto@ff060000/
directory which tells me it loads the correct dtb.
But lsmod
does NOT show rk_crypto
which I expected to happen. I also don't see any references to it in dmesg
.
So then I did a modprobe rk_crypto
after which it shows up in lsmod
. But still no entries in dmesg
.
Then I did cat /proc/crypto
and the result was exactly the same as without the kernel module or the patch set (iow: like the Debian kernel already had)!
I've been in contact with the patch set author (Corentin Labbe) to try to figure out why it isn't working, but so far without success.
I asked for what I was supposed to see and this was his response:
You should have some xxx-rk like names in /proc/crypto like ecb-aes-rk.
The dmesg should have:
[ 21.392914] rk3288-crypto ff8b0000.crypto: will run requests pump with realtime priority
[ 21.393699] rk3288-crypto ff8b0000.crypto: Register ecb(aes) as ecb-aes-rk
[ 21.447948] rk3288-crypto ff8b0000.crypto: Register cbc(aes) as cbc-aes-rk
[ 21.529663] rk3288-crypto ff8b0000.crypto: Register ecb(des) as ecb-des-rk
[ 21.754146] rk3288-crypto ff8b0000.crypto: Register cbc(des) as cbc-des-rk
[ 21.941749] rk3288-crypto ff8b0000.crypto: Register ecb(des3_ede) as ecb-des3-ede-rk
[ 22.201585] rk3288-crypto ff8b0000.crypto: Register cbc(des3_ede) as cbc-des3-ede-rk
[ 22.464795] rk3288-crypto ff8b0000.crypto: Register sha1 as rk-sha1
[ 22.647242] rk3288-crypto ff8b0000.crypto: Register sha256 as rk-sha256
[ 22.843539] rk3288-crypto ff8b0000.crypto: Register md5 as rk-md5
[ 23.017146] rk3288-crypto ff8b8000.crypto: will run requests pump with realtime priority
And he also said that the rk_crypto
module should have been loaded automatically. None of this happened with my test.
So now I'm wondering whether I did something incorrectly, whether other (kernel) modules need to be enabled too or something else.
@vagrant and @ukleinek could you take a look?
Others are of course also welcome to review and help figure out what is needed to actually make it work :-)