Skip to contentSkip to conversation

hw/riscv/server_platform_ref: Fix mtimer frequency

PATCH Applied Sunil V L 3 participants 4 messages Nov 11 – Nov 12 RISC-V

lore
Share & tools
lore

Sunil V L

author
#0 lore raw

PATCH 1/1 hw/riscv/server_platform_ref: Fix mtimer frequency

The RISC-V server reference platform requires a 1 GHz timer frequency. Although the timer frequency is advertised as 1 GHz in the device tree, the mtimer device is still created with a 10 MHz frequency. This mismatch causes the OS to boot very slowly.

Use the correct 1 GHz frequency when creating the mtimer device.

Fixes c2fa4320803b ("hw/riscv: server platform reference machine")
---
 hw/riscv/server_platform_ref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/riscv/server_platform_ref.c +1 -1
index 5f485b1c79cb..fec967f708c2 100644
@@ -556,7 +556,7 @@ static void rvserver_ref_machine_init(MachineState *machine)
                 base_hartid, hart_count,
                 RISCV_ACLINT_DEFAULT_MTIMECMP,
                 RISCV_ACLINT_DEFAULT_MTIME,
-                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
+                RVSERVER_ACLINT_TIMEBASE_FREQ, true);
 
         /* Per-socket interrupt controller */
         s->irqchip[i] = riscv_create_aia(system_memory, true, s->aia_guests,
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Sunil V L

The RISC-V server reference platform requires a 1 GHz timer frequency. Although the timer frequency is advertised as 1 GHz in the device tree, the mtimer device is still created with a 10 MHz frequency. This mismatch causes the OS to boot very slowly.

Use the correct 1 GHz frequency when creating the mtimer device.

Fixes c2fa4320803b ("hw/riscv: server platform reference machine")

---

I believe this is suitable for a freeze PR. Thanks,

Daniel

Quoted 16 lines
  hw/riscv/server_platform_ref.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/riscv/server_platform_ref.c +1 -1
index 5f485b1c79cb..fec967f708c2 100644
@@ -556,7 +556,7 @@ static void rvserver_ref_machine_init(MachineState *machine)
                  base_hartid, hart_count,
                  RISCV_ACLINT_DEFAULT_MTIMECMP,
                  RISCV_ACLINT_DEFAULT_MTIME,
-                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
+                RVSERVER_ACLINT_TIMEBASE_FREQ, true);
 
          /* Per-socket interrupt controller */
          s->irqchip[i] = riscv_create_aia(system_memory, true, s->aia_guests,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Sunil V L
Quoted 8 lines · Sunil V L

The RISC-V server reference platform requires a 1 GHz timer frequency.
Although the timer frequency is advertised as 1 GHz in the device tree,
the mtimer device is still created with a 10 MHz frequency. This mismatch
causes the OS to boot very slowly.

Quoted 4 lines

Use the correct 1 GHz frequency when creating the mtimer device.

Fixes c2fa4320803b ("hw/riscv: server platform reference machine")

Alistair

Quoted 20 lines

---
 hw/riscv/server_platform_ref.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
hw/riscv/server_platform_ref.c +1 -1
index 5f485b1c79cb..fec967f708c2 100644
@@ -556,7 +556,7 @@ static void
 rvserver_ref_machine_init(MachineState *machine)
                  base_hartid, hart_count,
                  RISCV_ACLINT_DEFAULT_MTIMECMP,
                  RISCV_ACLINT_DEFAULT_MTIME,
-                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
+                RVSERVER_ACLINT_TIMEBASE_FREQ, true);


         /* Per-socket interrupt controller */ s->irqchip[i] = riscv_create_aia(system_memory, true, s-

Quoted 1 line

aia_guests,

#3 lore raw
In reply to Sunil V L
Quoted 8 lines · Sunil V L

The RISC-V server reference platform requires a 1 GHz timer frequency.
Although the timer frequency is advertised as 1 GHz in the device tree,
the mtimer device is still created with a 10 MHz frequency. This mismatch
causes the OS to boot very slowly.

Quoted 4 lines

Use the correct 1 GHz frequency when creating the mtimer device.

Fixes c2fa4320803b ("hw/riscv: server platform reference machine")

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 20 lines

---
 hw/riscv/server_platform_ref.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
hw/riscv/server_platform_ref.c +1 -1
index 5f485b1c79cb..fec967f708c2 100644
@@ -556,7 +556,7 @@ static void
 rvserver_ref_machine_init(MachineState *machine)
                  base_hartid, hart_count,
                  RISCV_ACLINT_DEFAULT_MTIMECMP,
                  RISCV_ACLINT_DEFAULT_MTIME,
-                RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, true);
+                RVSERVER_ACLINT_TIMEBASE_FREQ, true);


         /* Per-socket interrupt controller */ s->irqchip[i] = riscv_create_aia(system_memory, true, s-

Quoted 1 line

aia_guests,