mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00

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>
31 lines
462 B
Plaintext
31 lines
462 B
Plaintext
/*
|
|
* Copyright (c) 2018 Western Digital Corporation or its affiliates.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <anup.patel@wdc.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
OUTPUT_ARCH(riscv)
|
|
ENTRY(_start)
|
|
|
|
SECTIONS
|
|
{
|
|
#include "fw_base.ldS"
|
|
|
|
#ifdef FW_PAYLOAD_OFFSET
|
|
. = FW_TEXT_START + FW_PAYLOAD_OFFSET;
|
|
#else
|
|
. = ALIGN(FW_PAYLOAD_ALIGN);
|
|
#endif
|
|
|
|
.payload :
|
|
{
|
|
PROVIDE(_payload_start = .);
|
|
*(.payload)
|
|
. = ALIGN(8);
|
|
PROVIDE(_payload_end = .);
|
|
}
|
|
}
|