From nobody Sun Feb 8 18:29:18 2026 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1661523360; cv=none; d=zohomail.com; s=zohoarc; b=fZ6o1Y6BrL1ZfeA79LfCSR1nkR6c7dE7LqsrjNyIDhi64t6ahmtzlTajUA3+j6bvFXTSuolVPNMB/5HLY7SKlehZ9lMQeEuqnBThhrTunXE7ZPaJIZqSo/yYIv380mn8uF5gyMDBZ1ElEfDJBUzQPMAXMEKijjO+QEmz4/xB49M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661523360; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j1RYsPISHcQmqkfg0bCXBflgdHOzA77Z6HtOczxpsOA=; b=DHtZQnq5WXr5SNJmuuqunUkLRYxrvPfV/FqNAh4LfuvQ9OyN7SN97FwT4KKfd1PICXvsHoiXfcnGyG+SAqwMzyn76CLK84YbFcjDB6B4XnUvQ8PkgtiFKgGawJzvV0b3FFuM4wr5EO5eqgiYpboObVAgCV5wt7Eyhc8aBQ/RbX4= 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 1661523360132509.75120142218327; Fri, 26 Aug 2022 07:16:00 -0700 (PDT) Received: from localhost ([::1]:36796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRa7r-0003Ws-14 for importer@patchew.org; Fri, 26 Aug 2022 10:15:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRa4D-0007cQ-4L; Fri, 26 Aug 2022 10:12:13 -0400 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]:43840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRa43-0003qH-V1; Fri, 26 Aug 2022 10:12:12 -0400 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-11e86b7379dso924494fac.10; Fri, 26 Aug 2022 07:12:03 -0700 (PDT) Received: from balboa.COMFAST ([177.189.45.98]) by smtp.gmail.com with ESMTPSA id z12-20020a056808064c00b00344aa3f17d9sm1087736oih.10.2022.08.26.07.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 07:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=j1RYsPISHcQmqkfg0bCXBflgdHOzA77Z6HtOczxpsOA=; b=SV+1hPN5vfdPYqYnEbsFUdulxGd6hv//jAJqny0cgLkZAqe309mR5VESbcSyEAELeB 32zikRo1bnVJWueEJnIJl9OjVo8q6PfybbEYdCWYZJ5VyrJVDLlmUudjr4gUnxvZzP9k DgDdgRt2Qfer+FvS1hrNynoKDRjSrPHbut7JUIkApiU4/JByTKRjQ2D8L4t758EsgdLx 2SYXz/GFsXwS+lpMXkDqwtLkSqVJg+Qz8+fJvBlNbmADoLmk9DCuLleQ7kwAlpwjjn2R xCHOCLkFPeXv4roZabDo8NZ36wWELhndXMFuFJQmhQjD9if9TKwCUCCzvobYhbeWp5It 2s8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=j1RYsPISHcQmqkfg0bCXBflgdHOzA77Z6HtOczxpsOA=; b=BRwTqVesBRFWExDBcWGVPd9ICVsHtSmAzVKjDNbsW+EUiiFFD6PezwFA1h8FhArSmn jb4qBBfaDxBTkKewpxf3b/Om30k0C30eM1vCYg7jFCLCMS++7QGpWIMie2veQ6QA7+Z2 kPMUVLCfZfOuFhORj48j3K0T1HCmFKMWMhTQTHAqHabE0oamz1VbfzT6lhG+BcJwMvgm CniDTicFE42iweiwahsOKZyC4gGyGBDZNr2JMKzsEqYLJMbkqNBvwJV/8+kh3HJJ+iiP 5HEIODXn1T5n/YxkJwj+ETWmjEqKfFbQ1L+RQRrDSHz86wbpMV5I0VTx22nBe/0MupTU sKHQ== X-Gm-Message-State: ACgBeo1yzRNdh9ZVxcPVIM5BuBjSNqMjDgxUpZLGB/z3y29Fs6LZawnL MwQy5g/K665MFaw9lrrHUmcdv27k+iw= X-Google-Smtp-Source: AA6agR74VKXjELPAWCyRXlmKH1A14sZCFuSy0heZEfmTMfyrxp02y1Cq9wBqneX/RkDwvxaCgPMVAA== X-Received: by 2002:a05:6870:c14a:b0:11d:588:da3a with SMTP id g10-20020a056870c14a00b0011d0588da3amr1889262oad.214.1661523121982; Fri, 26 Aug 2022 07:12:01 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au, alistair.francis@wdc.com, Daniel Henrique Barboza , "Edgar E . Iglesias" Subject: [PATCH for-7.2 v4 02/21] hw/microblaze: set machine->fdt in microblaze_load_dtb() Date: Fri, 26 Aug 2022 11:11:31 -0300 Message-Id: <20220826141150.7201-3-danielhb413@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220826141150.7201-1-danielhb413@gmail.com> References: <20220826141150.7201-1-danielhb413@gmail.com> MIME-Version: 1.0 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=2001:4860:4864:20::31; envelope-from=danielhb413@gmail.com; helo=mail-oa1-x31.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1661523362001100001 Content-Type: text/plain; charset="utf-8" This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all microblaze machines that uses microblaze_load_dtb(). Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/microblaze/boot.c | 11 ++++++++++- hw/microblaze/meson.build | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 8b92a9801a..e9ebc04381 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -39,6 +39,8 @@ =20 #include "boot.h" =20 +#include + static struct { void (*machine_cpu_reset)(MicroBlazeCPU *); @@ -72,6 +74,7 @@ static int microblaze_load_dtb(hwaddr addr, const char *kernel_cmdline, const char *dtb_filename) { + MachineState *machine =3D MACHINE(qdev_get_machine()); int fdt_size; void *fdt =3D NULL; int r; @@ -100,7 +103,13 @@ static int microblaze_load_dtb(hwaddr addr, } =20 cpu_physical_memory_write(addr, fdt, fdt_size); - g_free(fdt); + + /* + * Update the machine->fdt pointer to enable support for + * 'dumpdtb' and 'info fdt' QMP/HMP commands. + */ + machine->fdt =3D fdt; + return fdt_size; } =20 diff --git a/hw/microblaze/meson.build b/hw/microblaze/meson.build index bb9e4eb8f4..a38a397872 100644 --- a/hw/microblaze/meson.build +++ b/hw/microblaze/meson.build @@ -1,5 +1,5 @@ microblaze_ss =3D ss.source_set() -microblaze_ss.add(files('boot.c')) +microblaze_ss.add(files('boot.c'), fdt) microblaze_ss.add(when: 'CONFIG_PETALOGIX_S3ADSP1800', if_true: files('pet= alogix_s3adsp1800_mmu.c')) microblaze_ss.add(when: 'CONFIG_PETALOGIX_ML605', if_true: files('petalogi= x_ml605_mmu.c')) microblaze_ss.add(when: 'CONFIG_XLNX_ZYNQMP_PMU', if_true: files('xlnx-zyn= qmp-pmu.c')) --=20 2.37.2