Skip to content

feat(dts): emit 64-bit initrd device-tree cells for large initramfs#25

Merged
poemonsense merged 1 commit into
mainfrom
feat-dts-64bit-initrd
Jul 10, 2026
Merged

feat(dts): emit 64-bit initrd device-tree cells for large initramfs#25
poemonsense merged 1 commit into
mainfrom
feat-dts-64bit-initrd

Conversation

@eastonman

Copy link
Copy Markdown
Member

The device tree packed linux,initrd-start / linux,initrd-end into single
32-bit cells, which truncates the physical address once the total initramfs
exceeds 4 GiB. dtc only warns on out-of-range cells (exit 0), so the
truncation is silent — a >4 GiB initramfs boots with a short/corrupt rootfs.

Changes

  • build-firmware-linux.sh computes 64-bit hi/lo halves of the initramfs
    begin/end addresses and substitutes INITRAMFS_{BEGIN,END}_{HI,LO} into the
    templates. The _HI/_LO tokens are substituted before the bare
    INITRAMFS_BEGIN/INITRAMFS_END to avoid a prefix collision.
  • Every device-tree template switches linux,initrd-start/end to <hi lo>
    cell pairs. Below 4 GiB the high cell resolves to 0x0, so existing images
    are byte-identical; above 4 GiB the address is preserved instead of truncated.
  • New xiangshan-fpga-noAIA-mem128g-novec profile (128 GiB memory node) for
    guests whose initramfs boot-unpack peak exceeds 64 GiB.

The device tree packed linux,initrd-start/end into single 32-bit cells,
truncating the physical address for a total initramfs above 4 GiB. Compute
64-bit hi/lo halves in build-firmware-linux.sh and switch every device-tree
template to <hi lo> cell pairs; below 4 GiB the high cell resolves to 0, so
existing images are byte-identical. Add a mem128g-novec profile for guests
whose initramfs boot-unpack peak (blob + rootfs) exceeds 64 GiB.

Assisted-by: Claude Opus 4.8
@eastonman eastonman requested review from poemonsense and rezado July 10, 2026 01:53
@poemonsense poemonsense merged commit f7b8e6d into main Jul 10, 2026
2 checks passed
@poemonsense poemonsense deleted the feat-dts-64bit-initrd branch July 10, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants