summaryrefslogtreecommitdiff
path: root/firmware/payloads
AgeCommit message (Collapse)AuthorFilesLines
2021-03-19firmware: Use lla to access all global symbolsVincent Chen1-9/+9
When OpenSBI is compiled as fPIE mode, the assembler will translate "la" to GOT reference pattern. It will cause to cost an additional load instruction when obtaining the symbol address. However, if the symbol locates within the positive or negative 2GB region, we can use "lla" instead of "la" to avoid unneeded GOT references. This patch assumes that the OpenSBI image excluding the payload does not exceed 2GB. Based on this assumption, all "la" instructions are replaced by "lla" to avoid performance degradation when compiling as fPIE mode. Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2020-01-10firmware: Fix placement of .align directivesAndreas Schwab1-3/+3
Move the .align directives after switching the section. We want to align the start of the current section, not the end of the previous section. This also obsoletes the misguided workaround of disabling relaxation. Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-10-03lib: Rename existing SBI implementation as 0.1.Atish Patra1-1/+1
Current SBI implementation is now considered as version 0.1 and will be removed/replaced with newer extension/functions in future. Rename the existing implementations accordingly to be in sync with the specification. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Zong Li <zong.li@sifive.com>
2019-10-03Test: Move test payload related code out of interface headerAtish Patra1-0/+25
Test payload uses an SBI call and uses the macros defined in interface header which is not the correct place to have these definitions. The interface header file should be used to keep SBI specification related macros. Keep all the test payload related code in test itself. Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-04-24all: run clang-format and update checked-in filesOlof Johansson1-4/+4
Noisy commit, no functional changes. Generated with an current upstream clang-format and: clang-format -i $(find . -name \*.[ch]) Signed-off-by: Olof Johansson <olof@lixom.net>
2019-02-14firmware: Use CSR_<FOO> instead of <foo> for csr*Atish Patra1-3/+4
Some older toolchains may not have all the csr's defined. Update all the csr functions to use the CSR_ #define values instead of the toolchain defined values. Signed-off-by: Atish Patra <atish.patra@wdc.com>
2019-01-24all: Update copyright header in all filesAnup patel4-12/+12
This patch updates copyright header in all files as follows: 1. Makes "SPDX-License-Identifier: BSD-2-Clause" as first line 2. Change copyright year to 2019 for Western Digital Signed-off-by: Anup Patel <anup.patel@wdc.com>
2019-01-21sbi: Add ecall helpersDamien Le Moal1-9/+1
Define sbi_ecall_console_puts() using sbi_ecall_console_putchar() renamed as sbi_ecall_console_putc() and remove the hardcoded version of the same funtion in the test payload code. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-01-21payload: rename dummy payload to test payloadDamien Le Moal4-8/+8
Use a more neutral term more representative of this payload intent. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
2019-01-21build: Introduce FW_PAYLOAD_ALIGNDamien Le Moal1-0/+4
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>
2018-12-27firmware: Add separate dummy payload for FW_PAYLOADAnup Patel4-0/+220
Currently, the default payload for FW_PAYLOAD is embedded fw_payload.S itself. This means people have to hack fw_payload.S if they want to have some temporary S-mode test code. This patch adds a separate dummy payload for FW_PAYLOAD which can be easily hacked for some S-mode testing. Signed-off-by: Anup Patel <anup.patel@wdc.com>