Skip to content

Commit 12b75e0

Browse files
committed
Add NXP S32G2 (S32G274A GoldBox) target: wolfBoot as the Boot ROM image, booting a signed FIT from SD, eMMC or QuadSPI NOR
1 parent 6155973 commit 12b75e0

21 files changed

Lines changed: 3719 additions & 32 deletions

‎.github/workflows/test-configs.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,38 @@ jobs:
879879
config-file: ./config/examples/imx8mm-pico.config
880880
make-args: IMX8MM_BL33=1 DISK_EMMC=0 IMX8MM_MMU=0 wolfboot.bin test-app/image_v1_signed.bin
881881

882+
s32g2_test:
883+
uses: ./.github/workflows/test-build-aarch64.yml
884+
with:
885+
arch: aarch64
886+
# Boot ROM image in SRAM, signed FIT from the SD card.
887+
config-file: ./config/examples/s32g2-goldbox.config
888+
make-args: wolfboot.bin
889+
890+
s32g2_emmc_test:
891+
uses: ./.github/workflows/test-build-aarch64.yml
892+
with:
893+
arch: aarch64
894+
# FIT from the eMMC behind the board's SW3, no console.
895+
config-file: ./config/examples/s32g2-goldbox.config
896+
make-args: DISK_EMMC=1 DISK_SDCARD=0 DEBUG_UART=0 wolfboot.bin
897+
898+
s32g2_qspi_test:
899+
uses: ./.github/workflows/test-build-aarch64.yml
900+
with:
901+
arch: aarch64
902+
# Boot from the QuadSPI NOR with the A/B partitions in the NOR.
903+
config-file: ./config/examples/s32g2-goldbox-qspi.config
904+
make-args: wolfboot.bin
905+
906+
s32g2_qspi_program_test:
907+
uses: ./.github/workflows/test-build-aarch64.yml
908+
with:
909+
arch: aarch64
910+
# NOR programmer build: image file from the SD card to the NOR.
911+
config-file: ./config/examples/s32g2-goldbox.config
912+
make-args: S32G2_QSPI=1 S32G2_QSPI_PROGRAM_FILE=/s32g2_qspi_boot.bin wolfboot.bin
913+
882914
disk_boot_confirm_test:
883915
uses: ./.github/workflows/test-build-aarch64.yml
884916
with:

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,3 +694,9 @@ tools/unit-tests/stm32wb_write_extract.h
694694
tools/unit-tests/t10xx_flash_status_extract.h
695695
tools/unit-tests/ti_hercules_erase_extract.h
696696
tools/unit-tests/versal_host_write.c
697+
# S32G2 GoldBox FIT build outputs (tools/scripts/s32g2/s32g2-mkfit.sh)
698+
Image.gz
699+
s32g2-fitImage*
700+
boot.scr
701+
s32g2.dtb
702+
s32g2_ddr.bin

‎Makefile‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,11 @@ ifeq ($(TARGET),imx8mm)
511511
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
512512
endif
513513

514+
# S32G2 runs from SRAM and boots a signed FIT; there is no factory.bin.
515+
ifeq ($(TARGET),s32g2)
516+
MAIN_TARGET:=wolfboot.bin
517+
endif
518+
514519
# i.MX95 M7 runs from ITCM (loaded by the Linux remoteproc driver); the payload
515520
# lives in DDR at 0x80100000, so there is no contiguous flash image to assemble.
516521
ifeq ($(TARGET),imx95_m7)
@@ -1097,6 +1102,16 @@ secondary: $(SECONDARY_PRIVATE_KEY)
10971102
@echo "\t[CC $(ARCH)] $@"
10981103
$(Q)$(CC) $(CFLAGS) -c $(OUTPUT_FLAG) $@ $^
10991104

1105+
# The S32G2 HAL objects are rebuilt on every make: hal/s32g2_ddr.o links the
1106+
# DDR blob in by content (its path and presence are build options), and the
1107+
# NOR programmer file and offset in hal/s32g2.o are command-line options that
1108+
# a stale object would silently keep.
1109+
ifeq ($(TARGET),s32g2)
1110+
hal/s32g2.o hal/s32g2_ddr.o: %.o: %.c FORCE
1111+
@echo "\t[CC $(ARCH)] $@"
1112+
$(Q)$(CC) $(CFLAGS) -c $(OUTPUT_FLAG) $@ $<
1113+
endif
1114+
11001115
%.o:%.S
11011116
@echo "\t[AS $(ARCH)] $@"
11021117
$(Q)$(CC) $(CFLAGS) -c $(OUTPUT_FLAG) $@ $^

