From nobody Tue Feb 10 03:38:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) client-ip=209.85.221.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1603053280; cv=none; d=zohomail.com; s=zohoarc; b=d/nVhy4GL5i+MDVi8i1fMRMCjT6xkJvj+KPM7z6HkbRkaOmJMQKO9tpN/DvttNSsZ+CfAt6a2X/fg4EZrb2aBFXbb9kk4x0YQ47G65RAM8jnE0fka3aHu5YsUAELtsUOjIS/WvSqpehnmlHTtwvUluLflIz6scpOVWm9T5KhrPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603053280; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=T+AjHLV6TbQto2ptPmPM4vzjwRMfK43yR9xTQuzop2M=; b=HWe7r0Zs2nnV2CkXYYeUeoOqCTRpvu9bJ2E+brN+klvcD5ZhNEavTloJ2kEY3KaWXdf/JRFlnP635L8wZPwx2bNp5Tbuf9Crap+EbVJHuBWsulTsKYp0EDvkYY4Uqq7K47rW66MzYBJIUWXlVe4Ek/c3rU/34z2lilv5T5aTf2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.zohomail.com with SMTPS id 1603053280346396.35127239132726; Sun, 18 Oct 2020 13:34:40 -0700 (PDT) Received: by mail-wr1-f68.google.com with SMTP id b8so9180093wrn.0 for ; Sun, 18 Oct 2020 13:34:39 -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 g5sm13452489wmi.4.2020.10.18.13.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:37 -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=T+AjHLV6TbQto2ptPmPM4vzjwRMfK43yR9xTQuzop2M=; b=gMCc+q6SdNQ3Y5/Lz5suHD7Sacqw2KW33mm+3gmrGycb3IJ5VTTWGu0E5skFyEW2g2 9K595vduWOx6Hv4dGn4hCMCKKJhmRj21Oib5JKCsOjgLcfWerhlqxzW8wMOKexfgo6ii pXo9HXyLmgcU7PZlCAJP0kr/P4RoWX653itwEob05mGTtOta64SAIspDplmIKcD7VIxC kRAq+sLVklt44uoJpkajtkP3UB/6/SdL4aUYYnC2YvZLerZXvfa6rfnZTXvtI3H7j8bL ZeaNiMFpBNgS1T2y6MYZVy/cjC/roGiB+W4yNxTJjB6kQ8tt6MIc0jTkcNAngG3WHjDL QsMQ== 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=T+AjHLV6TbQto2ptPmPM4vzjwRMfK43yR9xTQuzop2M=; b=aYQymT3v7sTdgatrnOXVKwCQLUyLHN2QcXfmNyvbiDsZvxR6Tlg2TzIpPrlT2uXFlw LtFmiEtjV6yqblCCG1T/ZhOvEboVJDunfpylyMlGY/cxWH9+G60vu1B6VqXtfLO9G9GT HWhtwmJqEaKtCNTojg2UHyncVauK/CFR1vTbpwlyle7nFnXuNhqUnJPEbbeOrWrobYc2 JjE9UuHlfdV4O90PEjaikE6E369UDHJAoQt4Def0fekvox2i/AvOA2WlmHq05LDKzgI8 dGPYWMBn7EVUJAJfvmMnxQDBRiETpX4csqR4keVcJIrpj4cX3bpc0x5A237htYXHguee SotA== X-Gm-Message-State: AOAM531USJBiGic7wl02pU84vJ6rv22yxqhwx7wyNEDtDzQdnsLcaKSz 9crSzr2X8IUDL/KE0vEprnU= X-Google-Smtp-Source: ABdhPJx2TkLFDVsQzdqrE1shupbQBccbEwjXO1yjvXlOPG5IeX2dA9iMLsz4e74JxO7RDJbK0V4mLg== X-Received: by 2002:a5d:6a49:: with SMTP id t9mr15964543wrw.194.1603053278522; Sun, 18 Oct 2020 13:34:38 -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?= , Peter Maydell , Luc Michel , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Subject: [PATCH v3 8/9] hw/arm/raspi: Add the Raspberry Pi Zero machine Date: Sun, 18 Oct 2020 22:33:57 +0200 Message-Id: <20201018203358.1530378-9-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201018203358.1530378-1-f4bug@amsat.org> References: <20201018203358.1530378-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). 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 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Igor Mammedov --- hw/arm/raspi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 91a59d1d489..1510ca01afe 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 0x900092; + 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