Repository navigation
Boot a FIT with no kernel load/entry and no device tree #920
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:versal_fit_noload
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.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| # wolfBoot configuration for AMD Versal - DDR Boot with a high DDR aperture | ||
| # Versal with DDR mapped at 0x400_0000_0000 instead of the default map. | ||
| # | ||
| # PLM -> PSM -> BL31 (EL3) -> wolfBoot (EL2) -> Linux (EL2) | ||
| # | ||
| # Derived from versal_vmk180.config; see that file for the knobs this one | ||
| # does not change. Every address here lives inside the aperture declared by | ||
| # DDR_HIGH_BASE/DDR_HIGH_SIZE. | ||
| # | ||
| # Three things outside this file have to agree with it: the bootgen BIF | ||
| # (wolfboot.elf at WOLFBOOT_ORIGIN, raw DTB at WOLFBOOT_LOAD_DTS_ADDRESS), | ||
| # BL31's PRELOADED_BL33_BASE = WOLFBOOT_ORIGIN, and the FIT ITS using | ||
| # #address-cells = <2>. | ||
|
|
||
| ARCH?=AARCH64 | ||
| TARGET?=versal | ||
|
|
||
| WOLFBOOT_VERSION?=1 | ||
|
|
||
| # ECC-384 with SHA-384 (good balance of security and performance) | ||
| SIGN?=ECC384 | ||
| HASH?=SHA384 | ||
| IMAGE_HEADER_SIZE?=512 | ||
|
|
||
| # RSA 4096-bit with SHA3-384 (alternative) | ||
| #SIGN?=RSA4096 | ||
| #HASH?=SHA3 | ||
| #IMAGE_HEADER_SIZE?=1024 | ||
|
|
||
| # Debug options | ||
| DEBUG?=1 | ||
| DEBUG_SYMBOLS=1 | ||
| DEBUG_UART=1 | ||
|
|
||
| # Boot Benchmarking (optional): | ||
| # Enables timing of boot operations (flash read, integrity, signature). | ||
| BOOT_BENCHMARK?=1 | ||
|
|
||
| VTOR?=1 | ||
| CORTEX_M0?=0 | ||
| NO_ASM?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| NVM_FLASH_WRITEONCE?=0 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=0 | ||
| DUALBANK_SWAP?=0 | ||
| PKA?=0 | ||
| WOLFTPM?=0 | ||
|
|
||
| # Flash configuration | ||
| EXT_FLASH?=1 | ||
| NO_XIP=1 | ||
|
|
||
| # Boot Exception Level (mutually exclusive) | ||
| # BOOT_EL1: drop to EL1 via ERET before entering the application. | ||
| # BOOT_EL2: enter the application at the EL2 wolfBoot runs at (default). | ||
| # EL2 is the default: PSCI brings the secondary cores up at EL2, so dropping | ||
| # only the boot core leaves Linux with "CPUs started in inconsistent modes". | ||
| #BOOT_EL1=1 | ||
| #BOOT_EL2=1 | ||
|
|
||
| # ELF loading support | ||
| ELF?=1 | ||
|
|
||
| # Native gzip decompression for FIT subimages (set GZIP=0 to disable) | ||
| GZIP?=1 | ||
|
|
||
| # FIT ramdisk (initramfs) extraction plus the /chosen/linux,initrd-{start,end} | ||
| # fixup. A stock PetaLinux image.ub carries a ramdisk sub-image that a U-Boot | ||
| # "bootm" loads; without this wolfBoot ignores it. | ||
| FIT_RAMDISK?=1 | ||
|
|
||
| # WOLFBOOT_LOAD_KERNEL_ADDRESS / WOLFBOOT_LOAD_RAMDISK_ADDRESS override the | ||
| # FIT's own `load`/`entry`, so a FIT built without them boots. Set below. | ||
|
|
||
| # Toolchain | ||
| USE_GCC=1 | ||
| CROSS_COMPILE=aarch64-none-elf- | ||
|
|
||
| # ============================================================================ | ||
| # Boot Memory Layout | ||
| # ============================================================================ | ||
| # wolfBoot runs from DDR inside the high aperture, at EL2 non-secure. | ||
| # WOLFBOOT_ORIGIN is set with the rest of the layout further down. | ||
|
|
||
| # Optional debugging with OCRAM | ||
| # Versal Gen 1 (VMK180): OCM is 256KB at 0xFFFC0000 - 0xFFFFFFFF | ||
| # Versal Gen 2: OCM is 2MB at 0xFFE00000 - 0xFFFFFFFF | ||
| #WOLFBOOT_ORIGIN=0xFFFC0000 | ||
|
|
||
| # Flash Sector Size (QSPI) | ||
| WOLFBOOT_SECTOR_SIZE=0x20000 | ||
|
|
||
| # Application Partition Size (44MB) | ||
| WOLFBOOT_PARTITION_SIZE=0x2C00000 | ||
|
|
||
| # Location in Flash for Primary Boot Partition | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x800000 | ||
|
|
||
| # Load Partition to RAM Address (Linux kernel loads here) | ||
| WOLFBOOT_LOAD_ADDRESS?=0x10000000 | ||
|
|
||
| # Location in Flash for Secondary Partition (update image) | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x3400000 | ||
|
|
||
| # Location to store wolfBoot state/swap | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x6000000 | ||
|
|
||
| # DTS (Device Tree) - matches addresses from BOOT.BIN analysis | ||
| WOLFBOOT_LOAD_DTS_ADDRESS?=0x1000 | ||
|
|
||
| # The aperture itself. Base and size are 512 GB aligned with no UL/ULL | ||
| # suffix - the assembler consumes them. NO_DDR_LOW drops the low mapping. | ||
| DDR_HIGH_BASE=0x40000000000 | ||
| DDR_HIGH_SIZE=0x10000000000 | ||
| NO_DDR_LOW=1 | ||
|
|
||
| # DDR layout inside the aperture, using '=' to override the '?=' defaults | ||
| # above. Each region is distinct: the kernel and ramdisk destinations must | ||
| # clear the FIT staging buffer the sub-images are read out of. | ||
| # | ||
| # 0x400_0000_1000 DTB (WOLFBOOT_LOAD_DTS_ADDRESS) | ||
| # 0x400_0080_0000 wolfBoot (WOLFBOOT_ORIGIN) | ||
| # 0x400_0200_0000 kernel (WOLFBOOT_LOAD_KERNEL_ADDRESS) | ||
| # 0x400_1000_0000 FIT staging (WOLFBOOT_LOAD_ADDRESS) | ||
| # 0x400_3000_0000 ramdisk (WOLFBOOT_LOAD_RAMDISK_ADDRESS) | ||
| WOLFBOOT_ORIGIN=0x40000800000 | ||
| WOLFBOOT_LOAD_DTS_ADDRESS=0x40000001000 | ||
| WOLFBOOT_LOAD_KERNEL_ADDRESS=0x40002000000 | ||
| WOLFBOOT_LOAD_ADDRESS=0x40010000000 | ||
| WOLFBOOT_LOAD_RAMDISK_ADDRESS=0x40030000000 | ||
|
|
||
| # Cap the decompressed kernel at the 224 MB gap to the staging buffer above, | ||
| # which is tighter than the 256 MB WOLFBOOT_FIT_MAX_DECOMP default. | ||
| CFLAGS_EXTRA+=-DWOLFBOOT_FIT_MAX_KERNEL=0xE000000 | ||
| WOLFBOOT_DTS_BOOT_ADDRESS?=0x7B0000 | ||
| WOLFBOOT_DTS_UPDATE_ADDRESS?=0x39B0000 | ||
|
|
||
| # Speed up reads by using larger blocks | ||
| CFLAGS_EXTRA+=-DWOLFBOOT_SHA_BLOCK_SIZE=4096 | ||
|
|
||
| # UART Configuration - UART0 for APU console | ||
| CFLAGS_EXTRA+=-DDEBUG_UART_NUM=0 | ||
|
|
||
| # QSPI Reference Clock: Ref (300MHz default for Versal) | ||
| #CFLAGS_EXTRA+=-DGQSPI_CLK_REF=300000000 | ||
|
|
||
| # QSPI Bus Divisor: (2 << div) = BUS (0=div2, 1=div4, 2=div8) | ||
| # MT25QU01G max: 133MHz Quad Read (0x6C) with 8 dummy cycles | ||
| # div=0: 300MHz/2 = 150MHz (above spec but tested working) | ||
| # div=1: 300MHz/4 = 75MHz (within spec, default) | ||
| # div=2: 300MHz/8 = 37.5MHz (conservative) | ||
| #CFLAGS_EXTRA+=-DGQSPI_CLK_DIV=1 | ||
|
|
||
| # QSPI flash options (uncomment to enable) | ||
| #CFLAGS_EXTRA+=-DDEBUG_QSPI # Enable QSPI debug logging | ||
| #CFLAGS_EXTRA+=-DGQSPI_MODE_IO # Use polling instead of DMA (slower) | ||
| #CFLAGS_EXTRA+=-DTEST_EXT_FLASH # Run flash erase/write/read test |
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
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.
Uh oh!
There was an error while loading. Please reload this page.