Repository navigation
Add wolfBoot target for Infineon PSOC Edge E8 #949
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
Open
dgarske
wants to merge
1
commit into
wolfSSL:master
Choose a base branch
from
dgarske:psoc_e8
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,272
−26
Open
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
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,50 @@ | ||
| ARCH?=ARM | ||
| TARGET?=psoc_e8 | ||
| SIGN?=ECC256 | ||
| HASH?=SHA256 | ||
| DEBUG?=0 | ||
| VTOR?=1 | ||
| CORTEX_M33?=1 | ||
| TZEN?=1 | ||
| NO_ASM?=0 | ||
| NO_MPU=1 | ||
| EXT_FLASH?=0 | ||
| SPI_FLASH?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| # The QSPI NOR rejects a second program into a 16-byte ECC unit. | ||
| NVM_FLASH_WRITEONCE?=1 | ||
| WOLFBOOT_VERSION?=1 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=1 | ||
| DUALBANK_SWAP?=0 | ||
| DEBUG_UART=1 | ||
| # Keeps the application vector table 1 KB aligned. | ||
| IMAGE_HEADER_SIZE?=1024 | ||
|
|
||
| # KIT_PSE84_AI with TrustZone and a wolfHSM server in the Secure world. The | ||
| # Non-secure application is the wolfHSM client, over the NSC transport, and | ||
| # uses SRAM1 (0x24080000). 64 MB QSPI NOR, 256 KB sectors; the boot partition | ||
| # is in the Non-secure code-bus alias, the rest in the Secure one. Erase the | ||
| # key store once with psoc_e8_flash.sh --erase-keyvault. | ||
| # | ||
| # 0x32040000 - 0x3204FFFF RRAM wolfHSM NVM (WOLFBOOT_KEYVAULT_*) | ||
| # 0x34058000 - 0x3407FFFF SRAM0 top, Secure wolfHSM heap | ||
| # 0x18100000 - 0x1813BFFF wolfBoot slot: 0x400 boot header + wolfBoot | ||
| # 0x1813C000 - 0x1813FFFF NSC gateway veneers | ||
| # 0x08140000 - 0x0823FFFF BOOT (1 MB, Non-secure) | ||
| # 0x18240000 - 0x1833FFFF UPDATE (1 MB) | ||
| # 0x18340000 - 0x1837FFFF SWAP (one sector) | ||
| # | ||
| # Board wiring: PSOC_E8_* make options in arch.mk, see docs/Targets.md. | ||
| WOLFBOOT_SECTOR_SIZE?=0x40000 | ||
| WOLFBOOT_PARTITION_SIZE?=0x100000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08140000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18240000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x18340000 | ||
| WOLFBOOT_NSC_ADDRESS?=0x1813C000 | ||
| WOLFBOOT_NSC_SIZE?=0x4000 | ||
| WOLFCRYPT_TZ=1 | ||
| WOLFCRYPT_TZ_WOLFHSM=1 | ||
| WOLFBOOT_KEYVAULT_ADDRESS?=0x32040000 | ||
| WOLFBOOT_KEYVAULT_SIZE?=0x10000 |
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,43 @@ | ||
| ARCH?=ARM | ||
| TARGET?=psoc_e8 | ||
| SIGN?=ECC256 | ||
| HASH?=SHA256 | ||
| DEBUG?=0 | ||
| VTOR?=1 | ||
| CORTEX_M33?=1 | ||
| TZEN?=1 | ||
| NO_ASM?=0 | ||
| NO_MPU=1 | ||
| EXT_FLASH?=0 | ||
| SPI_FLASH?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| # The QSPI NOR rejects a second program into a 16-byte ECC unit. | ||
| NVM_FLASH_WRITEONCE?=1 | ||
| WOLFBOOT_VERSION?=1 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=1 | ||
| DUALBANK_SWAP?=0 | ||
| DEBUG_UART=1 | ||
| # Keeps the application vector table 1 KB aligned. | ||
| IMAGE_HEADER_SIZE?=1024 | ||
|
|
||
| # KIT_PSE84_AI with TrustZone: wolfBoot Secure, the application Non-secure. | ||
| # 64 MB QSPI NOR, 256 KB sectors. The boot partition is in the Non-secure | ||
| # code-bus alias, the rest in the Secure one. The application uses SRAM1 | ||
| # (0x24080000) and prints through a Secure console gateway. | ||
| # | ||
| # 0x18100000 - 0x1813BFFF wolfBoot slot: 0x400 boot header + wolfBoot | ||
| # 0x1813C000 - 0x1813FFFF NSC gateway veneers | ||
| # 0x08140000 - 0x0823FFFF BOOT (1 MB, Non-secure) | ||
| # 0x18240000 - 0x1833FFFF UPDATE (1 MB) | ||
| # 0x18340000 - 0x1837FFFF SWAP (one sector) | ||
| # | ||
| # Board wiring: PSOC_E8_* make options in arch.mk, see docs/Targets.md. | ||
| WOLFBOOT_SECTOR_SIZE?=0x40000 | ||
| WOLFBOOT_PARTITION_SIZE?=0x100000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08140000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18240000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x18340000 | ||
| WOLFBOOT_NSC_ADDRESS?=0x1813C000 | ||
| WOLFBOOT_NSC_SIZE?=0x4000 |
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,37 @@ | ||
| ARCH?=ARM | ||
| TARGET?=psoc_e8 | ||
| SIGN?=ECC256 | ||
| HASH?=SHA256 | ||
| DEBUG?=0 | ||
| VTOR?=1 | ||
| CORTEX_M33?=1 | ||
| TZEN?=0 | ||
| NO_ASM?=0 | ||
| NO_MPU=1 | ||
| EXT_FLASH?=0 | ||
| SPI_FLASH?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| # The QSPI NOR rejects a second program into a 16-byte ECC unit. | ||
| NVM_FLASH_WRITEONCE?=1 | ||
| WOLFBOOT_VERSION?=1 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=1 | ||
| DUALBANK_SWAP?=0 | ||
| DEBUG_UART=1 | ||
| # Keeps the application vector table 1 KB aligned. | ||
| IMAGE_HEADER_SIZE?=1024 | ||
|
|
||
| # KIT_PSE84_AI: 64 MB QSPI NOR, 256 KB sectors, Secure code-bus alias. | ||
| # | ||
| # 0x18100000 - 0x1813FFFF wolfBoot slot: 0x400 boot header + wolfBoot | ||
| # 0x18140000 - 0x1823FFFF BOOT (1 MB) | ||
| # 0x18240000 - 0x1833FFFF UPDATE (1 MB) | ||
| # 0x18340000 - 0x1837FFFF SWAP (one sector) | ||
| # | ||
| # Board wiring: PSOC_E8_* make options in arch.mk, see docs/Targets.md. | ||
| WOLFBOOT_SECTOR_SIZE?=0x40000 | ||
| WOLFBOOT_PARTITION_SIZE?=0x100000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x18140000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18240000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x18340000 |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Reserve space for the appended boot-image TLV
BOOTLOADER_PARTITION_SIZEreserves only the 0x400-byte prefix, butpsoc_e8_boot_header.pyalso appends 40 bytes afterwolfboot.bin: a 4-byte TLV-info header, a 4-byte SHA-256 entry header, and a 32-byte digest. An image accepted at the linker limit therefore extends 40 bytes beyond the configured boot slot. In QSPI this overlaps the BOOT partition; in RRAM it exceeds the provisioned slot. The TrustZone linker layout has the analogous problem if.gnu.sgstubsconsumes the available NSC region.Fix: Reserve the 40-byte trailer in every PSOC E8 linker layout and add a linker or packaging-time assertion that the header, image, and TLV remain within the selected boot slot.