From nobody Tue Feb 10 20:48:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 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=1602943484; cv=none; d=zohomail.com; s=zohoarc; b=ZR6DrYE7Gs+3dbQJgoZDRorfCiKofnpey8RlOYIi1el9+orZhZPrq85mdo2vzVZfydXMzD+UMEa+ugTMQ8tTye5ISYbVR0P6Ck1zyKKgZDCAGx8wq8c57lqawdcYktXF21cJkhtzCDcIY3hZddhhhBNLQ8hJfcFZ9wcAenEwbP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943484; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XmLmCuW1uC91Ho4Ow45XNevc9vvm/zFFsaaxmUUiG5M=; b=dcUqx/iFv86JxnHDEm77Y51GGomCkD9AVIeUqXpueP1Bzarw4orEqG90X7ai7KUtTgpw9NoTsSshZnEmOLtn+zPb2Eq4GyzEd3Ee5jTJ4A63C7SVgR1LsJLQoc9pAawP99wJf6cCiEkYcWWhfVnKXZGTJsRCjUZwGTRV2dXc4PY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1602943484571655.791692394343; Sat, 17 Oct 2020 07:04:44 -0700 (PDT) Received: by mail-wm1-f43.google.com with SMTP id a72so6126503wme.5 for ; Sat, 17 Oct 2020 07:04:43 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id j7sm9226923wrn.81.2020.10.17.07.04.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:42 -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=XmLmCuW1uC91Ho4Ow45XNevc9vvm/zFFsaaxmUUiG5M=; b=mqHNvVO2fTMeS3nBKdm4vhleFvgihW6QRu3mUkC5imATa2QZ2zKtKNyFHkR6Ccot2+ +md8ipYIZm57WNnUPBgSfgg9qi0E0jD6oE295Y8MBqzt7v9H9IOzbWJvyhk7Oud/oc1X eMoib9l90CxJtzMpG/VAALC0aK5FkBi8eRG956I5ayjrpZk2UuIQrWfPeVJ40bR+70yV BGpXsPc3eTxE5jLjTAeUqUamkjgNgR7Y35CdAoCm8Zzyg5JPXo1+rmfe4tcOY7AZPbmO CcjGQmcGwLqSMRQHzqsJ6lCivTjtnw2LmJBf+qzUaNHoHCR79B+k7YbLyoVL1DUSck4s HVBg== 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=XmLmCuW1uC91Ho4Ow45XNevc9vvm/zFFsaaxmUUiG5M=; b=UvlwJGIdbRH3aRp364Q0psnzKrFZk5DLObxnJmF+ig9pYnNrzn2MDXyH95p0rr/qQk NfOwLYyYW/VMViuJHY/q4Rm05G6T4QBzAAXwxDlXQCQdFGkqzQBW9La//77jlzv1xwpJ lP6Dqa+YMMQCA+M9duKsAukBX+GLTt528XE/YAhh6mL+zfG/UdKDG8oLx9bW5h/iGEwb bV1YAD9HFO+DEoVvE3mHX28ZoCNYIA/noMU3o5iW+AtzQTye7dZJwRJHmBMvb2qDrGl3 sStsNtYCnDMnanJWbqXyxtZy9gU3c17ZwYTZJHADrW61T67JgpY1U4xZaJcHkwAIJ1VP fqOw== X-Gm-Message-State: AOAM5334+MPuaC+3n/tno5ih7X81eKmUaN3EV21cl5jNwJ2nWluvlDkS 1mroLJ7ueyi+GwfRft+WQvc= X-Google-Smtp-Source: ABdhPJwj01yC179U9DYlynyObToIbQeXqwPVrPV5r+USZE7Ridb8rpPYLCwGaZB60dbFY1V2tyOFSw== X-Received: by 2002:a05:600c:2144:: with SMTP id v4mr8603091wml.172.1602943482716; Sat, 17 Oct 2020 07:04:42 -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: Jiaxun Yang , Huacai Chen , Paul Burton , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 25/44] hw/mips/jazz: Correct CPU frequencies Date: Sat, 17 Oct 2020 16:02:24 +0200 Message-Id: <20201017140243.1078718-26-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201017140243.1078718-1-f4bug@amsat.org> References: <20201017140243.1078718-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The Magnum 4000PC CPU runs at 100 MHz, and the Acer PICA-61 CPU at ~134 MHz. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201012095804.3335117-17-f4bug@amsat.org> --- hw/mips/jazz.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 47723093b63..8f1ad55ba34 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "hw/clock.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/intc/i8259.h" @@ -142,6 +143,7 @@ static void mips_jazz_init(MachineState *machine, MemoryRegion *address_space =3D get_system_memory(); char *filename; int bios_size, n; + Clock *cpuclk; MIPSCPU *cpu; CPUClass *cc; CPUMIPSState *env; @@ -163,14 +165,25 @@ static void mips_jazz_init(MachineState *machine, MemoryRegion *bios2 =3D g_new(MemoryRegion, 1); SysBusESPState *sysbus_esp; ESPState *esp; + static const struct { + unsigned freq_hz; + unsigned pll_mult; + } ext_clk[] =3D { + [JAZZ_MAGNUM] =3D {50000000, 2}, + [JAZZ_PICA61] =3D {33333333, 4}, + }; =20 if (machine->ram_size > 256 * MiB) { error_report("RAM size more than 256Mb is not supported"); exit(EXIT_FAILURE); } =20 + cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); + clock_set_hz(cpuclk, ext_clk[jazz_model].freq_hz + * ext_clk[jazz_model].pll_mult); + /* init CPUs */ - cpu =3D MIPS_CPU(cpu_create(machine->cpu_type)); + cpu =3D mips_cpu_create_with_clock(machine->cpu_type, cpuclk); env =3D &cpu->env; qemu_register_reset(main_cpu_reset, cpu); =20 --=20 2.26.2