‎arch.mk‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,56 @@ ifeq ($(ARCH),AARCH64)
359359
endif
360360
endif
361361

362+
ifeq ($(TARGET),s32g2)
363+
# NXP S32G274A GoldBox: wolfBoot is the Boot ROM's application image,
364+
# copied into SRAM and entered at EL3. It runs its own identity MMU there
365+
# and tears it down at the handoff with the stack-free flush routine.
366+
ARCH_FLAGS=-mcpu=cortex-a53+crypto -march=armv8-a+crypto -mstrict-align
367+
CFLAGS+=$(ARCH_FLAGS) -DCORTEX_A53
368+
CFLAGS+=-DWOLFBOOT_AARCH64_MMU_TEARDOWN
369+
WOLFBOOT_ORIGIN=0x340A0000
370+
OBJS+=hal/s32g2_ddr.o
371+
# wolfBoot adds /memory and the spin-table addresses to the FIT's DTB,
372+
# which needs more room than the default headroom.
373+
CFLAGS+=-DWOLFBOOT_FDT_FIXUP_HEADROOM=4096
374+
# LPDDR4 register tables and PHY training firmware, generated by
375+
# tools/scripts/s32g2/s32g2-ddr-blob.py. Without the file the image
376+
# still builds, and reports the missing blob instead of training.
377+
S32G2_DDR_BLOB ?= s32g2_ddr.bin
378+
ifneq ($(wildcard $(S32G2_DDR_BLOB)),)
379+
CFLAGS+=-DS32G2_DDR_BLOB='"$(abspath $(S32G2_DDR_BLOB))"'
380+
endif
381+
# uSDHC0 board facts. Here rather than in the config because a command-line
382+
# CFLAGS_EXTRA= would replace the config's, whereas CFLAGS is additive.
383+
ifneq ($(filter 1,$(DISK_SDCARD) $(DISK_EMMC)),)
384+
# uSDHC -> SDHCI shim, shared with the i.MX 8 targets
385+
OBJS+=hal/imx_usdhc_sdhci.o
386+
# Card detect is a GPIO, so PRES_STATE bit 16 never sets.
387+
CFLAGS+=-DSDHCI_FORCE_CARD_DETECT
388+
# Read the payload in 64 KB chunks rather than the 512-byte default.
389+
DISK_BLOCK_SIZE ?= 65536
390+
CFLAGS+=-DDISK_BLOCK_SIZE=$(DISK_BLOCK_SIZE)
391+
# 3.3 V signalling only (no-1-8-v): high-speed rates.
392+
ifeq ($(DISK_EMMC),1)
393+
S32G2_USDHC_MAX_CLK_KHZ ?= 52000
394+
else
395+
S32G2_USDHC_MAX_CLK_KHZ ?= 50000
396+
endif
397+
CFLAGS+=-DS32G2_USDHC_MAX_CLK_KHZ=$(S32G2_USDHC_MAX_CLK_KHZ)
398+
endif
399+
# QuadSPI NOR driver (the ext_flash API with EXT_FLASH=1)
400+
ifeq ($(S32G2_QSPI),1)
401+
CFLAGS+=-DS32G2_QSPI
402+
# NOR programmer build: writes the named file from the SD/eMMC FAT
403+
# partition to the NOR at S32G2_QSPI_PROGRAM_OFFSET, then halts.
404+
ifneq ($(S32G2_QSPI_PROGRAM_FILE),)
405+
S32G2_QSPI_PROGRAM_OFFSET ?= 0
406+
CFLAGS+=-DS32G2_QSPI_PROGRAM_FILE='"$(S32G2_QSPI_PROGRAM_FILE)"'
407+
CFLAGS+=-DS32G2_QSPI_PROGRAM_OFFSET=$(S32G2_QSPI_PROGRAM_OFFSET)
408+
endif
409+
endif
410+
endif
411+
362412
ifeq ($(TARGET),imx8mm)
363413
# uSDHC -> SDHCI shim, shared with imx8qm
364414
ifneq ($(filter 1,$(DISK_SDCARD) $(DISK_EMMC)),)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# NXP S32G2 GoldBox (S32G-VNP-GLDBOX, S32G274A-RDB2) - wolfBoot as the Boot
2+
# ROM's application image booting from the 64 MB QuadSPI NOR, with the A/B
3+
# image partitions in the same NOR and the signed FIT loaded into DDR. No SD
4+
# card is needed (DISK_SDCARD=0).
5+
#
6+
# NOR layout: wolfBoot at 0 (IVT, ROM QSPI parameters, code), BOOT partition
7+
# at 1 MB, UPDATE at 17 MB, SWAP sector at 33 MB; 4 KB erase sectors.
8+
# tools/scripts/s32g2/s32g2_mkimage.py wolfboot.bin s32g2_qspi_boot.bin --qspi
9+
# The NOR is written by a programmer build of the SD config
10+
# (S32G2_QSPI=1 S32G2_QSPI_PROGRAM_FILE=/<file>); the board must be strapped
11+
# for QuadSPI boot.
12+
# See docs/Targets.md.
13+
#
14+
# Never pass CFLAGS_EXTRA= on the command line - it replaces, not appends.
15+
ARCH=AARCH64
16+
TARGET=s32g2
17+
S32G2_QSPI=1
18+
SIGN?=ECC384
19+
HASH?=SHA384
20+
DEBUG?=1
21+
DEBUG_UART?=1
22+
SPMATH?=1
23+
NO_XIP?=1
24+
EXT_FLASH?=1
25+
SKIP_GIC_INIT?=1
26+
GZIP?=1
27+
DISK_SDCARD?=0
28+
WOLFBOOT_SECTOR_SIZE?=0x1000
29+
WOLFBOOT_PARTITION_SIZE?=0x1000000
30+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x100000
31+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x1100000
32+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x2100000
33+
# Separate DTB partitions are not used (the FIT carries the DTB) but the
34+
# RAM-boot flow needs them defined; they sit after the swap sector.
35+
WOLFBOOT_DTS_BOOT_ADDRESS?=0x2110000
36+
WOLFBOOT_DTS_UPDATE_ADDRESS?=0x2120000
37+
38+
WOLFBOOT_RAMBOOT_MAX_SIZE=0x4000000
39+
WOLFBOOT_LOAD_ADDRESS?=0xA0000000
40+
WOLFBOOT_LOAD_DTS_ADDRESS?=0xA5000000
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# NXP S32G2 GoldBox (S32G-VNP-GLDBOX, S32G274A-RDB2) - wolfBoot as the Boot
2+
# ROM's application image: copied into SRAM at 0x340A0000 and entered at EL3
3+
# with only FIRC running, in place of U-Boot. The signed FIT (kernel + DTB,
4+
# hal/s32g2.its) is read from a FAT32 partition of the SD card, or of the
5+
# eMMC with DISK_EMMC=1 DISK_SDCARD=0.
6+
#
7+
# The LPDDR4 tables and PHY firmware come from the NXP BSP U-Boot sources:
8+
# tools/scripts/s32g2/s32g2-ddr-blob.py <nxp-u-boot> s32g2_ddr.bin
9+
# Wrap wolfboot.bin for the Boot ROM and write it at SD byte offset 0x1000:
10+
# tools/scripts/s32g2/s32g2_mkimage.py wolfboot.bin s32g2_boot.bin
11+
# dd if=s32g2_boot.bin of=/dev/sdX bs=512 seek=8
12+
# See docs/Targets.md.
13+
#
14+
# Never pass CFLAGS_EXTRA= on the command line - it replaces, not appends.
15+
ARCH=AARCH64
16+
TARGET=s32g2
17+
SIGN?=ECC384
18+
HASH?=SHA384
19+
DEBUG?=1
20+
DEBUG_UART?=1
21+
SPMATH?=1
22+
NO_XIP?=1
23+
SKIP_GIC_INIT?=1
24+
WOLFBOOT_SECTOR_SIZE?=0x1000
25+
WOLFBOOT_NO_PARTITIONS=1
26+
GZIP?=1
27+
WOLFBOOT_PARTITION_SIZE?=0x100000
28+
DISK_SDCARD?=1
29+
DISK_FS?=fat32
30+
31+
# A/B slots: two files on the third partition (FAT32). The higher version
32+
# boots. An older version is not used when the newer one fails to verify
33+
# (anti-rollback), unless built with ALLOW_DOWNGRADE=1.
34+
CFLAGS_EXTRA+=-DBOOT_PART_A=2
35+
CFLAGS_EXTRA+=-DBOOT_PART_B=2
36+
CFLAGS_EXTRA+=-DBOOT_FILE_A='"/fitImage_a.bin"'
37+
CFLAGS_EXTRA+=-DBOOT_FILE_B='"/fitImage_b.bin"'
38+
39+
WOLFBOOT_RAMBOOT_MAX_SIZE=0x4000000
40+
WOLFBOOT_LOAD_ADDRESS?=0xA0000000
41+
WOLFBOOT_LOAD_DTS_ADDRESS?=0xA5000000

