[PATCH 3/3] ARM: rockchip: pack the device tree passed to TF-A and OP-TEE
Sascha Hauer
s.hauer at pengutronix.de
Thu Oct 15 01:00:01 PDT 2026
On 2026-10-14 14:45, Ahmad Fatoum wrote:
> Hello Sascha,
>
> On 10/1/26 9:42 AM, Sascha Hauer wrote:
> > rockchip_create_optee_fdt() builds a device tree with just the memory
> > nodes, but fdt_create_empty_tree() sets its totalsize to the size of the
> > whole scratch buffer, i.e. CONFIG_ARCH_ROCKCHIP_ATF_FDT_SIZE (384 KiB).
> >
> > TF-A and OP-TEE both call fdt_open_into() on the device tree, which
> > copies totalsize bytes regardless of the actual content. TF-A does this
> > with the MMU disabled and OP-TEE through an uncached mapping. On an
> > RK3588 this takes 185 ms in TF-A and another 182 ms in OP-TEE.
> >
> > Pack the device tree so that totalsize matches its content. OP-TEE can
> > still expand it in place, the scratch buffer keeps its size.
>
> While I don't object to the patch, for future reference it would be good
> to point out what the implication is for fixups onto the device tree.
>
> Do both TF-A and OP-TEE apply fixups on this platforms? Are these fixups
> no longer possible now?
TF-A doesn't apply any fixups. OP-TEE does, but it opens the device tree
with fdt_open_into(blob, blob, CFG_DTB_MAX_SIZE), so it can expand as
necessary up to CFG_DTB_MAX_SIZE. It just doesn't have to read so much
from it initially.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list