[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 34/35] hw/mips/fuloong2e: Correct cpuclock in PROM environment
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 34/35] hw/mips/fuloong2e: Correct cpuclock in PROM environment |
Date: |
Sun, 3 Jan 2021 21:50:20 +0100 |
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
Missed in 3ca7639ff00 ("hw/mips/fuloong2e: Set CPU frequency
to 533 MHz"), we need to tell the kernel the correct clock.
Fixes: 3ca7639ff00 ("hw/mips/fuloong2e: Set CPU frequency to 533 MHz").
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201224031750.52146-7-jiaxun.yang@flygoat.com>
[PMD: Reworded]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/mips/fuloong2e.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 9b44ac6cf97..29805242caa 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -99,7 +99,7 @@ static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf,
int index,
va_end(ap);
}
-static uint64_t load_kernel(CPUMIPSState *env)
+static uint64_t load_kernel(MIPSCPU *cpu)
{
uint64_t kernel_entry, kernel_high, initrd_size;
int index = 0;
@@ -159,7 +159,7 @@ static uint64_t load_kernel(CPUMIPSState *env)
/* Setup minimum environment variables */
prom_set(prom_buf, index++, "busclock=33000000");
- prom_set(prom_buf, index++, "cpuclock=100000000");
+ prom_set(prom_buf, index++, "cpuclock=%u", clock_get_hz(cpu->clock));
prom_set(prom_buf, index++, "memsize=%"PRIi64, loaderparams.ram_size /
MiB);
prom_set(prom_buf, index++, NULL);
@@ -330,7 +330,7 @@ static void mips_fuloong2e_init(MachineState *machine)
loaderparams.kernel_filename = kernel_filename;
loaderparams.kernel_cmdline = kernel_cmdline;
loaderparams.initrd_filename = initrd_filename;
- kernel_entry = load_kernel(env);
+ kernel_entry = load_kernel(cpu);
write_bootloader(env, memory_region_get_ram_ptr(bios), kernel_entry);
} else {
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
--
2.26.2
- Re: [PULL 23/35] hw/intc: Rework Loongson LIOINTC, (continued)
- [PULL 25/35] hw/mips: Add Loongson-3 boot parameter helpers, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 26/35] hw/mips: Add Loongson-3 machine support, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 27/35] docs/system: Update MIPS machine documentation, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 28/35] hw/mips: Make bootloader addresses unsigned, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 29/35] hw/mips/malta: Use address translation helper to calculate bootloader_run_addr, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 30/35] hw/mips: Use address translation helper to handle ENVP_ADDR, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 31/35] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 32/35] hw/mips/fuloong2e: Replace faulty documentation links, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 33/35] hw/mips/fuloong2e: Remove unused env entry, Philippe Mathieu-Daudé, 2021/01/03
- [PULL 34/35] hw/mips/fuloong2e: Correct cpuclock in PROM environment,
Philippe Mathieu-Daudé <=
- [PULL 35/35] tests/acceptance: Test boot_linux_console for fuloong2e, Philippe Mathieu-Daudé, 2021/01/03
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Peter Maydell, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Peter Maydell, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Peter Maydell, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Philippe Mathieu-Daudé, 2021/01/04
- Re: [PULL 00/35] MIPS patches for 2021-01-03, Huacai Chen, 2021/01/04