diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2019-01-14 05:17:25 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-01-21 07:28:33 +0300 |
commit | ac3041f4e906ee75d423ac788803218db51ef343 (patch) | |
tree | 3e096ccc8f91d44ff440ca9259eed25d62954166 /firmware/payloads | |
parent | ebfe23125666a11fd3dc14b85f5ca58b7f40276b (diff) | |
download | opensbi-ac3041f4e906ee75d423ac788803218db51ef343.tar.xz |
build: Introduce FW_PAYLOAD_ALIGN
The firmware payload offset defined by FW_PAYLOAD_OFFSET must
specify a value large enough so the the payload does not overlap
with the base firmware data, bss and text. For platforms without
any strong requirement on the payload address, introduce the
FW_PAYLOAD_ALIGN build parameter to automatically place the payload
right after the base firmware at an address aligned with the defined
value.
Either FW_PAYLOAD_OFFSET or FW_PAYLOAD_ALIGN should be defined by a
platform configuration. If both FW_PAYLOAD_OFFSET and FW_PAYLOAD_ALIGN
are defined by a platform, FW_PAYLOAD_OFFSET has precedence and is
used for building the final firmawre image.
Using FW_PAYLOAD_ALIGN=4096 with the Kendryte platform rather than
the abitrary FW_PAYLOAD_OFFSET=0x10000 value reduces the final
firmware image size by about 20KB.
Add a description of the FW_PAYLOAD_ALIGN configuration parameter in the
fw_payload documentation file as well. And while at it, also fix
various grammar and style issues in that file..
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Diffstat (limited to 'firmware/payloads')
-rw-r--r-- | firmware/payloads/dummy.elf.ldS | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/payloads/dummy.elf.ldS b/firmware/payloads/dummy.elf.ldS index b4d9f75..d0854d5 100644 --- a/firmware/payloads/dummy.elf.ldS +++ b/firmware/payloads/dummy.elf.ldS @@ -12,7 +12,11 @@ ENTRY(_start) SECTIONS { +#ifdef FW_PAYLOAD_OFFSET . = FW_TEXT_START + FW_PAYLOAD_OFFSET; +#else + . = ALIGN(FW_PAYLOAD_ALIGN); +#endif PROVIDE(_payload_start = .); |