Skip to contentSkip to conversation

Fix K3 HS builds when external SECDEV is not provided

PATCH In review Denys Dmytriyenko 2 participants 5 messages Nov 2, 2022 – Nov 3, 2022

lore
Share & tools
lore
#0 lore raw

cover Fix K3 HS builds when external SECDEV is not provided

From: Denys Dmytriyenko <[email protected]>

Normally, SECDEV tools are provided externally to the build and pointed to by TI_SECURE_DEV_PKG_K3 variable. Recently changes were made to pull SECDEV tools during the build automatically and stage them for use, if TI_SECURE_DEV_PKG_K3 is not defined. Unfortunately, there were couple problems with the flow, fixed by this patchset.

Denys Dmytriyenko (2):
ti-k3-secdev: include ti-paths.inc
ti-sci-fw: use getVar() to check if TI_SECURE_DEV_PKG_K3 is defined

 recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb | 2 +-
 recipes-ti/secdev/ti-k3-secdev_git.bb  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 ti-k3-secdev: include ti-paths.inc

From: Denys Dmytriyenko <[email protected]>

Include ti-paths.inc so TI_K3_SECDEV_INSTALL_DIR_RECIPE gets defined and artifacts are installed in the correct location.

---
 recipes-ti/secdev/ti-k3-secdev_git.bb | 2 ++
 1 file changed, 2 insertions(+)
recipes-ti/secdev/ti-k3-secdev_git.bb +2 -0
index 28dbe9e..7196be9 100644
@@ -4,6 +4,8 @@ SECTION = "devel"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
 
+require recipes-ti/includes/ti-paths.inc
+
 # Native host tool only
 COMPATIBLE_MACHINE = "null"
 COMPATIBLE_MACHINE_class-native = "(.*)"
Signature · 1 line
2.7.4
Acked-by on v1 1/2
#2 lore raw

Re: [dunfell][PATCH 1/2] ti-k3-secdev: include ti-paths.inc

Quoted 16 lines · Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

Include ti-paths.inc so TI_K3_SECDEV_INSTALL_DIR_RECIPE gets defined and artifacts are installed in the correct location.

---
  recipes-ti/secdev/ti-k3-secdev_git.bb | 2 ++
  1 file changed, 2 insertions(+)
recipes-ti/secdev/ti-k3-secdev_git.bb +0 -0
index 28dbe9e..7196be9 100644

recipes-ti/secdev/ti-k3-secdev_git.bb SECTION = "devel" · line 8

Quoted 5 lines
recipes-ti/secdev/ti-k3-secdev_git.bb +2 -0
@@ -4,6 +4,8 @@ SECTION = "devel"
  LICENSE = "BSD-3-Clause"
  LIC_FILES_CHKSUM = "file://manifest/k3-secdev-0.2-manifest.html;md5=f632a78870cc64550078d7b3cbac0892"
 
+require recipes-ti/includes/ti-paths.inc
+

Seems like a rather big missing piece, how was this even working at all before?

I'm feeling there should be a better way to use the contents of -native packages without putting all their content into some hard-coded directory. I wrote all this in a hurry and just copied what the TI compilers were doing, might be good to revisit this whole patch for kirkstone/master..

Quoted 3 lines
recipes-ti/secdev/ti-k3-secdev_git.bb +0 -0
  # Native host tool only
  COMPATIBLE_MACHINE = "null"
  COMPATIBLE_MACHINE_class-native = "(.*)"
#3 lore raw

PATCH 2/2 ti-sci-fw: use getVar() to check if TI_SECURE_DEV_PKG_K3 is defined

In reply to Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

Otherwise undefined variable is returned literally as ${TI_SECURE_DEV_PKG_K3} and the condition won't work.

---
 recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb +1 -1
index 866cd7b..e5dcdd6 100644
@@ -20,7 +20,7 @@ COMPATIBLE_MACHINE_aarch64 = "null"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-TI_SECURE_DEV_PKG = "${@ '${TI_SECURE_DEV_PKG_K3}' or '${TI_K3_SECDEV_INSTALL_DIR}' }"
+TI_SECURE_DEV_PKG = "${@ d.getVar('TI_SECURE_DEV_PKG_K3') or '${TI_K3_SECDEV_INSTALL_DIR}' }"
 export TI_SECURE_DEV_PKG
 
 SYSFW_SOC ?= "unknown"
Signature · 1 line
2.7.4
Acked-by on v1 2/2
#4 lore raw

Re: [dunfell][PATCH 2/2] ti-sci-fw: use getVar() to check if TI_SECURE_DEV_PKG_K3 is defined

Quoted 16 lines · Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

Otherwise undefined variable is returned literally as ${TI_SECURE_DEV_PKG_K3} and the condition won't work.

---
  recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb +0 -0
index 866cd7b..e5dcdd6 100644

recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb COMPATIBLE_MACHINE_aarch64 = "null" · line 25

Quoted 7 lines
recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb +1 -1
@@ -20,7 +20,7 @@ COMPATIBLE_MACHINE_aarch64 = "null"
 
  PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-TI_SECURE_DEV_PKG = "${@ '${TI_SECURE_DEV_PKG_K3}' or '${TI_K3_SECDEV_INSTALL_DIR}' }"
+TI_SECURE_DEV_PKG = "${@ d.getVar('TI_SECURE_DEV_PKG_K3') or '${TI_K3_SECDEV_INSTALL_DIR}' }"
  export TI_SECURE_DEV_PKG
 

I remember +Randolph did exactly this in another spot in this same file[0]. Should we check this everywhere we have input env vars?

[0] https://patchwork.yoctoproject.org/project/ti/patch/[email protected]/

Quoted 1 line
recipes-bsp/ti-sci-fw/ti-sci-fw_git.bb +0 -0
  SYSFW_SOC ?= "unknown"