2026-10-29 · Wilber Zheng · Sources: Amlogic SDK aml-comp/uboot/fip/s7d/ and meta-meson/; Amlogic "Yocto SDK Enable Secureboot User Guide" rev 0.1 (T6D example, shared by SEI)
fip/s7d/generate-device-keys/gen_all_device_key.sh --rsa-size 4096 --rootkey-index 0 ...dv_scs_keys/:
rootrsa-0..3-priv.pem / -pub.pem (RSA 2048 or 4096, default 4096).level-1/2-rsa-priv.pem, level-3 keys per stage (bl30, bl31, bl32, bl33, bl40, kernel)..bin, 16 bytes).openssl genrsa, no passphrase); AES keys are raw binary.export_dv_scs_signing_keys.sh exports device-keys/ for signing. It does not include the root private keys.hash-device-rootcert-rsa.bin) is what goes into eFuse, because eFuse cannot hold the full key.fip/s7d/bin/efuse-gen.sh --enable-device-vendor-scs true --device-roothash ... -o pattern.efusepattern.efuse is a text list of U-Boot efuse_obj set/lock commands:
HASH_NORMAL_DEVICE_ROOTCERT, HASH_DFU_DEVICE_ROOTCERT: the root hash, then locked.FEAT_ENABLE_DEVICE_* (ROOT/LVL1/LVLX_PUBRSA_PROT, VENDOR_SIG, PROT, SCS_SIG).efuse_obj get / get_lock.scs feature, every release)device-keys/ and fw_arb.cfg to aml-comp/prebuilt/hosttools/aml-linux-scs/<soc>/<chipset>/. Only s4, sc2, t6d, t7 exist today; s7d must be added there and to SOC_FAMILY in aml-linux-scs-native_1.0.bb.DISTRO_FEATURES += "AVB scs".scs.cfg);bl33-level-3-rsa-priv.pem (SHA256_RSA4096);amlogic_scs_sign_whole_pkg.bash (from Aml_Linux_SCS_SignTool.zip) and outputs aml_upgrade_package_enc.img; the swupdate OTA package is signed too.pattern.efuse (irreversible).usb_password.bin (vendor-keytool gen-usb-passwd from DVUK + chip ID), then adnl_burn_pkg -p aml_upgrade_package_enc.img -k usb_password.bin.| Option | Effect | Cost |
|---|---|---|
| Signature check (root hash + enable bits) | Only firmware signed with our keys boots | Firmware content is not hidden. No secret goes to SEI. |
| DVGK / DVUK | Firmware encrypted; only chips with the key can decrypt | SEI's pattern file carries secret keys |
| USB / DIF password | USB burning / debug port needs a per-unit password | Rework and reflash need a per-unit password |
OptiSigns (offline, once) SEI (mass production)
┌─────────────────────────────────────────┐
│ 1. gen_all_device_key.sh │
│ 4 root RSA-4096 key pairs (PEM) │
│ + lower-level signing keys (PEM) │
│ + DVGK / DVUK AES-128 (.bin) │
└───────────────┬─────────────────────────┘
│
┌───────────┴──────────────┐
▼ ▼
┌──────────────────────┐ ┌──────────────────────────────────────┐
│ 2. Root cert │ │ 4. Sign firmware (every release) │
│ 4 root public keys │ │ a. export device-keys (no root key) │
│ → SHA-256 (32 B) │ │ + fw_arb.cfg into SDK │
└─────────┬────────────┘ │ aml-linux-scs/ (add s7d) │
▼ │ b. DISTRO_FEATURES += "AVB scs" │
┌──────────────────────┐ │ c. build: signed u-boot; │
│ 3. efuse-gen.sh │ │ vbmeta/recovery signed │
│ pattern.efuse: │ │ (SHA256_RSA4096) │
│ root hash + enable │ │ d. amlogic_scs_sign_whole_pkg.bash │
│ bits (no secrets) │ │ → aml_upgrade_package_enc.img │
└─────────┬────────────┘ └──────────────────┬───────────────────┘
│ │
└──────────────► to SEI ◄──────────┘
│
▼
┌──────────────────────────────┐
│ 5. Burn signed firmware │
│ 6. Burn pattern.efuse │
│ (irreversible) │
└──────────────┬───────────────┘
▼
┌──────────────────────────────┐
│ Boot: ROM hashes root cert, │
│ compares with eFuse, then │
│ verifies each stage's sig. │
│ Unsigned firmware won't boot │
└──────────────────────────────┘
Key storage: root keys encrypted, offline, 2 copies.
Signing keys in GCP Secret Manager, pulled only to sign.
From Frank's draft mail to Amlogic. The names he uses exist in the SDK: CONFIG_AML_SIGNED_UBOOT in fip/s7d/build.sh (line 816 calls device-vendor-scs-signing.sh), and binary-tool/acpu-imagetool has --cmd-signpipe-device-root / -lvl1 / -lvl2 / -bl30..-lvl3.
| Amlogic standard | Frank | |
|---|---|---|
| Where to sign | Yocto scs: signed u-boot + whole package → aml_upgrade_package_enc.img | u-boot build only (CONFIG_AML_SIGNED_UBOOT=y → device-vendor-scs-signing.sh); no Yocto scs |
| Private keys | PEM files from openssl | All RSA-4096 in Google Cloud KMS, not exportable; acpu-imagetool --cmd-signpipe-* calls KMS; no key file exists |
| OS verification | vbmeta/recovery signed with bootloader level-3 key | Keep our own AVB key, as today |
| eFuse | All 6 FEAT_ENABLE_DEVICE_* bits | Only what is needed; ask which bits are optional |
| Encryption / passwords | Optional | Prefer none (no USB / debug password) unless Amlogic recommends |
OptiSigns SEI (mass production)
┌─────────────────────────────────────────┐
│ 1. Keys in Google Cloud KMS (RSA-4096) │
│ root + lower-level keys │
│ not exportable; export public keys │
└───────────────┬─────────────────────────┘
│
┌───────────┴──────────────┐
▼ ▼
┌──────────────────────┐ ┌──────────────────────────────────────┐
│ 2. Root cert from │ │ 4. Sign bootloader (every release) │
│ root public keys │ │ u-boot build │
│ → SHA-256 (32 B) │ │ CONFIG_AML_SIGNED_UBOOT=y │
│ (tool: open Q6) │ │ → device-vendor-scs-signing.sh │
└─────────┬────────────┘ │ → acpu-imagetool --cmd-signpipe-* │
▼ │ → KMS signs → signed bootloader │
┌──────────────────────┐ ├──────────────────────────────────────┤
│ 3. efuse-gen.sh │ │ 5. OS: kernel/system via AVB │
│ pattern.efuse: │ │ with our own AVB key (as today) │
│ root hash + minimum │ │ no Yocto scs, no encrypted package │
│ bits (open Q3) │ │ │
└─────────┬────────────┘ └──────────────────┬───────────────────┘
│ │
└──────────────► to SEI ◄──────────┘
│
▼
┌──────────────────────────────┐
│ 6. Burn signed firmware │
│ 7. Burn pattern.efuse │
│ (irreversible) │
└──────────────┬───────────────┘
▼
┌──────────────────────────────┐
│ Boot: ROM checks root hash → │
│ verifies signed bootloader → │
│ u-boot verifies vbmeta with │
│ our AVB key (open Q5) │
└──────────────────────────────┘
scs feature?..._PUBRSA_PROT, USB auth, debug-port lock)?--cmd-signpipe-*: full data or SHA-256 hash? RSA-PSS (SHA-256, 32-byte salt) or PKCS#1 v1.5? What output format?add-device-keys-bl33.sh replace the AVB key u-boot trusts?gen_all_device_key.sh creates keys locally with openssl, but our keys are generated in Cloud KMS and cannot be exported. Can we build the root cert, root hash and pattern.efuse from the public keys only, and sign the lower-level certs through --cmd-signpipe-device-root / -lvl1 / -lvl2? Which tool and options?