From patchwork Wed May 24 14:59:06 2023 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: 685363 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp298359wrt; Wed, 24 May 2023 08:01:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HFK79lK69M79MpR/BFqcBcqRAENpSV5Wztup1SmMnPEbNQfhQHAbdKyMiiE+8+qGrgUZY X-Received: by 2002:a05:622a:1316:b0:3f6:b7c9:e443 with SMTP id v22-20020a05622a131600b003f6b7c9e443mr9742398qtk.1.1684940491553; Wed, 24 May 2023 08:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684940491; cv=none; d=google.com; s=arc-20160816; b=wKzfAnuz3ZU9rgqFYnTUP4I6sl11qS4tpwsTcI/NBuMmDLGpV4+FXWiEGXKl26gVZu EXDWwIDOuscqBBTjkiS7ztynZH3L4FNl7ptMk6apnEREvh3YOELlviMWu8ur9zriOa7Q RkzSoK0MJfIR0+j3i/I9pLC46H8xo+F5URaf3N47eCZXQ7sV9hDnOWGJw3ypjPz+oDZw CSWdBg01xDqiZaryK1NmK7Gdmnz1Wh+gEWYPQhg0iha72HIUQctHZm2EEIsvl+fFTvGN jgqXbE9/FV/8kb7nrAukZEoxcDz1iMGkOE49ucOK9rRDsgcjTo99KdoWhwxhHnPBzYxP rXvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kk8jHY5mepVVbmOZAIHsqrtCCvRurLEnDXO0jm3/hbc=; b=to+eWREUimtlkzBvNbmkZWERWNZqrHMq2734dMgswd6YzRtJMJQItp+VRmyUlcHteE fdK+c8JKtpVZVWK1RaB3gUgIEoOmhdIm3YxGrMswXuzNSjSkzAoAzBhGr0aQqz3SpKGp Ck75E0BU3XgfqB2D5TAxxtNHZmrwWrJbInk4PtE9AgabR2O/gEFs8MWoMWVS+nXt7T8x Dxfk7BpsUM9zys4ak/8HHkZuFr3V3cx3UlCG1+sJzUoR4Xk/JtLDF0876rdUop6U8ewf hO3CdBz5PYoKj/1BX3HBe0nDxuMeXiVOAnc5jd+KkQ6gGcAmHkn7T/C1nsOwPwn3mLaC J8Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AIrhM3Au; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l12-20020a05622a050c00b003f6ecf7d37dsi571744qtx.427.2023.05.24.08.01.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 08:01:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AIrhM3Au; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1pyK-0007GI-8K; Wed, 24 May 2023 11:00:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1pyE-000779-9w for qemu-devel@nongnu.org; Wed, 24 May 2023 11:00:10 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1py9-0006gJ-DM for qemu-devel@nongnu.org; Wed, 24 May 2023 11:00:09 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-309382efe13so686595f8f.2 for ; Wed, 24 May 2023 08:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684940403; x=1687532403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kk8jHY5mepVVbmOZAIHsqrtCCvRurLEnDXO0jm3/hbc=; b=AIrhM3Aulmqe+FCp8DksBqIW4DT3ESrVWIMlILTFSkxfKoMmVp6JCBk4yVuhNz7mtn KH0Dvh3c+XMMvdWJVWSJQ+Su2c4+Wy6/jhPyvMsSQVPoIfkmB3+mEQ/bF+JgwFBVvgjw hyi1Avw3bX6i+MvP35JxoyI1475l+5wo3kFzpm65KTPvV41H3V1B0sphd4o1vI2lDy9F trQi5xesM8+Pt3BYIkbqxS8Ap0hPZ/TZ5rwhsRmOsJT/EoMaUUA0QtB9tCMoGJAYMhKR vlqB7ilghf7BWB9G1kJsVBZtN9Cm2wL3Ht+BrOcuJ5TOJn01AC8wcNC4vgJoU4XvE+yn iAxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684940403; x=1687532403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kk8jHY5mepVVbmOZAIHsqrtCCvRurLEnDXO0jm3/hbc=; b=eUym+cVIyF36di8kKnYFxP05MxmiyO4+BjxI/Ms0Uz6juz0C1s44FrlD8HmJ7QpgHi CZV9hKseRHraziN0GeKWVz/sWPqyLvCD/K0LYRekmLvxAYBaBVnlGY+50WAo0FeZR1fW sjYMhAQnEOxinCiD9QiPbZLd3f4YeNjQHOQ5xJkH6cGqMm6T6OkB1IOL4PTOEBcMly7z MGD/AJ6Z+vjgx0fNA824wV3rThJU+gcmv/1WaM4qCIKD6/xbndOUTgxP0JKoS3Wq5wKa zYkHEYYt/IO0Aid6Mw+vLIc7rFm+bKWpaxB4ni9BQZnYwWUIXVKQFpobOXXssnliXy+I P4dg== X-Gm-Message-State: AC+VfDzFoxhUlKEF820r/Csn1Ex0wXC1IBJPLqq//GX2TukcZEYjLFfe OeU65+O0CwoT9aH8mu3EgglBEdZaQjOVoXpPZGk1WQ== X-Received: by 2002:adf:ee05:0:b0:306:2b83:2d32 with SMTP id y5-20020adfee05000000b003062b832d32mr49767wrn.43.1684940403553; Wed, 24 May 2023 08:00:03 -0700 (PDT) Received: from localhost.localdomain (fac34-h02-176-184-31-193.dsl.sta.abo.bbox.fr. [176.184.31.193]) by smtp.gmail.com with ESMTPSA id q3-20020adff783000000b002e61e002943sm14656962wrp.116.2023.05.24.08.00.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 May 2023 08:00:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 10/10] hw/arm/realview: Set MachineClass::default_nic in machine_class_init() Date: Wed, 24 May 2023 16:59:06 +0200 Message-Id: <20230524145906.33156-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230524145906.33156-1-philmd@linaro.org> References: <20230524145906.33156-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Mark the default NIC via the new MachineClass->default_nic setting so that the machine-defaults code in vl.c can decide whether the default NIC is usable or not (for example when compiling with the "--without-default-devices" configure switch). Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/realview.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index b7bb384000..0b2d6b82c8 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -70,6 +70,7 @@ static void split_irq_from_named(DeviceState *src, const char* outname, static void realview_common_machine_init(MachineState *machine) { + MachineClass *mc = MACHINE_GET_CLASS(machine); RealviewMachineClass *rmc = REALVIEW_MACHINE_GET_CLASS(machine); ARMCPU *cpu = NULL; CPUARMState *env; @@ -274,7 +275,7 @@ static void realview_common_machine_init(MachineState *machine) for(n = 0; n < nb_nics; n++) { nd = &nd_table[n]; - if (!nd->model || strcmp(nd->model, is_pb ? "lan9118" : "smc91c111") == 0) { + if (!nd->model || strcmp(nd->model, mc->default_nic) == 0) { if (is_pb) { lan9118_init(nd, 0x4e000000, pic[28]); } else { @@ -378,6 +379,7 @@ static void realview_eb_class_init(ObjectClass *oc, void *data) mc->desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)"; mc->block_default_type = IF_SCSI; mc->default_cpu_type = ARM_CPU_TYPE_NAME("arm926"); + mc->default_nic = "smc91c111"; rmc->board_id = 0x33b; } @@ -390,6 +392,7 @@ static void realview_eb_mpcore_class_init(ObjectClass *oc, void *data) mc->block_default_type = IF_SCSI; mc->max_cpus = 4; mc->default_cpu_type = ARM_CPU_TYPE_NAME("arm11mpcore"); + mc->default_nic = "smc91c111"; rmc->board_id = 0x33b; rmc->mpcore_periphbase = 0x10100000; } @@ -401,6 +404,7 @@ static void realview_pb_a8_class_init(ObjectClass *oc, void *data) mc->desc = "ARM RealView Platform Baseboard for Cortex-A8"; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a8"); + mc->default_nic = "lan9118"; rmc->board_id = 0x769; rmc->is_pb = true; rmc->loader_start = 0x70000000; @@ -414,6 +418,7 @@ static void realview_pbx_a9_class_init(ObjectClass *oc, void *data) mc->desc = "ARM RealView Platform Baseboard Explore for Cortex-A9"; mc->max_cpus = 4; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a9"); + mc->default_nic = "lan9118"; rmc->board_id = 0x76d; rmc->is_pb = true; rmc->mpcore_periphbase = 0x1f000000;