From patchwork Wed Nov 22 18:43:34 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: 746040 Delivered-To: patch@linaro.org Received: by 2002:a5d:6706:0:b0:32d:baff:b0ca with SMTP id o6csp480221wru; Wed, 22 Nov 2023 10:44:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzIjJ0Op9gcmTkXriV7YnIK0N15n08/+CCWlSwJsn3fXtEzl6svgGJyz5y67EAY5aHRY9Z X-Received: by 2002:a05:6102:50a6:b0:45f:3b30:9c9a with SMTP id bl38-20020a05610250a600b0045f3b309c9amr3754753vsb.27.1700678640712; Wed, 22 Nov 2023 10:44:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700678640; cv=none; d=google.com; s=arc-20160816; b=CxOjum+0AnI4TAO6q5L5gs5f4EMMExG8QHGQazlVuh3x60dhOOVaLzHpOlTpWsqKYC lOAjPNNWhfpTiytqv6J9dEsX5t3Ixd6qhKaOwO6MLXe4SEzbntIwxpJAJP6fTk42TFtY sJ1NUQZQnVoDets59sUyqVj3BQDtvvOO81DaIJFvcmFftfGGY6Lfkx30Wpfsx0vXmD9a 1/6dmC61cfiB1IgFL4P5Va6dmoBcMNFrZBXmNnzeS4RL4PjDzm/syu6hcArn9rSDH7mc viZHMD7TU/ljgxvDBfXPjEdwDOO/Zt4i6ITVOnXNzpDmXXF1RO5I3Raz7wywpA+Whq89 iqUQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=jwHo/tGYbjQnZzolItAUZKsD/hW+gqW7av2VFd5Fxgg=; fh=efsQyEvMeAabG60sENzEDgpTLeHpWu2TV1TmTEUWyDY=; b=vBRK75tHCIMve/m5NMh1LFmgJaPGtmgeGgVMZRvawx14pwEZ+V1RZP6vI8J/O76Dzm ENzkm9CIyCyizNExxMAV/XXmM+63D/hIe56WEDw5/t1evy3VrD77jKPsEYSm1fJqLs8v hA8p9cgrIYBIEkzAlfXmI6vJ1yw6T7B1hjxdbP/6Wze86S3eeBWTTQrT5RycJUnG7tMJ DPfyZwAU+Q5w205v2BZGsV8ENSMmVqwDDa9a14h/BItRUK5T44wLcIF8YbIUwf/pXWUX F0MJehR1EEopO1H+20F4ham635eme91p5xTjqdYcjBa74+pyljuXP7z7XxwR42cZ2AaK ZPrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QfzpgDqA; 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 cs10-20020ad44c4a000000b006779f704f86si22550qvb.85.2023.11.22.10.44.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Nov 2023 10:44:00 -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=QfzpgDqA; 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 1r5sCL-0007f5-Jp; Wed, 22 Nov 2023 13:43:41 -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 1r5sCJ-0007ev-Hj for qemu-devel@nongnu.org; Wed, 22 Nov 2023 13:43:39 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5sCH-00071B-TM for qemu-devel@nongnu.org; Wed, 22 Nov 2023 13:43:39 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4083f613272so396105e9.1 for ; Wed, 22 Nov 2023 10:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700678616; x=1701283416; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jwHo/tGYbjQnZzolItAUZKsD/hW+gqW7av2VFd5Fxgg=; b=QfzpgDqA9D+CPllu0RC9GXGSypTadv58sEBHbglGznbh2FmLLepxVtSPDXcg76IGnD K5GL0ErR1k4UvbRkgzIOZG6jP4RHKl2R8apST40RW1cIodwY0J0SJVJhdDYNgok91mxm C1mzWm6wrBm1TiX1XkW36rmJHIwXIueao4stzHGT7lul0V0ni/JOFOBP0ncR16UPkpdQ c7xgGMcpHfss18Zv5gFd+pGnTum5YQ+lUOjROW2jbG/b0t6fzv6HHgImYuRhJzRWTaDZ /uAVAKWtz/upsUyWEEUVdiwkSNRfIFQTjW1ux8Acav5dBIT2ziAR4B3BL7KLLZsLAVAC jIpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700678616; x=1701283416; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jwHo/tGYbjQnZzolItAUZKsD/hW+gqW7av2VFd5Fxgg=; b=KxMtdSmeG1uQ8IjTyS2BTTxGzsoMm6iOanJv3TpMSWzWFoHPxgbY4u9jpINgTAT+Vx G64OhbEjM1eLqYdn5TeIj/gWxk9Ha/HDfWdmVNW3Hg5ajma3cLGIaisygrMNbpXtZ6RU Z2a3hUMBnBLBbgBuu0H4yYSFjhAme+zeMvNk0hDwfm981wHDDo8XJzWuqRwmgyuEzpp/ dkuOedOZpmyshIZ6qEo9d2kd4lRfeYEpRUutlQmSz1fai/Og0+mPgdBTNemf+ypjLuIl Zv7NEsJqR5GQVsQ31mLZN6Mc4sKoHKFMJUO+RJIp4VVjnmB7+hCG+p67gZ4h/hILO1OQ TTQg== X-Gm-Message-State: AOJu0YzsFx16EnXw6QYHcBjO6QGIXdQn9kwuEkUplTlqok4//nmx5N8k JnVR8kEJiFB2AjMSm2jZV38O3Qk8YSs4utTKoyU= X-Received: by 2002:adf:d1c7:0:b0:32f:8024:64f1 with SMTP id b7-20020adfd1c7000000b0032f802464f1mr2720288wrd.2.1700678616151; Wed, 22 Nov 2023 10:43:36 -0800 (PST) Received: from m1x-phil.lan (pas38-h02-176-184-5-64.dsl.sta.abo.bbox.fr. [176.184.5.64]) by smtp.gmail.com with ESMTPSA id n2-20020a5d4202000000b0032db8cccd3asm58359wrq.114.2023.11.22.10.43.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 22 Nov 2023 10:43:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aleksandar Rikalo , =?utf-8?q?Herv=C3=A9_P?= =?utf-8?q?oussineau?= , Jiaxun Yang , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.0] hw/mips: Inline 'bios.h' definitions Date: Wed, 22 Nov 2023 19:43:34 +0100 Message-ID: <20231122184334.18201-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=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 There is no universal BIOS, each machine needs a specific one. Move the machine-specific definitions to each machine code and remove this bogus header. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/mips/bios.h | 14 -------------- hw/mips/jazz.c | 10 +++++++++- hw/mips/malta.c | 9 ++++++++- hw/mips/mipssim.c | 10 +++++++++- 4 files changed, 26 insertions(+), 17 deletions(-) delete mode 100644 include/hw/mips/bios.h diff --git a/include/hw/mips/bios.h b/include/hw/mips/bios.h deleted file mode 100644 index 44acb6815b..0000000000 --- a/include/hw/mips/bios.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HW_MIPS_BIOS_H -#define HW_MIPS_BIOS_H - -#include "qemu/units.h" -#include "cpu.h" - -#define BIOS_SIZE (4 * MiB) -#if TARGET_BIG_ENDIAN -#define BIOS_FILENAME "mips_bios.bin" -#else -#define BIOS_FILENAME "mipsel_bios.bin" -#endif - -#endif diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index d33a76ad4d..0d2348aa5a 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -36,7 +36,6 @@ #include "hw/boards.h" #include "net/net.h" #include "hw/scsi/esp.h" -#include "hw/mips/bios.h" #include "hw/loader.h" #include "hw/rtc/mc146818rtc.h" #include "hw/timer/i8254.h" @@ -53,12 +52,19 @@ #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" #endif /* CONFIG_TCG */ +#include "cpu.h" enum jazz_model_e { JAZZ_MAGNUM, JAZZ_PICA61, }; +#if TARGET_BIG_ENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif + static void main_cpu_reset(void *opaque) { MIPSCPU *cpu = opaque; @@ -147,6 +153,8 @@ static void mips_jazz_init_net(NICInfo *nd, IOMMUMemoryRegion *rc4030_dma_mr, prom[7] = 0xff - checksum; } +#define BIOS_SIZE (4 * MiB) + #define MAGNUM_BIOS_SIZE_MAX 0x7e000 #define MAGNUM_BIOS_SIZE \ (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 049de46a9e..d22bb1edef 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -40,7 +40,6 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "qemu/log.h" -#include "hw/mips/bios.h" #include "hw/ide/pci.h" #include "hw/irq.h" #include "hw/loader.h" @@ -59,6 +58,7 @@ #include "hw/qdev-clock.h" #include "target/mips/internal.h" #include "trace.h" +#include "cpu.h" #define ENVP_PADDR 0x2000 #define ENVP_VADDR cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR) @@ -71,6 +71,7 @@ #define RESET_ADDRESS 0x1fc00000ULL #define FLASH_SIZE 0x400000 +#define BIOS_SIZE (4 * MiB) #define PIIX4_PCI_DEVFN PCI_DEVFN(10, 0) @@ -91,6 +92,12 @@ typedef struct { bool display_inited; } MaltaFPGAState; +#if TARGET_BIG_ENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif + #define TYPE_MIPS_MALTA "mips-malta" OBJECT_DECLARE_SIMPLE_TYPE(MaltaState, MIPS_MALTA) diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index 4f743f37eb..01e323904d 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -35,7 +35,6 @@ #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h" -#include "hw/mips/bios.h" #include "hw/loader.h" #include "elf.h" #include "hw/sysbus.h" @@ -43,6 +42,15 @@ #include "qemu/error-report.h" #include "sysemu/qtest.h" #include "sysemu/reset.h" +#include "cpu.h" + +#define BIOS_SIZE (4 * MiB) + +#if TARGET_BIG_ENDIAN +#define BIOS_FILENAME "mips_bios.bin" +#else +#define BIOS_FILENAME "mipsel_bios.bin" +#endif static struct _loaderparams { int ram_size;