From nobody Mon Feb 9 22:38:06 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=1603558931; cv=none; d=zohomail.com; s=zohoarc; b=HDxkEhQj4qAyHIL/VRsn1PkJnKRYkTHbIpLGoaeY8fhUjTCq7gTl6CvHcJptuf0Bpj/az04yyfIHmVbgNvIIrZQKTPkNPNNq0H/e+LgReUYCEVrjm8wMBIZS0VQTkk9yLLGZuoJtgjOe2q0N13fyr/pc9j/Jc59orEnaLOFhgms= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603558931; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cuBUbDkqPu7YN9qL1F67Qvxpg+vH+NzaO82nHRsjbP8=; b=QcIjFlYIn8LuWUSEDDXL7pXGoZxy8Ijo2ndjMwVEQJiMs6UorcKwkFVmpeHNCAKhZmcN0TCHwTthIGz9ayrDvwCMLGKVcPebkQK2i0/H73UzSBb57jlKreMh4xjlWFVUCDL1jqE4NIaoeTxqW+MnQyxccEXYhoMxPCHsz7IcD3M= 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 1603558931644680.7002185889451; Sat, 24 Oct 2020 10:02:11 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id d78so5703899wmd.3 for ; Sat, 24 Oct 2020 10:02:11 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id g5sm10992116wmi.4.2020.10.24.10.02.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 10:02:09 -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=cuBUbDkqPu7YN9qL1F67Qvxpg+vH+NzaO82nHRsjbP8=; b=TfGvL36iVj4ewkGzPw2CN8ilyExWJPmYDd/PL5yYUsBzMoToxRVUfsRr8x58AG/HmJ UfrhOUM8wCOhp++v0nzVlBWD8E/qf6uWQ5Rm8iW054GrFKffeH7yx/i89hZYHk2C4Gfl rd4CPkux6Y12CmLyGGj8RUxzyQ15u81pnTzp0D4G2uOiJYuzIOivsDNvXfyJq2kqcmX2 +fz1esr1Bq8D6OA+nhTO+ZXgtlvQXb37SYQyYGlHbkIzekCmDfpioKJ8CS4Uxzy5Tars /s4jj2AQLqgyAC/b8lKsrBTB97MfcldSpOOyynt5JBzhqyPKKsozvvEYJkE/rXBZRp8J C46w== 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=cuBUbDkqPu7YN9qL1F67Qvxpg+vH+NzaO82nHRsjbP8=; b=gsPp9JbRbIMCFerMBGUNK0IK91n7Ifh2LArNcVpVYF/XFT6dUA4zr10jaVqe9TVeGH vfhKLLlH2xNGwmASHVBMQ9W1t9OW0NztkrxzwdvWyLtE/jPiGuU6VsDWtjiPiMKeKBWR mgcMyZAERvdpNOc+LBncpA8OpoaEJ1P9xWhAZVOhtMSbWe+OxCTi1VO5BJ/WnY9u+4P0 Ss0nsMuSJ0TxRQ5RpNOYBZTlU6zETE/C93Nd0OoKPs95TGoGw/1N4638E19uwhLodqkD wHneGI1x9p1m58jQ9BaLy1gjRzqp8aW44kPfwxX262CkfbdWt8bFA5MkLsUeS5ju/fv0 QS/Q== X-Gm-Message-State: AOAM532DCTrWtTN/Iyolq0lLHmmV3WJ3WzyarelhfuAjX05HI2yxz7As hn7fpBLqxOb4TZ/eRIbIOng= X-Google-Smtp-Source: ABdhPJzrL2c75JeM9cRYXh4tnVGy8vjyqr9C4MfgdyxE7clIMigSZjLzXAvti5Qgy3WwxTfmZqfj1w== X-Received: by 2002:a1c:3243:: with SMTP id y64mr7692111wmy.175.1603558929862; Sat, 24 Oct 2020 10:02:09 -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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , Peter Maydell , qemu-arm@nongnu.org, Luc Michel , Luc Michel , Igor Mammedov Subject: [PATCH v4 8/9] hw/arm/raspi: Add the Raspberry Pi Zero machine Date: Sat, 24 Oct 2020 19:01:26 +0200 Message-Id: <20201024170127.3592182-9-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201024170127.3592182-1-f4bug@amsat.org> References: <20201024170127.3592182-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) Similarly to the Pi A, the Pi Zero uses a BCM2835 SoC (ARMv6Z core). The only difference between the revision 1.2 and 1.3 is the latter exposes a CSI camera connector. As we do not implement the Unicam peripheral, there is no point in exposing a camera connector :) Therefore we choose to model the 1.2 revision. Example booting the machine using content from [*]: $ qemu-system-arm -M raspi0 -serial stdio \ -kernel raspberrypi/firmware/boot/kernel.img \ -dtb raspberrypi/firmware/boot/bcm2708-rpi-zero.dtb \ -append 'printk.time=3D0 earlycon=3Dpl011,0x20201000 console=3DttyAMA= 0' [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.19.118+ (dom@buildbot) (gcc version 4.9.3 = (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1311 Mon Apr 27 14:16:15 B= ST 2020 [ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARM= v7), cr=3D00c5387d [ 0.000000] CPU: VIPT aliasing data cache, unknown instruction cache [ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero ... [*] http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/= raspberrypi-kernel_1.20200512-2_armhf.deb Reviewed-by: Luc Michel Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/raspi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 79fdd354603..0f5ea7e99b5 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -319,6 +319,15 @@ static void raspi_machine_class_common_init(MachineCla= ss *mc, mc->default_ram_id =3D "ram"; }; =20 +static void raspi0_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + RaspiMachineClass *rmc =3D RASPI_MACHINE_CLASS(oc); + + rmc->board_rev =3D 0x920092; /* Revision 1.2 */ + raspi_machine_class_common_init(mc, rmc->board_rev); +}; + static void raspi1ap_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -352,6 +361,10 @@ static void raspi3b_machine_class_init(ObjectClass *oc= , void *data) =20 static const TypeInfo raspi_machine_types[] =3D { { + .name =3D MACHINE_TYPE_NAME("raspi0"), + .parent =3D TYPE_RASPI_MACHINE, + .class_init =3D raspi0_machine_class_init, + }, { .name =3D MACHINE_TYPE_NAME("raspi1ap"), .parent =3D TYPE_RASPI_MACHINE, .class_init =3D raspi1ap_machine_class_init, --=20 2.26.2