All firmware types support the following common compile time configuration
parameters:
-* **FW_TEXT_START** - Defines the execution address of the OpenSBI firmware.
- This configuration parameter is mandatory.
* **FW_FDT_PATH** - Path to an external flattened device tree binary file to
be embedded in the *.rodata* section of the final firmware. If this option
is not provided then the firmware will expect the FDT to be passed as an
At least one of *FW_JUMP_ADDR* and *FW_JUMP_OFFSET* (see below) should be
defined. Compilation errors will result from not defining one of them.
-* **FW_JUMP_OFFSET** - Address offset from the *FW_TEXT_START* where the
+* **FW_JUMP_OFFSET** - Address offset from the opensbi load address where the
entry point of the next booting stage is located. This offset is used as
relocatable address of the next booting stage entry point. If *FW_JUMP_ADDR*
is also defined, the firmware will prefer *FW_JUMP_ADDR*.
echo fdt overlaps kernel, increase FW_JUMP_FDT_ADDR
```
-* **FW_JUMP_FDT_OFFSET** - Address offset from the *FW_TEXT_START* where
+* **FW_JUMP_FDT_OFFSET** - Address offset from the opensbi load address where
the FDT will be passed to the next booting stage. This offset is used
as relocatable address of the FDT passed to the next booting stage. If
*FW_JUMP_FDT_ADDR* is also defined, the firmware will prefer
level `make` command line or the target platform *objects.mk* configuration
file. The parameters currently defined are as follows:
-* **FW_PAYLOAD_OFFSET** - Offset from *FW_TEXT_START* where the payload binary
- will be linked in the final *FW_PAYLOAD* firmware binary image. This
+* **FW_PAYLOAD_OFFSET** - Offset from the opensbi load address where the payload
+ binary will be linked in the final *FW_PAYLOAD* firmware binary image. This
configuration parameter is mandatory if *FW_PAYLOAD_ALIGN* is not defined.
Compilation errors will result from an incorrect definition of
*FW_PAYLOAD_OFFSET* or of *FW_PAYLOAD_ALIGN*, or if neither of these
firmware will pass the FDT address passed by the previous booting stage
to the next booting stage.
-* **FW_PAYLOAD_FDT_OFFSET** - Address offset from the *FW_TEXT_START* where
+* **FW_PAYLOAD_FDT_OFFSET** - Address offset from the opensbi load address where
the FDT will be passed to the next booting stage. This offset is used as
relocatable address of the FDT passed to the next booting stage. If
*FW_PAYLOAD_FDT_ADDR* is also defined, the firmware will prefer *FW_PAYLOAD_FDT_ADDR*.
By default, the generic FDT platform makes following assumptions:
-1. platform FW_TEXT_START is 0x80000000
-2. platform features are default
-3. platform stack size is default
-4. platform has no quirks or work-arounds
+1. platform features are default
+2. platform stack size is default
+3. platform has no quirks or work-arounds
The above assumptions (except 1) can be overridden by adding special platform
callbacks which will be called based on FDT root node compatible string.
To build the platform-specific library and firmware images, provide the
*PLATFORM=generic* parameter to the top level `make` command.
-For custom FW_TEXT_START, we can build the platform-specific library and
-firmware images by passing *PLATFORM=generic FW_TEXT_START=<custom_text_start>*
-parameter to the top level `make` command.
-
Platform Options
----------------
bnez a6, _wait_for_boot_hart
/* relocate the global table content */
- li t0, FW_TEXT_START /* link start */
- lla t1, _fw_start /* load start */
- sub t2, t1, t0 /* load offset */
+ lla t2, _fw_start
lla t0, __rel_dyn_start
lla t1, __rel_dyn_end
beq t0, t1, _relocate_done
* Anup Patel <anup.patel@wdc.com>
*/
- . = FW_TEXT_START;
- /* Don't add any section between FW_TEXT_START and _fw_start */
+ /* Don't add any section before _fw_start */
PROVIDE(_fw_start = .);
. = ALIGN(0x1000); /* Need this to create proper sections */
#include "fw_base.ldS"
#ifdef FW_PAYLOAD_OFFSET
- . = FW_TEXT_START + FW_PAYLOAD_OFFSET;
+ . = FW_PAYLOAD_OFFSET;
#else
. = ALIGN(FW_PAYLOAD_ALIGN);
#endif
firmware-asflags-y +=
firmware-ldflags-y +=
-ifdef FW_TEXT_START
-firmware-genflags-y += -DFW_TEXT_START=$(FW_TEXT_START)
-endif
-
ifdef FW_FDT_PATH
firmware-genflags-y += -DFW_FDT_PATH=\"$(FW_FDT_PATH)\"
ifdef FW_FDT_PADDING
SECTIONS
{
#ifdef FW_PAYLOAD_OFFSET
- . = FW_TEXT_START + FW_PAYLOAD_OFFSET;
+ . = FW_PAYLOAD_OFFSET;
#else
. = ALIGN(FW_PAYLOAD_ALIGN);
#endif
PLATFORM_RISCV_XLEN = 64
# Blobs to build
-FW_TEXT_START=0x80000000
FW_JUMP=n
ifeq ($(PLATFORM_RISCV_XLEN), 32)
PLATFORM_RISCV_XLEN = 64
# Blobs to build
-FW_TEXT_START=0x80000000
FW_JUMP=n
ifeq ($(PLATFORM_RISCV_XLEN), 32)
# Command for platform specific "make run"
platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \
- -nographic -bios $(build_dir)/platform/generic/firmware/fw_payload.elf
+ -nographic -bios $(build_dir)/platform/generic/firmware/fw_payload.bin
# Objects to build
platform-objs-y += platform.o
platform-objs-y += platform_override_modules.o
# Blobs to build
-FW_TEXT_START=0x80000000
FW_DYNAMIC=y
FW_JUMP=y
ifeq ($(PLATFORM_RISCV_XLEN), 32)
platform-padding-k210.o = 2048
# Blobs to build
-FW_TEXT_START=0x80000000
FW_PAYLOAD=y
FW_PAYLOAD_ALIGN=0x1000
platform-objs-y += platform.o
# Blobs to build
-FW_TEXT_START=0xA0000000
FW_DYNAMIC=y
FW_JUMP=y
#
# platform-objs-y += <dt file name>.o
-# Firmware load address configuration. This is mandatory.
-FW_TEXT_START=0x80000000
-
# Optional parameter for path to external FDT
# FW_FDT_PATH="path to platform flattened device tree file"
# endif
# FW_JUMP_FDT_OFFSET=0x2200000
#
-# You can use fixed address for jump firmware as an alternative option,
-# but this may fail when setting wrong FW_TEXT_START. Use with caution.
+# You can use fixed address for jump firmware as an alternative option.
# SBI will prefer "<X>_ADDR" if both "<X>_ADDR" and "<X>_OFFSET" are
# defined
# ifeq ($(PLATFORM_RISCV_XLEN), 32)
# FW_PAYLOAD_PATH="path to next boot stage binary image file"
# FW_PAYLOAD_FDT_OFFSET=0x2200000
#
-# You can use fixed address for payload firmware as an alternative option,
-# but this may fail when setting wrong FW_TEXT_START. Use with caution.
+# You can use fixed address for payload firmware as an alternative option.
# SBI will prefer "FW_PAYLOAD_FDT_ADDR" if both "FW_PAYLOAD_FDT_OFFSET"
# and "FW_PAYLOAD_FDT_ADDR" are defined.
# FW_PAYLOAD_FDT_ADDR=0x82200000