From patchwork Mon Jan 13 00:47:43 2025 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: 856908 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1213972wrc; Sun, 12 Jan 2025 16:52:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrYsif0NaSPTXeqG8s1lOpMTq16cUZ+9LP75NY6qWain9UZJEZQB3XFdxZi5DrjNeN698F4A==@linaro.org X-Google-Smtp-Source: AGHT+IEFlKnJW3uTfEf+qwcogklb7/GwA30gQj5g+kzas+7thhQu6VAd0SzG0bK3MiCIsJFPKnVm X-Received: by 2002:ac8:7d8f:0:b0:466:9197:b4fb with SMTP id d75a77b69052e-46c7109e81emr316902291cf.47.1736729568950; Sun, 12 Jan 2025 16:52:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736729568; cv=none; d=google.com; s=arc-20240605; b=dvIknmt8ahKH3CvQUOxQCdoznyQqlkkrDb1FZch7KfGldebIhzAJ3bHgrXsZNNRhOL 9CNGzuslB6/ay+W4h3/TaBGbMzzSCGKVspzVsNS58/O/qRS6nWLLom+IejrxifpWXqC5 sz0HiMYE8lRojn2HwBNzWoBWse4idrM7TTfwi2h+tXZS0Z6hK4w/9AVrJ4bPsNVGF89P JP3/y4qFsthSwrbRZh8Lx8yfBAp55Sbd3/Hg642ZRvqojueH7Fhmdh4OBUTQjFb6LZgy RUDiSUwzdA9a4b/qXhs/vUkzsQwzwBZu9kKmYkyh798hF5ga/KEIsY1fmyl41dkc+kVh RwDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=yiNeuarA8r14N/udmX2Ti0NAodknr96nxpHCBqLhgpc=; fh=NAziacGX1oLRG5aXR1KEGKyZTrl+lhslKvmHcMEZt5Y=; b=g9wt8hZCcK/7ZpkLizyfAGqkZOQQpW88HV+Crf6y+3L9OcZLXA4pcJZ049c3B0iV9I LDPlYllWNMBlGFPB3iRGQa1FAfpCQ19I1OlwrLnxeNlw0kEPSRxh0Do4QV2j5YU/Ggsi BxKyic0yz2sdcKYROyLOzG3V7rz+/AKeBpM09xx7qOIqznSq/e8tulI/kE8qyGDQPz4J pLbU/rC1P3PzheKUBydpBKSuAO+EDyJGtbQDFmqH9voFnAOsi7dnD5qWTQjmX1cDKdfY 9+3pX8nWtZbbstQk3dDoBZwRSwb461h1FrX8LWnRVrhYE8TZ2EcB0q36aVMc+H2FGbEC UtJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="oBB/VBv/"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c87412d95si84007601cf.484.2025.01.12.16.52.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 16:52:48 -0800 (PST) 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="oBB/VBv/"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tX8eJ-0006pL-TU; Sun, 12 Jan 2025 19:49:48 -0500 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 1tX8eB-0006Vj-Tt for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:49:42 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX8e9-0000wZ-PH for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:49:39 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43626213fffso29001235e9.1 for ; Sun, 12 Jan 2025 16:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736729374; x=1737334174; darn=nongnu.org; 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=yiNeuarA8r14N/udmX2Ti0NAodknr96nxpHCBqLhgpc=; b=oBB/VBv/cwKnZb977hJWQgeiL46FgCsSfLzM47xNBQFF9pmubUeVhRSyRhTeRCUE6X zU0m+v0EadbAK/pCdVdmj4vVU+l/RphoDHkko9coRG0cG+F2Yqz8UGyWfV69kVd8whp1 ZZiXyc3Z3afDFnbkkDNJ1QJM6CcVEx1jC0+L2J+8My/8l361Vd5j2pjiMZ1l78xRuphr YFxFW6U2VEFAz7CxyjSH+bKlZeerkqRsDjLy/0R4/mfpgeqODokrH9GT8xar2+L42ep+ vFzbRq3TFgtmhHmkxHOi/wmeS8p0/7a8jilQsAGmtw4SuCDKJfdZtBN3q+5qfrq95jNf vFCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736729374; x=1737334174; 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=yiNeuarA8r14N/udmX2Ti0NAodknr96nxpHCBqLhgpc=; b=KI41Rtp9bJ3UnYOtn/vLULkvl1Hs4qXAoEMLwOGVgixBK4471wuMo8dOY9oHJh+OeM D//TUg6R9Mj9AYFZq3xJywGlBdUpTwZaexMQ7O7kvUVm+j4GHRtogvGAuFZwU2E+/XT4 71fnpvFDZPgUlZ/gZn9z0o3OaGPaHfTlYkSqR7F7L85O4gPD3Ya8LBco/13nDOFr7DMN uv+WTXOHXvCzg+m4pJQNOTTKeh9HjgYV1b1IqVLvRpHCK9ouDYwpi/TqNfaIquPD7pYA UF6EXP3KCkAIlgM1ggFXdDGW4U191axS/STVybjavKslqEPdDsYeMqxNhW+HZsGcgRaL U0Ig== X-Gm-Message-State: AOJu0Ywnh4WjEJ05SVMPig0xpAVqzstvkf4889tT2IMF0zQzKDCW92kW z2qnFF7eO77fgwhpecBywivhQsZBB8MENkp7iFlgBenl1PQokDZbFQNW8YHgq1v44XwCvx0LOyP Z3jo= X-Gm-Gg: ASbGnctV06ff8XUXrwUZO1Xo42zYkHkW5QwpxqtykQt0GWxGJuGV+enQX7mVaVU1dqk QdmPR19TWdccDGdgnO9ogNy2bAQ4F3sYzCUq311k6hO/94lfqvzPpOCDTPuCCb7/GDO2jrnBEua qcd9CO2khArT84mHaJ1OQvq0J8l3BnOPTZ5F60EG211VllDDkAEcD0ZDLcNPIP07Nt/k9P+IoAl Hg+m3wzxkhv1VWBjrGP6ER6ENUzAMTYouCRgKDyeuYp6PoZhbrHJjfkX6YNG9bjNNO/j9+uonPU Km+wSTwRdGonkByiM/COvhQZoqZeQOQ= X-Received: by 2002:a05:600c:1c11:b0:436:76bf:51cc with SMTP id 5b1f17b1804b1-436e8843d76mr111840665e9.12.1736729373805; Sun, 12 Jan 2025 16:49:33 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9dc8802sm125761915e9.10.2025.01.12.16.49.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 16:49:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Huacai Chen , Paul Burton , Aurelien Jarno , Jiaxun Yang Subject: [PATCH 18/23] hw/mips/boston: Propagate CPU to gen_firmware() Date: Mon, 13 Jan 2025 01:47:43 +0100 Message-ID: <20250113004748.41658-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250113004748.41658-1-philmd@linaro.org> References: <20250113004748.41658-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 autolearn=ham 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 In boston_mach_init(), resolves the first CPU from the CPS container using the QOM "cpu[0]" path. Propagate it to gen_firmware(), removing the &first_cpu use. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/boston.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 09c4dfade12..f2c0e335e73 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -323,25 +323,26 @@ static void boston_register_types(void) } type_init(boston_register_types) -static void gen_firmware(void *p, hwaddr kernel_entry, hwaddr fdt_addr) +static void gen_firmware(const MIPSCPU *cpu, void *p, + hwaddr kernel_entry, hwaddr fdt_addr) { uint64_t regaddr; /* Move CM GCRs */ regaddr = cpu_mips_phys_to_kseg1(NULL, GCR_BASE_ADDR + GCR_BASE_OFS), - bl_gen_write_u64(MIPS_CPU(first_cpu), &p, regaddr, + bl_gen_write_u64(cpu, &p, regaddr, boston_memmap[BOSTON_CM].base); /* Move & enable GIC GCRs */ regaddr = cpu_mips_phys_to_kseg1(NULL, boston_memmap[BOSTON_CM].base + GCR_GIC_BASE_OFS), - bl_gen_write_u64(MIPS_CPU(first_cpu), &p, regaddr, + bl_gen_write_u64(cpu, &p, regaddr, boston_memmap[BOSTON_GIC].base | GCR_GIC_BASE_GICEN_MSK); /* Move & enable CPC GCRs */ regaddr = cpu_mips_phys_to_kseg1(NULL, boston_memmap[BOSTON_CM].base + GCR_CPC_BASE_OFS), - bl_gen_write_u64(MIPS_CPU(first_cpu), &p, regaddr, + bl_gen_write_u64(cpu, &p, regaddr, boston_memmap[BOSTON_CPC].base | GCR_CPC_BASE_CPCEN_MSK); /* @@ -352,7 +353,7 @@ static void gen_firmware(void *p, hwaddr kernel_entry, hwaddr fdt_addr) * a2/$6 = 0 * a3/$7 = 0 */ - bl_gen_jump_kernel(MIPS_CPU(first_cpu), &p, + bl_gen_jump_kernel(cpu, &p, true, 0, true, (int32_t)-2, true, fdt_addr, true, 0, true, 0, kernel_entry); @@ -825,7 +826,9 @@ static void boston_mach_init(MachineState *machine) } } - gen_firmware(memory_region_get_ram_ptr(flash) + 0x7c00000, + gen_firmware(MIPS_CPU(object_resolve_path_component(OBJECT(&s->cps), + "cpu[0]")), + memory_region_get_ram_ptr(flash) + 0x7c00000, s->kernel_entry, s->fdt_base); } else if (!qtest_enabled()) { error_report("Please provide either a -kernel or -bios argument");