Message ID | 20250410103102.2984208-1-b-padhi@ti.com |
---|---|
State | Accepted |
Delegated to: | Ryan Eatmon |
Headers | show |
Series | [master/scarthgap,v2] ti-hsm-demo-fw: Add a recipe to export prebuilt HSM demo firmware | expand |
On Thu, Apr 10, 2025 at 04:01:02PM +0530, Beleswar Padhi via lists.yoctoproject.org wrote: > Add a recipe to deploy the HSM demo firmware to the DEPLOYDIR, to be > picked up by the tisdk-core-bundle for the prebuilt binaries directory. > This firmware is then further picked by U-Boot and packaged inside > tispl.bin FIT image for loading the HSM M4 core in applicable SoCs. > > Signed-off-by: Beleswar Padhi <b-padhi@ti.com> > --- > v2: Changelog: > 1. Added COMPATIBLE_MACHINE as j721s2|j784s4 for this recipe. > 2. Used ti-hsm-demo-fw throughout instead of ti-hsm-fw. > 3. Updated commit description to call out how the firmware will be used. > 4. Removed the do_install() task from the recipe as this firmware is not used in > the rootfs. > > Link to v1: > https://lore.kernel.org/all/20250327092323.1726839-1-b-padhi@ti.com/ > > Sorry for the delay, took some time to test this patch. Had issues with my > setup. > > .../ti-hsm-fw/ti-hsm-demo-fw_git.bb | 24 +++++++++++++++++++ > .../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, 29 insertions(+) > create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb > > diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb > new file mode 100644 > index 00000000..f6a7b43f > --- /dev/null > +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb > @@ -0,0 +1,24 @@ > +SUMMARY = "TI HSM demo Firmware" > + > +inherit deploy > + > +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc > + > +PACKAGE_ARCH = "${MACHINE_ARCH}" > + > +PV = "${TI_HSM_DEMO_FW_VERSION}" > +PR = "${INC_PR}.0" > + > +COMPATIBLE_MACHINE = "j721s2|j784s4" > + > +HSM_FW_SOC:j721s2 = "j721s2" > +HSM_FW_SOC:j784s4 = "j784s4" > + > +HSM_BINARY = "hsm-demo-firmware-${HSM_FW_SOC}*.bin" > + > +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 d69109f4..ba58747a 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_DEMO_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..3c56d8b2 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 Demo Firmware is only applicable for J721S2 & J784S4 devices > +DEPENDS:append:j721s2 = " ti-hsm-demo-fw" > +DEPENDS:append:j784s4 = " ti-hsm-demo-fw" While this is fine as it is, it kind of hardcodes HSM for these 2 platforms. I was wondering if it would be better to make it a PACKAGECONFIG the same way we already do with atf, optee, dm, and such, so it can be easily toggled? > DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" > > PLAT_SFX = "" > -- > 2.34.1
Hi Denys, On 10/04/25 22:13, Denys Dmytriyenko wrote: > On Thu, Apr 10, 2025 at 04:01:02PM +0530, Beleswar Padhi via lists.yoctoproject.org wrote: >> Add a recipe to deploy the HSM demo firmware to the DEPLOYDIR, to be >> picked up by the tisdk-core-bundle for the prebuilt binaries directory. >> This firmware is then further picked by U-Boot and packaged inside >> tispl.bin FIT image for loading the HSM M4 core in applicable SoCs. >> >> Signed-off-by: Beleswar Padhi <b-padhi@ti.com> >> --- >> v2: Changelog: >> 1. Added COMPATIBLE_MACHINE as j721s2|j784s4 for this recipe. >> 2. Used ti-hsm-demo-fw throughout instead of ti-hsm-fw. >> 3. Updated commit description to call out how the firmware will be used. >> 4. Removed the do_install() task from the recipe as this firmware is not used in >> the rootfs. >> >> Link to v1: >> https://lore.kernel.org/all/20250327092323.1726839-1-b-padhi@ti.com/ >> >> Sorry for the delay, took some time to test this patch. Had issues with my >> setup. >> >> .../ti-hsm-fw/ti-hsm-demo-fw_git.bb | 24 +++++++++++++++++++ >> .../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, 29 insertions(+) >> create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb >> >> diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb >> new file mode 100644 >> index 00000000..f6a7b43f >> --- /dev/null >> +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb >> @@ -0,0 +1,24 @@ >> +SUMMARY = "TI HSM demo Firmware" >> + >> +inherit deploy >> + >> +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc >> + >> +PACKAGE_ARCH = "${MACHINE_ARCH}" >> + >> +PV = "${TI_HSM_DEMO_FW_VERSION}" >> +PR = "${INC_PR}.0" >> + >> +COMPATIBLE_MACHINE = "j721s2|j784s4" >> + >> +HSM_FW_SOC:j721s2 = "j721s2" >> +HSM_FW_SOC:j784s4 = "j784s4" >> + >> +HSM_BINARY = "hsm-demo-firmware-${HSM_FW_SOC}*.bin" >> + >> +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 d69109f4..ba58747a 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_DEMO_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..3c56d8b2 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 Demo Firmware is only applicable for J721S2 & J784S4 devices >> +DEPENDS:append:j721s2 = " ti-hsm-demo-fw" >> +DEPENDS:append:j784s4 = " ti-hsm-demo-fw" > While this is fine as it is, it kind of hardcodes HSM for these 2 platforms. > > I was wondering if it would be better to make it a PACKAGECONFIG the same way > we already do with atf, optee, dm, and such, so it can be easily toggled? I was trying to keep HSM as close as possible to SYSFW (ti-sci-fw). There is no additional build commands needed for building U-Boot with HSM firmware, unlike for atf, optee, dm etc. So, please let me know if you have a preference to go with PACKAGECONFIG or as it is now. Thanks, Beleswar > > >> DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" >> >> PLAT_SFX = "" >> -- >> 2.34.1
diff --git a/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb new file mode 100644 index 00000000..f6a7b43f --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb @@ -0,0 +1,24 @@ +SUMMARY = "TI HSM demo Firmware" + +inherit deploy + +require recipes-bsp/ti-linux-fw/ti-linux-fw.inc + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +PV = "${TI_HSM_DEMO_FW_VERSION}" +PR = "${INC_PR}.0" + +COMPATIBLE_MACHINE = "j721s2|j784s4" + +HSM_FW_SOC:j721s2 = "j721s2" +HSM_FW_SOC:j784s4 = "j784s4" + +HSM_BINARY = "hsm-demo-firmware-${HSM_FW_SOC}*.bin" + +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 d69109f4..ba58747a 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_DEMO_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..3c56d8b2 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 Demo Firmware is only applicable for J721S2 & J784S4 devices +DEPENDS:append:j721s2 = " ti-hsm-demo-fw" +DEPENDS:append:j784s4 = " ti-hsm-demo-fw" + DM_FIRMWARE = "ipc_echo_testb_mcu1_0_release_strip.xer5f" PLAT_SFX = ""
Add a recipe to deploy the HSM demo firmware to the DEPLOYDIR, to be picked up by the tisdk-core-bundle for the prebuilt binaries directory. This firmware is then further picked by U-Boot and packaged inside tispl.bin FIT image for loading the HSM M4 core in applicable SoCs. Signed-off-by: Beleswar Padhi <b-padhi@ti.com> --- v2: Changelog: 1. Added COMPATIBLE_MACHINE as j721s2|j784s4 for this recipe. 2. Used ti-hsm-demo-fw throughout instead of ti-hsm-fw. 3. Updated commit description to call out how the firmware will be used. 4. Removed the do_install() task from the recipe as this firmware is not used in the rootfs. Link to v1: https://lore.kernel.org/all/20250327092323.1726839-1-b-padhi@ti.com/ Sorry for the delay, took some time to test this patch. Had issues with my setup. .../ti-hsm-fw/ti-hsm-demo-fw_git.bb | 24 +++++++++++++++++++ .../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, 29 insertions(+) create mode 100644 meta-ti-bsp/recipes-bsp/ti-hsm-fw/ti-hsm-demo-fw_git.bb