Skip to content

GFW TrustZone support.#772

Open
Ricardo Casallas (rcasallas-silabs) wants to merge 1 commit intorelease_2.8-1.5from
feature/provision_tz_support
Open

GFW TrustZone support.#772
Ricardo Casallas (rcasallas-silabs) wants to merge 1 commit intorelease_2.8-1.5from
feature/provision_tz_support

Conversation

@rcasallas-silabs
Copy link
Contributor

Summary

Adds support for the Generator Firware (GFW) TrustZone images.

Related issues

Testing

  • Matter Extension Lighting-app TZ example built, provisioned, and commissioned in BRD4187C.

Readability checklist

The checklist below will help the reviewer finish PR review in time and keep the
code readable:

  • PR title is
    descriptive
  • Apply the
    “When in Rome…”
    rule (coding style)
  • PR size is short
  • Try to avoid "squashing" and "force-update" in commit history
  • CI time didn't increase

See: Pull Request Guidelines

Copilot AI review requested due to automatic review settings December 10, 2025 14:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Generator Firmware (GFW) TrustZone images by preventing NVM3 end address configuration in TrustZone non-secure contexts. The change ensures that setNvm3End() is only called when building with the provision generator in secure or non-TrustZone environments, as this operation requires secure privileges.

  • Modified preprocessor condition to exclude setNvm3End() call in TrustZone non-secure builds
  • Ensures NVM3 configuration is only performed in privileged contexts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

return GFW_Flash_ErasePage(addr) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR;
#elif defined(_SILICON_LABS_32B_SERIES_2)
MSC_ErasePage((uint32_t *) addr);
return MSC_ErasePage((uint32_t *) addr) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value logic appears inverted. MSC_ErasePage typically returns 0 (msc_Return_OK) on success, so a successful call would incorrectly return CHIP_ERROR_INTERNAL. The ternary condition should be inverted to match the GFW pattern or the MSC function's actual return convention should be verified.

Copilot uses AI. Check for mistakes.
return GFW_Flash_WriteWord(addr, data, size) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR;
#elif defined(_SILICON_LABS_32B_SERIES_2)
MSC_WriteWord((uint32_t *) addr, data, size);
return MSC_WriteWord((uint32_t *) addr, data, size) ? CHIP_ERROR_INTERNAL : CHIP_NO_ERROR;
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value logic appears inverted. MSC_WriteWord typically returns 0 (msc_Return_OK) on success, so a successful call would incorrectly return CHIP_ERROR_INTERNAL. The ternary condition should be inverted to match the GFW pattern or the MSC function's actual return convention should be verified.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@Sarthak-Shaha sarthak shaha (Sarthak-Shaha) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add prefixe to PR title and tags,
perhaps [SL-ONLY] or [SL-UP] ?


#endif // (defined(SL_MATTER_RGB_LED_ENABLED) && SL_MATTER_RGB_LED_ENABLED == 1)
}
#endif
Copy link
Contributor

@Sarthak-Shaha sarthak shaha (Sarthak-Shaha) Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif //ENABLE_WSTK_LEDS

nit

return CHIP_NO_ERROR;
#else
return CHIP_ERROR_NOT_IMPLEMENTED;
#endif
Copy link
Contributor

@Sarthak-Shaha sarthak shaha (Sarthak-Shaha) Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif //defined(SL_PROVISION_GENERATOR) && defined(SL_TRUSTZONE_NONSECURE)

nit

return CHIP_NO_ERROR;
#else
return CHIP_ERROR_NOT_IMPLEMENTED;
#endif

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif
#endif //#if defined(SL_PROVISION_GENERATOR) && defined(SL_TRUSTZONE_NONSECURE)

nit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants