<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=IMX93%3A_Yocto_Linux%3A_Secure_Boot</id>
	<title>IMX93: Yocto Linux: Secure Boot - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=IMX93%3A_Yocto_Linux%3A_Secure_Boot"/>
	<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=IMX93:_Yocto_Linux:_Secure_Boot&amp;action=history"/>
	<updated>2026-04-15T01:57:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://www.mediawiki.compulab.com/w/index.php?title=IMX93:_Yocto_Linux:_Secure_Boot&amp;diff=5749&amp;oldid=prev</id>
		<title>Igor: Created page with &quot;= Enabling AHAB Secure Boot on iMX93 based products =  == Prepare Yocto Sources ==  https://github.com/compulab-yokneam/meta-bsp-imx9/blob/scarthgap/README.md == Install CST =...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=IMX93:_Yocto_Linux:_Secure_Boot&amp;diff=5749&amp;oldid=prev"/>
		<updated>2026-02-19T14:22:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Enabling AHAB Secure Boot on iMX93 based products =  == Prepare Yocto Sources ==  https://github.com/compulab-yokneam/meta-bsp-imx9/blob/scarthgap/README.md == Install CST =...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Enabling AHAB Secure Boot on iMX93 based products =&lt;br /&gt;
&lt;br /&gt;
== Prepare Yocto Sources ==&lt;br /&gt;
&lt;br /&gt;
https://github.com/compulab-yokneam/meta-bsp-imx9/blob/scarthgap/README.md&lt;br /&gt;
== Install CST ==&lt;br /&gt;
The NXP Code Signing Tool (CST) cannot be downloaded automatically by Yocto due to NXP licensing requirements. &lt;br /&gt;
&lt;br /&gt;
# '''Download CST:''' Manually download the latest version of the CST from the [https://www.nxp.com/search?keyword=cst%2520tools&amp;amp;start=0 NXP CST Download Page]&lt;br /&gt;
# '''Run Setup Script:''' Use the automated setup script to install CST, generate keys, and configure Yocto:&lt;br /&gt;
&lt;br /&gt;
 bash &amp;lt;(curl -sL https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx9/refs/heads/scarthgap/scripts/setup-secure-boot.sh) /opt/NXP/cst ~/Downloads/cst-4.0.1.tgz 4.0.1&lt;br /&gt;
&lt;br /&gt;
'''Add Security Layer and Build:'''&lt;br /&gt;
 bitbake imx-boot-signature&lt;br /&gt;
&lt;br /&gt;
boot e.g.:&lt;br /&gt;
 sudo uuu $BBPATH/tmp/deploy/images/$MACHINE/signed-imx-boot-$MACHINE-sd.bin-flash_singleboot&lt;br /&gt;
&lt;br /&gt;
run:&lt;br /&gt;
 ahab_status&lt;br /&gt;
