mbox series

[0/4] Add relocatable address support for jump and payload firmware

Message ID IA1PR20MB495352218C0BF2CE8D86B3B9BB422@IA1PR20MB4953.namprd20.prod.outlook.com
Headers show
Series Add relocatable address support for jump and payload firmware | expand

Message

Inochi Amaoto Feb. 2, 2024, 4:04 a.m. UTC
If FW_PIC=y is defined, the jump and payload firmware and will
be broken if FW_TEXT_START is wrong. This is not the desired behavior.

Add some new variable to support relocatable address.

build command:
make BUILD_INFO=y DEBUG=1 FW_PIC=y PLATFORM=generic FW_TEXT_START=0x0

test command:
qemu-system-riscv64 -smp cpus=4 -M virt -m 256M \
  -bios build/platform/generic/firmware/fw_payload.bin

Inochi Amaoto (4):
  firmware: Add relocatable FW_JUMP_ADDR and FW_JUMP_FDT_ADDR
  firmware: Add relocatable FW_PAYLOAD_FDT_ADDR
  platform: Apply relocatable address
  doc/firmware: add new configuration options for jump and payload
    firmware

 docs/firmware/fw_jump.md    | 17 ++++++++++++++---
 docs/firmware/fw_payload.md |  6 ++++++
 firmware/fw_jump.S          | 20 ++++++++++++++++----
 firmware/fw_payload.S       |  4 ++++
 firmware/objects.mk         | 21 +++++++++++++++++++++
 platform/generic/objects.mk |  8 ++++----
 6 files changed, 65 insertions(+), 11 deletions(-)

--
2.43.0

Comments

Anup Patel Feb. 23, 2024, 5:05 a.m. UTC | #1
On Fri, Feb 2, 2024 at 9:34 AM Inochi Amaoto <inochiama@outlook.com> wrote:
>
> If FW_PIC=y is defined, the jump and payload firmware and will
> be broken if FW_TEXT_START is wrong. This is not the desired behavior.
>
> Add some new variable to support relocatable address.
>
> build command:
> make BUILD_INFO=y DEBUG=1 FW_PIC=y PLATFORM=generic FW_TEXT_START=0x0
>
> test command:
> qemu-system-riscv64 -smp cpus=4 -M virt -m 256M \
>   -bios build/platform/generic/firmware/fw_payload.bin

Overall this patch is in the right direction but the new options should not
depend on FW_PIC.

Regards,
Anup

>
> Inochi Amaoto (4):
>   firmware: Add relocatable FW_JUMP_ADDR and FW_JUMP_FDT_ADDR
>   firmware: Add relocatable FW_PAYLOAD_FDT_ADDR
>   platform: Apply relocatable address
>   doc/firmware: add new configuration options for jump and payload
>     firmware
>
>  docs/firmware/fw_jump.md    | 17 ++++++++++++++---
>  docs/firmware/fw_payload.md |  6 ++++++
>  firmware/fw_jump.S          | 20 ++++++++++++++++----
>  firmware/fw_payload.S       |  4 ++++
>  firmware/objects.mk         | 21 +++++++++++++++++++++
>  platform/generic/objects.mk |  8 ++++----
>  6 files changed, 65 insertions(+), 11 deletions(-)
>
> --
> 2.43.0
>