-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathcm4_emmc_rauc.config
More file actions
74 lines (70 loc) · 3.02 KB
/
Copy pathcm4_emmc_rauc.config
File metadata and controls
74 lines (70 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Raspberry Pi CM4 (BCM2711) - production RAUC A/B boot: wolfBoot replaces GCX's
# U-Boot as the RAUC slot arbiter. Same Linux boot as cm4_emmc_linux.config, plus
# wolfBoot reads a raw U-Boot-env partition (RAUC bootloader=uboot, fw_setenv),
# runs the BOOT_ORDER / BOOT_<name>_LEFT state machine, decrements the try counter
# (so a hung slot fails over), and injects "root=<slot> rauc.slot=<name>".
#
# eMMC GPT layout (0-based indices in [brackets]):
# p1 boot FAT [0] : RPi fw + wolfBoot kernel8.img + config.txt (disable-bt)
# p2 uboot-env raw [1] : U-Boot env (RAUC fw_env.config -> this partition)
# p3 fitImage raw [2] : wolfBoot-signed kernel FIT (shared across A/B)
# p4 rootfs_A ext4 [3] : RAUC slot A
# p5 rootfs_B ext4 [4] : RAUC slot B
# p6 data ext4 [5] : persistent /data
#
# Target: GCX "iron-butterfly" Yocto Scarthgap, kernel 6.6.63, raspberrypi4-64.
ARCH?=AARCH64
TARGET?=cm4
SIGN?=ECC384
HASH?=SHA384
IMAGE_HEADER_SIZE?=1024
DEBUG?=0
DEBUG_UART?=1
# --- eMMC disk driver --------------------------------------------------------
DISK_SDCARD?=0
DISK_EMMC?=1
CFLAGS_EXTRA+=-DSDHCI_FORCE_CARD_DETECT
CFLAGS_EXTRA+=-DSDHCI_SDMA_DISABLED
# Opt into the bounded multi-block write settle-wait (BCM2711 EMMC2 raises TC
# only at CMD12). Especially relevant here: the RAUC try-counter writeback is a
# multi-block write, and a silently timed-out write must propagate as a failure.
CFLAGS_EXTRA+=-DSDHCI_WRITE_SETTLE_SPINS=1000000U
#CFLAGS_EXTRA+=-DDEBUG_SDHCI
#CFLAGS_EXTRA+=-DDEBUG_DISK
EXT_FLASH?=0
NO_XIP=1
NO_QNX?=1
ELF?=1
VTOR?=1
SPMATH?=1
PKA?=0
WOLFTPM?=0
WOLFBOOT_NO_PARTITIONS=1
# Shared kernel FIT lives on p3 (index 2); no per-slot kernel, so A==B. RAUC A/B
# here is rootfs-level (root= selected via the U-Boot env, see hal/cm4.c); the
# kernel FIT is common to both slots. Consequence: the wolfBoot image A/B retry
# points at the same partition (a corrupt shared FIT is not recoverable by slot
# failover - protect it with the outer wolfBoot signature + a known-good image).
CFLAGS_EXTRA+=-DBOOT_PART_A=2
CFLAGS_EXTRA+=-DBOOT_PART_B=2
CFLAGS_EXTRA+=-DDISK_BLOCK_SIZE=0x80000
# --- Linux boot (see cm4_emmc_linux.config for the rationale) -----------------
GZIP?=1
CFLAGS_EXTRA+=-DCM4_UART_PL011
CFLAGS_EXTRA+=-DCM4_FIRMWARE_DTB
# Fallback root if the RAUC env read fails (normally root= comes from the slot).
CFLAGS_EXTRA+=-DLINUX_BOOTARGS_ROOT=\"/dev/mmcblk0p4\"
# --- RAUC A/B slot selection (wolfBoot replaces U-Boot's boot.scr) ------------
# CM4_RAUC_AB is a make var: arch.mk links src/ubootenv.o and defines -DCM4_RAUC_AB.
CM4_RAUC_AB?=1
# 0-based GPT index of the raw U-Boot-env partition (p2). Match RAUC fw_env.config.
CFLAGS_EXTRA+=-DCM4_UBOOT_ENV_PART=1
# RAUC bootname -> rootfs device. Match RAUC system.conf slot devices.
CFLAGS_EXTRA+=-DCM4_ROOT_A=\"/dev/mmcblk0p4\"
CFLAGS_EXTRA+=-DCM4_ROOT_B=\"/dev/mmcblk0p5\"
WOLFBOOT_LOAD_ADDRESS?=0x18000000
WOLFBOOT_RAMBOOT_MAX_SIZE=0x23C00000
WOLFBOOT_LOAD_DTS_ADDRESS?=0x08000000
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x80200000
WOLFBOOT_PARTITION_SIZE=0x4000000
WOLFBOOT_SECTOR_SIZE=0x1000