From patchwork Mon Jan 13 00:47:46 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: 856919 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp1214378wrc; Sun, 12 Jan 2025 16:54:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrL1zSqLAI9GSA3j5UDNBhlxY72f7SLwQ/b7qiuuO29FtXdBwI/LOU4mHxPg4EhrFCe7CEzA==@linaro.org X-Google-Smtp-Source: AGHT+IFxdypIEWw47g8rN1dq4i2p3HiEH+uFneeuJSOjYiPE2keJu3lnS5WwBzTkKBPOkFUBfF5a X-Received: by 2002:a05:622a:302:b0:467:63fb:68d7 with SMTP id d75a77b69052e-46c7109eaf9mr327195451cf.50.1736729692151; Sun, 12 Jan 2025 16:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736729692; cv=none; d=google.com; s=arc-20240605; b=CnG4UBNpqE4NnLqrjBzu8fF/h4DEJsmo2EP7HQiFo6SqUuPst+cltJMJ+OPfjtDx7M +ymEeO2ogI+YhNX6FSEza2jTfienaByuz2MeyVQ2qKhItuNOuEFT5ZCczyXULfLLqA7W ZUPyWfAb+9DYrtKGirBXSoNdRL3tlPdXioGbiBn+Ss0ncTIrBkT0yhUiHGInkzHRBCUI CFiFt93LLLpkw7sEbOR2Roo7qUoo8du0Kf5YhixG9pdDkG9vowH3DJZwsqGy73Rt3sgk qDRL/bPm7cfZ0ufoAb00fJoMEihbw+tokJoODDL/CLL4GPEPNeAKvj4guXBc/MKV0kmI 27Yg== 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=5t7LN/wKZvE1noLloA1ScY9xrm7gHXj/oUl+gXuqqpU=; fh=NAziacGX1oLRG5aXR1KEGKyZTrl+lhslKvmHcMEZt5Y=; b=Ejkf0BPzLVxf0mwFLVUpsPWIQ5tZ7m2tCQHbYYdtJHj7EdRQIoiFh8cHUL3JnRBkSI HJn6Dl05ZhAPTedMKSVFG40vRxP9TArbKrLpfty3jjMpQLLxmuXLkaC45aIEc/Za04B6 VZs9t00MOb41g4HG0BjTYTNtFTxuk0tw+7i3h/lcqS5PSX67W1JEBQ6RvLpRqmYaKKWh gedcF3zo4vYw8ZfmQWuG0yYRBHWbZTnmHExvIN8of5QfWkpETvI0xUhL/kR3bcHzm472 pVRlPFhVy2atydiHdg8libwZubazv7mopFSQfOXgcoRwKKJ1ZTJXniXQj13m0EZl6glB WgAQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sntkCroI; 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-46c873faee0si83567581cf.395.2025.01.12.16.54.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2025 16:54:52 -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=sntkCroI; 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 1tX8eT-0007o7-JC; Sun, 12 Jan 2025 19:49:57 -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 1tX8eP-0007P0-HP for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:49:53 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tX8eN-00010l-QG for qemu-devel@nongnu.org; Sun, 12 Jan 2025 19:49:53 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-436281c8a38so26340045e9.3 for ; Sun, 12 Jan 2025 16:49:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736729390; x=1737334190; 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=5t7LN/wKZvE1noLloA1ScY9xrm7gHXj/oUl+gXuqqpU=; b=sntkCroIm9AADpXZ688KLaNL2EXoOYFJSmGwIl5bYmdWuH0/3PVtcBeWAGTibYh2zc fbv+QEElkYNdwqDfLQjSO6ibZrlz6uoVu/GYrMkWZ61PQQ3itQwTnp+Y1RHhuJkVeQ4h pDdDjuiphGi1XuFB76NMAjjExJcBVPZZcH1AYUWWcgfdxdyPfEwp1yDZt1IA7C4Z35St sXhZGszV2pnAnjnnPo7xDs9MG61ATHw2nkwWs88jxWvgt0rsX5e1o5G3bXvenUaho1TR Y9k3+MYhJ/3OU+aj5qOgrp4b6CuMZohnyRZq3sbiAI0Lcg4mzEjiIlKX6qOrKJxbxNzp /5nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736729390; x=1737334190; 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=5t7LN/wKZvE1noLloA1ScY9xrm7gHXj/oUl+gXuqqpU=; b=A0T2j6oa8Y94V2DFV/wPwVaqDJDyoNtTOUoHXd12W/ucj1KT91IPhiaQ8si5AWNwll D9BzQEOj/RYVNhyuCThiqttO5tYkzJn7f3zIDT83z2DuNlOXOrgXqcISOmQhKfsj4zqT 4a3JCcA3LbK1eBpDxf63lQKXUrk5ksy20VrNL6B22r4i15Asg7AO5YwZKlHO8+LUb33o SQshr4Szc6kkTz7W5nyBKzOc91+gtcr7yyCimxckOPR8+3Q1Q6xQXioClc1TJoOfOCTA vXw91nj6yg7I3BQJkYKQq+JfZGJKcSGweXv7ztCC0yxBVlcTxOYMjlLfHw/Ex2epDarq qrVQ== X-Gm-Message-State: AOJu0Yz7aMsgfioXQYdPtxUCZlV+JZuo0bypXx0YHitZReS8vWejc+KK MVbgpwXqeQPHY/z/Pq3ITus5gCyq3vc0okg3RoSHtUjDFfdz/zbSXXQ8cQuz/BDIX5Kq3tYwQaQ BIgU= X-Gm-Gg: ASbGnctSHy5RGoWW8k5NJpxsvMVAdcmnKvByNxl23O2VKlb5eYvySWBdt3Ula79k9Qz +BvuE8hRRgsCSwkBZuvLY3A3Ea096wlUlGuhTn9I6EWsHtSEWiRSXS/Xi3Yrwf062uog39mBSPs jnG/UyQX+Cz/ouAUmyYU150Lw1UcJqAFTp8M3L4DUirDLCValysgz1XMyAhUlyZqhpEYAeZb75Z Z/5WVI+zl5BzY0Sv7cN+0Zp3mfFCXWfWIhTiMr76ryNWFbPoPnFs6xKp6AdReX4OB5YRi/0Q0/e U5p4Ygq9fD97JFWgfVRtyFZHM2PlfYk= X-Received: by 2002:a05:600c:4586:b0:434:9e1d:7626 with SMTP id 5b1f17b1804b1-436e26f4b91mr149209055e9.25.1736729389903; Sun, 12 Jan 2025 16:49:49 -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-436e9d8fd03sm129722785e9.6.2025.01.12.16.49.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 12 Jan 2025 16:49:49 -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 21/23] hw/mips/malta: Propagate MaltaState to write_bootloader() Date: Mon, 13 Jan 2025 01:47:46 +0100 Message-ID: <20250113004748.41658-22-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 Pass MaltaState as argument to write_bootloader() so next commit can propagate it to bl_setup_gt64120_jump_kernel(). Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index a037ec2cc8d..589e1a07e47 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -692,7 +692,8 @@ static void bl_setup_gt64120_jump_kernel(void **p, uint64_t run_addr, kernel_entry); } -static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, +static void write_bootloader_nanomips(MaltaState *s, + uint8_t *base, uint64_t run_addr, uint64_t kernel_entry) { uint16_t *p; @@ -744,7 +745,8 @@ static void write_bootloader_nanomips(uint8_t *base, uint64_t run_addr, * a2 - 32-bit address of the environment variables table * a3 - RAM size in bytes */ -static void write_bootloader(uint8_t *base, uint64_t run_addr, +static void write_bootloader(MaltaState *s, + uint8_t *base, uint64_t run_addr, uint64_t kernel_entry) { uint32_t *p; @@ -1172,10 +1174,10 @@ void mips_malta_init(MachineState *machine) kernel_entry = load_kernel(); if (!cpu_type_supports_isa(machine->cpu_type, ISA_NANOMIPS32)) { - write_bootloader(memory_region_get_ram_ptr(bios), + write_bootloader(s, memory_region_get_ram_ptr(bios), bootloader_run_addr, kernel_entry); } else { - write_bootloader_nanomips(memory_region_get_ram_ptr(bios), + write_bootloader_nanomips(s, memory_region_get_ram_ptr(bios), bootloader_run_addr, kernel_entry); } } else {