Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "suit: Add nRF9280 support (#151)" #161

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions ncs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ config SSF_SUIT_SERVICE_ENABLED

config SUIT_ENVELOPE_TEMPLATE_FILENAME
string "Path to the envelope template"
default "app_envelope.yaml.jinja2" if (SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF9230_ENGB_CPUAPP) && !SUIT_RECOVERY
default "rad_envelope.yaml.jinja2" if (SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPURAD) && !SUIT_RECOVERY
default "app_recovery_local_envelope.yaml.jinja2" if (SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF9230_ENGB_CPUAPP) && SUIT_RECOVERY
default "rad_recovery_envelope.yaml.jinja2" if (SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPURAD) && SUIT_RECOVERY
default "app_envelope.yaml.jinja2" if SOC_NRF54H20_CPUAPP_COMMON && !SUIT_RECOVERY
default "rad_envelope.yaml.jinja2" if SOC_NRF54H20_CPURAD_COMMON && !SUIT_RECOVERY
default "app_recovery_local_envelope.yaml.jinja2" if SOC_NRF54H20_CPUAPP_COMMON && SUIT_RECOVERY
default "rad_recovery_envelope.yaml.jinja2" if SOC_NRF54H20_CPURAD_COMMON && SUIT_RECOVERY

config SUIT_ENVELOPE_TARGET
string "Target name inside the envelope templates"
default "application" if (SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF9230_ENGB_CPUAPP) && !SUIT_RECOVERY
default "radio" if (SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPURAD) && !SUIT_RECOVERY
default "app_recovery" if (SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF9230_ENGB_CPUAPP) && SUIT_RECOVERY
default "rad_recovery" if (SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPURAD) && SUIT_RECOVERY
default "application" if SOC_NRF54H20_CPUAPP_COMMON && !SUIT_RECOVERY
default "radio" if SOC_NRF54H20_CPURAD_COMMON && !SUIT_RECOVERY
default "app_recovery_img" if SOC_NRF54H20_CPUAPP_COMMON && SUIT_RECOVERY
default "rad_recovery" if SOC_NRF54H20_CPURAD_COMMON && SUIT_RECOVERY

config SUIT_ENVELOPE_OUTPUT_ARTIFACT
string "Name of the output merged artifact"
Expand All @@ -32,7 +32,7 @@ config SUIT_RECOVERY

config SUIT_LOCAL_ENVELOPE_GENERATE
bool "Generate local envelope"
default y if SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPUAPP || SOC_NRF9230_ENGB_CPURAD
default y if SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF54H20_CPURAD_COMMON

config SUIT_DFU_CACHE_EXTRACT_IMAGE
bool "Extract firmware image to DFU cache"
Expand All @@ -53,9 +53,9 @@ config SUIT_DFU_CACHE_EXTRACT_IMAGE_PARTITION

config SUIT_DFU_CACHE_EXTRACT_IMAGE_URI
string "The URI used as key for the image in the DFU cache"
default "cache://application.bin" if (SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF9230_ENGB_CPUAPP) && !SUIT_RECOVERY
default "cache://radio.bin" if (SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPURAD) && !SUIT_RECOVERY
default "cache://app_recovery.bin" if (SOC_NRF54H20_CPUAPP_COMMON || SOC_NRF9230_ENGB_CPUAPP) && SUIT_RECOVERY
default "cache://rad_recovery.bin" if (SOC_NRF54H20_CPURAD_COMMON || SOC_NRF9230_ENGB_CPURAD) && SUIT_RECOVERY
default "cache://application.bin" if SOC_NRF54H20_CPUAPP_COMMON && !SUIT_RECOVERY
default "cache://radio.bin" if SOC_NRF54H20_CPURAD_COMMON && !SUIT_RECOVERY
default "cache://app_recovery.bin" if SOC_NRF54H20_CPUAPP_COMMON && SUIT_RECOVERY
default "cache://rad_recovery.bin" if SOC_NRF54H20_CPURAD_COMMON && SUIT_RECOVERY

endif # SUIT_DFU_CACHE_EXTRACT_IMAGE
8 changes: 0 additions & 8 deletions ncs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,6 @@ def get_absolute_address(node, use_offset: bool = True):
default=None,
help="Path to KConfig file",
)
cmd_storage_arg_parser.add_argument(
"--soc",
required=False,
type=str,
default="nrf54h20",
help="SoC device (nrf54h20 or nrf9280)",
)