&lt;br /&gt;
You will see &lt;br /&gt;
IND - 0xFA (ELE_BAD_KEY_HASH_FAILURE_IND); because when the i.MX93 ROM/ELE verifies a signed image, it compares its hash to the value stored in the '''Hash Fuses''' and since you haven’t burned them yet, they are set to factory default state and the hash in your image does not match them&lt;br /&gt;
== Fusing the SRK Hash and Advancing the Lifecycle ==&lt;br /&gt;
This phase makes the Secure Boot permanent on the device. &lt;br /&gt;
* Based on https://github.com/nxp-imx/uboot-imx/blob/lf_v2025.04/doc/imx/ahab/guides/mx8ulp_9x_secure_boot.txt#L395 &lt;br /&gt;
* '''⚠️ WARNING: These steps are irreversible. If your keys are lost or incorrect, the board will be permanently bricked.&lt;br /&gt;
&lt;br /&gt;
Fuse the SRK Hash:''' Fuse the hash of your generated public keys (Super Root Keys) into the device fuses. This tells the device’s hardware (the ELE) which key to trust for authentication. &lt;br /&gt;
&lt;br /&gt;
a. '''Generate Fuse Script:''' Inspect the fuse data binary:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /opt/NXP/cst/cst-4.0.1/crts&lt;br /&gt;
od -t x4 SRK_1_2_3_4_fuse.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
b. For parsing convenience use generate_fuses.py on the fuse binary to generate the fusion commands:&lt;br /&gt;
 od -t x4 /opt/NXP/cst/cst-4.0.1/crts/SRK_1_2_3_4_fuse.bin| python3 &amp;lt;(curl -fsSL https://raw.githubusercontent.com/compulab-yokneam/meta-bsp-imx9/refs/heads/scarthgap/Documentation/generate_fuses.py)&lt;br /&gt;
&lt;br /&gt;
c. '''Advance Lifecycle:''' After the SRK hash is fused, advance the device lifecycle from “OEM Open” to “OEM Closed” using the U-Boot command:&lt;br /&gt;
 ahab_close&lt;br /&gt;
&lt;br /&gt;
= Signing a kernel image to extend the '''Root of Trust''' after the OEM is closed. =&lt;br /&gt;
&lt;br /&gt;
'''Security Scope:''' simply booting a signed image is '''not sufficient for full security certification'''; additional steps like disabling the U-Boot CLI and securing the rootfs boot partition are required&lt;br /&gt;
&lt;br /&gt;
== Create the Image Container ==&lt;br /&gt;
&lt;br /&gt;
assuming that you cloned https://github.com/compulab-yokneam/meta-bsp-imx9/blob/scarthgap/ for secure boot&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd $BBPATH/tmp/deploy/images/$MACHINE&lt;br /&gt;
./mkimage_imx8 -soc IMX9 -c -ap path/to/Image a55 0x80400000 --data path/to/dtb a55 0x83000000 -out flash.bin&lt;br /&gt;
mv flash.bin flash_os.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sign the Image ==&lt;br /&gt;
&lt;br /&gt;
Use the '''NXP Code Signing Tool (CST)''' to sign the container: - Download the Command Sequence File (CSF) template:&lt;br /&gt;
 wget https://raw.githubusercontent.com/nxp-imx/uboot-imx/refs/heads/lf_v2024.04/doc/imx/ahab/csf_examples/csf_linux_img.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Update the paths''' inside csf_linux_img.txt to point to your specific '''SRK (Super Root Key)''' files.&lt;br /&gt;
* Execute the signing command e.g.:&lt;br /&gt;
 /opt/NXP/cst/cst-4.0.1/linux64/bin/cst -i csf_linux_img.txt -o os_cntr_signed.bin&lt;br /&gt;
&lt;br /&gt;
copy os_cntr_signed.bin to the target’s boot partition (1) of the bootable media&lt;br /&gt;
&lt;br /&gt;
== Verify in U-Boot ==&lt;br /&gt;
&lt;br /&gt;
obtain the latest boot logic from : https://github.com/compulab-yokneam/u-boot-compulab/commit/42a7661322af4e44294e304165c7ca532264391d this can be done by building :&lt;br /&gt;
 bitbake imx-boot&lt;br /&gt;
&lt;br /&gt;
on the target: - Load the image from the MMC:&lt;br /&gt;
 load mmc $mmcdev:1 $cntr_addr os_cntr_signed.bin&lt;br /&gt;
&lt;br /&gt;
* Authenticate the container:&lt;br /&gt;
 auth_cntr $cntr_addr&lt;br /&gt;
&lt;br /&gt;
* if no error shows you can proceed with:&lt;br /&gt;
 boot&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Yocto]]&lt;br /&gt;
[[Category:MCM-iMX93]]&lt;br /&gt;
[[Category:UCM-iMX93]]&lt;br /&gt;
[[Category:IOT-LINK]]&lt;/div&gt;</summary>
		<author><name>Igor</name></author>
		
	</entry>
</feed>