From nobody Tue Feb 10 10:19:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1601313359; cv=none; d=zohomail.com; s=zohoarc; b=LkYY9bx/rubCMVYJfrc0OYzfG80TLuzY1NdqJKqMaE5MvMojllkF6PZNpWWFnwICg4j0KrH/ONvRB2ItGIEMCTYxC3ptXF71cpppJydsvFp66yhPlw4ShWMtJ5N+3W7zWx8X/ZgOk4ZFYegavxt7Vo379qSiMiNWwH0CuSOOtOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601313359; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r+U9x/gecjwhaxSv786ubx8yYIvjY9xUzlQ4g9WyIPM=; b=gRP5BDfU82F5CWc4T+P7OyL7QRJgrH/79eCRd86Nkgj5UylIDV2io5hrp8XnmnsOfqsWgXnPO97QSw9WVJKRCm2lg+8WLiYrjVda1DIu9yH7BpFRxYU5dRtqYR7Rz+qLhdbKfvj6Ygj0mqWE9bb7Tt373Yy6fSSUdHi21RYIJYg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 160131335934091.95312595261873; Mon, 28 Sep 2020 10:15:59 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id a9so1948244wmm.2 for ; Mon, 28 Sep 2020 10:15:58 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id z67sm464787wme.41.2020.09.28.10.15.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 10:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r+U9x/gecjwhaxSv786ubx8yYIvjY9xUzlQ4g9WyIPM=; b=kCeHcv5brC+Qe+whSEartTnY8z08yYclKkNSBAFBXvtFa+9SSJUeElsYYi3PxH6fy8 z+2GE2QjlRMRew7rGf7kSwxefXT3rieVBJZ+xivkMYgRJ+8GGBh70s4qIKzuO7aF66or QG/fLzBh34YjgT0ne2vutiU8pvIAt0WflXDNOyiI1yyUAKeSnbiuWbUsR/5nnIF0lcNp 5ycdCm6gomyD4yNJJy74qB2VcNGRcr38VV5GZUM5tQmh8gbAUm/1cLvVZFOZ2JwbZbTH H6IVSjACTRx8/FeageAa+GG3EdLKFJUjk1EQB9+ATOvmzTl6RU9pC/E3sxog7J8JHP1B tXCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=r+U9x/gecjwhaxSv786ubx8yYIvjY9xUzlQ4g9WyIPM=; b=YlpdN8BOvGxaOIVGSW5o4Anv0WU6/zqSjQ+pIf/8zHrMXWluvMvBoWb7zPoCEsQrfg zkuqYawuFUthbuLeQ32P4vBZmLACOMiCr3sjmBPGWCZQQorfHfEU4L43hKcYrxHURR3r fRG3pLxRIeWbJKH2/xpf2C4ypAHNdoY3rHpsM0h6p4gAzmL1RdYODgGwxXtXEDw8izHC yHqKP42Skjvga5eZM4kRy+NHgn813nTwyPQUlmlk1UMZWjVgzjRpHgOllqz9+0AV2YFO QB5xvCHvf1Fh2JERA3e9mfa532aXnypHv9Thg8RhVuE9NsD6bdwZJLoKQE2Lk6+HCs+6 eLFg== X-Gm-Message-State: AOAM531PoDbB/gP0ppbkf3oB4ARpHY04IErmG9DLpeD8icbPwqOo/Wqb A0ogzkyvdnzhY88kMZH+17s= X-Google-Smtp-Source: ABdhPJyg65BRW+oZ4tEB50bqugGwYDFWgP5f8A+z27+EORiRJerLRcxX9SwbpEpKvaoh7vUBQmVGaA== X-Received: by 2002:a1c:f008:: with SMTP id a8mr178411wmb.155.1601313357147; Mon, 28 Sep 2020 10:15:57 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Wainer dos Santos Moschetta , Richard Henderson , Paul Burton , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Damien Hedde , Jiaxun Yang , Huacai Chen , Cleber Rosa , Marcel Apfelbaum , Huacai Chen , Eduardo Habkost , "Edgar E . Iglesias" , Aurelien Jarno Subject: [PATCH 09/16] hw/mips/mipssim: Correct CPU frequency Date: Mon, 28 Sep 2020 19:15:32 +0200 Message-Id: <20200928171539.788309-10-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200928171539.788309-1-f4bug@amsat.org> References: <20200928171539.788309-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The MIPSsim machine CPU frequency is too fast running at 200 MHz, while it should be 12 MHz for the 24K and 6 MHz for the 5K core. Ref: Linux commit c78cbf49c4ed ("Support for MIPSsim, the cycle accurate MIPS simulator.") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/mipssim.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index 1b3b7622035..6660af19c18 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -40,6 +40,7 @@ #include "hw/loader.h" #include "elf.h" #include "hw/sysbus.h" +#include "hw/qdev-clock.h" #include "hw/qdev-properties.h" #include "exec/address-spaces.h" #include "qemu/error-report.h" @@ -152,11 +153,20 @@ mips_mipssim_init(MachineState *machine) MemoryRegion *bios =3D g_new(MemoryRegion, 1); MIPSCPU *cpu; CPUMIPSState *env; + Clock *cpuclk; ResetData *reset_info; int bios_size; =20 /* Init CPUs. */ - cpu =3D MIPS_CPU(cpu_create(machine->cpu_type)); + cpu =3D MIPS_CPU(object_new(machine->cpu_type)); + cpuclk =3D qdev_init_clock_out(DEVICE(cpu), "cpuclk"); +#ifdef TARGET_MIPS64 + clock_set_hz(cpuclk, 6000000); /* 6 MHz */ +#else + clock_set_hz(cpuclk, 12000000); /* 12 MHz */ +#endif + qdev_connect_clock_in(DEVICE(cpu), "clk", cpuclk); + qdev_realize(DEVICE(cpu), NULL, &error_abort); env =3D &cpu->env; =20 reset_info =3D g_malloc0(sizeof(ResetData)); --=20 2.26.2