]> git.baikalelectronics.ru Git - uboot.git/commit
arm64: booti: allow to place kernel image anywhere in physical memory
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 9 Mar 2017 07:28:25 +0000 (16:28 +0900)
committerTom Rini <trini@konsulko.com>
Wed, 15 Mar 2017 00:40:23 +0000 (20:40 -0400)
commitf7428269ec1c1187358f9d892add3b2c64d97063
treedbde878c68a528f04cc709ea5f918379531bb503
parent1602cb4e79da73f46968e872e0d43b2131d7d060
arm64: booti: allow to place kernel image anywhere in physical memory

At first, the ARM64 Linux booting requirement recommended that the
kernel image be placed text_offset bytes from 2MB aligned base near
the start of usable system RAM because memory below that base address
was unusable at that time.

This requirement was relaxed by Linux commit a7f8de168ace ("arm64:
allow kernel Image to be loaded anywhere in physical memory").
Since then, the bit 3 of the flags field indicates the tolerance
of the kernel physical placement.  If this bit is set, the 2MB
aligned base may be anywhere in physical memory.  For details, see
Documentation/arm64/booting.txt of Linux.

The booti command should be also relaxed.  If the bit 3 is set,
images->ep is respected, and the image is placed at the nearest
bootable location.  Otherwise, it is relocated to the start of the
system RAM to keep the original behavior.

Another wrinkle we need to take care of is the unknown endianness of
text_offset for a kernel older than commit a2c1d73b94ed (i.e. v3.16).
We can detect this based on the image_size field.  If the field is
zero, just use a fixed offset 0x80000.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
cmd/booti.c