‎docs/Targets.md‎

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This README describes configuration of supported targets.
2828
* [Nordic nRF54LM20](#nordic-nrf54lm20)
2929
* [NXP i.MX 8M Mini](#nxp-imx-8m-mini)
3030
* [NXP i.MX 8QuadMax](#nxp-imx-8quadmax)
31+
* [NXP S32G2 (S32G274A GoldBox)](#nxp-s32g2-s32g274a-goldbox)
3132
* [NXP i.MX95 Cortex-M7](#nxp-imx95-cortex-m7)
3233
* [NXP i.MX95 Cortex-A55 (BL33)](#nxp-imx95-cortex-a55-bl33)
3334
* [NXP iMX-RT](#nxp-imx-rt)
@@ -10551,6 +10552,124 @@ Register bases used by the HAL, from the upstream device tree (`imx8-ss-{lsio,co
1055110552

1055210553
`-DDEBUG_SDHCI -DDEBUG_DISK -DDEBUG_GPT` add command-level tracing to the storage paths, and `-DDEBUG_FS` traces the filesystem layer when `DISK_FS` is enabled.
1055310554

10555+
## NXP S32G2 (S32G274A GoldBox)
10556+
10557+
wolfBoot runs on the NXP S32G274A (4x Cortex-A53 + 3x Cortex-M7 lock-step pairs) as the Boot ROM's application image, in place of U-Boot: the ROM copies it into the 8 MB system SRAM at 0x340A0000 and enters it at EL3 with only the 48 MHz FIRC running. wolfBoot brings the SoC up, verifies a signed FIT (kernel plus device tree) and enters Linux at EL2. Developed against the S32G-VNP-GLDBOX, which is an S32G274A-RDB2 in an enclosure.
10558+
10559+
```
10560+
Boot ROM -> wolfBoot in SRAM (EL3) -> signed FIT from SD, eMMC or QuadSPI NOR -> Linux (EL2)
10561+
```
10562+
10563+
### Example configurations
10564+
10565+
| Config | Boot ROM loads wolfBoot from | Signed FIT from |
10566+
|---|---|---|
10567+
| [/config/examples/s32g2-goldbox.config](/config/examples/s32g2-goldbox.config) | SD card (or eMMC) | FAT32 partition of the SD card; of the eMMC with `DISK_EMMC=1 DISK_SDCARD=0` |
10568+
| [/config/examples/s32g2-goldbox-qspi.config](/config/examples/s32g2-goldbox-qspi.config) | QuadSPI NOR | BOOT / UPDATE partitions in the same NOR |
10569+
10570+
Both use `SIGN=ECC384 HASH=SHA384`. The disk config has two file slots on the third partition, `/fitImage_a.bin` and `/fitImage_b.bin`: the higher version boots. With wolfBoot's anti-rollback default an older version is not booted when the newer one fails to verify; that needs `ALLOW_DOWNGRADE=1`. The NOR config has BOOT at 1 MB, UPDATE at 17 MB and a 4 KB SWAP sector at 33 MB, with the FIT read into DDR through the `ext_flash` API.
10571+
10572+
### LPDDR4 data blob
10573+
10574+
wolfBoot trains the LPDDR4 itself ([/hal/s32g2_ddr.c](/hal/s32g2_ddr.c)) but does not carry the board's controller and PHY register tables or the Synopsys PHY training firmware. NXP publishes both in the BSP U-Boot tree, and [/tools/scripts/s32g2/s32g2-ddr-blob.py](/tools/scripts/s32g2/s32g2-ddr-blob.py) packs them into the binary the build links in:
10575+
10576+
```
10577+
git clone -b release/bsp29.0-2020.04 https://github.com/nxp-auto-linux/u-boot.git
10578+
tools/scripts/s32g2/s32g2-ddr-blob.py u-boot s32g2_ddr.bin
10579+
```
10580+
10581+
`S32G2_DDR_BLOB` names the file (default `s32g2_ddr.bin` in the wolfBoot root). Without it the image still builds, and reports the missing blob on the console instead of training. The blob is checked by magic, version and CRC before use. Inline ECC is not supported.
10582+
10583+
### Building
10584+
10585+
```
10586+
cp config/examples/s32g2-goldbox.config .config
10587+
make
10588+
tools/scripts/s32g2/s32g2_mkimage.py wolfboot.bin s32g2_boot.bin
10589+
dd if=/dev/sdX bs=512 count=8192 of=sd_raw_backup.bin # keep the stock boot area
10590+
dd if=s32g2_boot.bin of=/dev/sdX bs=512 seek=8 conv=fsync # IVT at byte 0x1000
10591+
tools/scripts/s32g2/s32g2-mkfit.sh Image 1 wolfboot_signing_private_key.der fsl-s32g274a-rdb2.dtb
10592+
mcopy -i /dev/sdX3 s32g2-fitImage_v1_signed.bin ::/fitImage_a.bin
10593+
```
10594+
10595+
[/tools/scripts/s32g2/s32g2_mkimage.py](/tools/scripts/s32g2/s32g2_mkimage.py) writes the IVT (tag 0xD1), a no-op DCD and the application boot code header (tag 0xD5) in the stock BSP's layout. The card must stay MBR: the IVT sits where GPT entries would be. Restoring the backup puts the stock chain back. The stock card's first partition is FAT16, which wolfBoot does not read, so the FIT goes on an added FAT32 partition (`mkfs.vfat -F 32 -s 8`).
10596+
10597+
`s32g2-mkfit.sh` builds the FIT from [/hal/s32g2.its](/hal/s32g2.its): the gzip-compressed kernel, loaded at 0x84080000 (2 MB-aligned base plus the image's text offset), and the board DTB, both under the wolfBoot signature.
10598+
10599+
### What wolfBoot does before the FIT
10600+
10601+
In this order, in [/hal/s32g2.c](/hal/s32g2.c) and the S32G2 block of [/src/boot_aarch64_start.S](/src/boot_aarch64_start.S):
10602+
10603+
- ECC-initialises `.bss`, the stack and the spin-table page through SRAM controller 0. The ROM only initialises the bytes it copies, and the controller works in 512-byte granules, so `.data` ends on a granule boundary.
10604+
- Routes the UART0 pads and programs LINFlexD_0.
10605+
- Services the VR5510 PMIC over I2C4: fail-safe watchdog and FCCU monitoring off. Unserviced, the PMIC power-cycles the board about a second after power-up, and on any clock change.
10606+
- Clock tree: FXOSC, ARM PLL (A53 at 1 GHz), XBAR 800 MHz, PERIPH PLL (LINFlexD 125 MHz, uSDHC 400 MHz, QuadSPI), DDR PLL 800 MHz.
10607+
- Ncore coherent interconnect, then an identity MMU at EL3 with the caches on: SRAM Normal, peripherals and the QuadSPI window Device. Cluster 1's interconnect port only joins when its cores are released, since a port admitted with its cores in reset stalls the barrier after a TLB invalidate.
10608+
- LPDDR4 training (1D and 2D), a read-back check through a Device mapping, then DRAM mapped Normal.
10609+
- MSCM interrupt routing, GICv3 distributor and redistributors, and the three secondary cores released through MC_ME and parked at EL2 on a spin table at 0x34000000.
10610+
- uSDHC and QuadSPI pads, whichever medium holds the FIT, as the OS expects them routed. The card and eMMC run at their 3.3 V high-speed rates with SDMA, using the shared uSDHC shim's cache maintenance.
10611+
10612+
`hal_dts_fixup` adds the `/memory` node for both DRAM banks, each core's `enable-method = "spin-table"` and `cpu-release-addr`, the bootargs, and clears `linux,initrd-start/end` (the stock DTB's range overlaps the kernel). The handoff flushes the caches, turns the MMU off and enters the kernel at EL2 with `SCR_EL3` leaving IRQ and FIQ to EL2. EL3 exception vectors report ESR, ELR and FAR on the console.
10613+
10614+
### QuadSPI NOR
10615+
10616+
`S32G2_QSPI=1` builds the driver for the QuadSPI controller at 0x40134000 and the GoldBox's 64 MB Macronix MX25UW51245G. The flash runs in plain SPI mode with 4-byte addresses: single commands are IP commands described by a LUT sequence (page program 0x12, 4 KB sector erase 0x21), bulk reads go through the memory-mapped AHB window (fast read 0x0C), the DLL slave is bypassed and data is sampled from the internal DQS loopback. The serial clock comes from PERIPH DFS1 through MC_CGM0 mux 12 (`S32G2_QSPI_2X_DIV`, 8 = 50 MHz). If the Boot ROM left the flash in octal DTR mode, the init resets it to SPI mode with the two-byte OPI reset commands.
10617+
10618+
```
10619+
cp config/examples/s32g2-goldbox-qspi.config .config
10620+
make
10621+
tools/scripts/s32g2/s32g2_mkimage.py wolfboot.bin s32g2_qspi_boot.bin --qspi
10622+
```
10623+
10624+
`--qspi` lays the image out for QuadSPI boot: the IVT at flash offset 0, the 0x200-byte QuadSPI parameter block the ROM programs the controller with at 0x200 (`sdr`, the default, reads in plain SPI mode with no mode switch; `--qspi-params octal` is the stock BSP block that moves the flash to octal DTR), the DCD and the application. Strap the RDB2 for QuadSPI boot with SW4 all OFF, SW9 OFF, SW10 1 ON / 2 OFF.
10625+
10626+
The NOR is written by a programmer build of the SD config: it reads the named file from the FAT32 partition into DDR, erases, programs and reads it back, then halts. It refuses to erase anything when the flash was not identified, when the partition is not a recognised filesystem, or when the file does not fit. Boot it from the SD card once per image:
10627+
10628+
```
10629+
cp config/examples/s32g2-goldbox.config .config
10630+
make S32G2_QSPI=1 S32G2_QSPI_PROGRAM_FILE=/s32g2_qspi_boot.bin # wolfBoot at 0
10631+
make S32G2_QSPI=1 S32G2_QSPI_PROGRAM_FILE=/fitImage_a.bin S32G2_QSPI_PROGRAM_OFFSET=0x100000 # FIT in BOOT
10632+
```
10633+
10634+
### eMMC
10635+
10636+
The GoldBox routes uSDHC0 either to the microSD slot or to the on-board 32 GB eMMC with the RDB2's SW3 (ON = microSD, OFF = eMMC). `make DISK_EMMC=1 DISK_SDCARD=0` drives the eMMC through the same uSDHC shim. The factory eMMC carries the BSP image (FAT16 boot partition, ext3 rootfs), so a FAT32 partition is appended from the board's Linux (`sfdisk --append`, `mkfs.vfat -F 32 -s 8`) for the FIT files. With wolfBoot in the NOR and SW3 OFF the box boots with no card inserted.
10637+
10638+
### Hardware setup (GoldBox)
10639+
10640+
- Console: UART0 micro-USB (FTDI FT232R), LINFlexD_0, 115200 8N1. The second micro-USB is UART1 and prints nothing.
10641+
- Boot source switches on the RDB2: SD boot is SW4 position 7 ON only; QuadSPI boot is SW4 all OFF; SW9 OFF and SW10 1 ON / 2 OFF for both.
10642+
- Expected console, booting from the SD card:
10643+
10644+
```
10645+
wolfBoot S32G2 (EL3, running from SRAM)
10646+
DDR: 1D training
10647+
DDR: 2D training
10648+
s32g2: DDR up, 4096 MB, erratum polling 0
10649+
s32g2: core 1 parked
10650+
p2: fat32, /fitImage_a.bin
10651+
Firmware Valid.
10652+
FDT: memory and spin-table set
10653+
```
10654+
10655+
### Peripheral map
10656+
10657+
| Block | Base | Notes |
10658+
|---|---|---|
10659+
| LINFlexD_0 | 0x401C8000 | FIFO mode; TX pin PC09 (MSCR41), RX PC10 (MSCR42, IMCR512) |
10660+
| uSDHC0 | 0x402F0000 | i.MX uSDHC v3, shared shim [/hal/imx_usdhc_sdhci.c](/hal/imx_usdhc_sdhci.c), per clock 400 MHz |
10661+
| QuadSPI | 0x40134000 | AHB window at 0x0 |
10662+
| I2C4 | 0x402DC000 | VR5510 fail-safe unit at 0x21 |
10663+
| SRAM | 0x34000000 | 8 MB; controllers at 0x4019C000 / 0x401A0000 |
10664+
| DRAM | 0x80000000 + 0x880000000 | 2 GB + 2 GB |
10665+
| Ncore / GICv3 | 0x50400000 / 0x50800000 | |
10666+
10667+
### Known limitations
10668+
10669+
- The NOR UPDATE partition has not been written from Linux: the BSP29 5.4 kernel's QuadSPI driver blocks on its first flash read under this boot chain, so the NOR update and rollback flow is untested and the NOR is programmed through the programmer build.
10670+
- QuadSPI boot with the octal DTR parameter block is untested.
10671+
- Inline DRAM ECC, HSE secure boot and chain-loading BL31 (for kernels that need PSCI or SCMI) are not implemented.
10672+
1055410673
## NXP i.MX95 Cortex-M7
1055510674

1055610675
The i.MX95 pairs an A55 cluster running Linux with a real-time Cortex-M7 and a Cortex-M33 System Manager. The M7 has no dedicated flash: it is loaded into TCM by the Linux `remoteproc` driver on the A55 side, so wolfBoot is the ELF that `remoteproc` loads, and the images it verifies live in the DDR region the device tree reserves for the M7.

‎hal/imx_usdhc_sdhci.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#include "hal/imx8qm.h"
3838
#elif defined(TARGET_imx8mm)
3939
#include "hal/imx8mm.h"
40+
#elif defined(TARGET_s32g2)
41+
#include "hal/s32g2.h"
4042
#else
4143
#error "hal/imx_usdhc_sdhci.c: unsupported target"
4244
#endif
@@ -393,7 +395,8 @@ uint32_t imx_usdhc_get_clock_khz(void)
393395
return usdhc_achieved_clk_khz;
394396
}
395397

396-
#if defined(WOLFBOOT_AARCH64_EL2_IDMAP) && !defined(SDHCI_SDMA_DISABLED)
398+
#if (defined(WOLFBOOT_AARCH64_EL2_IDMAP) || \
399+
defined(WOLFBOOT_AARCH64_DCACHE_RANGE)) && !defined(SDHCI_SDMA_DISABLED)
397400
/* SDMA cache maintenance with the identity MMU on, by address range rather than
398401
* the set/way walk used at handoff, which would cost more per transfer than the
399402
* DMA saves. The range routines are in src/boot_aarch64_start.S. */
@@ -423,5 +426,5 @@ void sdhci_platform_dma_complete(void* buf, uint32_t sz, int is_write)
423426
if (!is_write && sz != 0)
424427
invalidate_dcache_range(start, start + sz);
425428
}
426-
#endif /* WOLFBOOT_AARCH64_EL2_IDMAP && !SDHCI_SDMA_DISABLED */
429+
#endif /* (EL2_IDMAP || DCACHE_RANGE) && !SDHCI_SDMA_DISABLED */
427430
#endif /* DISK_SDCARD || DISK_EMMC */

0 commit comments

Comments
 (0)