mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Firmware Handoff for DT Overlay created by OP-TEE?
@ 2025-06-11 18:09 Ahmad Fatoum
       [not found] ` <VI1PR08MB1021788AAFA0E6A859BA3C18CC074A@VI1PR08MB10217.eurprd08.prod.outlook.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-11 18:09 UTC (permalink / raw)
  To: manish.pandey2
  Cc: op-tee, BAREBOX, rouven.czerwinski, Michael Tretter, kernel

Hello Manish,

In your recent talk[1] at LinaroConnect about the Firmware Handoff
specification, you were asking about what other use cases it could
address for OP-TEE.

We ran into a possible use case that we would like to share:

BL2 can pass a DT to OP-TEE, which it would use to discover memory and
to fix up with memory reservations covering the memory it carves out for
itself.

OP-TEE also supports passing along the reservations as a device tree
overlay. AFAICS, there is no way currently to have both: A DT for OP-TEE
to probe hardware from and a way to pass the normal world a device tree
overlay in return.

I think this could be neatly addressed with Firmware Handoff and would
be a motivation for us to implement support in barebox BL2/BL33 to take
advantage of this. The current way is suboptimal as we would prefer the
DT passed to OP-TEE to be read-only. This avoids either having to copy
it or to pad it sufficiently in anticipation of it growing with the
addition of the new nodes.

[1]: https://www.youtube.com/watch?v=RxU798h8aiE

Cheers,
Ahmad

-- 
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 |




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Firmware Handoff for DT Overlay created by OP-TEE?
       [not found] ` <VI1PR08MB1021788AAFA0E6A859BA3C18CC074A@VI1PR08MB10217.eurprd08.prod.outlook.com>
@ 2025-06-12 10:44   ` Ahmad Fatoum
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-12 10:44 UTC (permalink / raw)
  To: Manish Pandey2
  Cc: BAREBOX, Raymond Mao, Jose Marinho, rouven.czerwinski,
	Ilias Apalodimas, Michael Tretter, Dan Handley, op-tee, kernel

Hello Manish,

On 6/12/25 12:13, Manish Pandey2 wrote:
> Thanks Ahmad for reaching out!

Thanks for the quick response.

> There is a PR [1] on the Firmware Handoff specification that is still
> under discussion. Could you take a look and see if it could accommodate
> your use case?

Cool, thanks for pointing it out. I will check it out in detail.

> To confirm my understanding, would the desired flow be something like:
> 
>  1.
>     *BL31 passes a read-only DT* to OP-TEE via the Transfer List (TL)

DT comes from BL2 originally, but yes, BL31 passes it along.

>  2.
>     *OP-TEE consumes* the DT, adds memory reservations via a *DTO*, and
>     appends this DTO to the TL

My original thought was that BL2 (via BL31) allocates some memory and
passes it via transfer list for OP-TEE to fill out.

This allows reclaiming the space used by the overlay, which would
otherwise not be possible:

  - If OP-TEE uses arbitrary memory, it may turn out to be used
    otherwise

  - If OP-TEE uses its own memory that it reserves, the space is
    never reclaimed as it doesn't know when it's no longer needed

>  3.
>     *BL31 then forwards* the updated TL to BL33

Right.

> 
> Does that match what you had in mind?

Thanks,
Ahmad

> 
> 
> [1]: https://github.com/FirmwareHandoff/firmware_handoff/pull/74
> <https://github.com/FirmwareHandoff/firmware_handoff/pull/74>
> 
> ------------------------------------------------------------------------
> *From:* Ahmad Fatoum <a.fatoum@pengutronix.de>
> *Sent:* 11 June 2025 19:09
> *To:* Manish Pandey2 <Manish.Pandey2@arm.com>
> *Cc:* op-tee@lists.trustedfirmware.org <op-
> tee@lists.trustedfirmware.org>; BAREBOX <barebox@lists.infradead.org>;
> rouven.czerwinski@linaro.org <rouven.czerwinski@linaro.org>; Michael
> Tretter <m.tretter@pengutronix.de>; kernel@pengutronix.de
> <kernel@pengutronix.de>
> *Subject:* Firmware Handoff for DT Overlay created by OP-TEE?
>  
> Hello Manish,
> 
> In your recent talk[1] at LinaroConnect about the Firmware Handoff
> specification, you were asking about what other use cases it could
> address for OP-TEE.
> 
> We ran into a possible use case that we would like to share:
> 
> BL2 can pass a DT to OP-TEE, which it would use to discover memory and
> to fix up with memory reservations covering the memory it carves out for
> itself.
> 
> OP-TEE also supports passing along the reservations as a device tree
> overlay. AFAICS, there is no way currently to have both: A DT for OP-TEE
> to probe hardware from and a way to pass the normal world a device tree
> overlay in return.
> 
> I think this could be neatly addressed with Firmware Handoff and would
> be a motivation for us to implement support in barebox BL2/BL33 to take
> advantage of this. The current way is suboptimal as we would prefer the
> DT passed to OP-TEE to be read-only. This avoids either having to copy
> it or to pad it sufficiently in anticipation of it growing with the
> addition of the new nodes.
> 
> [1]: https://www.youtube.com/watch?v=RxU798h8aiE <https://
> www.youtube.com/watch?v=RxU798h8aiE>
> 
> Cheers,
> Ahmad
> 
> --
> Pengutronix e.K.                  |                             |
> Steuerwalder Str. 21              | http://www.pengutronix.de/ <http://
> www.pengutronix.de/>  |
> 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
> 

-- 
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 |




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-12 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-11 18:09 Firmware Handoff for DT Overlay created by OP-TEE? Ahmad Fatoum
     [not found] ` <VI1PR08MB1021788AAFA0E6A859BA3C18CC074A@VI1PR08MB10217.eurprd08.prod.outlook.com>
2025-06-12 10:44   ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox