HomeFreeBSD

RISC-V: handle DTB aligned to less than 2MB

Description

RISC-V: handle DTB aligned to less than 2MB

By default OpenSBI and BBL will pass the DTB at a 2MB-aligned address.
However, by default there are no 2MB aligned regions between the SBI and
the kernel, so we have to choose a 2MB aligned region after the kernel.
OpenSBI defaults to placing the DTB 32MB after the start of the kernel but
this is not sufficient for a kernel with a large MFS embedded.
We could increase this offset to a larger number (e.g. 64/128/256) but that
imposes restrictions on the minimum RAM size.
Another solution would be to place the DTB between OpenSBI and the kernel
at 1MB alignment, but current locore.S code assumes 2MB alignment.

With this change I can now boot on QEMU with an OpenSBI configured to
store the DTB at an offset of 1MB.

See also https://github.com/riscv/opensbi/issues/169

Reviewed By: mhorne
Differential Revision: https://reviews.freebsd.org/D25151

Details

Provenance
arichardsonAuthored on Jun 8 2020, 8:51 AM
Parents
rG0e89af3b8872: RELNOTES: Post-portem note about sed(1) \x support
Branches
Unknown
Tags
Unknown

Event Timeline