]> git.ipfire.org Git - thirdparty/openwrt.git/commit
mediatek: replace downstream TRNGv2 driver 22266/head
authorDaniel Golle <daniel@makrotopia.org>
Wed, 4 Mar 2026 01:18:08 +0000 (01:18 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 5 Mar 2026 02:26:41 +0000 (02:26 +0000)
commitb7a2f80740c857a3e0353a8dd9638c34cd0f0740
tree1357c9318184764336832350a4c93e4dca86c7b2
parent57bf713ef7d427e4b83c05ae4f72b0f817598837
mediatek: replace downstream TRNGv2 driver

Replace the downstream mtk-rng-v2 driver which was acquires random bytes
from TF-A via SMC. A new approach is needed as TF-A for MT7986 has
changed and now requires to use SMC instead of directly accessing the
TRNG via MMIO. However, we can't know whether we are on old or new TF-A,
many devices (like the BananaPi BPi-R3) allow updating TF-A BL3 in the
field, so it may be of the old or new type, and the RNG driver will have
to figure it out somehow.

This currently means that MT7986 with newer TF-A has broken/non-working
HWRNG in Linux:
root@OpenWrt:~# hexdump -C /dev/hwrng
hexdump: /dev/hwrng: I/O error

Fix this by creating a new combined driver which replaces the previous
mtk-rng-v2 driver, and is able to auto-detect which convention to use
on MT7986.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/mediatek/filogic/config-6.12
target/linux/mediatek/mt7622/config-6.12
target/linux/mediatek/mt7629/config-6.12
target/linux/mediatek/patches-6.12/051-v6.16-hwrng-mtk-Add-struct-device-pointer-to-device-contex.patch [new file with mode: 0644]
target/linux/mediatek/patches-6.12/320-hwrng-add-driver-for-MediaTek-TRNG-SMC.patch [deleted file]
target/linux/mediatek/patches-6.12/320-hwrng-mtk-add-support-for-hw-access-via-SMCC.patch [new file with mode: 0644]