From nobody Thu Apr 3 11:26:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741189390; cv=none; d=zohomail.com; s=zohoarc; b=bymoVKnV7VCT3K8m/D1+I7yyzxznCYH6kpNH1PTTkGs5sCQV86evgxjcMgqJ6XjnsiRd4TQltd+ufJNzblweRk6fhOR4nrga2xDOcE5C19kh3Gq38Vl1MXS4oADIkLo/DC+HP4T2e5fyoSmCxCzcCUnzsueHAFgqD001CI1LWjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741189390; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+vtQIxIHxpXveYUhgNWWXCgOpU/U9ptA2e3UaY3frqU=; b=cG6vLFxpIVzckpwy+FhkASOfxHKDYjR24oCz/AlDGNI7YP0oUDeHbSw9wg8TCyNAmdJObsegzShsTpU1M+eRMuyPrhKStdghGKouD/WIe87L2lPwru/3IeX3d9WH3WtXxCJx31SFrP1AceZLqHyieYsqHffOrtp1BeNwAnkyDkY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741189390112650.9645925023488; Wed, 5 Mar 2025 07:43:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpqrm-00018L-Ka; Wed, 05 Mar 2025 10:41:02 -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 1tpqrc-0000qe-2E for qemu-devel@nongnu.org; Wed, 05 Mar 2025 10:40:52 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpqra-0002cu-3T for qemu-devel@nongnu.org; Wed, 05 Mar 2025 10:40:51 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43bc48ff815so6925465e9.0 for ; Wed, 05 Mar 2025 07:40: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-43bd6530fd6sm14836865e9.6.2025.03.05.07.40.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 05 Mar 2025 07:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741189248; x=1741794048; 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=+vtQIxIHxpXveYUhgNWWXCgOpU/U9ptA2e3UaY3frqU=; b=Ev19cYtPzA4UrckDtxwZJjqeKKN95r12kjAydAWAdn9FidWY2fK9Jln7WzibXFEgts ylK/vfovFDFu/V/foL7KFSoOX3BrgoRpZfNhhyHegRjOohCBb7PHypgCAr5buuEMYZFZ rNUusQudXXIFjcpRMTcdReaBN53F9kt/P1MBfm8IlMKW1cva17g5yaSfH9TwcAockSRA I3womS+vttfK/G08TkeaRHi8/a+GsMaZptrI63y3cKluBKNblVQ75JpfGyRIJhAAfeEu ZgKX2BAihtqMcGxtkaf6DcHMw8e+8Cj77QsokAGpmaPOpVV1wFUlhChRBvdfncioI274 caWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741189248; x=1741794048; 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=+vtQIxIHxpXveYUhgNWWXCgOpU/U9ptA2e3UaY3frqU=; b=EVyCkdNxwJY8C6xDXLanxs7WuMJUeOjDhWB93H2PHOQJR0wig7zsCEL001rEWIoNoR E7tGc7qKFVFmQjkU5Gl7LnvFJFyxnOaANPeRctwPSMphEqeXJkAHy31ptnX5Yoz6h7vL 6eS13hrEb5+JSa6o6YKEmDr1Ba1dDhf7zt4YrMbLCD2RgcAv8sjqGvWdpQ/eKDpHAP/t zDME+Ph8U2p5NzoE9UFaLCML3d8+zdM4y627WBb3JWd5YTKajWED4/Di2M8M51kgb0Nq lWzDtoJ7iSpt8bZs5ZgpHSfiJKZMPGURW74A1Lsuh2/6HwxSwtwzCcjZ8+xf8t4RSU0H oGcg== X-Gm-Message-State: AOJu0YzGOLe68J85HnRN2GPUllSqR2efY3W9QVKxbaPpHWu/gEcPC/nH LbZf05ekNaxc8usWrSTU6LKRQ1WD/WFdS63+jo6Dva6PxbLOuAyupnsB5ncu5S6g+XdbyOzpXCU r9Hg= X-Gm-Gg: ASbGncuVRjf8mfZehSv1BS8C7BzN6SU1U30EVpdVP7kbS6j9Q/etxuxD9gtls9QKyi+ I5EUknHqkKTP2P4EzchSiQLnbka+yUFnmlTRVO9tkV42+aMPHLX4hhXRHVVYOIXSBCpxndlxnON UvK7DqH7upnB/Uy0IB59uClK7BP9f4FzqUYhv8PuTbQZDWnq09bJTidKvpSLJZrT8ZZgRKp7myK zlCdiHT19675oXKbxVExtIKxJ/rbKimZEBTOixYg/3b1zNkEkbCgq4bcnATIDOtQSK+pyecwKX4 Ct8ncIN+qoAZVHkLFrNU3OYoVqqU5fq7exAbiHZM4AhNNL45UiKxFntenZ5eFimxjrQPIdVnbFF Gu6dSa342jdYTLKmGT2k= X-Google-Smtp-Source: AGHT+IGNuYMnXF6rBDXaLT19GqJ/gNbsa16vAYpnR8cczTS6BrISULUSR6Buy3vVTyHNK+Bwa7jrLw== X-Received: by 2002:a05:600c:470e:b0:439:9434:4f3b with SMTP id 5b1f17b1804b1-43bd20ba1c7mr28944025e9.8.1741189248150; Wed, 05 Mar 2025 07:40:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Paolo Bonzini , Richard Henderson , Pierrick Bouvier , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 16/18] hw/microblaze/petalogix_s3adsp1800_mmu: Use legacy_binary_is_big_endian Date: Wed, 5 Mar 2025 16:39:26 +0100 Message-ID: <20250305153929.43687-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305153929.43687-1-philmd@linaro.org> References: <20250305153929.43687-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741189391966019100 For legacy binaries, legacy_binary_is_big_endian() is equivalent of the compile time TARGET_BIG_ENDIAN definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index bdba2006b72..12d4d6c336f 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/legacy_binary_info.h" #include "qapi/error.h" #include "cpu.h" #include "hw/sysbus.h" @@ -71,13 +72,12 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *phys_ram =3D g_new(MemoryRegion, 1); qemu_irq irq[32]; MemoryRegion *sysmem =3D get_system_memory(); - EndianMode endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG - : ENDIAN_MODE_LITTLE; + EndianMode endianness =3D legacy_binary_endianness(); =20 cpu =3D MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort= ); object_property_set_bool(OBJECT(cpu), "little-endian", - !TARGET_BIG_ENDIAN, &error_abort); + endianness =3D=3D ENDIAN_MODE_LITTLE, &error_= abort); qdev_realize(DEVICE(cpu), NULL, &error_abort); =20 /* Attach emulated BRAM through the LMB. */ @@ -135,7 +135,8 @@ petalogix_s3adsp1800_init(MachineState *machine) =20 create_unimplemented_device("xps_gpio", GPIO_BASEADDR, 0x10000); =20 - microblaze_load_kernel(cpu, !TARGET_BIG_ENDIAN, ddr_base, ram_size, + microblaze_load_kernel(cpu, endianness =3D=3D ENDIAN_MODE_LITTLE, + ddr_base, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, NULL); @@ -145,7 +146,9 @@ static void petalogix_s3adsp1800_machine_class_init(Obj= ectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); =20 - mc->desc =3D "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800"; + mc->desc =3D legacy_binary_endianness() =3D=3D ENDIAN_MODE_LITTLE + ? "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800 (little = endian)" + : "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800 (big end= ian)"; mc->init =3D petalogix_s3adsp1800_init; mc->is_default =3D true; } --=20 2.47.1