- 
                Notifications
    
You must be signed in to change notification settings  - Fork 720
 
[nrf fromlist] soc: add ironside boot report #2752
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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| zephyr_library_sources_ifdef(CONFIG_SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT ironside_se_boot_report.c) | ||
| zephyr_include_directories(include) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| config SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT | ||
| bool "Nordic IRONside SE boot report" | ||
| default y if SOC_NRF54H20_CPUAPP | ||
| depends on SOC_NRF54H20_IRON | ||
| help | ||
| This option enables parsing of the Boot Report populated by Nordic IRONside SE. | ||
| 
     | 
||
| config SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT_MAGIC | ||
| hex | ||
| default 0x4d69546f | ||
| help | ||
| Constant used to check if an Nordic IRONside SE boot report has been written. | 
        
          
          
            63 changes: 63 additions & 0 deletions
          
          63 
        
  soc/nordic/nrf54h/ironside/se/include/nrf/ironside_se_boot_report.h
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| /* | ||
| * Copyright (c) 2025 Nordic Semiconductor ASA | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| 
     | 
||
| #ifndef ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ | ||
| #define ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ | ||
| 
     | 
||
| #include <stdint.h> | ||
| #include <stddef.h> | ||
| 
     | 
||
| #define IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /* Size in bytes */ | ||
| #define IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) /* Size in bytes */ | ||
| 
     | 
||
| /** @brief UICR error description contained in the boot report. */ | ||
| struct ironside_se_boot_report_uicr_error { | ||
| /** The type of error. A value of 0 indicates no error */ | ||
| uint32_t error_type; | ||
| /** Error descriptions specific to each type of UICR error */ | ||
| union { | ||
| /** RFU */ | ||
| struct { | ||
| uint32_t rfu[4]; | ||
| } rfu; | ||
| } description; | ||
| }; | ||
| 
     | 
||
| /** @brief IRONside boot report. */ | ||
| struct ironside_se_boot_report { | ||
| /** Magic value used to identify valid boot report */ | ||
| uint32_t magic; | ||
| /** Firmware version of IRONside SE. 8bit MAJOR.MINOR.PATCH.SEQNUM */ | ||
| uint32_t ironside_se_version_int; | ||
| /** Human readable extraversion of IRONside SE */ | ||
| char ironside_se_extraversion[12]; | ||
| /** Firmware version of IRONside SE recovery firmware. 8bit MAJOR.MINOR.PATCH.SEQNUM */ | ||
| uint32_t ironside_se_recovery_version_int; | ||
| /** Human readable extraversion of IRONside SE recovery firmware */ | ||
| char ironside_se_recovery_extraversion[12]; | ||
| /** Copy of SICR.UROT.UPDATE.STATUS.*/ | ||
| uint32_t ironside_update_status; | ||
| /** See @ref ironside_se_boot_report_uicr_error */ | ||
| struct ironside_se_boot_report_uicr_error uicr_error_description; | ||
| /** Data passed from booting local domain to local domain being booted */ | ||
| uint8_t local_domain_context[IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE]; | ||
| /** CSPRNG data */ | ||
| uint8_t random_data[IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE]; | ||
| /** Reserved for Future Use */ | ||
| uint32_t rfu[64]; | ||
| }; | ||
| 
     | 
||
| /** | ||
| * @brief Get a pointer to the IRONside boot report. | ||
| * | ||
| * @param[out] report Will be set to point to the IRONside boot report. | ||
| * | ||
| * @return non-negative value if success, negative value otherwise. | ||
| * @retval -EFAULT if the magic field in the report is incorrect. | ||
| * @retval -EINVAL if @ref report is NULL. | ||
| */ | ||
| int ironside_se_boot_report_get(const struct ironside_se_boot_report **report); | ||
| 
     | 
||
| #endif /* ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ */ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /* | ||
| * Copyright (c) 2025 Nordic Semiconductor ASA | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| 
     | 
||
| #include <errno.h> | ||
| #include <zephyr/devicetree.h> | ||
| #include <nrf/ironside_se_boot_report.h> | ||
| 
     | 
||
| #define IRONSIDE_SE_BOOT_REPORT_ADDR DT_REG_ADDR(DT_NODELABEL(cpuapp_ironside_se_boot_report)) | ||
| #define IRONSIDE_SE_BOOT_REPORT_MAGIC CONFIG_SOC_NRF54H20_IRONSIDE_SE_BOOT_REPORT_MAGIC | ||
| 
     | 
||
| int ironside_se_boot_report_get(const struct ironside_se_boot_report **report) | ||
| { | ||
| const struct ironside_se_boot_report *tmp_report = | ||
| (const struct ironside_se_boot_report *)IRONSIDE_SE_BOOT_REPORT_ADDR; | ||
| 
     | 
||
| if (tmp_report->magic != IRONSIDE_SE_BOOT_REPORT_MAGIC) { | ||
| return -EINVAL; | ||
| } | ||
| 
     | 
||
| *report = tmp_report; | ||
| 
     | 
||
| return 0; | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright (c) 2025 Nordic Semiconductor | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| 
     | 
||
| cmake_minimum_required(VERSION 3.20.0) | ||
| find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
| project(ironside_se_boot_report) | ||
| 
     | 
||
| FILE(GLOB app_sources src/*.c) | ||
| target_sources(app PRIVATE ${app_sources}) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Empty | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * Copyright (c) 2025 Nordic Semiconductor ASA | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| 
     | 
||
| #include <nrf/ironside_se_boot_report.h> | ||
| #include <stdio.h> | ||
| 
     | 
||
| int main(void) | ||
| { | ||
| int err; | ||
| const struct ironside_se_boot_report *report; | ||
| 
     | 
||
| err = ironside_se_boot_report_get(&report); | ||
| printf("err: %d\n", err); | ||
| printf("version: 0x%x\n", report->ironside_se_version_int); | ||
| printf("extraversion: %s\n", report->ironside_se_extraversion); | ||
| 
     | 
||
| return 0; | ||
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| common: | ||
| tags: | ||
| - drivers | ||
| - hwinfo | ||
| harness: console | ||
| 
     | 
||
| tests: | ||
| soc.nordic.ironside_se_boot_report: | ||
| harness_config: | ||
| type: multi_line | ||
| ordered: true | ||
| regex: | ||
| - "err: 0" | ||
| - "version: 0x([0-9a-fA-F]+)" | ||
| - "extraversion: ([0-9a-fA-F]+)" | ||
| platform_allow: | ||
| - nrf54h20dk/nrf54h20/cpuapp/iron | ||
| integration_platforms: | ||
| - nrf54h20dk/nrf54h20/cpuapp/iron | ||
                
      
                  hakonfam marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I intend to introduce a "memory map" DTS file that both APP and RAD use soon.
This is so that the app can send the correct vector table address to IRONside SE.
We need to make sure we don't conflict with each other more than necessary somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest your change goes in first, then I adapt to that. I need this for the random numbers anyway.