diff options
author | Anup Patel <apatel@ventanamicro.com> | 2023-03-02 06:14:06 -0300 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2023-03-05 12:07:30 -0800 |
commit | 007698632814b4b4aeae1a9c176d932951e9c8cf (patch) | |
tree | c93da832e14f24dafb4cfefb3b37f808ee10bee6 /hw | |
parent | 59cb29d6a5149871d1acb18fb465879b1af5f3b2 (diff) | |
download | qemu-007698632814b4b4aeae1a9c176d932951e9c8cf.zip qemu-007698632814b4b4aeae1a9c176d932951e9c8cf.tar.gz qemu-007698632814b4b4aeae1a9c176d932951e9c8cf.tar.bz2 |
hw/riscv/virt.c: add cbo[mz]-block-size fdt properties
The cbom-block-size fdt property property is used to inform the OS about
the blocksize in bytes for the Zicbom cache operations. Linux documents
it in Documentation/devicetree/bindings/riscv/cpus.yaml
as:
riscv,cbom-block-size:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The blocksize in bytes for the Zicbom cache operations.
cboz-block-size has the same role but for the Zicboz extension, i.e.
informs the size in bytes for Zicboz cache operations. Linux support
for it is under review/approval in [1]. Patch 3 of that series describes
cboz-block-size as:
riscv,cboz-block-size:
$ref: /schemas/types.yaml#/definitions/uint32
description:
The blocksize in bytes for the Zicboz cache operations.
[1] https://lore.kernel.org/all/20230224162631.405473-1-ajones@ventanamicro.com/
Cc: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
Message-ID: <20230302091406.407824-2-dbarboza@ventanamicro.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/riscv/virt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4f81918..7f70fa1 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -249,6 +249,17 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int socket, name = riscv_isa_string(cpu_ptr); qemu_fdt_setprop_string(ms->fdt, cpu_name, "riscv,isa", name); g_free(name); + + if (cpu_ptr->cfg.ext_icbom) { + qemu_fdt_setprop_cell(ms->fdt, cpu_name, "riscv,cbom-block-size", + cpu_ptr->cfg.cbom_blocksize); + } + + if (cpu_ptr->cfg.ext_icboz) { + qemu_fdt_setprop_cell(ms->fdt, cpu_name, "riscv,cboz-block-size", + cpu_ptr->cfg.cboz_blocksize); + } + qemu_fdt_setprop_string(ms->fdt, cpu_name, "compatible", "riscv"); qemu_fdt_setprop_string(ms->fdt, cpu_name, "status", "okay"); qemu_fdt_setprop_cell(ms->fdt, cpu_name, "reg", |