Realme 5 Pro
Realme 5 Pro running the UniXNU source kernel through its own U-Boot UEFI: boot chain, entry, MMU, timer, PSCI, platform expert and the boot-progress console work on hardware; XNU idles in bsd_init waiting for a root device until the internal UFS is usable.
源记录: porting.toml, e0c2df8bedf4292066372aa325c2ead0db02d1c5.
本页按设备记录自动生成。
| 部分 | 状态 |
|---|---|
| 配置 | implemented |
| 固件与启动 | device-verified |
| CPU 与中断 | device-verified |
| 内存与 DMA | device-verified |
| 存储与根卷 | implemented |
| 显示 | device-verified |
| 输入 | planned |
| GPU | planned |
| 网络 | planned |
| 音频 | planned |
| 电源 | planned |
| 镜像组装 | device-verified |
| 诊断 | device-verified |
配置
implemented
组件: ArmDTPlatform.
硬件与依赖
- SoC: SDM710/712 (Kryo 360, 2x Cortex-A75 + 6x Cortex-A55), GIC-500 GICv3, 19.2 MHz Qualcomm XO counter, PSCI over SMC.
- DRAM: 4 GiB model, one contiguous window at 0x1_0000_0000 + 0x7e2c_0000 above the ABL reservations.
- Target OS: the unchanged iPad7,1 iPadOS 17.7.11 (21H461) restore image, the same kernelcache the UniXNU iPadOS profile ships.
- Shared SoC layer: UniXNU-sdm710-common, pinned in feeds.toml because SDM712 is the same die with a 100 MHz higher big-core clock.
配置
- board.toml is format 2 (schema_version = 2), selects soc_source = sdm710 and os_profile = ipados-17.7.11-21H461, and includes ArmDTPlatform, ArmCpu, XnuPrelink and DarwinBoot.
- dts/rmx1971.dts declares memory@100000000 (0x1_0000_0000 + 0x7e2c_0000) and the eight cores with their affinities, and includes sdm710.dtsi for the GIC, PSCI and counter.
- configs/rmx1971_defconfig starts from the shared sdm710 first-console configuration unchanged: the SoC half is identical, and diverging before the first hardware run would make a porting error indistinguishable from a tuning change.
- kernel.patch_series appends device:patches/xnu/series after the arch, SoC and OS series, so the board's own XNU change applies last.
操作步骤
- ./unixnu fetch sdm710; ./unixnu defconfig rmx1971_defconfig -D .; ./unixnu status --json
- python3 scripts/porting-record.py check --device . (from a UniXNU checkout) validates this record against board.toml.
开发经验
- Every number here comes from the handset: the partition geometry, the DRAM window and the timer rate were read off the device (part list, scsi read, and the kernel's own panel) before being written down.
- SDM712 differs from SDM710 only in the top CPU OPP (2.3 against 2.2 GHz) and the GPU clock; nothing in the boot path needs a 712-specific description, so the shared SoC layer is used unchanged rather than copied.
- The device tree is the one place where U-Boot and XNU disagree and both are right: U-Boot's board tree must describe the LOW half (0x8000_0000 + 0x7e2c_0000) because that is the memory it owns and relocates in, while XNU's tree describes the HIGH half, which is the only contiguous window left.
完成条件
- The record validates against board.toml, the device tree compiles, and the configuration resolves through all four profiles (arm64, sdm710, iPadOS 17.7.11, this board).
当前范围
- Only the first-console configuration is exercised; nothing that needs a storage driver, GPU or input device is configured yet.
下一步
- Add the storage area's device evidence once the UFS driver completes a read on hardware, and extend the record with each peripheral as it is brought up.
证据
source: Format 2 descriptor: soc_source sdm710, os_profile ipados-17.7.11-21H461, four components.source: Memory window and eight CPU nodes over sdm710.dtsi; dtc output carries model, compatible and timebase-frequency 0x124f800.host: Kernel, prelink and all kit archives build; the job also compiles the board device tree. Command:./unixnu build kernel --defconfig rmx1971_defconfig --device AppleCampus/UniXNU-rmx1971. Revision:14a9ae187e345111e85a24674cbad57d0020ccfd.
固件与启动
device-verified
组件: DarwinBoot.
硬件与依赖
- Firmware: OPPO/realme ABL (no boot command over fastboot), U-Boot 2026.07 built by this repository, UEFI from its EFI loader.
- Payload volume: 128 MiB FAT32 on LUN0 partition 8 (vm-system, LBA 0x2d00), because that partition is unused by this project and writable by the ABL.
- UniXNU.efi and DarwinBoot.efi built from source in CI; the kernel arrives from the macOS kernel workflow.
配置
- U-Boot bootcmd: `bootefi bootmgr`, then a fallback that reads a bare PE image from logfs (LUN4 LBA 0x19391) and starts it with `bootefi 0xa0000000:400000`.
- unixnu.toml entries: default = "xnu", timeout = 3, [[driver]] Payloads/DarwinBoot.efi, [[entry]] xnu -> Payloads/kernel.macho.
- Kernel arguments include boot-progress=2 sheng-smp=1 cpus=8 armcpu-timer-intid=19 sheng-pmgr=2 amfi_get_out_of_my_way=1 rd=ufsroot0 ufsroot=userdata.
操作步骤
- fastboot flash vm-system rmx1971-payload.img; fastboot flash boot uboot-rmx1971-boot.img; fastboot reboot
- fastboot boot is not usable on this ABL: it transfers the image and then fails with FAILED (remote: 'unknown command').
开发经验
- The ABL matches the appended DTB table by qcom,msm-id and ignores androidboot.dtb_idx, so the image cannot choose its entry; every entry in the vendor table is patched with the framebuffer and memory nodes instead.
- U-Boot's EFI boot manager enumerates block devices, sees the UFS partitions as SCSI block devices with partition children, and starts \EFI\BOOT\BOOTAA64.EFI from the FAT volume; no vendor-specific plumbing was needed.
- bootefi accepts an explicit :size for images that were read into memory directly; without it the loader answers 'No UEFI binary known at ...' because it only trusts addresses it recorded itself.
完成条件
- ABL starts U-Boot, U-Boot starts UniXNU.efi from the payload volume, UniXNU starts DarwinBoot, DarwinBoot enters the kernel, and the kernel reaches its own console.
当前范围
- USB gadget fastboot is not usable: `fastboot usb 0` waits for a host that never enumerates, most likely because VBUS is absent at the moment the gadget is initialised. Development therefore goes through the ABL on every iteration.
- The payload volume lives on vm-system, so a factory reset that reformats that partition removes it; the fix is one `fastboot flash vm-system`.
下一步
- Retry the USB gadget with the cable attached before power-on, to see whether enumeration depends on VBUS at init time.
证据
device: Boot chain observed end to end: 'U-Boot 2026.07', 'Model: Realme 5 Pro (RMX1971)', UniXNU menu, DarwinBoot entry bars, kernel panel. Command:fastboot flash vm-system rmx1971-payload.img && fastboot flash boot uboot-rmx1971-boot.img && fastboot reboot. Revision:ba18c53feab7b92b316addaecc7497b8586e64cd.source: Assembles the ESP: UniXNU.efi, unixnu.toml, DarwinBoot.efi, kernel.macho and .adt, plus the entry-probe patch.
CPU 与中断
device-verified
组件: ArmCpu.
硬件与依赖
- CPUs: 2x Cortex-A75 + 6x Cortex-A55, PSCI over SMC, GIC-500 (GICD 0x17a00000, GICR 0x17a60000), 19.2 MHz counter, virtual timer INTID 19.
- Boot CPU numbering comes from the ADT; the Apple ARM CPU platform expert looks up /cpus by matching name.
配置
- dts/rmx1971.dts lists [email protected]@700 with their reg, enable-method = "psci" and the A55/A75 compatible strings.
- Kernel arguments: sheng-smp=1 cpus=8 armcpu-self-ipi=1 armcpu-timer-intid=19.
- The AppleARMCPU personality's IONameMatch is rewritten cpu -> xpu at payload assembly time so the native ArmCpu owns /cpus.
操作步骤
- Build the payload, boot it, and read TOPO/CLK/SMP off the boot-progress panel.
开发经验
- Without the IONameMatch rewrite Apple's CPU class claims cpu0..cpu7 by prefix and the kernel panics with 'CPU configuration in device tree is invalid'; the rewrite is a same-length string substitution, so the kernel image is not relaid out.
- All eight cores reach step7 with the non-Apple timer INTID; the counter rate reported by the kernel (19200000) equals the device tree's timebase-frequency, and the derived milliseconds match the wall clock of the boot.
完成条件
- Every secondary CPU reports its entry checkpoint and takes timer interrupts, and the delay calibration agrees with the device tree.
当前范围
- CPU frequency scaling is not implemented: the kernel runs at whatever the bootloader left. The 2.3 GHz SDM712 OPP does not exist in the shared sdm710 clock table.
下一步
- Add the 2.3 GHz big-core OPP to a board clock table once the root device works; it is a table entry, not a boot-path change.
证据
device: TOPO max=7 nums=01234567 | DT cfg=1 cpu=8; SMP run=7 with c1..c7=step7; CLK cntfrq=19200000 dt-timebase=19200000, converted values equal. Command:fastboot flash vm-system rmx1971-payload.img && fastboot reboot. Revision:784c151b1c0b5d99bab522a7d4f8d3f497a747ce.
内存与 DMA
device-verified
硬件与依赖
- DRAM: 4 GiB total; below 4 GiB the ABL and its reserved-memory carve-outs fragment everything, and the only contiguous window is 0x1_0000_0000 + 0x7e2c_0000.
- DarwinBoot allocates the kernel's owned window from the EFI memory map it was given, not from the device tree.
配置
- board.toml: dram_size = 0x7e2c0000, [payload.adt] owned_memory_size = 0x20000000 (512 MiB).
- dts/rmx1971.dts: memory@100000000 { reg = <0x1 0x0 0x0 0x7e2c0000> }.
操作步骤
- Boot and read MEM totalMiB / free4K / wired from the panel; the three must add up.
开发经验
- Unset owned_memory_size gives the 256 MiB default, which is what the first boot reported (free4k 173 MiB + wired 83 MB).
- Asking for the whole 0x7e000000 fails before the kernel starts with 'rmx1971 first boot returned: out of resources': the EFI map is U-Boot's low half, where the ABL reservations end at 0xB8300000, the frame buffer holds 10 MiB at 0x9c000000 and U-Boot relocates to the top, leaving a little over 1 GiB contiguous that also has to hold the 52 MiB kernel image.
- 512 MiB boots with wired=22411 and free4K=108298, and is the value the port ships.
完成条件
- The kernel owns a contiguous window large enough for the kernel image plus userland, and every reserved region is accounted for.
当前范围
- The full 1.97 GiB requires U-Boot's memory node to describe the high half as well; until then the kernel is limited to 512 MiB of the window the device tree declares.
下一步
- Extend U-Boot's /memory node to cover 0x1_0000_0000 + 0x7e2c_0000 and re-measure the largest contiguous EFI allocation before raising owned_memory_size.
证据
device: MEM totalMiB=512 free4K=108298 wired=22411 after owned_memory_size = 0x20000000; the 0x7e000000 attempt reported 'out of resources' instead. Command:fastboot flash vm-system rmx1971-payload.img && fastboot reboot. Revision:784c151b1c0b5d99bab522a7d4f8d3f497a747ce.
存储与根卷
implemented
硬件与依赖
- Storage: UFS (ufshc@1d84000, UFSHCI 2.1) with six LUNs and 4096-byte blocks; no eMMC, so the shared layer's SDCC1 eMMC kit does not apply.
- The host is left enabled with the link up by U-Boot, exactly as the ABL leaves it, so the XNU driver does not initialise the PHY or the link.
配置
- patches/xnu/sweet-ufs-root.patch adds bsd/dev/sweet_ufs.c, bsd/conf/files, an IOKitBSDInit probe and a vfs_mountroot probe that assigns rootdev.
- Kernel arguments: rd=ufsroot0 ufsroot=userdata (default partition name is userdata, GPT entry 14 at LUN0 LBA 0x198900).
- U-Boot side: patches/uboot/0001-clk-sdm670-add-ufs-phy-rx-symbol-1.patch adds GCC_UFS_PHY_RX_SYMBOL_1_CLK at 0x770a8, without which ufshcd fails to enable the controller with -ENOENT.
操作步骤
- fastboot flash vm-system rmx1971-payload.img, boot, and read the driver's verdict on the panel's stage line.
- From U-Boot: part list scsi <lun> and scsi read to verify the GPT and read a partition by LBA.
开发经验
- Six LUNs totalling 63.99 GB: LUN0 58.6 GiB Android, LUN1 xbl/xbl_config, LUN2 an empty GPT, LUN3 ALIGN_TO_128K_1/cdt/ddr, LUN4 and LUN5 the firmware half including boot at LBA 0xc505.
- LUN0's GPT has 32 slots and 14 entries, while the ABL knows 64 partitions whose reversed order starts with those same 14: the table on LUN0 is a truncated copy, and the firmware partitions are on LUN4/LUN5 with tables of their own.
- scsi read of LUN4 LBA 0xc505 returns 'ANDROID!', so the running boot image is readable from U-Boot by fixed LBA.
- The first XNU driver attempt added a branch inside IOFindBSDRoot and produced no output at all: the panel showed vfs_mountroot entered every five seconds, which means rootdev stayed NODEV and bdevvp() failed before any filesystem was asked. The probe therefore belongs at the top of vfs_mountroot(), and it must assign rootdev rather than only report.
- The driver keeps its verdict on the boot-progress stage line because everything it printf()s scrolls off a console that retains only the latest seven lines; the hook is a weak reference so the bootstrap pass, which links without the kit archives, still links.
完成条件
- The driver reports the partition geometry on the stage line, the kernel mounts a filesystem from it, and userdata is reachable without touching any other partition.
当前范围
- Read-only and not yet observed on hardware. userdata currently holds Android's encrypted filesystem, so the first successful probe is still expected to fail the mount with errno 19.
- Writes, 4 GiB-plus DMA and the speed work from the same source project are not ported.
下一步
- Boot the payload carrying the vfs_mountroot probe and read its stage line: 'UFS ok: ...' moves the problem to the filesystem, 'UFS: init failed N' names the stage (5 host handover, 6 no GPT, 2 no such partition, 12 DMA).
证据
source: Read-only UFS block driver, conf/files entry, IOKitBSDInit probe and the vfs_mountroot probe that assigns rootdev.host: Kernel builds with the driver; the assembled payload's kernel.macho carries the driver strings and both probes. Command:./unixnu build kernel --defconfig rmx1971_defconfig --device AppleCampus/UniXNU-rmx1971. Revision:14a9ae187e345111e85a24674cbad57d0020ccfd.
显示
device-verified
硬件与依赖
- Panel: 1080x2340, stride 1080*4, a8r8g8b8, handed over lit by the ABL at 0x9c000000; no GPU driver and no backlight control.
- There is no UART on a retail unit, so the framebuffer is the only log transport.
配置
- U-Boot's board tree carries a root-level framebuffer@9c000000 (simple-framebuffer) so vidconsole exists; /chosen would never be bound.
- XNU draws through package/BootProgress.c onto the same address, with boot-progress=2.
操作步骤
- Boot and read the panel: the header, the sampled PCs and the console pane are the log.
开发经验
- A simple-framebuffer node nested under /chosen is never bound: dm_scan_fdt() walks the root's children and recurses only into simple-bus, and /chosen has no driver, so vidconsole never appears.
- The console pane keeps the latest seven lines, which is what makes a verbose boot readable and what identified the vfs_mountroot retry loop.
- The panic screen is disabled: it is assembled into the padding at the end of the kernel text, and this kernel's padding is 0xa30 bytes against 0xa37 needed.
完成条件
- Kernel output is readable on the panel from early boot onward, and a hang is distinguishable from a crash.
当前范围
- Brightness control, panel backlight and any GPU-accelerated presentation are absent; everything is CPU copies into the splash buffer.
下一步
- Shrink the panic-screen glyph table (or find 7 more bytes of padding) so panics can be reported even before the console is up.
证据
device: Boot-progress panel rendered by the kernel: header, TOPO/CLK/SMP lines, stage history and console pane all legible on the panel. Command:fastboot flash vm-system rmx1971-payload.img && fastboot reboot. Revision:784c151b1c0b5d99bab522a7d4f8d3f497a747ce.
输入
planned
硬件与依赖
- Touch: the panel's controller is not identified in open sources for this variant; the vendor kernel tree and the stock DTB are the references to check.
- Buttons: power and both volume keys reach the PM660/PM660L PMIC; the volume keys are on PM660L GPIO 7 in the vendor tree.
配置
- Nothing configured yet; neither the touch node nor the key nodes exist in dts/rmx1971.dts.
操作步骤
- Read the touch controller's compatible and interrupt from the stock DTB before adding a node.
开发经验
- UniXNU's own menu cannot be driven on this handset: with no input device the timeout selects the default entry, which is why unixnu.toml sets timeout = 3 and makes the kernel the default.
完成条件
- Touch reports contacts with correct coordinates and the three physical keys deliver events.
当前范围
- No input device is described, so the boot menu is unusable and nothing can be typed at a shell.
下一步
- Extract the stock DTB and identify the touch controller and the key GPIOs.
证据
按下一步操作收集证据。
GPU
planned
硬件与依赖
- GPU: Adreno 616 (SDM712 runs it at 610 MHz), firmware and PM4 submission are not implemented for this SoC in UniXNU.
配置
- No GPU component is selected; the display path is CPU copies into the framebuffer.
操作步骤
- Defer until the storage and input areas are device-verified.
开发经验
- Nothing measured yet; the Adreno firmware for SDM670/710 has not been extracted from this handset.
完成条件
- A GPU provider matches, submits command buffers and presents a frame.
当前范围
- Entirely unimplemented; there is no accelerated presentation path of any kind.
下一步
- Decide whether the Adreno 6xx components can be reused from another Qualcomm port before writing anything board-specific.
证据
按下一步操作收集证据。
网络
planned
硬件与依赖
- Wi-Fi: the module and its bus are not identified for this variant; the vendor kernel tree lists it, the stock DTB carries the node.
配置
- Nothing configured: no Wi-Fi or Bluetooth node exists in the board tree.
操作步骤
- Identify the module and its firmware from the vendor tree before adding anything.
开发经验
- U-Boot reports 'Net: No ethernet found', which is expected and unrelated: there is no wired interface on this handset.
完成条件
- The interface associates and passes packets through the OS network stack.
当前范围
- No network device of any kind.
下一步
- Confirm the Wi-Fi module from the stock DTB and the vendor defconfig.
证据
按下一步操作收集证据。
音频
planned
硬件与依赖
- Audio: the codec is inside PM660L; the DSP path and its firmware services are not implemented.
配置
- Nothing configured.
操作步骤
- Defer until storage, input and power are device-verified.
开发经验
- Nothing measured yet.
完成条件
- Playback and capture through the speaker and the headset jack.
当前范围
- Unimplemented.
下一步
- Inventory the codec and DSP resources in the vendor tree.
证据
按下一步操作收集证据。
电源
planned
硬件与依赖
- PMIC: PM660 + PM660L over SPMI; the ABL leaves the regulators configured for Android's boot path. Reset and power-off work through PSCI.
配置
- Nothing configured: no regulator or charger driver is selected.
操作步骤
- Read the PMIC state through the SPMI bus once a driver exists.
开发经验
- The kernel runs on the rails the bootloader left enabled, which is sufficient to reach the console but not to control brightness or charging.
完成条件
- Regulators and battery state are readable, and at least one voltage rail is demonstrably controlled by the OS.
当前范围
- No regulator, charger or fuel-gauge driver.
下一步
- Identify the SPMI bus and the PM660 register window that the vendor tree uses.
证据
按下一步操作收集证据。
镜像组装
device-verified
组件: XnuPrelink.
硬件与依赖
- Kernel: kernel.macho plus the ADT from the prelink step, 52,486,144 bytes at this revision.
- Loader: DarwinBoot.efi from drivers/DarwinBoot, UniXNU.efi from the UniXNU package, both built in CI.
配置
- Payload volume: 128 MiB FAT32, label RMX1971ESP, files \EFI\BOOT\BOOTAA64.EFI, \EFI\UniXNU\unixnu.toml, \EFI\UniXNU\Payloads\{DarwinBoot.efi,kernel.macho,kernel.macho.adt}.
- Kernel patches applied at assembly: the entry probe (stage bars, --no-reset) and the IONameMatch cpu->xpu rewrite.
- Kernel build runs on a macOS runner because unixnu build kernel needs Xcode; the payload step runs on Linux.
操作步骤
- ./unixnu build payload --kernel kernel.macho --edk2 <edk2> --uefi <font tree>
- python3 scripts/make-uboot-payload.py --payload <image> --unixnu-efi <efi> --darwinboot-efi <efi> --entry-probe <script> --output rmx1971-payload.img
- fastboot flash vm-system rmx1971-payload.img
开发经验
- The payload volume is FAT32, not FAT16, because mformat chooses by size; parsing it as FAT16 silently shows an empty root directory.
- The panic screen does not fit this kernel's text padding (0xa30 bytes against 0xa37), so board.toml disables it and the entry probe is applied separately.
- Upstream's macOS workflow publishes text logs only, so this repository's copy adds an artifact upload; a kernel nobody can download is a kernel nobody can flash.
完成条件
- The volume boots end to end and every file in it matches the hash recorded in the payload report.
当前范围
- No userland image is produced yet; the kernel stops at bsd_init because there is no root filesystem.
下一步
- Produce a mountable root image once the storage area reports a working block device.
证据
device: Volume assembled and flashed, then booted to the kernel console; the same volume carries the UFS driver probes. Command:fastboot flash vm-system rmx1971-payload.img && fastboot reboot. Revision:ba18c53feab7b92b316addaecc7497b8586e64cd.
诊断
device-verified
硬件与依赖
- Log transport: the framebuffer only. No UART on retail units, and the USB gadget never enumerates.
- U-Boot side: environments compiled into the image, since nothing can be typed at its prompt.
配置
- Kernel: boot-progress=2 selects the full panel; the console pane keeps the latest seven lines.
- U-Boot: four environments (main, probe, diag, usb) are separate builds because CONFIG_ENV_DEFAULT_ENV_TEXT_FILE is compiled in.
操作步骤
- Read the stage line and the eight PC samples, then resolve a PC against the kernel's LC_SYMTAB.
开发经验
- Every PC sample landing on _machine_idle is what distinguished 'waiting for a root device' from a crash; the same method identified the vfs_mountroot retry loop from the stage history.
- The panel's stage line is the only place a driver message survives, so the UFS driver writes its verdict there instead of relying on printf.
- A three-image set made the ABL behaviour observable: boot.img (the real thing), boot-probe.img (sleep 15; reset, proves bootcmd was reached) and boot-stub.img (300 bytes of assembly that paints the screen and resets, proves the ABL jumped).
完成条件
- Any boot failure can be attributed to a phase from the panel alone, without a serial port.
当前范围
- The console pane holds seven lines; anything that prints more scrolls away, which is why drivers must pin their conclusions on the stage line.
下一步
- Add the first UFS read to the panel's UFS TIME line by filling the native_ufs_* counters the kit already renders.
证据
device: Panel dumps at four stages of bring-up, including the sampled PCs and the vfs_mountroot retry history. Command:fastboot flash boot uboot-rmx1971-boot.img && fastboot reboot. Revision:06d0e0e31133c9e226e3b507a3fced7b7dbb6512.