diff options
author | Anup Patel <anup.patel@wdc.com> | 2019-02-08 10:13:07 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-02-12 15:55:15 +0530 |
commit | 84169e2e691183594d0ba3b2acd85024c65b7370 (patch) | |
tree | eccb0f27e3eec555d2f5c249390f7e8588c35d1e /platform | |
parent | ab12d6ef8fbcc6e6d185bac60412151e843534a1 (diff) |
platform: qemu: Set FW_JUMP_ADDR and FW_PAYLOAD_OFFSET as-per XLEN
The current 4MB aligned FW_JUMP_ADDR and FW_PAYLOAD_OFFSET breaks
U-Boot on QEMU virt and sifive_u machines.
Instead of using 4MB aligned for both 32bit and 64bit systems, we
use different values based compiler XLEN. Another advantage of this
approach will be that our fw_payload.bin will smaller for 64bit
systems.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/qemu/sifive_u/config.mk | 16 | ||||
-rw-r--r-- | platform/qemu/virt/config.mk | 18 |
2 files changed, 28 insertions, 6 deletions
diff --git a/platform/qemu/sifive_u/config.mk b/platform/qemu/sifive_u/config.mk index 6e2c193..fe51024 100644 --- a/platform/qemu/sifive_u/config.mk +++ b/platform/qemu/sifive_u/config.mk @@ -21,10 +21,22 @@ PLATFORM_SYS_CLINT=y # Blobs to build FW_TEXT_START=0x80000000 FW_JUMP=y -FW_JUMP_ADDR=0x80200000 +ifeq ($(OPENSBI_CC_XLEN), 32) + # This needs to be 4MB alligned for 32-bit system + FW_JUMP_ADDR=0x80400000 +else + # This needs to be 2MB alligned for 64-bit system + FW_JUMP_ADDR=0x80200000 +endif FW_JUMP_FDT_ADDR=0x82200000 FW_PAYLOAD=y -FW_PAYLOAD_OFFSET=0x200000 +ifeq ($(OPENSBI_CC_XLEN), 32) + # This needs to be 4MB alligned for 32-bit system + FW_PAYLOAD_OFFSET=0x400000 +else + # This needs to be 2MB alligned for 64-bit system + FW_PAYLOAD_OFFSET=0x200000 +endif FW_PAYLOAD_FDT_ADDR=0x82200000 # External Libraries to include diff --git a/platform/qemu/virt/config.mk b/platform/qemu/virt/config.mk index fcd25c8..cd87745 100644 --- a/platform/qemu/virt/config.mk +++ b/platform/qemu/virt/config.mk @@ -30,12 +30,22 @@ PLATFORM_SYS_CLINT=y # Blobs to build FW_TEXT_START=0x80000000 FW_JUMP=y -# This needs to be 4MB alligned for 32-bit support -FW_JUMP_ADDR=0x80400000 +ifeq ($(OPENSBI_CC_XLEN), 32) + # This needs to be 4MB alligned for 32-bit system + FW_JUMP_ADDR=0x80400000 +else + # This needs to be 2MB alligned for 64-bit system + FW_JUMP_ADDR=0x80200000 +endif FW_JUMP_FDT_ADDR=0x82200000 FW_PAYLOAD=y -# This needs to be 4MB alligned for 32-bit support -FW_PAYLOAD_OFFSET=0x400000 +ifeq ($(OPENSBI_CC_XLEN), 32) + # This needs to be 4MB alligned for 32-bit system + FW_PAYLOAD_OFFSET=0x400000 +else + # This needs to be 2MB alligned for 64-bit system + FW_PAYLOAD_OFFSET=0x200000 +endif FW_PAYLOAD_FDT_ADDR=0x82200000 # External Libraries to include |