# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD # # SPDX-License-Identifier: Apache-2.0 # ESP32-S31 chip-specific layout. # # The mask ROM loads an Espressif ESP image, while the kernel executes in # place from the flash cache window. # OpenSBI + U-Boot proper + the control dtb are already packed into u-boot.itb # by U-Boot's binman, so there is no separate fw_jump step here. # # This file is the single source of truth for the esptool parameters and the # raw flash slot offsets, consumed by tools/gen_esp_flash_image.sh. CHIP=esp32s31 # HP-RAM address the mask ROM loads the SPL app into (fixed by the SPL linker # script). Used as the wrapped-ELF load/start address before elf2image. SPL_SRAM_ADDR=0x2F040000 # esptool flash geometry. DIO/80m is MANDATORY: elf2image's QIO/40m default # makes the ROM read garbage before the SPL's own QIO bring-up (boot loop). ESPTOOL_FLASH="--flash-mode dio --flash-freq 80m --flash-size 16MB" FLASH_SIZE=0x1000000 # Must match with esptool's --flash-size argument above # Raw flash layout. SPL maps flash offset 0x100000 to the 0x40000000 XIP # window; the mask ROM handles the SPL app at 0x002000 separately. # # Flash offset Artifact XIP source / runtime destination # 0x002000 SPL app ROM copies to HP-RAM 0x2F040000 # 0x100000 u-boot.itb XIP source at 0x40000000 # FIT payload: OpenSBI SPL copies to HP-RAM 0x2F000000 # FIT payload: U-Boot SPL copies to PSRAM 0x50400000 # FIT payload: U-Boot DTB SPL copies to PSRAM 0x50300000 # 0x300000 Linux DTB XIP source at 0x40200000; U-Boot relocates it # 0x500000 xipImage executes in place at 0x40400000 # 0xC00000 rootfs.cramfs mapped at 0x40B00000, optional # # PSRAM spans 0x50000000-0x50FFFFFF. The Linux DTB relocation address is # selected dynamically near the top of PSRAM. SLOT_SPL=0x002000 SLOT_UBOOT_ITB=0x100000 # Fixed: SPL maps 0x100000 to XIP 0x40000000 SLOT_DTB=0x300000 SLOT_KERNEL=0x500000 # XIP kernel must be 4 MiB aligned in the XIP window SLOT_ROOTFS=0xC00000 # Must match the rootfs MTD partition in the kernel DTS # Artifact names within . Board variants with different Buildroot # output names can override these in their own layout configuration. SPL_DTB_BIN=u-boot-spl-dtb.bin UBOOT_ITB=u-boot.itb BASE_DTB=esp32s31-function-core-board-1.dtb KERNEL_IMAGE=xipImage ROOTFS_IMAGE=rootfs.cramfs SPL_APP_BIN=spl_app.bin OUT_IMAGE=s31_full_flash.bin