From patchwork Wed May 24 14:59:04 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: 685358 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp297734wrt; Wed, 24 May 2023 08:00:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5rRZAG+Vu7T/povEOs8Xkt7SMzQDMtVgfN9bc96HTIxI1slUi81TRA3mN4QOY2TABtXhBy X-Received: by 2002:a05:620a:4729:b0:75b:23a1:8e61 with SMTP id bs41-20020a05620a472900b0075b23a18e61mr9143763qkb.50.1684940433160; Wed, 24 May 2023 08:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684940433; cv=none; d=google.com; s=arc-20160816; b=e9Q1PaRXzfIW7/SkcjQM4LYELFdcR/YVkXimgbUbMcAJ1Z3ZhGuYU0fU/UgV01DiRO C6Ka0RbBbC3WmRGRykNDYfyQEW2R8jUHEqYaIKEtRrzXx9GfEJdjznmOwK1O5OxeGkuM hqO7q1Kda9/QTwk4GwYaDc3WsXfyEKSJ1KgGctPEaSfZY6gHpFi8NVQV0EyjCGcGgX/r XpviKYIQ6bOU2JfN3UFIYTDZQgkzaFjjjy2wdTml7AiEfATrVhICIr/tdYD+1jUsl0R0 jfFXsLtK5kedWl0cKCC8buyeiHPkzRzHdJXj35UVoMKKSojT2p4Ki+WIVCxlgaCy7/tZ nW2g== 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=vXln/1eI6qFBBphN0wAdNEHB1hgU4t96Zx44NnYHfMg=; b=LXhDkxgNN+bmCo5QffRBesaGW1lhfLKNrlU/gfCbS1x+WDFAfc+ttqMFVZC13W7Id+ OqaCdvZaNucDIIZRqN02WpkK+kWLvmX4KOP6O79TUBYelUZtRTYCuCmAibVxjxr8Uqmg GGH8Le+kLA/NWazxu1Nzkgly081yQQtBzVN2bvJO6lgVYewrCjOslU/on9Pc/3hs71u8 JuOcpwwesirpAlNXeNI3cdH9JqvvvFa6Zv/kS2iiDcWYZ8CNRcxkHFa9ThLiC6dO+oeq Ls3L9pWA10qPfHxxWsRMPTSb1lmik8WimKryIAUz2WHBYS/Q8E8uB1Qk+mvCMYMXOp2/ VNgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aUQOiuM8; 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 p10-20020a05620a132a00b0074a44b93927si6010136qkj.272.2023.05.24.08.00.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 08:00:33 -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=aUQOiuM8; 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 1q1py1-0006kc-4C; Wed, 24 May 2023 10:59:57 -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 1q1pxz-0006eF-QO for qemu-devel@nongnu.org; Wed, 24 May 2023 10:59:55 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1pxy-0006XJ-CF for qemu-devel@nongnu.org; Wed, 24 May 2023 10:59:55 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3094871953bso697798f8f.0 for ; Wed, 24 May 2023 07:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684940393; x=1687532393; 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=vXln/1eI6qFBBphN0wAdNEHB1hgU4t96Zx44NnYHfMg=; b=aUQOiuM8khuFhFB5866CK13bpsMuZVoiPDRsMlOHnDSlH98FUuOS09p5oU4QKvF2IU mbWDVtEZVE2s9Qm4F9+TWAT/bvYgsVFJCc9WBLa5vPfefuYDORL4lWIOL5dcCpbnNEPq ggoHcFI/LvKSBIL6j27y0bOqACrdGDc8RXyW2F+KBCrd7wxFKB9ly4xNNtpjf6GyFXuj +uKBjNfWK3epULafF2V4W+8vS+DKZ/aIXEXQECV5iy36hoLZQIyZgx//insbriqiS6y6 As0ze+lawE0xLzKNWL332NFe3hQSCPQLbnDEVrufD408INHNjio9EzOoa39ytYw960sY tn+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684940393; x=1687532393; 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=vXln/1eI6qFBBphN0wAdNEHB1hgU4t96Zx44NnYHfMg=; b=YPH40rt52bgMwt9cCpX+9fFbGZgJOuOo03bRoFi6yX+xWuTVcXXw2zlyiAn1Y5Ql7W eHz9BgBfbirNtMX4YYmEgxLISqsiBXN8Pgos+oQUdFyy9hCDfjcOpt7S0hzXcntopvmM yvfmw8nFAQjkfTxTsBdaytpu3bWiYl9qdOP+0m+oCw/OW1r+MUyNCdKzAL0Z+ZttbeE7 1Tv7ZsxgFxYnnlTVqCh5trIScLFdGykvf7Kj7dFgwS78AVCkPP6pG0y+s1M7HB8KZRpQ fufrTpsSsBrAUimiHDHcps90/vdyUadGpXQmutaoZbHCZiOYeEkJAJlwcA/D6dx70zjK r5Xw== X-Gm-Message-State: AC+VfDxSbAk+C2OJHUS+Qi5WsYHF4DxsvOHk9MxXtcudtKeu9rUeQoIJ Z9Ue52bkU74VqcJReS3lXncN9vgMqKpOBeDKmJURHQ== X-Received: by 2002:a5d:6889:0:b0:306:30ea:a072 with SMTP id h9-20020a5d6889000000b0030630eaa072mr29449wru.53.1684940392785; Wed, 24 May 2023 07:59:52 -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 j1-20020a056000124100b003047ea78b42sm14758972wrx.43.2023.05.24.07.59.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 May 2023 07:59:52 -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 08/10] hw/arm/realview: Move 'loader_start' to RealviewMachineClass Date: Wed, 24 May 2023 16:59:04 +0200 Message-Id: <20230524145906.33156-9-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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 Instead of having each machine instance resolve its loader start address, set it once in their class_init() handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/realview.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 8a3b5a48b1..917a1b22df 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -36,6 +36,7 @@ struct RealviewMachineClass { int board_id; bool is_pb; hwaddr mpcore_periphbase; + hwaddr loader_start; }; typedef struct RealviewMachineClass RealviewMachineClass; @@ -376,7 +377,7 @@ static void realview_init(MachineState *machine, realview_binfo.ram_size = ram_size; realview_binfo.board_id = rmc->board_id; - realview_binfo.loader_start = (board_type == BOARD_PB_A8 ? 0x70000000 : 0); + realview_binfo.loader_start = rmc->loader_start; arm_load_kernel(ARM_CPU(first_cpu), machine, &realview_binfo); } @@ -443,6 +444,7 @@ static void realview_pb_a8_class_init(ObjectClass *oc, void *data) mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a8"); rmc->board_id = 0x769; rmc->is_pb = true; + rmc->loader_start = 0x70000000; } static void realview_pbx_a9_class_init(ObjectClass *oc, void *data)