From nobody Tue Feb 10 01:50:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1602943475; cv=none; d=zohomail.com; s=zohoarc; b=Bj60RjYyxNBn2U5g985AQ3cm5zS4DEq7r7FCF2YYV4EQ482yE0z8UTvQFXqGLKUmv/mYJhPntMu+7tR5CWrg1ibvQdcMX+Sw0t+JO0JKifQ+ffkeLKOMUKKmnXovAHQ11cDa0/JNdbUpMVqx8YFso1AndHDP0IvLmMPh0605J2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602943475; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2du0I+yb+HwbuymUy7ZKJilfZng7wrSnlIMlk5mAbJI=; b=dyE1OBlgeJsHCHhda4bf4F9SIelttCfc8AamP2WiepC3ewDpCG5BwPzQgrq+CL31+eu3Fa8LG9rAD0jUZKoHoGkAAEjFeamHvOAHXHaG7v/1loOI+96EbvDNn1rtWKrF74fW6XJtG15GQmy6/Ru4FDxze/RpIhPGNeqgPs8NrDI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1602943475257812.2483491547339; Sat, 17 Oct 2020 07:04:35 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id d3so8367788wma.4 for ; Sat, 17 Oct 2020 07:04:34 -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 i33sm9106111wri.79.2020.10.17.07.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 07:04:32 -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=2du0I+yb+HwbuymUy7ZKJilfZng7wrSnlIMlk5mAbJI=; b=iEPscC/Krn7YrA07zMjweZVyt0/W+ECwh9ZMJRBs2yXBAANa9yUZ6Hf2H+Ab3fWR0W oK+jne/InRQHMFjtMLRHAIXX5V82fJRj14ekuqSzzYg2uj1oLMOgJNHThBYjNpWwjc1N E1zbC9k1vy9DWuyyy9k5a/LPDb19nAXUV1zGJNxMETd1L9+6PYLiNv+xGlq/S6t8pMqr vmPhgzD6EzqPy29EtS04Fbb9++Ey4cBI+flF2vrUSKcj/whDZAyUfokz4lc3QRymgRnT 2eLryTNVFUD7N88MUXd9KZ/bdogPy1DGKTK3aV9WuQzn0OT3rQubBv3MG3yWQL63vvMH zOxg== 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=2du0I+yb+HwbuymUy7ZKJilfZng7wrSnlIMlk5mAbJI=; b=jDnkRtDh02lZWKaBLF/VjumFkfRyiwyZuGxUNbdS0UHS+Ui5OAs9XYWZQ4lXCAJFkl nfVmxLqoN4w+zjslYHMUs59d9G3nO0MrSdZGhWrM/U2WRVb87dGWrATOChogc9XyCA8K xqNOP4US9kKdBqAG64uSThZ1hRrebPnHbcFSw3ikopvOojzmSu1kAsBIBfBkZ7eIhiWt pZUYDv3qm4S9pl6IWd3oFpODv5n9nBi1Z0+9Dbk3fH7dxiv5V0QiBDm3FsWMXB3wY6nJ XOc3CP6LFXkONh8A4eLVFCctd/YVxhXXRSftIsEAzOy6LBvfBO79BLzjq+TB52aYDSei jftA== X-Gm-Message-State: AOAM531mxDpljfcumWL8+x+DMUzcNMWsb2XKmh4lvb1AoSKjEM089kK0 ZmQ1ZP1Sdb89yATzC05Bh00= X-Google-Smtp-Source: ABdhPJwJ6w2hjGX0HLJUBBmgfA1ehblMkszC93hdqLx70HXtb52c+i1jH/5ZIw+SVPzXwxhLZqleEA== X-Received: by 2002:a1c:7d54:: with SMTP id y81mr8342558wmc.114.1602943473422; Sat, 17 Oct 2020 07:04:33 -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 23/44] hw/mips/fuloong2e: Set CPU frequency to 533 MHz Date: Sat, 17 Oct 2020 16:02:22 +0200 Message-Id: <20201017140243.1078718-24-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 CPU frequency is normally provided by the firmware in the "cpuclock" environment variable. The 2E board can handles up to 660MHz, but be conservative and take the same value used by the Linux kernel: 533 MHz. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Jiaxun Yang Message-Id: <20201012095804.3335117-15-f4bug@amsat.org> --- hw/mips/fuloong2e.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index b000ed1d7f7..b8234f61083 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -23,6 +23,7 @@ #include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" +#include "hw/clock.h" #include "hw/intc/i8259.h" #include "hw/dma/i8257.h" #include "hw/isa/superio.h" @@ -298,12 +299,16 @@ static void mips_fuloong2e_init(MachineState *machine) PCIBus *pci_bus; ISABus *isa_bus; I2CBus *smbus; + Clock *cpuclk; MIPSCPU *cpu; CPUMIPSState *env; DeviceState *dev; =20 + cpuclk =3D clock_new(OBJECT(machine), "cpu-refclk"); + clock_set_hz(cpuclk, 533080000); /* ~533 MHz */ + /* 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; =20 qemu_register_reset(main_cpu_reset, cpu); --=20 2.26.2