Re: [PATCH v3 2/9] arm: dts: imx8mp: Add common u-boot dtsi

Heiko Schocher
2021-07-19T04:16:18Z

Hello Tim,

On 12.07.21 18:42, Tim Harvey wrote:
> On Sat, Jul 10, 2021 at 5:23 AM Heiko Schocher <hs@denx.de> wrote:
>>
>> Hello Tim,
>>
>> On 09.07.21 16:47, Tim Harvey wrote:
>>> On Wed, Jul 7, 2021 at 5:58 AM Teresa Remmet <t.remmet@phytec.de> wrote:
>>>>
>>>> Factor out the common node settings for dm-spl and dm-pre-reloc
>>>> and move them to imx8mp-u-boot.dtsi
>>>>
>>>> Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
>>>> Reviewed-by: Fabio Estevam <festevam@gmail.com>
>>>> Reviewed-by: Heiko Schocher <hs@denx.de>
>>>> ---
>>>> Changes in v3:
>>>> - Moved binman nodes to common imx8mp-u-boot.dtsi
>>>> Changes in v2:
>>>> - none
>>>>
>>>> arch/arm/dts/imx8mp-evk-u-boot.dtsi | 143 +----------------
>>>> .../imx8mp-phyboard-pollux-rdk-u-boot.dtsi | 39 +----
>>>> arch/arm/dts/imx8mp-u-boot.dtsi | 149 ++++++++++++++++++
>>>> 3 files changed, 153 insertions(+), 178 deletions(-)
>>>> create mode 100644 arch/arm/dts/imx8mp-u-boot.dtsi
>>>>
> <snip>
>>>>
>>>
>>> Teresa,
>>>
>>> I've noticed many of the imx8m boards migrating to using binman for
>>> image packaging.
>>>
>>> Doesn't this change from having a single flash.bin encompasing the SPL
>>> and U-Boot proper to having split files? I noticed that happened with
>>> imx8mm_evk for example when it switched to binman.
>>
>> Yes, but you can easy generate there a single image again.
>>
>>> What are the benefits to using binman?
>>
>> Beside the pros from binmal in general, I see the benefit in special
>> for imx8mp, that you can get all infos you need for signing the image
>> from within the image. No need to save some log output from U-Boot
>> build and parse this output ...
>>
>
> (+cc Simon)
>
> Heiko,
>
> And what are the pros from binman in general? I've read over
> tools/binman/binman.rst so I'm assuming you mean what is described
> there as benefits.

Yes!

> How do you get all the details needed for signing the image from binman?

Not from binman directly, instead for getting the offset and length
of the images you want to sign, I simply used "fdtget" to read them
from the u-boot image:

(extract from my yocto class... WIP also):

dec2hex() {
echo 0x$(printf '%x' $1)
}

# $1 ... fit image name
# $2 ... part of fit image
fit_get_off() {
val=$(fdtget $1 /images/$2 data-position)
# dec -> hex
dec2hex $val
}

# $1 ... fit image name
# $2 ... part of fit image
fit_get_len() {
val=$(fdtget $1 /images/$2 data-size)
dec2hex $val
}

example for atf:

off=$(fit_get_off u-boot.itb atf)
len=$(fit_get_len u-boot.itb atf)

Hope this helps?

> If I make imx8mm_evk_defconfig which produces via binman flash.bin and
> u-boot.itb I get the following:
>
> $ ./tools/binman/binman ls -i flash.bin
> binman: Cannot find FDT map in image
> $ ./tools/binman/binman ls -i u-boot.itb
> binman: Cannot find FDT map in image
>
> I would very much like to understand how to use binman to get the
> various offsets needed for signing an IMX image for use with HAB.
>
> Thanks,
>
> Tim
>

bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs@denx.de