From c2132bb88e1236ca4056b8b813d897a1bc34464d Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Fri, 26 Jul 2024 10:02:19 +0800 Subject: [PATCH] risc-v/rv-virt: use RAM_START in ld.script This revises FLAT build ld.script so that to use CONFIG_RAM_START instead of hard coded address to increase flexibility. Signed-off-by: Yanfeng Liu --- boards/risc-v/qemu-rv/rv-virt/configs/flats/defconfig | 2 +- boards/risc-v/qemu-rv/rv-virt/configs/flats64/defconfig | 2 +- boards/risc-v/qemu-rv/rv-virt/scripts/ld.script | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/boards/risc-v/qemu-rv/rv-virt/configs/flats/defconfig b/boards/risc-v/qemu-rv/rv-virt/configs/flats/defconfig index 634c4f7ac9175..cab54f6a6d56c 100644 --- a/boards/risc-v/qemu-rv/rv-virt/configs/flats/defconfig +++ b/boards/risc-v/qemu-rv/rv-virt/configs/flats/defconfig @@ -52,7 +52,7 @@ CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_READLINE=y CONFIG_PATH_INITIAL="/system/bin" CONFIG_RAM_SIZE=33554432 -CONFIG_RAM_START=0x80000000 +CONFIG_RAM_START=0x80200000 CONFIG_READLINE_CMD_HISTORY=y CONFIG_RISCV_SEMIHOSTING_HOSTFS=y CONFIG_RR_INTERVAL=200 diff --git a/boards/risc-v/qemu-rv/rv-virt/configs/flats64/defconfig b/boards/risc-v/qemu-rv/rv-virt/configs/flats64/defconfig index d3f24d81f166d..23b5ab30b1648 100644 --- a/boards/risc-v/qemu-rv/rv-virt/configs/flats64/defconfig +++ b/boards/risc-v/qemu-rv/rv-virt/configs/flats64/defconfig @@ -55,7 +55,7 @@ CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_READLINE=y CONFIG_PATH_INITIAL="/system/bin" CONFIG_RAM_SIZE=33554432 -CONFIG_RAM_START=0x80000000 +CONFIG_RAM_START=0x80200000 CONFIG_READLINE_CMD_HISTORY=y CONFIG_RISCV_SEMIHOSTING_HOSTFS=y CONFIG_RR_INTERVAL=200 diff --git a/boards/risc-v/qemu-rv/rv-virt/scripts/ld.script b/boards/risc-v/qemu-rv/rv-virt/scripts/ld.script index 1b169a37e9cbb..e2c0bbd82006e 100644 --- a/boards/risc-v/qemu-rv/rv-virt/scripts/ld.script +++ b/boards/risc-v/qemu-rv/rv-virt/scripts/ld.script @@ -20,11 +20,7 @@ #include -#ifdef CONFIG_ARCH_USE_S_MODE -#define TEXT_ADDR 0x80200000 -#else -#define TEXT_ADDR 0x80000000 -#endif +#define TEXT_ADDR CONFIG_RAM_START SECTIONS {