On 11/1/23 17:25, Gavin Shan wrote:
Set mc->valid_cpu_types so that the user specified CPU type can
be validated in machine_run_board_init(). We needn't to do it
by ourselves.

Signed-off-by: Gavin Shan <gs...@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  hw/riscv/shakti_c.c | 11 +++++------
  1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/riscv/shakti_c.c b/hw/riscv/shakti_c.c
index 12ea74b032..fc83ed4db4 100644
--- a/hw/riscv/shakti_c.c
+++ b/hw/riscv/shakti_c.c
@@ -28,6 +28,10 @@
  #include "exec/address-spaces.h"
  #include "hw/riscv/boot.h"
+static const char * const valid_cpu_types[] = {
+    RISCV_CPU_TYPE_NAME("shakti-c"),
+    NULL
+};

Why are you using a different form here...

@@ -85,6 +83,7 @@ static void shakti_c_machine_class_init(ObjectClass *klass, 
void *data)
      mc->desc = "RISC-V Board compatible with Shakti SDK";
      mc->init = shakti_c_machine_state_init;
      mc->default_cpu_type = TYPE_RISCV_CPU_SHAKTI_C;

... than here?


r~

+    mc->valid_cpu_types = valid_cpu_types;
      mc->default_ram_id = "riscv.shakti.c.ram";
  }


Reply via email to