Message ID | 20250327092323.1726839-1-b-padhi@ti.com |
---|---|
State | Superseded |
Delegated to: | Ryan Eatmon |
Headers | show |
Series | [master/scarthgap] ti-hsm-fw: Add a recipe to export prebuilt HSM firmware | expand |
Hi Beleswar, On 3/27/25 04:23, Beleswar Padhi via lists.yoctoproject.org wrote: > Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked > up by the tisdk-core-bundle for the prebuilt binaries directory. The HSM firmware is only an example/demo firmware, and not a production HSM firmware. This is not clear when looking at this commit. Please revise your patch description and the SUMMARY to better reflect this. Hopefully, the same is captured as well in the commit that added this to the ti-linux-firmware repo. regards Suman > > Signed-off-by: Beleswar Padhi <b-padhi@ti.com> > --- > .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ > .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + > meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ > 3 files changed, 33 insertions(+) > create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > > diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > new file mode 100644 > index 00000000..8b225421 > --- /dev/null > +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > @@ -0,0 +1,28 @@ > +SUMMARY = "TI HSM Firmware" > + > +inherit deploy > + > +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc > + > +PACKAGE_ARCH = "${MACHINE_ARCH}" > + > +PV = "${TI_HSM_FW_VERSION}" > +PR = "${INC_PR}.0" > + > +SYSFW_SOC ?= "*" > +SYSFW_SOC:j721s2 = "j721s2" > +SYSFW_SOC:j784s4 = "j784s4" > + > +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" > + > +do_install() { > + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm > + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm > +} > + > +do_deploy() { > + install -d ${DEPLOYDIR}/ti-hsm > + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm > +} > + > +addtask deploy before do_build after do_compile > diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > index 0d912625..4e9c385c 100644 > --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" > CNM_WAVE521_FW_VERSION = "1.0.7" > TI_DM_FW_VERSION = "11.00.09" > TI_SYSFW_VERSION = "11.00.07" > +TI_HSM_FW_VERSION = "11.00.09" > > TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" > SRCREV = "${TI_LINUX_FW_SRCREV}" > diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > index 41d4abdd..8a800193 100644 > --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n > DEPENDS:append:k3 = " ti-sci-fw" > DEPENDS:append:k3r5 = " ti-sci-fw" > > +# HSM Firmware is only applicable for J721S2 & J784S4 devices > +DEPENDS:append:j721s2 = " ti-hsm-fw" > +DEPENDS:append:j784s4 = " ti-hsm-fw" > + > DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" > > PLAT_SFX = "" > > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#18422): https://lists.yoctoproject.org/g/meta-ti/message/18422 > Mute This Topic: https://lists.yoctoproject.org/mt/111933183/4594561 > Group Owner: meta-ti+owner@lists.yoctoproject.org > Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [s-anna@ti.com] > -=-=-=-=-=-=-=-=-=-=-=- >
On 3/27/2025 11:45 AM, Suman Anna wrote: > Hi Beleswar, > > On 3/27/25 04:23, Beleswar Padhi via lists.yoctoproject.org wrote: >> Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked >> up by the tisdk-core-bundle for the prebuilt binaries directory. > > The HSM firmware is only an example/demo firmware, and not a production HSM > firmware. Should the recipe name reflect the demo nature? ti-hsm-demo-fw ? > This is not clear when looking at this commit. Please revise your patch > description and the SUMMARY to better reflect this. > > Hopefully, the same is captured as well in the commit that added this to the > ti-linux-firmware repo. > > regards > Suman > >> >> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >> --- >> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ >> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + >> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ >> 3 files changed, 33 insertions(+) >> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> >> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> new file mode 100644 >> index 00000000..8b225421 >> --- /dev/null >> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> @@ -0,0 +1,28 @@ >> +SUMMARY = "TI HSM Firmware" >> + >> +inherit deploy >> + >> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> + >> +PACKAGE_ARCH = "${MACHINE_ARCH}" >> + >> +PV = "${TI_HSM_FW_VERSION}" >> +PR = "${INC_PR}.0" >> + >> +SYSFW_SOC ?= "*" >> +SYSFW_SOC:j721s2 = "j721s2" >> +SYSFW_SOC:j784s4 = "j784s4" >> + >> +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" >> + >> +do_install() { >> + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm >> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm >> +} >> + >> +do_deploy() { >> + install -d ${DEPLOYDIR}/ti-hsm >> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm >> +} >> + >> +addtask deploy before do_build after do_compile >> diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> index 0d912625..4e9c385c 100644 >> --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" >> CNM_WAVE521_FW_VERSION = "1.0.7" >> TI_DM_FW_VERSION = "11.00.09" >> TI_SYSFW_VERSION = "11.00.07" >> +TI_HSM_FW_VERSION = "11.00.09" >> >> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" >> SRCREV = "${TI_LINUX_FW_SRCREV}" >> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> index 41d4abdd..8a800193 100644 >> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n >> DEPENDS:append:k3 = " ti-sci-fw" >> DEPENDS:append:k3r5 = " ti-sci-fw" >> >> +# HSM Firmware is only applicable for J721S2 & J784S4 devices >> +DEPENDS:append:j721s2 = " ti-hsm-fw" >> +DEPENDS:append:j784s4 = " ti-hsm-fw" >> + >> DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" >> >> PLAT_SFX = "" >> >> >> >> -=-=-=-=-=-=-=-=-=-=-=- >> Links: You receive all messages sent to this group. >> View/Reply Online (#18422): https://lists.yoctoproject.org/g/meta-ti/message/18422 >> Mute This Topic: https://lists.yoctoproject.org/mt/111933183/4594561 >> Group Owner: meta-ti+owner@lists.yoctoproject.org >> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [s-anna@ti.com] >> -=-=-=-=-=-=-=-=-=-=-=- >> >
On 3/27/25 11:51, Ryan Eatmon wrote: > > > On 3/27/2025 11:45 AM, Suman Anna wrote: >> Hi Beleswar, >> >> On 3/27/25 04:23, Beleswar Padhi via lists.yoctoproject.org wrote: >>> Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked >>> up by the tisdk-core-bundle for the prebuilt binaries directory. >> >> The HSM firmware is only an example/demo firmware, and not a production HSM >> firmware. > > Should the recipe name reflect the demo nature? ti-hsm-demo-fw ? +1, the recipe name also indicates the nature clearly. regards Suman > > >> This is not clear when looking at this commit. Please revise your patch >> description and the SUMMARY to better reflect this. >> >> Hopefully, the same is captured as well in the commit that added this to the >> ti-linux-firmware repo. >> >> regards >> Suman >> >>> >>> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >>> --- >>> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ >>> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + >>> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ >>> 3 files changed, 33 insertions(+) >>> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> >>> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> new file mode 100644 >>> index 00000000..8b225421 >>> --- /dev/null >>> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> @@ -0,0 +1,28 @@ >>> +SUMMARY = "TI HSM Firmware" >>> + >>> +inherit deploy >>> + >>> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> + >>> +PACKAGE_ARCH = "${MACHINE_ARCH}" >>> + >>> +PV = "${TI_HSM_FW_VERSION}" >>> +PR = "${INC_PR}.0" >>> + >>> +SYSFW_SOC ?= "*" >>> +SYSFW_SOC:j721s2 = "j721s2" >>> +SYSFW_SOC:j784s4 = "j784s4" >>> + >>> +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" >>> + >>> +do_install() { >>> + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm >>> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} >>> ${D}${nonarch_base_libdir}/firmware/ti-hsm >>> +} >>> + >>> +do_deploy() { >>> + install -d ${DEPLOYDIR}/ti-hsm >>> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm >>> +} >>> + >>> +addtask deploy before do_build after do_compile >>> diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> index 0d912625..4e9c385c 100644 >>> --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" >>> CNM_WAVE521_FW_VERSION = "1.0.7" >>> TI_DM_FW_VERSION = "11.00.09" >>> TI_SYSFW_VERSION = "11.00.07" >>> +TI_HSM_FW_VERSION = "11.00.09" >>> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" >>> SRCREV = "${TI_LINUX_FW_SRCREV}" >>> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> index 41d4abdd..8a800193 100644 >>> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native >>> python3-pyyaml-native python3-jsonschema-n >>> DEPENDS:append:k3 = " ti-sci-fw" >>> DEPENDS:append:k3r5 = " ti-sci-fw" >>> +# HSM Firmware is only applicable for J721S2 & J784S4 devices >>> +DEPENDS:append:j721s2 = " ti-hsm-fw" >>> +DEPENDS:append:j784s4 = " ti-hsm-fw" >>> + >>> DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" >>> PLAT_SFX = "" >>> >>> >>> >>> -=-=-=-=-=-=-=-=-=-=-=- >>> Links: You receive all messages sent to this group. >>> View/Reply Online (#18422): >>> https://lists.yoctoproject.org/g/meta-ti/message/18422 >>> Mute This Topic: https://lists.yoctoproject.org/mt/111933183/4594561 >>> Group Owner: meta-ti+owner@lists.yoctoproject.org >>> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub [s-anna@ti.com] >>> -=-=-=-=-=-=-=-=-=-=-=- >>> >> >
On Thu, Mar 27, 2025 at 02:53:23PM +0530, Beleswar Padhi via lists.yoctoproject.org wrote: > Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked > up by the tisdk-core-bundle for the prebuilt binaries directory. > > Signed-off-by: Beleswar Padhi <b-padhi@ti.com> > --- > .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ > .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + > meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ > 3 files changed, 33 insertions(+) > create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > > diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > new file mode 100644 > index 00000000..8b225421 > --- /dev/null > +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > @@ -0,0 +1,28 @@ > +SUMMARY = "TI HSM Firmware" > + > +inherit deploy > + > +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc > + > +PACKAGE_ARCH = "${MACHINE_ARCH}" > + > +PV = "${TI_HSM_FW_VERSION}" > +PR = "${INC_PR}.0" > + > +SYSFW_SOC ?= "*" > +SYSFW_SOC:j721s2 = "j721s2" > +SYSFW_SOC:j784s4 = "j784s4" This variable is normally set by k3r5 machine configs and used for a different purpose. Re-using it here for another purpose may be confusing, should a new variable be used instead? Also, if the firmware is only applicable to j721s2 and j784s4, should there be a corresponding COMPATIBLE_MACHINE? > +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" What would happen if this gets pulled by other non compatible platforms and SYSFW_SOC is set to * above? > +do_install() { > + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm > + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm > +} > + > +do_deploy() { > + install -d ${DEPLOYDIR}/ti-hsm > + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm > +} > + > +addtask deploy before do_build after do_compile > diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > index 0d912625..4e9c385c 100644 > --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" > CNM_WAVE521_FW_VERSION = "1.0.7" > TI_DM_FW_VERSION = "11.00.09" > TI_SYSFW_VERSION = "11.00.07" > +TI_HSM_FW_VERSION = "11.00.09" > > TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" > SRCREV = "${TI_LINUX_FW_SRCREV}" > diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > index 41d4abdd..8a800193 100644 > --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n > DEPENDS:append:k3 = " ti-sci-fw" > DEPENDS:append:k3r5 = " ti-sci-fw" > > +# HSM Firmware is only applicable for J721S2 & J784S4 devices > +DEPENDS:append:j721s2 = " ti-hsm-fw" > +DEPENDS:append:j784s4 = " ti-hsm-fw" Why are these DEPENDS in U-boot? Is the firmware being packaged there? > DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" > > PLAT_SFX = "" > -- > 2.34.1
On 3/27/25 4:23 AM, Beleswar Padhi wrote: > Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked > up by the tisdk-core-bundle for the prebuilt binaries directory. > > Signed-off-by: Beleswar Padhi <b-padhi@ti.com> > --- > .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ > .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + > meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ > 3 files changed, 33 insertions(+) > create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > > diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > new file mode 100644 > index 00000000..8b225421 > --- /dev/null > +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > @@ -0,0 +1,28 @@ > +SUMMARY = "TI HSM Firmware" > + > +inherit deploy > + > +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc > + > +PACKAGE_ARCH = "${MACHINE_ARCH}" > + > +PV = "${TI_HSM_FW_VERSION}" > +PR = "${INC_PR}.0" > + > +SYSFW_SOC ?= "*" Was this supposed to be ""? Also, thinking on this, since these binaries have different names when deployed, do we really need this package to be different per machine? Why not have this recipe generate two packages, ti-hsm-fw-j721s2 ti-hsm-fw-j784s4 each containing the firmware for that SoC. Then in u-boot-ti.inc have: DEPENDS:append:j721s2 = " ti-hsm-fw-j721s2" DEPENDS:append:j784s4 = " ti-hsm-fw-j784s4" Then you can drop the PACKAGE_ARCH line above. I'm thinking about doing this for the other firmware. I'd like to keep removing machine dependent packages to push us closer to common rootfs images that work across machines. Andrew > +SYSFW_SOC:j721s2 = "j721s2" > +SYSFW_SOC:j784s4 = "j784s4" > + > +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" > + > +do_install() { > + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm > + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm > +} > + > +do_deploy() { > + install -d ${DEPLOYDIR}/ti-hsm > + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm > +} > + > +addtask deploy before do_build after do_compile > diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > index 0d912625..4e9c385c 100644 > --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" > CNM_WAVE521_FW_VERSION = "1.0.7" > TI_DM_FW_VERSION = "11.00.09" > TI_SYSFW_VERSION = "11.00.07" > +TI_HSM_FW_VERSION = "11.00.09" > > TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" > SRCREV = "${TI_LINUX_FW_SRCREV}" > diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > index 41d4abdd..8a800193 100644 > --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n > DEPENDS:append:k3 = " ti-sci-fw" > DEPENDS:append:k3r5 = " ti-sci-fw" > > +# HSM Firmware is only applicable for J721S2 & J784S4 devices > +DEPENDS:append:j721s2 = " ti-hsm-fw" > +DEPENDS:append:j784s4 = " ti-hsm-fw" > + > DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" > > PLAT_SFX = ""
Hi Suman, Ryan On 27/03/25 22:21, Ryan Eatmon wrote: > > > On 3/27/2025 11:45 AM, Suman Anna wrote: >> Hi Beleswar, >> >> On 3/27/25 04:23, Beleswar Padhi via lists.yoctoproject.org wrote: >>> Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked >>> up by the tisdk-core-bundle for the prebuilt binaries directory. >> >> The HSM firmware is only an example/demo firmware, and not a >> production HSM >> firmware. > > Should the recipe name reflect the demo nature? ti-hsm-demo-fw ? > > >> This is not clear when looking at this commit. Please revise your patch >> description and the SUMMARY to better reflect this. Will address this in the revision. Thanks, Beleswar >> >> Hopefully, the same is captured as well in the commit that added this >> to the >> ti-linux-firmware repo. >> >> regards >> Suman >> >>> >>> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >>> --- >>> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 >>> +++++++++++++++++++ >>> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + >>> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ >>> 3 files changed, 33 insertions(+) >>> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> >>> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> new file mode 100644 >>> index 00000000..8b225421 >>> --- /dev/null >>> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>> @@ -0,0 +1,28 @@ >>> +SUMMARY = "TI HSM Firmware" >>> + >>> +inherit deploy >>> + >>> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> + >>> +PACKAGE_ARCH = "${MACHINE_ARCH}" >>> + >>> +PV = "${TI_HSM_FW_VERSION}" >>> +PR = "${INC_PR}.0" >>> + >>> +SYSFW_SOC ?= "*" >>> +SYSFW_SOC:j721s2 = "j721s2" >>> +SYSFW_SOC:j784s4 = "j784s4" >>> + >>> +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" >>> + >>> +do_install() { >>> + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm >>> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} >>> ${D}${nonarch_base_libdir}/firmware/ti-hsm >>> +} >>> + >>> +do_deploy() { >>> + install -d ${DEPLOYDIR}/ti-hsm >>> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm >>> +} >>> + >>> +addtask deploy before do_build after do_compile >>> diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> index 0d912625..4e9c385c 100644 >>> --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>> @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" >>> CNM_WAVE521_FW_VERSION = "1.0.7" >>> TI_DM_FW_VERSION = "11.00.09" >>> TI_SYSFW_VERSION = "11.00.07" >>> +TI_HSM_FW_VERSION = "11.00.09" >>> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" >>> SRCREV = "${TI_LINUX_FW_SRCREV}" >>> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> index 41d4abdd..8a800193 100644 >>> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>> @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native >>> python3-pyyaml-native python3-jsonschema-n >>> DEPENDS:append:k3 = " ti-sci-fw" >>> DEPENDS:append:k3r5 = " ti-sci-fw" >>> +# HSM Firmware is only applicable for J721S2 & J784S4 devices >>> +DEPENDS:append:j721s2 = " ti-hsm-fw" >>> +DEPENDS:append:j784s4 = " ti-hsm-fw" >>> + >>> DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" >>> PLAT_SFX = "" >>> >>> >>> >>> -=-=-=-=-=-=-=-=-=-=-=- >>> Links: You receive all messages sent to this group. >>> View/Reply Online (#18422): >>> https://lists.yoctoproject.org/g/meta-ti/message/18422 >>> Mute This Topic: https://lists.yoctoproject.org/mt/111933183/4594561 >>> Group Owner: meta-ti+owner@lists.yoctoproject.org >>> Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub >>> [s-anna@ti.com] >>> -=-=-=-=-=-=-=-=-=-=-=- >>> >> >
Hi Denys, On 28/03/25 00:15, Denys Dmytriyenko wrote: > On Thu, Mar 27, 2025 at 02:53:23PM +0530, Beleswar Padhi via lists.yoctoproject.org wrote: >> Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked >> up by the tisdk-core-bundle for the prebuilt binaries directory. >> >> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >> --- >> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ >> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + >> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ >> 3 files changed, 33 insertions(+) >> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> >> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> new file mode 100644 >> index 00000000..8b225421 >> --- /dev/null >> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> @@ -0,0 +1,28 @@ >> +SUMMARY = "TI HSM Firmware" >> + >> +inherit deploy >> + >> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> + >> +PACKAGE_ARCH = "${MACHINE_ARCH}" >> + >> +PV = "${TI_HSM_FW_VERSION}" >> +PR = "${INC_PR}.0" >> + >> +SYSFW_SOC ?= "*" >> +SYSFW_SOC:j721s2 = "j721s2" >> +SYSFW_SOC:j784s4 = "j784s4" > This variable is normally set by k3r5 machine configs and used for a different > purpose. > > Re-using it here for another purpose may be confusing, should a new variable > be used instead? Sure we can have something like HSM_FW_SOC or so. > > Also, if the firmware is only applicable to j721s2 and j784s4, should there be > a corresponding COMPATIBLE_MACHINE? I put this ti-hsm-fw recipe as a depedency in the u-boot-ti.inc file for j721s2 and j784s4 boards. Does that not serve the same purpose as COMPATIBLE_MACHINE? Or am I missing something? > > >> +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" > What would happen if this gets pulled by other non compatible platforms and > SYSFW_SOC is set to * above? This should not be pulled by other platforms since we have the dependency in u-boot-ti.inc (correct me if I am wrong). If it does though, all the available HSM demo firmwares will be copied to that non-compatible platform. > > >> +do_install() { >> + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm >> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm >> +} >> + >> +do_deploy() { >> + install -d ${DEPLOYDIR}/ti-hsm >> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm >> +} >> + >> +addtask deploy before do_build after do_compile >> diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> index 0d912625..4e9c385c 100644 >> --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" >> CNM_WAVE521_FW_VERSION = "1.0.7" >> TI_DM_FW_VERSION = "11.00.09" >> TI_SYSFW_VERSION = "11.00.07" >> +TI_HSM_FW_VERSION = "11.00.09" >> >> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" >> SRCREV = "${TI_LINUX_FW_SRCREV}" >> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> index 41d4abdd..8a800193 100644 >> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n >> DEPENDS:append:k3 = " ti-sci-fw" >> DEPENDS:append:k3r5 = " ti-sci-fw" >> >> +# HSM Firmware is only applicable for J721S2 & J784S4 devices >> +DEPENDS:append:j721s2 = " ti-hsm-fw" >> +DEPENDS:append:j784s4 = " ti-hsm-fw" > Why are these DEPENDS in U-boot? Is the firmware being packaged there? Yes this firmware is packaged inside U-Boot (tispl.bin FIT image) and hence is a build time dependency. > > >> DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" >> >> PLAT_SFX = "" >> -- >> 2.34.1
Hi Andrew, On 28/03/25 00:19, Andrew Davis wrote: > On 3/27/25 4:23 AM, Beleswar Padhi wrote: >> Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked >> up by the tisdk-core-bundle for the prebuilt binaries directory. >> >> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >> --- >> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ >> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + >> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ >> 3 files changed, 33 insertions(+) >> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> >> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> new file mode 100644 >> index 00000000..8b225421 >> --- /dev/null >> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >> @@ -0,0 +1,28 @@ >> +SUMMARY = "TI HSM Firmware" >> + >> +inherit deploy >> + >> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> + >> +PACKAGE_ARCH = "${MACHINE_ARCH}" >> + >> +PV = "${TI_HSM_FW_VERSION}" >> +PR = "${INC_PR}.0" >> + >> +SYSFW_SOC ?= "*" > > Was this supposed to be ""? Hmm, this recipe is supposed to be built only for j721s2/j784s4 platforms. So ideally this should not be built for other platforms. But if it does, you're right; it's better to put it as an empty string to keep the package contents empty rather than copying everything. > > Also, thinking on this, since these binaries have different names > when deployed, do we really need this package to be different > per machine? Why not have this recipe generate two packages, > > ti-hsm-fw-j721s2 > ti-hsm-fw-j784s4 > > each containing the firmware for that SoC. Then in u-boot-ti.inc > have: > > DEPENDS:append:j721s2 = " ti-hsm-fw-j721s2" > DEPENDS:append:j784s4 = " ti-hsm-fw-j784s4" Sorry, I am confused. The HSM binaries have different name corresponding to each device. Do you wish to see one same package deployed in every machine which has all HSM binaries? Or do you wish to see different package deployed for every machine which have only the binaries it needs? If its the later, then this patch already serves that purpose, right? Thanks, Beleswar > > Then you can drop the PACKAGE_ARCH line above. I'm thinking about > doing this for the other firmware. I'd like to keep removing > machine dependent packages to push us closer to common rootfs > images that work across machines. > > Andrew > >> +SYSFW_SOC:j721s2 = "j721s2" >> +SYSFW_SOC:j784s4 = "j784s4" >> + >> +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" >> + >> +do_install() { >> + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm >> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} >> ${D}${nonarch_base_libdir}/firmware/ti-hsm >> +} >> + >> +do_deploy() { >> + install -d ${DEPLOYDIR}/ti-hsm >> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm >> +} >> + >> +addtask deploy before do_build after do_compile >> diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> index 0d912625..4e9c385c 100644 >> --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" >> CNM_WAVE521_FW_VERSION = "1.0.7" >> TI_DM_FW_VERSION = "11.00.09" >> TI_SYSFW_VERSION = "11.00.07" >> +TI_HSM_FW_VERSION = "11.00.09" >> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" >> SRCREV = "${TI_LINUX_FW_SRCREV}" >> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> index 41d4abdd..8a800193 100644 >> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >> @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native >> python3-pyyaml-native python3-jsonschema-n >> DEPENDS:append:k3 = " ti-sci-fw" >> DEPENDS:append:k3r5 = " ti-sci-fw" >> +# HSM Firmware is only applicable for J721S2 & J784S4 devices >> +DEPENDS:append:j721s2 = " ti-hsm-fw" >> +DEPENDS:append:j784s4 = " ti-hsm-fw" >> + >> DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" >> PLAT_SFX = ""
On Fri, Mar 28, 2025 at 10:20:08AM +0530, Beleswar Prasad Padhi wrote: > Hi Denys, > > On 28/03/25 00:15, Denys Dmytriyenko wrote: > >On Thu, Mar 27, 2025 at 02:53:23PM +0530, Beleswar Padhi via lists.yoctoproject.org wrote: > >>Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked > >>up by the tisdk-core-bundle for the prebuilt binaries directory. The commit message says the firmware only needs to be deployed for packaging into the SDK bundle. > >>Signed-off-by: Beleswar Padhi <b-padhi@ti.com> > >>--- > >> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ > >> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + > >> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ > >> 3 files changed, 33 insertions(+) > >> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > >> > >>diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > >>new file mode 100644 > >>index 00000000..8b225421 > >>--- /dev/null > >>+++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb > >>@@ -0,0 +1,28 @@ > >>+SUMMARY = "TI HSM Firmware" > >>+ > >>+inherit deploy > >>+ > >>+require recipes-bsp/ti-linux-fw/ti-linux-fw.inc > >>+ > >>+PACKAGE_ARCH = "${MACHINE_ARCH}" > >>+ > >>+PV = "${TI_HSM_FW_VERSION}" > >>+PR = "${INC_PR}.0" > >>+ > >>+SYSFW_SOC ?= "*" > >>+SYSFW_SOC:j721s2 = "j721s2" > >>+SYSFW_SOC:j784s4 = "j784s4" > >This variable is normally set by k3r5 machine configs and used for a different > >purpose. > > > >Re-using it here for another purpose may be confusing, should a new variable > >be used instead? > > > Sure we can have something like HSM_FW_SOC or so. > > > > >Also, if the firmware is only applicable to j721s2 and j784s4, should there be > >a corresponding COMPATIBLE_MACHINE? > > > I put this ti-hsm-fw recipe as a depedency in the u-boot-ti.inc file > for j721s2 and j784s4 boards. Does that not serve the same purpose > as COMPATIBLE_MACHINE? Or am I missing something? Not exactly the same - see below. > >>+HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" > >What would happen if this gets pulled by other non compatible platforms and > >SYSFW_SOC is set to * above? > > > This should not be pulled by other platforms since we have the > dependency in u-boot-ti.inc (correct me if I am wrong). If it does > though, all the available HSM demo firmwares will be copied to that > non-compatible platform. So, I was trying to understand how it is supposed to be used and how do you prevent incorrect usage. E.g. if someone accidentally pulls this package either directly or indirectly, what should be the behavior? 1. If you set COMPATIBLE_MACHINE in the recipe, any use by incompatible platform will result in a build failure 2. Alternatively, you could get corresponding FW images deployed and packaged for compatible platforms, but deploy/package nothing for incompatible ones w/o hard failure - in that case you want to avoid wildcards in the path/name and maybe do a conditional copy/install, in other places we sometimes do a "for" loop so it can be empty... 3. Or, as Andrew suggested, just package all FW images regardless of the platform and let build/runtime logic sort them out > >>+do_install() { > >>+ install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm > >>+ install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm > >>+} Here you intall the FW images into the rootfs to be used by the system, presumably the kernel? > >>+do_deploy() { > >>+ install -d ${DEPLOYDIR}/ti-hsm > >>+ install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm > >>+} Here you deploy them for SDK bundle (and U-boot packaging) > >>+addtask deploy before do_build after do_compile > >>diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > >>index 0d912625..4e9c385c 100644 > >>--- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > >>+++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc > >>@@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" > >> CNM_WAVE521_FW_VERSION = "1.0.7" > >> TI_DM_FW_VERSION = "11.00.09" > >> TI_SYSFW_VERSION = "11.00.07" > >>+TI_HSM_FW_VERSION = "11.00.09" > >> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" > >> SRCREV = "${TI_LINUX_FW_SRCREV}" > >>diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > >>index 41d4abdd..8a800193 100644 > >>--- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > >>+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc > >>@@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n > >> DEPENDS:append:k3 = " ti-sci-fw" > >> DEPENDS:append:k3r5 = " ti-sci-fw" > >>+# HSM Firmware is only applicable for J721S2 & J784S4 devices > >>+DEPENDS:append:j721s2 = " ti-hsm-fw" > >>+DEPENDS:append:j784s4 = " ti-hsm-fw" > >Why are these DEPENDS in U-boot? Is the firmware being packaged there? > > > Yes this firmware is packaged inside U-Boot (tispl.bin FIT image) > and hence is a build time dependency. First of all, that's not what the commit message above says. Second, if they get packaged into tispl.bin FIT image, why do you need to install them into the rootfs under /lib/firmware/ti-hsm? From the recipe it's not obvious and someone will try to add ti-hsm-fw package to the image...
Hi Denys, On 28/03/25 23:02, Denys Dmytriyenko wrote: > On Fri, Mar 28, 2025 at 10:20:08AM +0530, Beleswar Prasad Padhi wrote: >> Hi Denys, >> >> On 28/03/25 00:15, Denys Dmytriyenko wrote: >>> On Thu, Mar 27, 2025 at 02:53:23PM +0530, Beleswar Padhi via lists.yoctoproject.org wrote: >>>> Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked >>>> up by the tisdk-core-bundle for the prebuilt binaries directory. > The commit message says the firmware only needs to be deployed for packaging > into the SDK bundle. Will address in v2. > > >>>> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >>>> --- >>>> .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ >>>> .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + >>>> meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ >>>> 3 files changed, 33 insertions(+) >>>> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>>> >>>> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>>> new file mode 100644 >>>> index 00000000..8b225421 >>>> --- /dev/null >>>> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb >>>> @@ -0,0 +1,28 @@ >>>> +SUMMARY = "TI HSM Firmware" >>>> + >>>> +inherit deploy >>>> + >>>> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>>> + >>>> +PACKAGE_ARCH = "${MACHINE_ARCH}" >>>> + >>>> +PV = "${TI_HSM_FW_VERSION}" >>>> +PR = "${INC_PR}.0" >>>> + >>>> +SYSFW_SOC ?= "*" >>>> +SYSFW_SOC:j721s2 = "j721s2" >>>> +SYSFW_SOC:j784s4 = "j784s4" >>> This variable is normally set by k3r5 machine configs and used for a different >>> purpose. >>> >>> Re-using it here for another purpose may be confusing, should a new variable >>> be used instead? >> >> Sure we can have something like HSM_FW_SOC or so. >> >>> Also, if the firmware is only applicable to j721s2 and j784s4, should there be >>> a corresponding COMPATIBLE_MACHINE? >> >> I put this ti-hsm-fw recipe as a depedency in the u-boot-ti.inc file >> for j721s2 and j784s4 boards. Does that not serve the same purpose >> as COMPATIBLE_MACHINE? Or am I missing something? > Not exactly the same - see below. > > >>>> +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" >>> What would happen if this gets pulled by other non compatible platforms and >>> SYSFW_SOC is set to * above? >> >> This should not be pulled by other platforms since we have the >> dependency in u-boot-ti.inc (correct me if I am wrong). If it does >> though, all the available HSM demo firmwares will be copied to that >> non-compatible platform. > So, I was trying to understand how it is supposed to be used and how do you > prevent incorrect usage. E.g. if someone accidentally pulls this package > either directly or indirectly, what should be the behavior? > > 1. If you set COMPATIBLE_MACHINE in the recipe, any use by incompatible > platform will result in a build failure > > 2. Alternatively, you could get corresponding FW images deployed and packaged > for compatible platforms, but deploy/package nothing for incompatible ones > w/o hard failure - in that case you want to avoid wildcards in the path/name > and maybe do a conditional copy/install, in other places we sometimes do a > "for" loop so it can be empty... > > 3. Or, as Andrew suggested, just package all FW images regardless of the > platform and let build/runtime logic sort them out Thank you for helping with a detailed explanation. I understand it now. I will send a revision addressing this. I will use COMPATIBLE_MACHINE in the recipe. > > >>>> +do_install() { >>>> + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm >>>> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm >>>> +} > Here you intall the FW images into the rootfs to be used by the system, > presumably the kernel? Got it, we do not need that for this HSM firmware. > > >>>> +do_deploy() { >>>> + install -d ${DEPLOYDIR}/ti-hsm >>>> + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm >>>> +} > Here you deploy them for SDK bundle (and U-boot packaging) > > >>>> +addtask deploy before do_build after do_compile >>>> diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>>> index 0d912625..4e9c385c 100644 >>>> --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>>> +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc >>>> @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" >>>> CNM_WAVE521_FW_VERSION = "1.0.7" >>>> TI_DM_FW_VERSION = "11.00.09" >>>> TI_SYSFW_VERSION = "11.00.07" >>>> +TI_HSM_FW_VERSION = "11.00.09" >>>> TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" >>>> SRCREV = "${TI_LINUX_FW_SRCREV}" >>>> diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>>> index 41d4abdd..8a800193 100644 >>>> --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>>> +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc >>>> @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n >>>> DEPENDS:append:k3 = " ti-sci-fw" >>>> DEPENDS:append:k3r5 = " ti-sci-fw" >>>> +# HSM Firmware is only applicable for J721S2 & J784S4 devices >>>> +DEPENDS:append:j721s2 = " ti-hsm-fw" >>>> +DEPENDS:append:j784s4 = " ti-hsm-fw" >>> Why are these DEPENDS in U-boot? Is the firmware being packaged there? >> >> Yes this firmware is packaged inside U-Boot (tispl.bin FIT image) >> and hence is a build time dependency. > First of all, that's not what the commit message above says. > > Second, if they get packaged into tispl.bin FIT image, why do you need to > install them into the rootfs under /lib/firmware/ti-hsm? > > From the recipe it's not obvious and someone will try to add ti-hsm-fw package > to the image... > Thanks, I will address these comments in v2.
diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb new file mode 100644 index 00000000..8b225421 --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb @@ -0,0 +1,28 @@ +SUMMARY = "TI HSM Firmware" + +inherit deploy + +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +PV = "${TI_HSM_FW_VERSION}" +PR = "${INC_PR}.0" + +SYSFW_SOC ?= "*" +SYSFW_SOC:j721s2 = "j721s2" +SYSFW_SOC:j784s4 = "j784s4" + +HSM_BINARY = "hsm-demo-firmware-${SYSFW_SOC}*.bin" + +do_install() { + install -d ${D}${nonarch_base_libdir}/firmware/ti-hsm + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${D}${nonarch_base_libdir}/firmware/ti-hsm +} + +do_deploy() { + install -d ${DEPLOYDIR}/ti-hsm + install -m 644 ${S}/ti-hsm/${HSM_BINARY} ${DEPLOYDIR}/ti-hsm +} + +addtask deploy before do_build after do_compile diff --git a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc index 0d912625..4e9c385c 100644 --- a/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc +++ b/meta-ti-bsp/recipes-bsp/ti-linux-fw/ti-linux-fw.inc @@ -16,6 +16,7 @@ IMG_DEC_FW_VERSION = "1.0" CNM_WAVE521_FW_VERSION = "1.0.7" TI_DM_FW_VERSION = "11.00.09" TI_SYSFW_VERSION = "11.00.07" +TI_HSM_FW_VERSION = "11.00.09" TI_LINUX_FW_SRCREV ?= "27003b6bff61a55dd1fff2cc777e5e07b092b1f7" SRCREV = "${TI_LINUX_FW_SRCREV}" diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc index 41d4abdd..8a800193 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc @@ -40,6 +40,10 @@ DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-jsonschema-n DEPENDS:append:k3 = " ti-sci-fw" DEPENDS:append:k3r5 = " ti-sci-fw" +# HSM Firmware is only applicable for J721S2 & J784S4 devices +DEPENDS:append:j721s2 = " ti-hsm-fw" +DEPENDS:append:j784s4 = " ti-hsm-fw" + DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" PLAT_SFX = ""
Add a recipe to deploy the HSM firmware to the DEPLOYDIR, to be picked up by the tisdk-core-bundle for the prebuilt binaries directory. Signed-off-by: Beleswar Padhi <b-padhi@ti.com> --- .../recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb | 28 +++++++++++++++++++ .../recipes-bsp/ti-linux-fw/ti-linux-fw.inc | 1 + meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 4 +++ 3 files changed, 33 insertions(+) create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-fw_git.bb