All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: qemu-devel@nongnu.org
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH v3 6/8] hw/mips/fuloong2e: Correct cpuclock env
Date: Thu, 24 Dec 2020 11:17:48 +0800	[thread overview]
Message-ID: <20201224031750.52146-7-jiaxun.yang@flygoat.com> (raw)
In-Reply-To: <20201224031750.52146-1-jiaxun.yang@flygoat.com>

It was missed in 3ca7639ff00 ("hw/mips/fuloong2e:
Set CPU frequency to 533 MHz"), we need to tell kernel
correct clocks.

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>
---
 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 c4843dd15e..2744b211fd 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -100,7 +100,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++, "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);
 
@@ -304,7 +304,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.29.2



  parent reply	other threads:[~2020-12-24  3:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-24  3:17 [PATCH v3 0/8] hw/mips/fuloong2e fixes Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 1/8] hw/mips/fuloong2e: Remove define DEBUG_FULOONG2E_INIT Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 2/8] hw/mips/fuloong2e: Relpace fault links Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 3/8] hw/pci-host/bonito: Fixup IRQ mapping Jiaxun Yang
2020-12-24  8:36   ` BALATON Zoltan via
2020-12-24  8:40     ` BALATON Zoltan via
2020-12-25  1:46       ` Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 4/8] hw/pci-host/bonito: Fixup pci.lomem mapping Jiaxun Yang
2021-01-01 11:07   ` Philippe Mathieu-Daudé
2021-01-01 13:03     ` Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 5/8] hw/mips/fuloong2e: Remove unused env entry Jiaxun Yang
2020-12-24  8:24   ` BALATON Zoltan via
2021-01-01 18:05   ` Philippe Mathieu-Daudé
2021-01-01 20:51     ` Philippe Mathieu-Daudé
2020-12-24  3:17 ` Jiaxun Yang [this message]
2020-12-24  3:17 ` [PATCH v3 7/8] hw/mips/fuloong2e: Add highmem support Jiaxun Yang
2020-12-24  3:17 ` [PATCH v3 8/8] tests/acceptance: Test boot_linux_console for fuloong2e Jiaxun Yang
2021-01-03 13:35   ` Philippe Mathieu-Daudé
2021-01-03 20:51 ` [PATCH v3 0/8] hw/mips/fuloong2e fixes Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201224031750.52146-7-jiaxun.yang@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=chenhuacai@kernel.org \
    --cc=crosa@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.