[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/23] RISC-V: Use ROM base address and size
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/23] RISC-V: Use ROM base address and size from memmap |
Date: |
Sat, 10 Mar 2018 21:35:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 03/09/2018 05:12 AM, Michael Clark wrote:
> Another case of replaceing hard coded constants, this time
> referring to the definition in the virt machine's memmap.
>
> Cc: Sagar Karandikar <address@hidden>
> Cc: Bastian Koppelmann <address@hidden>
> Signed-off-by: Michael Clark <address@hidden>
> Signed-off-by: Palmer Dabbelt <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/riscv/virt.c | 4 ++--
> include/hw/riscv/virt.h | 2 --
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 0055439..0d101fc 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -338,11 +338,11 @@ static void riscv_virt_board_init(MachineState *machine)
> };
>
> /* copy in the reset vector */
> - copy_le32_to_phys(ROM_BASE, reset_vec, sizeof(reset_vec));
> + copy_le32_to_phys(memmap[VIRT_MROM].base, reset_vec, sizeof(reset_vec));
>
> /* copy in the device tree */
> qemu_fdt_dumpdtb(s->fdt, s->fdt_size);
> - cpu_physical_memory_write(ROM_BASE + sizeof(reset_vec),
> + cpu_physical_memory_write(memmap[VIRT_MROM].base + sizeof(reset_vec),
> s->fdt, s->fdt_size);
>
> /* create PLIC hart topology configuration string */
> diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
> index 2fbe808..655e85d 100644
> --- a/include/hw/riscv/virt.h
> +++ b/include/hw/riscv/virt.h
> @@ -23,8 +23,6 @@
> #define VIRT(obj) \
> OBJECT_CHECK(RISCVVirtState, (obj), TYPE_RISCV_VIRT_BOARD)
>
> -enum { ROM_BASE = 0x1000 };
> -
> typedef struct {
> /*< private >*/
> SysBusDevice parent_obj;
>
- [Qemu-devel] [PATCH v2 00/23] RISC-V Post-merge spec conformance and cleanup, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 01/23] RISC-V: Make virt create_fdt interface consistent, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 02/23] RISC-V: Replace hardcoded constants with enum values, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 04/23] RISC-V: Use ROM base address and size from memmap, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 05/23] RISC-V: Remove identity_translate from load_elf, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 03/23] RISC-V: Make virt board description match spike, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 06/23] RISC-V: Mark ROM read-only after copying in code, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 07/23] RISC-V: Remove unused class definitions, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 08/23] RISC-V: Make sure rom has space for fdt, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 09/23] RISC-V: Include intruction hex in disassembly, Michael Clark, 2018/03/08
- [Qemu-devel] [PATCH v2 10/23] RISC-V: Hold rcu_read_lock when accessing memory, Michael Clark, 2018/03/08