[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 12/20] hw/mips/r4k: Explicit CPU frequency is 200 MHz
From: |
chen huacai |
Subject: |
Re: [PATCH v3 12/20] hw/mips/r4k: Explicit CPU frequency is 200 MHz |
Date: |
Sun, 11 Oct 2020 11:52:41 +0800 |
Hi, Philippe,
On Sun, Oct 11, 2020 at 4:43 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Since its introduction in commit 6af0bf9c7c3,
> the 'r4k' machine runs at 200 MHz.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/mips/r4k.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/mips/r4k.c b/hw/mips/r4k.c
> index 3487013a4a1..e64687b505a 100644
> --- a/hw/mips/r4k.c
> +++ b/hw/mips/r4k.c
> @@ -37,6 +37,7 @@
> #include "sysemu/reset.h"
> #include "sysemu/runstate.h"
> #include "qemu/error-report.h"
> +#include "hw/qdev-clock.h"
>
> #define MAX_IDE_BUS 2
>
> @@ -184,6 +185,7 @@ void mips_r4k_init(MachineState *machine)
> int bios_size;
> MIPSCPU *cpu;
> CPUMIPSState *env;
> + Clock *cpuclk;
> ResetData *reset_info;
> int i;
> qemu_irq *i8259;
> @@ -193,7 +195,11 @@ void mips_r4k_init(MachineState *machine)
> int be;
>
> /* init CPUs */
> - cpu = MIPS_CPU(cpu_create(machine->cpu_type));
> + cpu = MIPS_CPU(object_new(machine->cpu_type));
> + cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
> + clock_set_hz(cpuclk, 200000000); /* 200 MHz */
> + qdev_connect_clock_in(DEVICE(cpu), "clk-in", cpuclk);
> + qdev_realize(DEVICE(cpu), NULL, &error_abort);
Can we add a new parameter to cpu_create() and set the freq in the core code?
Huacai
> env = &cpu->env;
>
> reset_info = g_malloc0(sizeof(ResetData));
> --
> 2.26.2
>
--
Huacai Chen
- [PATCH v3 08/20] target/mips: Move cp0_count_ns to CPUMIPSState, (continued)
- [PATCH v3 08/20] target/mips: Move cp0_count_ns to CPUMIPSState, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 05/20] target/mips: Move cpu_mips_get_random() with CP0 helpers, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 07/20] target/mips/cp0_timer: Document TIMER_PERIOD origin, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 09/20] target/mips/cpu: Calculate the CP0 timer period using the CPU frequency, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 10/20] target/mips/cpu: Make cp0_count_rate a property, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 11/20] target/mips/cpu: Allow the CPU to use dynamic frequencies, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 12/20] hw/mips/r4k: Explicit CPU frequency is 200 MHz, Philippe Mathieu-Daudé, 2020/10/10
- Re: [PATCH v3 12/20] hw/mips/r4k: Explicit CPU frequency is 200 MHz,
chen huacai <=
- [PATCH v3 14/20] hw/mips/mipssim: Correct CPU frequency, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 18/20] hw/mips/malta: Set CPU frequency to 320 MHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 20/20] target/mips/cpu: Display warning when CPU is used without input clock, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 17/20] hw/mips/boston: Set CPU frequency to 1 GHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 13/20] hw/mips/fuloong2e: Set CPU frequency to 533 MHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 16/20] hw/mips/cps: Expose input clock and connect it to CPU cores, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v3 15/20] hw/mips/jazz: Correct CPU frequencies, Philippe Mathieu-Daudé, 2020/10/10