Question about extension board used in U-boot
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.
My first question is if I want to use tpm2 in U-boot for measured boot. How to implement this right? Currently I just modify the dts used by U-boot to let it drive
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?
The second question is about extension manager.
I have read the extension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command is convenient for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that extension board.
But it is too late for U-boot itself, right?
The third question is I'm also dong SystemReady IR certificate. That means the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the Linux kernel by
the extension manager?
What is the best practice if I want to use U-boot dts for Linux in implementation?
Thanks a lot.
Yours,
Paul
Hi Paul
Too posting because I think we also need to address this at a higher level.
i think we discussed this topic quite a while back. I may be wrong but it may be Bill Mills who proposed to have an eeprom on the extensions that the carrier board can use to detect and fetch proper overlay. Another way would be that the contract between the extension board and the carrier board includes an i2c accessible storage to fetch an overlay that would identify the board and give all details. Bottom line, a software only solution seems not entirely satisfying.
In that suboptimal case, U-Boot shall be able to assemble a DT for itself and another for OS (may be same in some cases) through scripting. And in this case, come your questions below
.
Quoted 44 lines · Ying-Chun Liu (PaulLiu)
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.My first question is if I want to use tpm2 in U-boot for measured boot. How to implement this right? Currently I just modify the dts used by U-boot to let it drive
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?The second question is about extension manager.
I have read theextension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command is convenient for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that extension board.
But it is too late for U-boot itself, right?The third question is I'm also dong SystemReady IR certificate. That means the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the Linux kernel by
the extension manager?
What is the best practice if I want to use U-boot dts for Linux in implementation?
Quoted 8 lines
Thanks a lot.
Yours,
Paul--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog
Le sam. 18 sept. 2021 à 08:49, François Ozog <[email protected]> a écrit :
Quoted 11 lines
Hi Paul
Too posting because I think we also need to address this at a higher level.
i think we discussed this topic quite a while back. I may be wrong but it may be Bill Mills who proposed to have an eeprom on the extensions that the carrier board can use to detect and fetch proper overlay. Another way would be that the contract between the extension board and the carrier board includes an i2c accessible storage to fetch an overlay that would identify the board and give all details.
i just forgot to state that the mode is well known: SPD for DIMMs.
Quoted 61 lines
Bottom line, a software only solution seems not entirely satisfying. In that suboptimal case, U-Boot shall be able to assemble a DT for itself and another for OS (may be same in some cases) through scripting. And in this case, come your questions below
.
Quoted 51 lines · Ying-Chun Liu (PaulLiu)
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.My first question is if I want to use tpm2 in U-boot for measured boot. How to implement this right? Currently I just modify the dts used by U-boot to let it drive
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?The second question is about extension manager.
I have read theextension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command is convenient for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that extension board.
But it is too late for U-boot itself, right?The third question is I'm also dong SystemReady IR certificate. That means the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the Linux kernel by
the extension manager?
What is the best practice if I want to use U-boot dts for Linux in implementation?Thanks a lot.
Yours,
Paul
Quoted 6 lines
Quoted 1 line
--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog
Quoted 7 lines · François Ozog
Le sam. 18 sept. 2021 à 08:49, François Ozog <[email protected]> a écrit :
Quoted 4 lines
Hi Paul
Too posting because I think we also need to address this at a higher level.
Quoted 28 lines
Quoted 7 lines
i think we discussed this topic quite a while back. I may be wrong but it may be Bill Mills who proposed to have an eeprom on the extensions that the carrier board can use to detect and fetch proper overlay. Another way would be that the contract between the extension board and the carrier board includes an i2c accessible storage to fetch an overlay that would identify the board and give all details.
i just forgot to state that the mode is well known: SPD for DIMMs.
Quoted 19 lines
Bottom line, a software only solution seems not entirely satisfying. In that suboptimal case, U-Boot shall be able to assemble a DT for itself and another for OS (may be same in some cases) through scripting. And in this case, come your questions below
.
Quoted 9 lines · Ying-Chun Liu (PaulLiu)
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.
You could implement the weak function board_fdt_blob_setup() to detect your addon boards and extend the devicetree.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
My first question is if I want to use tpm2 in U-boot for measured boot. How to implement this right? Currently I just modify the dts used by U-boot to let it drive
Measured boot is provided in U-Boot v2021.10-rc4 based on TPMv2. Just enable CONFIG_EFI_TCG2_PROTOCOL.
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?The second question is about extension manager.
I have read theextension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command is convenient for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that extension board.
But it is too late for U-boot itself, right?
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
The third question is I'm also dong SystemReady IR certificate. That means the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the Linux kernel by
the extension manager?
U-Boot has a fdt command which you could use to apply overlays. Or implement function board_fdt_blob_setup().
Best regards
Heinrich
Quoted 25 lines
Quoted 11 lines
Quoted 11 lines
What is the best practice if I want to use U-boot dts for Linux in implementation?
Thanks a lot.
Yours,
PaulQuoted 6 lines
Quoted 1 line
--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog
_______________________________________________
boot-architecture mailing list [email protected]
https://lists.linaro.org/mailman/listinfo/boot-architecture
Hi Heinrich,
I think I met some chicken and egg problem. Or I misunderstand something you mentioned.
So I tried board_fdt_blob_setup() and board_fix_fdt().
Both are too early.
I need i2c to be drived first. And then I can use dm_i2c_probe() on different address to detect which extension board it is. However, in board_fdt_blob_setup() or board_fix_fdt(). i2c seems not working there.
I can do the detection in board_late_init() but it is just too late for U-boot itself.
Good for Linux kernel though.
Sorry for my bad English. Measured boot is already working on my branch. But the way I implemented this is directly modify the dts of U-boot and assume
the TPM extension board is always there. Thus this is not upstreamable.
I think let me upstream some code by extension manager first (for linux kernel first).
And then we can see how the detection is implemented and how to modify it for U-boot.
Thanks,
Paul
Heinrich Schuchardt 於 2021/9/18 下午3:14 寫道:
Quoted 125 lines · François Ozog
Quoted 20 lines
Le sam. 18 sept. 2021 à 08:49, François Ozog
<[email protected]> a
écrit :Quoted 5 lines
Hi Paul
Too posting because I think we also need to address this at a higher level.
Quoted 11 lines
i think we discussed this topic quite a while back. I may be wrong but it
may be Bill Mills who proposed to have an eeprom on the extensions that the
carrier board can use to detect and fetch proper overlay. Another way would
be that the contract between the extension board and the carrier board includes an i2c accessible storage to fetch an overlay that would identify
the board and give all details.Quoted 24 lines
i just forgot to state that the mode is well known: SPD for DIMMs.
Quoted 22 lines
Bottom line, a software only solution seems not entirely satisfying. In that suboptimal case, U-Boot shall be able to assemble a DT for itself
and another for OS (may be same in some cases) through scripting. And in
this case, come your questions below.
Quoted 9 lines · Ying-Chun Liu (PaulLiu)
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.You could implement the weak function
board_fdt_blob_setup()to detect your addon boards and extend the devicetree.Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
My first question is if I want to use tpm2 in U-boot for measured boot.
How to implement this right? Currently I just modify the dts used by U-boot to let it driveMeasured boot is provided in U-Boot v2021.10-rc4 based on TPMv2. Just enable
CONFIG_EFI_TCG2_PROTOCOL.Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?The second question is about extension manager.
I have read theextension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command is convenient
for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that
extension board.
But it is too late for U-boot itself, right?Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
The third question is I'm also dong SystemReady IR certificate. That means
the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the
Linux kernel by
the extension manager?U-Boot has a fdt command which you could use to apply overlays. Or implement function
board_fdt_blob_setup().Best regards
Heinrich
Quoted 25 lines
Quoted 7 lines
Quoted 7 lines
What is the best practice if I want to use U-boot dts for Linux in implementation?
Thanks a lot.
Quoted 10 lines
Quoted 5 lines
Yours,
PaulFrançois-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozogFrançois-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog
_______________________________________________
boot-architecture mailing list [email protected]
https://lists.linaro.org/mailman/listinfo/boot-architecture
Modules for carrier boards [Was: Re: Question about extension board used in U-boot]
In reply to François OzogQuoted 10 lines · François Ozog
Hi Paul
Too posting because I think we also need to address this at a higher level.
i think we discussed this topic quite a while back. I may be wrong but it may be Bill Mills who proposed to have an eeprom on the extensions that the carrier board can use to detect and fetch proper overlay. Another way would be that the contract between the extension board and the carrier board includes an i2c accessible storage to fetch an overlay that would identify the board and give all details.
What you're describing sounds exactly like Raspberry Pi HATs work:
https://github.com/raspberrypi/hats/blob/master/devicetree-guide.md
Similarly Beagleboard capes use rely on I2C EEPROMs for make them discoverable, although I don't think all have to have a built-in overlay (IIRC because they joined the party too early).
In other words there's plenty of prior art here and, as new hardware standards come out, it should be much easier for them to find this prior art. However I'm near certain mistakes will still be made...
Quoted 4 lines
Bottom line, a software only solution seems not entirely satisfying. In that suboptimal case, U-Boot shall be able to assemble a DT for itself and another for OS (may be same in some cases) through scripting. And in this case, come your questions below.
Sub-optimal or not[1] the u-boot extension board code still looks like it would be a good starting point even for boards with non-discoverable extensions (96Boards CE 1.0 for example).
If implementing on a board with non-discoverable extensions then I would consider implementing "extension scan" to report non-discoverable modules (e.g. from an internal list) and proposing patches to that "extension apply all" would not enable non-discoverable boards (so that non- discoverable boards would have to be enabled by injecting a "extension apply <id>" into the boot scripts).
Of course, I may have overlooked a better existing mechanism in u-boot but that's what I would start with until I was corrected by maintainers ;-) .
Daniel.
[1] And also extremely off-topic for Paul since his (a) boards are discoverable and (b) the extension framework can't fire up early enough for TPM extensions ;-) .
Quoted 62 lines
Quoted 44 lines · Ying-Chun Liu (PaulLiu)
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.My first question is if I want to use tpm2 in U-boot for measured boot. How to implement this right? Currently I just modify the dts used by U-boot to let it drive
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?The second question is about extension manager.
I have read theextension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command is convenient for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that extension board.
But it is too late for U-boot itself, right?The third question is I'm also dong SystemReady IR certificate. That means the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the Linux kernel by
the extension manager?
What is the best practice if I want to use U-boot dts for Linux in implementation?Quoted 8 lines
Thanks a lot.
Yours,
Paul--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog
_______________________________________________
boot-architecture mailing list [email protected]
https://lists.linaro.org/mailman/listinfo/boot-architecture
Re: Modules for carrier boards [Was: Re: Question about extension board used in U-boot]
Quoted 14 lines · Daniel Thompson
Quoted 3 lines · François Ozog
Hi Paul
Too posting because I think we also need to address this at a higher
level.
Quoted 3 lines
i think we discussed this topic quite a while back. I may be wrong but it may be Bill Mills who proposed to have an eeprom on the extensions that
the
Quoted 1 line
carrier board can use to detect and fetch proper overlay. Another way
would
Quoted 2 lines
be that the contract between the extension board and the carrier board includes an i2c accessible storage to fetch an overlay that would
identify
Quoted 9 lines
Quoted 1 line
the board and give all details.
What you're describing sounds exactly like Raspberry Pi HATs work:
https://github.com/raspberrypi/hats/blob/master/devicetree-guide.mdSimilarly Beagleboard capes use rely on I2C EEPROMs for make them discoverable, although I don't think all have to have a built-in overlay (IIRC because they joined the party too early).
I believe this would be a great SystemReady addition: define details of the DT lifecycle and probably adopt one of the two models. Or worst case define a consolidated one.
I hope this is also adoptable by 96boards…
Quoted 102 lines
In other words there's plenty of prior art here and, as new hardware standards come out, it should be much easier for them to find this prior art. However I'm near certain mistakes will still be made...
Quoted 4 lines
Bottom line, a software only solution seems not entirely satisfying. In that suboptimal case, U-Boot shall be able to assemble a DT for itself and another for OS (may be same in some cases) through scripting. And in this case, come your questions below.
Sub-optimal or not[1] the u-boot extension board code still looks like it would be a good starting point even for boards with non-discoverable extensions (96Boards CE 1.0 for example).
If implementing on a board with non-discoverable extensions then I would consider implementing "extension scan" to report non-discoverable modules (e.g. from an internal list) and proposing patches to that "extension apply all" would not enable non-discoverable boards (so that non- discoverable boards would have to be enabled by injecting a "extension apply <id>" into the boot scripts).
Of course, I may have overlooked a better existing mechanism in u-boot but that's what I would start with until I was corrected by maintainers ;-) .
Daniel.
[1] And also extremely off-topic for Paul since his (a) boards are discoverable and (b) the extension framework can't fire up early enough for TPM extensions ;-) .
Quoted 1 line
Le sam. 18 sept. 2021 à 01:21, Ying-Chun Liu (PaulLiu) <
Quoted 22 lines
Quoted 18 lines · a écrit :
Hi all,
I have some questions about how to implement extension board usage. My case is on imx8mm-cl-iot-gate. It can add three different types of extension boards.
One of the extension boards is SPI extension which have 3 empty slots. And you can add
some small boards onto it. One of them is a "TPM2" module.My first question is if I want to use tpm2 in U-boot for measured boot. How to implement this right? Currently I just modify the dts used by U-boot to let it drive
the extension board. And let it drive the TPM. But it is not good for upstreaming because
when other types of extension boards installed then it is not working. Where to implement this? What is the best practice of this?Quoted 7 lines
Quoted 7 lines
The second question is about extension manager.
I have read theextension.rst. I think I'll implement this anyway because then
I can have a command to query what type of extension boards I have. And if the extension board is the 3 slots one. I can then detect which slot is the TPM.
I'll implement this anyway because the "extension" command isconvenient
Quoted 8 lines
Quoted 8 lines
for users.
But it seems to me that it only solves the problem for Linux kernel. It can apply a DTB Overlay to Linux DTB to let Linux knows we have that extension board.
But it is too late for U-boot itself, right?The third question is I'm also dong SystemReady IR certificate. That
means
Quoted 24 lines
Quoted 9 lines
the dtb for Linux is directly provided by U-boot. We use U-boot dtb directly to Linux
kernel. In this case, how to modify that dts dynamically to feed to the Linux kernel by
the extension manager?
What is the best practice if I want to use U-boot dts for Linux in implementation?Quoted 8 lines
Thanks a lot.
Yours,
Paul--
François-Frédéric Ozog | *Director Business Development*
T: +33.67221.6485
[email protected] | Skype: ffozog
_______________________________________________
boot-architecture mailing list [email protected]
https://lists.linaro.org/mailman/listinfo/boot-architecture
Signature · 3 lines
François-Frédéric Ozog | *Director Business Development* T: +33.67221.6485 [email protected] | Skype: ffozog