From patchwork Sun Oct 18 20:33:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 271035 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AD17C433DF for ; Sun, 18 Oct 2020 20:36:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E88072227E for ; Sun, 18 Oct 2020 20:36:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NTw7BVNe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E88072227E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFPP-0003Mf-2c for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:36:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFNa-0001dc-MS; Sun, 18 Oct 2020 16:34:10 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35171) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNY-0000xd-KX; Sun, 18 Oct 2020 16:34:10 -0400 Received: by mail-wr1-x442.google.com with SMTP id n15so9154030wrq.2; Sun, 18 Oct 2020 13:34:07 -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=JltEwXbGzmO7Iz477A1CNJvyjNGP/jwshVCvgGssOxI=; b=NTw7BVNemAHcvBRqoWTLshLu4jivqW5YakETFN99wdCcTKLZ6jH/BTv33U+nyWBrIv ka09/4NG1rqLvsg0NrKDmgykvh7hTIufA8Caq1FrrqLzvoePoP2KGasoPTP0v8v6BJJl VDVECrB9WCHdDee95IKbb6xVEnlVKzCLNHif69qGtvPv8sqSIiXles+4v+DO+MW/RDld K/bSOtU7AVWp2hgdJyDsxUPSrcW5FTpJs3FSymbK8wrSdzfxj1MpOFQkzpe8jw4SJpFe xdCygaRZ0tYPjfz1edSnVxOd8tTlnkTQRz6zOu+MfM05nhfyY93l0V5J+6mk2KL8e1Kf SNKQ== 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=JltEwXbGzmO7Iz477A1CNJvyjNGP/jwshVCvgGssOxI=; b=GGLt6e3A7why+12B8fOx5RSN4GSYE6BwO8bwL30hxNBS822nlAhYcb50oQXz1NMJy2 qXLK3CrF+o6yWFg/MWBNoPYcW2uijYjnQCsJFbXw3KH6fvTfzibbLIxHSGB3c/6tBz8U xN4Mi85bhfoAJwynaEfrPVQo2SwC0GxPMEjA9/0HF/VoISeSPeV4nY/8Oh1Dj+I7IqGn 3jSQKWFtv8LwVH+eY02PwyKc64IdnrQoWkxaFJzgGRWsOAFyZ4s8DOWTt+Q+L3+/O6dp Ems+XjP97wlCvCFyTQxPxlcqQ/aYZs82YUkQb5nt86SaYZLV37zGpBzv28yR2tIm2oC5 l4Tw== X-Gm-Message-State: AOAM530BuTvfLVstkajBNhQP3SVjwYBBxoEYuEDiD81FIl7ss4gbXLUL KkfpoSPJWZhilJBf1yr+3iLuJI/kIn4= X-Google-Smtp-Source: ABdhPJzl/cpUUSyqCT4RVaRiQObPh5b8VF72su4Twl/WOxKA9meLc4tXPxcd1lhx0Bc0rs10gKPsgw== X-Received: by 2002:a5d:44cb:: with SMTP id z11mr15831401wrr.290.1603053246274; Sun, 18 Oct 2020 13:34:06 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id k16sm13828755wmi.5.2020.10.18.13.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 1/9] hw/arm/bcm2836: Restrict BCM283XInfo declaration to C source Date: Sun, 18 Oct 2020 22:33:50 +0200 Message-Id: <20201018203358.1530378-2-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 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" No code out of bcm2836.c uses (or requires) the BCM283XInfo declarations. Move it locally to the C source file. Reviewed-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé --- include/hw/arm/bcm2836.h | 8 -------- hw/arm/bcm2836.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 428c15d316e..43e9f8cd0ef 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -43,12 +43,4 @@ struct BCM283XState { BCM2835PeripheralState peripherals; }; -typedef struct BCM283XInfo BCM283XInfo; - -struct BCM283XClass { - DeviceClass parent_class; - const BCM283XInfo *info; -}; - - #endif /* BCM2836_H */ diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index f15cc3b4053..e7cc2c930d9 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -17,6 +17,15 @@ #include "hw/arm/raspi_platform.h" #include "hw/sysbus.h" +typedef struct BCM283XInfo BCM283XInfo; + +typedef struct BCM283XClass { + /*< private >*/ + DeviceClass parent_class; + /*< public >*/ + const BCM283XInfo *info; +} BCM283XClass; + struct BCM283XInfo { const char *name; const char *cpu_type; @@ -25,6 +34,11 @@ struct BCM283XInfo { int clusterid; }; +#define BCM283X_CLASS(klass) \ + OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) +#define BCM283X_GET_CLASS(obj) \ + OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) + static const BCM283XInfo bcm283x_socs[] = { { .name = TYPE_BCM2836, From patchwork Sun Oct 18 20:33:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 271034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23E71C433E7 for ; Sun, 18 Oct 2020 20:37:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF8B922277 for ; Sun, 18 Oct 2020 20:37:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XPVK9BnV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF8B922277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFQj-0006J7-TQ for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:37:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFNf-0001go-Ev; Sun, 18 Oct 2020 16:34:15 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:36453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNd-0000yG-Qq; Sun, 18 Oct 2020 16:34:15 -0400 Received: by mail-wr1-x443.google.com with SMTP id x7so9164172wrl.3; Sun, 18 Oct 2020 13:34:13 -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=stOTEgOsHIG6dN4Yvyqzv0io+9AejfdctLjiiWuokYQ=; b=XPVK9BnVpNNfRClYxbktOvyOkcXO+ijlj0zwIMZh+zJLZaxXc8nrr2aq/Yde6xfT4j B8JJSDK1lg2q8MplTede05BJa/jiLTi7zBCp3VAuh+WTdxjgSIn0vimNqgbveYa0qiA+ 92IXAZ5CYFgEa2YZOPwq7sjVfu2NMxpqTMBlCJ5wmF5ss5NvhIfz4ax2adHww+f/IBle GMBI8In/2SV6pmY9K2GO75Eekk5JOsgFSKgNhm0RGsRcIw4jzMMVuKmZ1c1styRM0ZQ2 AdaBI/KpZCa8bRzpXQ3UQCeBalCgulsiwwp9VJFhUxD0ZG/1WL0qwrLTNkD9Ghd+5Z7w JQQA== 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=stOTEgOsHIG6dN4Yvyqzv0io+9AejfdctLjiiWuokYQ=; b=hw5+f93jRxc0wm/6PErBH3A6q0foR92Tt+J9FMR5FdEfQwKTKGm4PZuwyOZv4bnZdf utqs9tuJmaZ+AAst+P9anAVSkP4KwirIniszCWA0jOdaB0AUzjccTohEoJvyl6WSOlvL HB7K7Vcls6x81GWT92T1x03Ga8WzGlGR3tYp4O+gCMq9a7YvIL832E+0sIlS44BdlDAa KSsP/37VdYr/9TCbRFxHojsFJwspe7w89c5ogcNIquhIsn3w8OlUrP8DRq5Ie0aaEHHu N9w0+9bwuf23tTpB+rE0Nlrbr8O6pKxgMXg4q7iY6qUXvz9Rd+LPym2U0HCu0aqcNrRe X/MQ== X-Gm-Message-State: AOAM532ud9TdRd1L7nuaHoY5pXIIdGVd9AiphONhl9mCezDUELb3M1rP St4F+pzuHpwrs/3+NXAQmT5S9mTxLCs= X-Google-Smtp-Source: ABdhPJy/bzaiqnyUJxyw6S4mJLuRy0WJeTZnt7UTSayfcGX9r762+SdcCCynsrYbWh/xnwUqorfGvg== X-Received: by 2002:adf:e8cb:: with SMTP id k11mr16207730wrn.91.1603053250894; Sun, 18 Oct 2020 13:34:10 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id y14sm12934561wma.48.2020.10.18.13.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 2/9] hw/arm/bcm2836: QOM'ify more by adding class_init() to each SoC type Date: Sun, 18 Oct 2020 22:33:51 +0200 Message-Id: <20201018203358.1530378-3-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 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Igor Mammedov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Remove usage of TypeInfo::class_data. Instead fill the fields in the corresponding class_init(). So far all children use the same values for almost all fields, but we are going to add the BCM2711/BCM2838 SoC for the raspi4 machine which use different fields. Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/bcm2836.c | 108 ++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 57 deletions(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index e7cc2c930d9..8f921d8e904 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -17,57 +17,31 @@ #include "hw/arm/raspi_platform.h" #include "hw/sysbus.h" -typedef struct BCM283XInfo BCM283XInfo; - typedef struct BCM283XClass { /*< private >*/ DeviceClass parent_class; /*< public >*/ - const BCM283XInfo *info; -} BCM283XClass; - -struct BCM283XInfo { const char *name; const char *cpu_type; hwaddr peri_base; /* Peripheral base address seen by the CPU */ hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */ int clusterid; -}; +} BCM283XClass; #define BCM283X_CLASS(klass) \ OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X) #define BCM283X_GET_CLASS(obj) \ OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) -static const BCM283XInfo bcm283x_socs[] = { - { - .name = TYPE_BCM2836, - .cpu_type = ARM_CPU_TYPE_NAME("cortex-a7"), - .peri_base = 0x3f000000, - .ctrl_base = 0x40000000, - .clusterid = 0xf, - }, -#ifdef TARGET_AARCH64 - { - .name = TYPE_BCM2837, - .cpu_type = ARM_CPU_TYPE_NAME("cortex-a53"), - .peri_base = 0x3f000000, - .ctrl_base = 0x40000000, - .clusterid = 0x0, - }, -#endif -}; - static void bcm2836_init(Object *obj) { BCM283XState *s = BCM283X(obj); BCM283XClass *bc = BCM283X_GET_CLASS(obj); - const BCM283XInfo *info = bc->info; int n; for (n = 0; n < BCM283X_NCPUS; n++) { object_initialize_child(obj, "cpu[*]", &s->cpu[n].core, - info->cpu_type); + bc->cpu_type); } object_initialize_child(obj, "control", &s->control, TYPE_BCM2836_CONTROL); @@ -84,7 +58,6 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) { BCM283XState *s = BCM283X(dev); BCM283XClass *bc = BCM283X_GET_CLASS(dev); - const BCM283XInfo *info = bc->info; Object *obj; int n; @@ -102,14 +75,14 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) "sd-bus"); sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->peripherals), 0, - info->peri_base, 1); + bc->peri_base, 1); /* bcm2836 interrupt controller (and mailboxes, etc.) */ if (!sysbus_realize(SYS_BUS_DEVICE(&s->control), errp)) { return; } - sysbus_mmio_map(SYS_BUS_DEVICE(&s->control), 0, info->ctrl_base); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->control), 0, bc->ctrl_base); sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 0, qdev_get_gpio_in_named(DEVICE(&s->control), "gpu-irq", 0)); @@ -118,11 +91,11 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) for (n = 0; n < BCM283X_NCPUS; n++) { /* TODO: this should be converted to a property of ARM_CPU */ - s->cpu[n].core.mp_affinity = (info->clusterid << 8) | n; + s->cpu[n].core.mp_affinity = (bc->clusterid << 8) | n; /* set periphbase/CBAR value for CPU-local registers */ if (!object_property_set_int(OBJECT(&s->cpu[n].core), "reset-cbar", - info->peri_base, errp)) { + bc->peri_base, errp)) { return; } @@ -165,38 +138,59 @@ static Property bcm2836_props[] = { static void bcm283x_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - BCM283XClass *bc = BCM283X_CLASS(oc); - bc->info = data; - dc->realize = bcm2836_realize; - device_class_set_props(dc, bcm2836_props); /* Reason: Must be wired up in code (see raspi_init() function) */ dc->user_creatable = false; } -static const TypeInfo bcm283x_type_info = { - .name = TYPE_BCM283X, - .parent = TYPE_DEVICE, - .instance_size = sizeof(BCM283XState), - .instance_init = bcm2836_init, - .class_size = sizeof(BCM283XClass), - .abstract = true, +static void bcm2836_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + BCM283XClass *bc = BCM283X_CLASS(oc); + + bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a7"); + bc->peri_base = 0x3f000000; + bc->ctrl_base = 0x40000000; + bc->clusterid = 0xf; + dc->realize = bcm2836_realize; + device_class_set_props(dc, bcm2836_props); }; -static void bcm2836_register_types(void) +#ifdef TARGET_AARCH64 +static void bcm2837_class_init(ObjectClass *oc, void *data) { - int i; + DeviceClass *dc = DEVICE_CLASS(oc); + BCM283XClass *bc = BCM283X_CLASS(oc); - type_register_static(&bcm283x_type_info); - for (i = 0; i < ARRAY_SIZE(bcm283x_socs); i++) { - TypeInfo ti = { - .name = bcm283x_socs[i].name, - .parent = TYPE_BCM283X, - .class_init = bcm283x_class_init, - .class_data = (void *) &bcm283x_socs[i], - }; - type_register(&ti); + bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a53"); + bc->peri_base = 0x3f000000; + bc->ctrl_base = 0x40000000; + bc->clusterid = 0x0; + dc->realize = bcm2836_realize; + device_class_set_props(dc, bcm2836_props); +}; +#endif + +static const TypeInfo bcm283x_types[] = { + { + .name = TYPE_BCM2836, + .parent = TYPE_BCM283X, + .class_init = bcm2836_class_init, +#ifdef TARGET_AARCH64 + }, { + .name = TYPE_BCM2837, + .parent = TYPE_BCM283X, + .class_init = bcm2837_class_init, +#endif + }, { + .name = TYPE_BCM283X, + .parent = TYPE_DEVICE, + .instance_size = sizeof(BCM283XState), + .instance_init = bcm2836_init, + .class_size = sizeof(BCM283XClass), + .class_init = bcm283x_class_init, + .abstract = true, } -} +}; -type_init(bcm2836_register_types) +DEFINE_TYPES(bcm283x_types) From patchwork Sun Oct 18 20:33:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 271032 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFBBDC433DF for ; Sun, 18 Oct 2020 20:40:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 491E222277 for ; Sun, 18 Oct 2020 20:40:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GoktLn+7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 491E222277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFTN-00010G-8M for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:40:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFNj-0001jc-RD; Sun, 18 Oct 2020 16:34:19 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:54675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNh-0000yo-CS; Sun, 18 Oct 2020 16:34:18 -0400 Received: by mail-wm1-x342.google.com with SMTP id p15so8334212wmi.4; Sun, 18 Oct 2020 13:34:16 -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=wZ942IpuEYn6heYqqSxOTzqAXYjCwIpQoTDS92tNWTM=; b=GoktLn+7Kg6e5bzY1x2YW/octAubvrjSEOSOVcinXgzvkMW2KKb6meio6GyucaI43K B7QOFoZKew9EpnWusMPoxU/WN4FeLEVyHQu6tWY1QJTnrxmvnG9Cw3d9IGYQf8wwdrAu 3Yyjnz6lPrscGaiQYlFPIcbGDtMLmE7sCmhoYiV8nQYjLg8CvSMTclS7yErun2PAaiiu RQ4BLgKuPpewRuYw1l+/FVzjQn/q4PGpx7LmHRimAVYD3QlcsH3WTAAHF5COzSNT33Gj w3NNBbAZ/Lt+ugNgnvY7TPo/N9g5Mh7i122cmkKvOcpJnBNlc6GqgHctUMO31FD8sDVk XzFQ== 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=wZ942IpuEYn6heYqqSxOTzqAXYjCwIpQoTDS92tNWTM=; b=ddsIEd7qFUfDrq0G89oPvKPdTFskNE2TL6PpZiCCaaE/FfAmVH+2tNZPkJcnNeQXOx pXszNkKeIS2+T1t2cynaZtsUeetL/LU3x/33Q6vhrrk2qinlQ33XhKsCVVGjuxKupvVH 7ugCeI0NUHOq94rHczA2xDJn9ADONdMlsSNofLqxkEQasiX5uP98Aev8//9V9rL7N9iv WXL4hYjlcqXQOa9sFlFU1RCm4juqe2sQBHVhaDS6dXuho650NxDIfUXipM/wwIKsQ4qp f5IAMkVqVJ6NLglb8FyyHctKPQQLdZGPHes4Chr8S4oPtK655UzaAGSL+Y2JTfmbjiCi CnHQ== X-Gm-Message-State: AOAM532mlSXVCK+MnmHWTcjez4PjkBEsUJzcZUmTjPekURzWs5MvWiYy 6jwFatO75QVSNcfv0QGh6STAT09MEiU= X-Google-Smtp-Source: ABdhPJxTKAB4eRLpWLWpd5of0t7AjsT/yu0zk11mLI/oldhgFRRdU4qk1ZV+lGNw8FDJ6C4XlUZm1w== X-Received: by 2002:a7b:cbd1:: with SMTP id n17mr14077026wmi.29.1603053255469; Sun, 18 Oct 2020 13:34:15 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id y7sm13123376wmg.40.2020.10.18.13.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 3/9] hw/arm/bcm2836: Introduce BCM283XClass::core_count Date: Sun, 18 Oct 2020 22:33:52 +0200 Message-Id: <20201018203358.1530378-4-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 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The BCM2835 has only one core. Introduce the core_count field to be able to use values different than BCM283X_NCPUS (4). Reviewed-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/bcm2836.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 8f921d8e904..c5d46a8e805 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -23,6 +23,7 @@ typedef struct BCM283XClass { /*< public >*/ const char *name; const char *cpu_type; + unsigned core_count; hwaddr peri_base; /* Peripheral base address seen by the CPU */ hwaddr ctrl_base; /* Interrupt controller and mailboxes etc. */ int clusterid; @@ -39,7 +40,7 @@ static void bcm2836_init(Object *obj) BCM283XClass *bc = BCM283X_GET_CLASS(obj); int n; - for (n = 0; n < BCM283X_NCPUS; n++) { + for (n = 0; n < bc->core_count; n++) { object_initialize_child(obj, "cpu[*]", &s->cpu[n].core, bc->cpu_type); } @@ -149,6 +150,7 @@ static void bcm2836_class_init(ObjectClass *oc, void *data) BCM283XClass *bc = BCM283X_CLASS(oc); bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a7"); + bc->core_count = BCM283X_NCPUS; bc->peri_base = 0x3f000000; bc->ctrl_base = 0x40000000; bc->clusterid = 0xf; @@ -163,6 +165,7 @@ static void bcm2837_class_init(ObjectClass *oc, void *data) BCM283XClass *bc = BCM283X_CLASS(oc); bc->cpu_type = ARM_CPU_TYPE_NAME("cortex-a53"); + bc->core_count = BCM283X_NCPUS; bc->peri_base = 0x3f000000; bc->ctrl_base = 0x40000000; bc->clusterid = 0x0; From patchwork Sun Oct 18 20:33:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 302635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EADBC433DF for ; Sun, 18 Oct 2020 20:36:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE82B22277 for ; Sun, 18 Oct 2020 20:36:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S88fHOt4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE82B22277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFQA-0004pl-0q for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:36:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFNn-0001lq-FU; Sun, 18 Oct 2020 16:34:23 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:35174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNl-0000yz-Ss; Sun, 18 Oct 2020 16:34:23 -0400 Received: by mail-wr1-x443.google.com with SMTP id n15so9154316wrq.2; Sun, 18 Oct 2020 13:34:21 -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=QcjhrFqjAYV+Q6plgNPayGWcmQofCNspcYhj6aIa8BM=; b=S88fHOt4fYPvKKEH0xh2S14khv8CZREiBDQPhGjwnuTTVinBOHQ51NeCHg5RPOOvfG 0pevdhh7TcViZiHr/cvt13uSjrr4NPuYtYrFHEiHmcwcsN7BksRlm0gpJpQ04EgRYvTL Pf3FC30Ll1STlF5D1COoMzQcuWg7rZ4FrD+7cMU0LmoNcLWyuoNrvCYzTzt4222McDwU Pj03gq84PPRq6+1wS8Zqk31ZePLYNdbs2bXQypzc/uyL14WsbwiSnlnCvs3k/9FX1Cd7 XNNOiWUQZ74lMk0lPjpys3T5t0dnGhKP6Cfz1PA+e2qjzQDn7anHdIwtyDPlK5nOJJdg iPTA== 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=QcjhrFqjAYV+Q6plgNPayGWcmQofCNspcYhj6aIa8BM=; b=dWvkiuT8DI5rAiBl1ZtfCsBEx3KK5zSj4gfhWEdK71QhitSGH5BC3W+IZTi9fhdbto sBPABxy3hjdAUddF+hubSY+IdCM9G0xSb8Iz/xf0rJBSQbwTh8kzQitK5zWvKHJoLdT9 uUtolyICxdZmseNoe41qzC9iMD/eRAKeDYNaXJqasmlSmEbhGH2PIrEIvixmPJbvieC/ HifKdxTVH/ogb/SWE6LSljC2kZzqzDDO51hTGTdW2DiNs7XVjVLhekw5N1IomV2c3D2s Fq6rixWrZxPaa7/plYYBBP2HmVFdDU0Lro8CLvvSDhCS2kI+l7tUQSyyEjmEpSF7iWSL 0qQQ== X-Gm-Message-State: AOAM533GFFSexN3oGtWbHBjTcPsxCRmUYDNhp/PtHFWabV1B7gIblB5G AGhMeKK1NwrMjX0/PxKSt+Av/W5OMuQ= X-Google-Smtp-Source: ABdhPJyMxOLmcmB6MgHjtw4hORwQBemfFcIetNda0xBwwM8Lmg5GkLkFvVwmmWJc1EuRJyIixrqq9g== X-Received: by 2002:adf:eb41:: with SMTP id u1mr15593621wrn.94.1603053260138; Sun, 18 Oct 2020 13:34:20 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id v189sm14080474wmg.14.2020.10.18.13.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 4/9] hw/arm/bcm2836: Only provide "enabled-cpus" property to multicore SoCs Date: Sun, 18 Oct 2020 22:33:53 +0200 Message-Id: <20201018203358.1530378-5-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 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" It makes no sense to set enabled-cpus=0 on single core SoCs. Reviewed-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/bcm2836.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index c5d46a8e805..fcb2c9c3e73 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -34,6 +34,9 @@ typedef struct BCM283XClass { #define BCM283X_GET_CLASS(obj) \ OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X) +static Property bcm2836_enabled_cores_property = + DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, 0); + static void bcm2836_init(Object *obj) { BCM283XState *s = BCM283X(obj); @@ -44,6 +47,10 @@ static void bcm2836_init(Object *obj) object_initialize_child(obj, "cpu[*]", &s->cpu[n].core, bc->cpu_type); } + if (bc->core_count > 1) { + qdev_property_add_static(DEVICE(obj), &bcm2836_enabled_cores_property); + qdev_prop_set_uint32(DEVICE(obj), "enabled-cpus", bc->core_count); + } object_initialize_child(obj, "control", &s->control, TYPE_BCM2836_CONTROL); @@ -130,12 +137,6 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) } } -static Property bcm2836_props[] = { - DEFINE_PROP_UINT32("enabled-cpus", BCM283XState, enabled_cpus, - BCM283X_NCPUS), - DEFINE_PROP_END_OF_LIST() -}; - static void bcm283x_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -155,7 +156,6 @@ static void bcm2836_class_init(ObjectClass *oc, void *data) bc->ctrl_base = 0x40000000; bc->clusterid = 0xf; dc->realize = bcm2836_realize; - device_class_set_props(dc, bcm2836_props); }; #ifdef TARGET_AARCH64 @@ -170,7 +170,6 @@ static void bcm2837_class_init(ObjectClass *oc, void *data) bc->ctrl_base = 0x40000000; bc->clusterid = 0x0; dc->realize = bcm2836_realize; - device_class_set_props(dc, bcm2836_props); }; #endif From patchwork Sun Oct 18 20:33:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 271033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 014E2C433DF for ; Sun, 18 Oct 2020 20:38:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8AE4822277 for ; Sun, 18 Oct 2020 20:38:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UYP46wZd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AE4822277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFRv-0007eT-No for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:38:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFNy-0001yg-Ti; Sun, 18 Oct 2020 16:34:34 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33993) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNv-0000zX-V8; Sun, 18 Oct 2020 16:34:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id i1so9155510wro.1; Sun, 18 Oct 2020 13:34:25 -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=HrxoAnGYxfMe8eF6utEpYOM4v9LoQV8M0tbNnH02kgc=; b=UYP46wZdimnznKNXD3x5fvLg2rMN/VtjPo0QELUR0qQRjE6Wv+aVDRazQb9ewVizEY yvALQWI61uO5oVP3Z1AaoSleHcr5hif/mCNOch6IiVJwufT7oiwCa69uw1KzvnEl1xVw JH90S78BWJ+KaFd/CktuRBQh2N86G3jc4uP11kAnKl1gSqZ8xBtyzVeDRyp3WmU+QNoF nJxFwi8D3Y/olxPWjUJCjjLHVdTo1FCZDVOizgfqyLDDGOzZqOmZ3j7R/LLV8TNdVpRs +ECL4osDUzYOKgRTtrXEjVOwUGrIjrR3dEJRtFWYyodRczRWNfHfXmkE1AJiksCRjNVm jE3g== 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=HrxoAnGYxfMe8eF6utEpYOM4v9LoQV8M0tbNnH02kgc=; b=r65X+N/XMyLAmW1xrzIapzSgIXEZrZNqStxxqa+vqSzphQixGaB7Zlc3pvrDFDHbY4 h2W1wH7TfeJgFmnlesxxdn2xT4XiFdqW+0nNV9QH4HUUjKvU/YtCrUbgqZ9heXiEz68e 6P1HJCakCFbs4YFuV3crBYAUhXJ9xf3UqlIm9zfS9OPmkCQnBvqTrfEAEVpgHrqIF4CI WZNGLxyAdKsqNzPpdGoi91xiqu8f+tKD2sJV2ce5zxo2qOiLR3V9MDmZyCBzEFLRh2GQ sbvqB88FtyAY71tStlf8S9r/hZ4tcKm+eGilYD5lE6xxzjJvr20syvi1/gOez3cL0vXU P2hg== X-Gm-Message-State: AOAM532tfd2VFV9s/CBw6uh3oJlFwfv7Yf2XS+vCJm2z0smhYt/mrJ7k dlMymdBDpl+w2DAGdfyoNowv5+TWP30= X-Google-Smtp-Source: ABdhPJzuLuE8uPS5OhBzIn0N0oV3BnpR54H9YbCd5Vyl6YmwZ9jRSYoPl6e3qmZaJRDjcLUP1Ukn8w== X-Received: by 2002:a5d:4e8d:: with SMTP id e13mr16305755wru.368.1603053264804; Sun, 18 Oct 2020 13:34:24 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id g125sm8684474wme.33.2020.10.18.13.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 5/9] hw/arm/bcm2836: Split out common realize() code Date: Sun, 18 Oct 2020 22:33:54 +0200 Message-Id: <20201018203358.1530378-6-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 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The realize() function is clearly composed of two parts, each described by a comment: void realize() { /* common peripherals from bcm2835 */ ... /* bcm2836 interrupt controller (and mailboxes, etc.) */ ... } Split the two part, so we can reuse the common part with other SoCs from this family. Reviewed-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/bcm2836.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index fcb2c9c3e73..7d975cf2f53 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -52,7 +52,10 @@ static void bcm2836_init(Object *obj) qdev_prop_set_uint32(DEVICE(obj), "enabled-cpus", bc->core_count); } - object_initialize_child(obj, "control", &s->control, TYPE_BCM2836_CONTROL); + if (bc->ctrl_base) { + object_initialize_child(obj, "control", &s->control, + TYPE_BCM2836_CONTROL); + } object_initialize_child(obj, "peripherals", &s->peripherals, TYPE_BCM2835_PERIPHERALS); @@ -62,12 +65,11 @@ static void bcm2836_init(Object *obj) "vcram-size"); } -static void bcm2836_realize(DeviceState *dev, Error **errp) +static bool bcm283x_common_realize(DeviceState *dev, Error **errp) { BCM283XState *s = BCM283X(dev); BCM283XClass *bc = BCM283X_GET_CLASS(dev); Object *obj; - int n; /* common peripherals from bcm2835 */ @@ -76,7 +78,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj); if (!sysbus_realize(SYS_BUS_DEVICE(&s->peripherals), errp)) { - return; + return false; } object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->peripherals), @@ -84,6 +86,18 @@ static void bcm2836_realize(DeviceState *dev, Error **errp) sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->peripherals), 0, bc->peri_base, 1); + return true; +} + +static void bcm2836_realize(DeviceState *dev, Error **errp) +{ + BCM283XState *s = BCM283X(dev); + BCM283XClass *bc = BCM283X_GET_CLASS(dev); + int n; + + if (!bcm283x_common_realize(dev, errp)) { + return; + } /* bcm2836 interrupt controller (and mailboxes, etc.) */ if (!sysbus_realize(SYS_BUS_DEVICE(&s->control), errp)) { From patchwork Sun Oct 18 20:33:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 302633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AC55C433E7 for ; Sun, 18 Oct 2020 20:40:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E43FE22277 for ; Sun, 18 Oct 2020 20:40:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GJX+QQLt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E43FE22277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFTH-0000oU-1k for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:40:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFNx-0001ur-Il; Sun, 18 Oct 2020 16:34:33 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:40261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNv-0000zn-Sy; Sun, 18 Oct 2020 16:34:33 -0400 Received: by mail-wr1-x435.google.com with SMTP id h5so9125883wrv.7; Sun, 18 Oct 2020 13:34:30 -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=jViLzsnHUVqtQxwtvYdFxDUn3i00wRweHY3mgJ2gUEU=; b=GJX+QQLtomsdm7cmL4jaXRaGnQLv2L5aOFrd20TR+jHML8J4tkjGUye5K2o7Fb+WLP kHrREpL1OQ4y5D/a9Ulr+j/k+7HgKIWLb3UXcmJP4MvLHH/4Bjn56xUGCYvHXT0A0/nM joSqGxFVs542g+fYb195ZO+PfrBaRXUMWLGBuL25wM1aitEmhLoz6NKR8YhzDrtc+X4e knZvjIZPEJ41SZWtAFNzwDtEMacXIwLAcb+kxEOYx7KkCT4ffZ1dNdXyLlM+W4H4m/rU zFKMVmryNmJM2BIotDvOrIhbXL7E2JiRoy5E3idGM/ISO1a3MTdVeF5+KTgVrKeBzM+p DTnA== 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=jViLzsnHUVqtQxwtvYdFxDUn3i00wRweHY3mgJ2gUEU=; b=Npdh8mbHNZZHTUcqH8BvCHCHQgSHosYaMjLa5Uji4dYYamlaBHDR1zNTw27jQprxu+ bh5nu2JJFZQTj53B1ombvAyEyxnLE5X0ON/0AadnV+sBMYWGzZVB0Dy6xmA2NaoEnyJA FuV+ZKv5Iqw1v2mS4rIjBYWm7o9EZaaIwbqZsrShQFhStJOnnypALNA+6T5ZoQzs3Pff 8b58rLkpmbKvasiHv20pzLH4bTpmk8DOxzEzm2mHI8gTONGj2UsjAEuRJLDzfHCbKKxY 8VZ7F6tUqRJDsaHXOUQKmZ2Zgz5a/zPz6iapY6KQvEfM7RisktWDfpqcSUjvyIdCAC12 pV6A== X-Gm-Message-State: AOAM530eQuSjjYjcWJDALD+mDXVk+bU+ODC/NyIVuoFI0HaXCeEvCL+D Ycr8+BdTb02QQjYVfTn3wkdPWeZback= X-Google-Smtp-Source: ABdhPJz1YsVU2ZrYV7Qhiz2KxK32B+L/6zVQNSJyPunndu8CLQiAuO8FOKyF5bUBFK1q5xz/twAVZA== X-Received: by 2002:adf:cc82:: with SMTP id p2mr16478026wrj.177.1603053269399; Sun, 18 Oct 2020 13:34:29 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id p9sm13102665wmm.4.2020.10.18.13.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 6/9] hw/arm/bcm2836: Introduce the BCM2835 SoC Date: Sun, 18 Oct 2020 22:33:55 +0200 Message-Id: <20201018203358.1530378-7-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 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé --- include/hw/arm/bcm2836.h | 1 + hw/arm/bcm2836.c | 34 ++++++++++++++++++++++++++++++++++ hw/arm/raspi.c | 2 ++ 3 files changed, 37 insertions(+) diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 43e9f8cd0ef..6f90cabfa3a 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -26,6 +26,7 @@ OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X) * them, code using these devices should always handle them via the * BCM283x base class, so they have no BCM2836(obj) etc macros. */ +#define TYPE_BCM2835 "bcm2835" #define TYPE_BCM2836 "bcm2836" #define TYPE_BCM2837 "bcm2837" diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c index 7d975cf2f53..de7ade2878e 100644 --- a/hw/arm/bcm2836.c +++ b/hw/arm/bcm2836.c @@ -89,6 +89,25 @@ static bool bcm283x_common_realize(DeviceState *dev, Error **errp) return true; } +static void bcm2835_realize(DeviceState *dev, Error **errp) +{ + BCM283XState *s = BCM283X(dev); + + if (!bcm283x_common_realize(dev, errp)) { + return; + } + + if (!qdev_realize(DEVICE(&s->cpu[0].core), NULL, errp)) { + return; + } + + /* Connect irq/fiq outputs from the interrupt controller. */ + sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 0, + qdev_get_gpio_in(DEVICE(&s->cpu[0].core), ARM_CPU_IRQ)); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->peripherals), 1, + qdev_get_gpio_in(DEVICE(&s->cpu[0].core), ARM_CPU_FIQ)); +} + static void bcm2836_realize(DeviceState *dev, Error **errp) { BCM283XState *s = BCM283X(dev); @@ -159,6 +178,17 @@ static void bcm283x_class_init(ObjectClass *oc, void *data) dc->user_creatable = false; } +static void bcm2835_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(oc); + BCM283XClass *bc = BCM283X_CLASS(oc); + + bc->cpu_type = ARM_CPU_TYPE_NAME("arm1176"); + bc->core_count = 1; + bc->peri_base = 0x20000000; + dc->realize = bcm2835_realize; +}; + static void bcm2836_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -189,6 +219,10 @@ static void bcm2837_class_init(ObjectClass *oc, void *data) static const TypeInfo bcm283x_types[] = { { + .name = TYPE_BCM2835, + .parent = TYPE_BCM283X, + .class_init = bcm2835_class_init, + }, { .name = TYPE_BCM2836, .parent = TYPE_BCM283X, .class_init = bcm2836_class_init, diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index b5b30f0f38f..30fafa59ecb 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -70,6 +70,7 @@ FIELD(REV_CODE, MEMORY_SIZE, 20, 3); FIELD(REV_CODE, STYLE, 23, 1); typedef enum RaspiProcessorId { + PROCESSOR_ID_BCM2835 = 0, PROCESSOR_ID_BCM2836 = 1, PROCESSOR_ID_BCM2837 = 2, } RaspiProcessorId; @@ -78,6 +79,7 @@ static const struct { const char *type; int cores_count; } soc_property[] = { + [PROCESSOR_ID_BCM2835] = {TYPE_BCM2835, 1}, [PROCESSOR_ID_BCM2836] = {TYPE_BCM2836, BCM283X_NCPUS}, [PROCESSOR_ID_BCM2837] = {TYPE_BCM2837, BCM283X_NCPUS}, }; From patchwork Sun Oct 18 20:33:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 271031 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25709C433E7 for ; Sun, 18 Oct 2020 20:41:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBAB622277 for ; Sun, 18 Oct 2020 20:41:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="on6l74x8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBAB622277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFUt-0003TG-MJ for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFO1-000267-Hg; Sun, 18 Oct 2020 16:34:37 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:51545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFNz-000109-QJ; Sun, 18 Oct 2020 16:34:37 -0400 Received: by mail-wm1-x342.google.com with SMTP id d81so8364197wmc.1; Sun, 18 Oct 2020 13:34:34 -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=fgZFdmp8hPXpOTpZLII/XoKIJG5lZeFhbRQ1IzzXkNI=; b=on6l74x8eyZOJrDJj0WVo06J7GlkEiLiof7bU1/RxZcMkNT9buxz5WPH38JsuPn3Eb xu1dbnPGQjGCkssYcVHRvb+2XVOO95RKzpkKzNBHarLUF1hDVTwOECKEGMWCSWZqzZef MIu+Q1DBFEs+X7/D1kgbiXsJHL4Igfjo+uksAw3mDa7FmnJfcB72PF+UKRhoUANeBY9t jymz/ulgX1rDJTxmlVa/RSFGMXHkKsFftVdzVNrxPAWZ3T4Ko72vCyIKHhXjlwXKIwGn ynTSQq4587vGRM5adj7g/NDolBUzA7cUeDanMQggGsAdMiEPglC+RGd4p+PD3FMtkfY0 Jegw== 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=fgZFdmp8hPXpOTpZLII/XoKIJG5lZeFhbRQ1IzzXkNI=; b=pWUM2FzuYYUV9VOV4rkePjeODmKGJ7Cg44MTVIKUCE8cJPAYDNUpokD8gUaCZZOFKU kn35+eJ39Lrie6htWMz1bFbgxN0PS5bP2lwW1h21lCr6Sw4rSALwXxE1oxQRDLUS6hqe U+lLMvxMVPZV28hrXOpNx2wA3zodKszb2mvtavC7jmC+d2OajXWQBhjr+/RxLoYfCtT5 /YhqaZSBQYF9MXExjaMhyOoLPtuIqm0B3C6iPn4nKADcKWrBlgFaopoAaxTQqLMmIAml OtSEV5SJo2vkNH+q/8CG4NePwVJJ8eKRNvNNtcVREyR1QN+Lbos0XS04LByeZ7iQNIo3 3LEw== X-Gm-Message-State: AOAM533HEj/H4AHOpjRl4xWactlm4OBgz/xcRUrTPoXIxWjZ+2lisx7L cBOMSTvrXQfONQzsB4gus0jEa8TxM5M= X-Google-Smtp-Source: ABdhPJw06PEh5WMkh81mjrKilubsZAbZ/BWxiPvOtg0ZdDyqCaamBhri8LUG+3RM1dY/Hx7TEhHDtA== X-Received: by 2002:a1c:2d8f:: with SMTP id t137mr13993882wmt.26.1603053273890; Sun, 18 Oct 2020 13:34:33 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id 130sm9541760wmd.18.2020.10.18.13.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 7/9] hw/arm/raspi: Add the Raspberry Pi A+ machine Date: Sun, 18 Oct 2020 22:33:56 +0200 Message-Id: <20201018203358.1530378-8-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 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The Pi A is almost the first machine released. It uses a BCM2835 SoC which includes a ARMv6Z core. Example booting the machine using content from [*] (we use the device tree from the B model): $ qemu-system-arm -M raspi1ap -serial stdio \ -kernel raspberrypi/firmware/boot/kernel.img \ -dtb raspberrypi/firmware/boot/bcm2708-rpi-b-plus.dtb \ -append 'earlycon=pl011,0x20201000 console=ttyAMA0' [ 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 BST 2020 [ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d [ 0.000000] CPU: VIPT aliasing data cache, unknown instruction cache [ 0.000000] OF: fdt: Machine model: Raspberry Pi Model B+ ... [*] http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/raspberrypi-kernel_1.20200512-2_armhf.deb Signed-off-by: Philippe Mathieu-Daudé 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 30fafa59ecb..91a59d1d489 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -319,6 +319,15 @@ static void raspi_machine_class_common_init(MachineClass *mc, mc->default_ram_id = "ram"; }; +static void raspi1ap_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + RaspiMachineClass *rmc = RASPI_MACHINE_CLASS(oc); + + rmc->board_rev = 0x900021; + raspi_machine_class_common_init(mc, rmc->board_rev); +}; + static void raspi2b_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -343,6 +352,10 @@ static void raspi3b_machine_class_init(ObjectClass *oc, void *data) static const TypeInfo raspi_machine_types[] = { { + .name = MACHINE_TYPE_NAME("raspi1ap"), + .parent = TYPE_RASPI_MACHINE, + .class_init = raspi1ap_machine_class_init, + }, { .name = MACHINE_TYPE_NAME("raspi2b"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi2b_machine_class_init, From patchwork Sun Oct 18 20:33:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 302632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D858CC43457 for ; Sun, 18 Oct 2020 20:40:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D4AF2227E for ; Sun, 18 Oct 2020 20:40:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gMCc+q6S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D4AF2227E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFTv-00027j-Bk for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:40:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFO6-0002I9-9m; Sun, 18 Oct 2020 16:34:42 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:44318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFO4-00010g-Hg; Sun, 18 Oct 2020 16:34:41 -0400 Received: by mail-wr1-x441.google.com with SMTP id t9so9098735wrq.11; Sun, 18 Oct 2020 13:34:39 -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=Jj8cBXKJxq8dXmOpFwhRqViZ1agHtrO4EWhxkdq8zCEgigBx01QM4G4enHHmSZKJM7 euS0c414L6GgpxLTlSEoLAnGvQJA9U/2nPdnnlWnMErXR6341gk8DO7UGbw9qgYN/Zm7 QwOMkD6ugG0fgYFjtIOuRg4NAF9oCTkt9grKV1pH3SA7Gz1rl0KVdQBV/qLtr0P0DeEm LWi42156yh21zJ0Xsnn3RSl/sQs1NHp9hWxCnKwb1o80wjk8lYJwI2Cr1j7xeZILeDNt YXU3mZL/efBhIzvPwYaZmL8RGZ0x3skl6ULK4zug93mVrXXkCwEUe28gHQ32MCK8Z9kT yqQw== X-Gm-Message-State: AOAM531ua0gRV4qYIFFLmtL4twKOL8r7uzCDCJUpONFg6cDfT3iDXh5S HR4MY3aaLRxc4Tlr4IB4meYxIeq75xQ= 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann , qemu-arm@nongnu.org, Luc Michel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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=0 earlycon=pl011,0x20201000 console=ttyAMA0' [ 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 BST 2020 [ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d [ 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é 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(MachineClass *mc, mc->default_ram_id = "ram"; }; +static void raspi0_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + RaspiMachineClass *rmc = RASPI_MACHINE_CLASS(oc); + + rmc->board_rev = 0x900092; + raspi_machine_class_common_init(mc, rmc->board_rev); +}; + static void raspi1ap_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -352,6 +361,10 @@ static void raspi3b_machine_class_init(ObjectClass *oc, void *data) static const TypeInfo raspi_machine_types[] = { { + .name = MACHINE_TYPE_NAME("raspi0"), + .parent = TYPE_RASPI_MACHINE, + .class_init = raspi0_machine_class_init, + }, { .name = MACHINE_TYPE_NAME("raspi1ap"), .parent = TYPE_RASPI_MACHINE, .class_init = raspi1ap_machine_class_init, From patchwork Sun Oct 18 20:33:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 302631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5327DC433E7 for ; Sun, 18 Oct 2020 20:42:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A589D22277 for ; Sun, 18 Oct 2020 20:42:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z7OowUCO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A589D22277 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUFVA-00042N-LP for qemu-devel@archiver.kernel.org; Sun, 18 Oct 2020 16:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUFOD-0002TW-O9; Sun, 18 Oct 2020 16:34:49 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:43859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUFOC-000117-5B; Sun, 18 Oct 2020 16:34:49 -0400 Received: by mail-wr1-x441.google.com with SMTP id g12so9108188wrp.10; Sun, 18 Oct 2020 13:34:44 -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=uimP/iqQh3HvwHLU2i4l9uDQzRvHG8CsmPCcNRaOVH8=; b=Z7OowUCOFke1z16AdXigR9YxqUSnC7cOH8c7fbWkJ5kpB4HpMvxckNV+Y79VeKifso zql4kiFxQqam97vOkftwYXc0hpL3wKVAX/95fQxyl24O432Vgasyk6sQ4/Jf4Tv4hbVN t5CzzyBg3BnxQOEFNXcEaH78bCX0kc+yNJCKH10P3FiiBUBZImrS3WEFoysx3bzQ6ulc hdNuzmrPxJ1b8of6bqXShsgZinRYUsCR324Gd2iffLn4TQ5I93mGfL/E7dxUARYBy654 cO3RIIVDmfm5NxQPpqjmFoOnB3cv6ABYNA1Rh/OUH3PrftkLbf6yiBeg02jQFuHBkc7V Wrpw== 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=uimP/iqQh3HvwHLU2i4l9uDQzRvHG8CsmPCcNRaOVH8=; b=DZiIDrbbeGPA9W2ohQuBZbDGX3B1SKvrV4UTurq2Etz2QUo2vTO+vHtbOMUxldqPb6 9zdfvkRzKvQ+MV8XzBJOk8CGDkGsaV37TuVfVCQY3EBwzVT1HGDAgxDOvg4WszoHHT6g /6hRza+5haVaQSbEt0S545MfuvmSEs0QwFqgkA00UOsr4+haLDcO/pati6C0jruKDpEN VrD9zL98Z5Kwx4KQLjtq4J6BqBpb16mseyp83M+sawyjo2TUBFyRTSf4U1fBIWOxSptM fCyUedYPwhZDkGGxAy2S1gkB5ONTGKMh/1DlT5Qix6+sWqufmyzoKo1BvQsS9luuqE5Q 5t6Q== X-Gm-Message-State: AOAM5339kDX5ZiUl6G63mQAKuyP7G8mSqSwoML79IUmTi4tqf2UAyB4a ZWw1pNLF/wsx6KvJSgkaW/jYHHNkDcY= X-Google-Smtp-Source: ABdhPJzHG98Cn8a5rbSp2/QOntcvOvSTez+0ocTxa5q8kbwD7uRynyVBaSTi0d9+ubmek60R8QkMhQ== X-Received: by 2002:adf:e38f:: with SMTP id e15mr16211677wrm.294.1603053283026; Sun, 18 Oct 2020 13:34:43 -0700 (PDT) Received: from localhost.localdomain (117.red-83-52-172.dynamicip.rima-tde.net. [83.52.172.117]) by smtp.gmail.com with ESMTPSA id 13sm13179986wmk.20.2020.10.18.13.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Oct 2020 13:34:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 9/9] hw/arm/raspi: Add the Raspberry Pi 3 model A+ Date: Sun, 18 Oct 2020 22:33:58 +0200 Message-Id: <20201018203358.1530378-10-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 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, Luc Michel , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The Pi 3A+ is a stripped down version of the 3B: - 512 MiB of RAM instead of 1 GiB - no on-board ethernet chipset Add it as it is a closer match to what we model. Signed-off-by: Philippe Mathieu-Daudé 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 1510ca01afe..4ea200572ea 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -348,6 +348,15 @@ static void raspi2b_machine_class_init(ObjectClass *oc, void *data) }; #ifdef TARGET_AARCH64 +static void raspi3ap_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + RaspiMachineClass *rmc = RASPI_MACHINE_CLASS(oc); + + rmc->board_rev = 0x9020e0; + raspi_machine_class_common_init(mc, rmc->board_rev); +}; + static void raspi3b_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -373,6 +382,10 @@ static const TypeInfo raspi_machine_types[] = { .parent = TYPE_RASPI_MACHINE, .class_init = raspi2b_machine_class_init, #ifdef TARGET_AARCH64 + }, { + .name = MACHINE_TYPE_NAME("raspi3ap"), + .parent = TYPE_RASPI_MACHINE, + .class_init = raspi3ap_machine_class_init, }, { .name = MACHINE_TYPE_NAME("raspi3b"), .parent = TYPE_RASPI_MACHINE,