cmd_update_arg_parser = subparsers.add_parser(
UPDATE_CMD, help="Generate files needed for Secure Domain update", parents=[parent_parser]
Expand Down Expand Up @@ -291,7 +284,6 @@ def get_absolute_address(node, use_offset: bool = True):
storage_output_directory=arguments.storage_output_directory,
storage_address=arguments.storage_address,
config_file=arguments.config_file,
soc=arguments.soc,
)
elif arguments.command == UPDATE_CMD:
ImageCreator.create_files_for_update(
Expand Down
129 changes: 2 additions & 127 deletions suit_generator/cmd_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,46 +167,6 @@ class EnvelopeStorage:
"class_name": "nRF54H20_sys",
"role": ManifestRole.SEC_SYSCTRL,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sample_root",
"role": ManifestRole.APP_ROOT,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sample_app",
"role": ManifestRole.APP_LOCAL_1,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sample_app_recovery",
"role": ManifestRole.APP_RECOVERY,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sample_rad",
"role": ManifestRole.RAD_LOCAL_1,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sample_rad_recovery",
"role": ManifestRole.RAD_RECOVERY,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_nordic_top",
"role": ManifestRole.SEC_TOP,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sec",
"role": ManifestRole.SEC_SDFW,
},
{
"vendor_name": "nordicsemi.com",
"class_name": "nRF9280_sys",
"role": ManifestRole.SEC_SYSCTRL,
},
]

def __init__(self, base_address: int, load_defaults=True, kconfig=None):
Expand Down Expand Up @@ -313,9 +273,7 @@ def add_envelope(self, envelope: SuitEnvelope):
raise GeneratorError(f"Unable to find slot for manifest with class id {class_id.hex()}")

if slot[1] < len(envelope_bytes):
raise GeneratorError(
f"Unable to fit manifest with class id {class_id.hex()} ({len(envelope_bytes)} > {slot[1]})"
)
raise GeneratorError(f"Unable to fit manifest with class id ({len(class_id.hex())} > {slot})")

if role in self._envelopes.keys():
raise GeneratorError(f"Manifest with role {role} already added")
Expand Down Expand Up @@ -429,79 +387,6 @@ class EnvelopeStorageNrf54h20(EnvelopeStorage):
]


class EnvelopeStorageNrf9280(EnvelopeStorage):
"""Class generating SUIT storage binary in upcoming format."""

_LAYOUT = [
{
"role": ManifestRole.SEC_TOP,
"offset": 4096,
"size": 1536,
"domain": ManifestDomain.SECURE,
},
{
"role": ManifestRole.SEC_SDFW,
"offset": 2048,
"size": 1024,
"domain": ManifestDomain.SECURE,
},
{
"role": ManifestRole.SEC_SYSCTRL,
"offset": 3072,
"size": 1024,
"domain": ManifestDomain.SECURE,
},
{
"role": ManifestRole.RAD_RECOVERY,
"offset": 8192 + 1024 * 1,
"size": 1024,
"domain": ManifestDomain.RADIO,
},
{
"role": ManifestRole.RAD_LOCAL_1,
"offset": 8192 + 1024 * 2,
"size": 1024,
"domain": ManifestDomain.RADIO,
},
{
"role": ManifestRole.RAD_LOCAL_2,
"offset": 8192 + 1024 * 3,
"size": 1024,
"domain": ManifestDomain.RADIO,
},
{
"role": ManifestRole.APP_ROOT,
"offset": 12288 + 1024 * 1,
"size": 2048,
"domain": ManifestDomain.APPLICATION,
},
{
"role": ManifestRole.APP_RECOVERY,
"offset": 12288 + 1024 * 3,
"size": 2048,
"domain": ManifestDomain.APPLICATION,
},
{
"role": ManifestRole.APP_LOCAL_1,
"offset": 12288 + 1024 * 5,
"size": 1024,
"domain": ManifestDomain.APPLICATION,
},
{
"role": ManifestRole.APP_LOCAL_2,
"offset": 12288 + 1024 * 6,
"size": 1024,
"domain": ManifestDomain.APPLICATION,
},
{
"role": ManifestRole.APP_LOCAL_3,
"offset": 12288 + 1024 * 7,
"size": 1024,
"domain": ManifestDomain.APPLICATION,
},
]


class ImageCreator:
"""Helper class for extracting data from SUIT envelope and creating hex files."""

Expand Down Expand Up @@ -561,15 +446,8 @@ def _create_suit_storage_files_for_boot(
storage_address: int,
dir_name: str,
config_file: str,
soc: str = "nrf54h20",
) -> None:
if soc == "nrf54h20":
storage = EnvelopeStorageNrf54h20(storage_address, kconfig=config_file)
elif soc == "nrf9280":
storage = EnvelopeStorageNrf9280(storage_address, kconfig=config_file)
else:
raise GeneratorError(f"Unknown soc: {soc}")

storage = EnvelopeStorageNrf54h20(storage_address, kconfig=config_file)
for envelope in envelopes:
storage.add_envelope(envelope)

Expand Down Expand Up @@ -609,15 +487,13 @@ def create_files_for_boot(
storage_output_directory: str,
storage_address: int,
config_file: str | None,
soc: str = "nrf54h20",
) -> None:
"""Create storage and payload hex files allowing boot execution path.

:param input_files: file paths to SUIT envelope
:param storage_output_directory: directory path to store hex files with SUIT storage contents
:param storage_address: address of SUIT storage
:param config_file: path to KConfig file containing MPI settings
:param soc: soc in use, nrf54h20 or nrf9280
"""
try:
envelopes = []
Expand All @@ -633,7 +509,6 @@ def create_files_for_boot(
storage_address,
storage_output_directory,
config_file,
soc,
)
except FileNotFoundError as error:
raise GeneratorError(error)
Expand Down
Loading