Skip to content

Commit cfa3263

Browse files
lbmengalistair23
authored andcommitted
hw/riscv: sifive_u: Add a new property msel for MSEL pin state
On SiFive FU540 SoC, the value stored at physical address 0x1000 stores the MSEL pin state that is used to control the next boot location that ROM codes jump to. Add a new property msel to sifive_u machine for this. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Message-id: [email protected] Message-Id: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
1 parent 3e9667c commit cfa3263

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

hw/riscv/sifive_u.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,13 @@ static void sifive_u_machine_instance_init(Object *obj)
504504
"Set on to tell QEMU's ROM to jump to "
505505
"flash. Otherwise QEMU will jump to DRAM");
506506

507+
s->msel = 0;
508+
object_property_add(obj, "msel", "uint32",
509+
sifive_u_machine_get_uint32_prop,
510+
sifive_u_machine_set_uint32_prop, NULL, &s->msel);
511+
object_property_set_description(obj, "msel",
512+
"Mode Select (MSEL[3:0]) pin state");
513+
507514
s->serial = OTP_SERIAL;
508515
object_property_add(obj, "serial", "uint32",
509516
sifive_u_machine_get_uint32_prop,

include/hw/riscv/sifive_u.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ typedef struct SiFiveUState {
6363
int fdt_size;
6464

6565
bool start_in_flash;
66+
uint32_t msel;
6667
uint32_t serial;
6768
} SiFiveUState;
6869

0 commit comments

Comments
 (0)