From patchwork Wed Jan 4 22:04:37 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: 639051 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1973083pvb; Wed, 4 Jan 2023 14:43:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXue6NvxWTSytkfcsM667k9LC5UvCc3LGcoNvDUzc+pzy92xRscpMfOcZ9mksNIgkeMZUlgu X-Received: by 2002:a05:6214:449b:b0:531:d615:9145 with SMTP id on27-20020a056214449b00b00531d6159145mr13004021qvb.5.1672872211484; Wed, 04 Jan 2023 14:43:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672872211; cv=none; d=google.com; s=arc-20160816; b=QajwAScO6cR7fXffHpK9Qrvog8jqzGzraYv/+aT5wFwW4Bh9MpYI5q8TaMglcGS4mC 35ec7+NBUFtbIeg2bCDjARjFHZnJ1EnTnqHWUF8AvDdJRs49QBA5/axVY1pZTj6yokGa GFuLkHHwJmyILrdh25yuEaUrvdlXRsESGZ6nOUYRp5T7nIO8a1B5AV6yNW1RLhHNfwgo n/6cxAYCWRVWMyCHgXwDHPaJrVY+kbc2qUV7e8SKinNjLk9c3DZbgUwGRXqEK8D9EITZ mkZ4ZU8MnR0NXhDCZlSph6QX+p45YLbdGl1zVlIRRuS5WQ/Jga3UYC6TaomubCNvmZon 1yFA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ML6wRiyFlYJ0aSJ3m/RlR9qnqnqYeCYdx+C4vqE1q1o=; b=FQdRc/9JyhGKEfPwHqn8EviwVqsY9fuucb4Nlv3obNLczlqtoioV0RXMVTqPX49ysV 7pWFrQIksEve3kQTF8rZzTRFnThfMP7HAlTSeTDNmzO8O8/y0Zop1IBp1mSETJC9Qz18 pqMp1HukagsrYMVMPkMBKpEq6SXxVRDxtOaTOUoLZV9dhDPHZJkVZbnP04QGyV4ZdesO 646uT2EgKpqXLhYGcc5iqNK0bu/IuBvjDodk+XOWQ30H6dGAxo7LsvzdoKIsEABttktN E+Z/m32KJMhEZ0lpymBJw0rns0WQNaCR8F4ZxAamjFnHu4mwDhqNpSl6qaWRfWu02blt LpfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tOcrrXr/"; 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 dm26-20020a05620a1d5a00b006fa2bd5f8a6si17714664qkb.407.2023.01.04.14.43.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jan 2023 14:43:31 -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="tOcrrXr/"; 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 1pDBtg-0000pK-PK; Wed, 04 Jan 2023 17:06:08 -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 1pDBtf-0000n7-7r for qemu-devel@nongnu.org; Wed, 04 Jan 2023 17:06:07 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDBtc-0005NE-6U for qemu-devel@nongnu.org; Wed, 04 Jan 2023 17:06:06 -0500 Received: by mail-ed1-x52e.google.com with SMTP id z11so34707691ede.1 for ; Wed, 04 Jan 2023 14:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ML6wRiyFlYJ0aSJ3m/RlR9qnqnqYeCYdx+C4vqE1q1o=; b=tOcrrXr/ZKEL1dv6XM/UVZADyYAKSFhSQfIDLGLOYafYj6WohiAvbR/v9z2WOwyo9Z AV2G0X5kV/MJS+JBvt9wptuqe/Fma27TyVsTrHyjrSppz6iDLIOVDr8YcTUWOTZfyxcO 08ywThR/Wa48OTO4EcQTfifr4rNp6M91we0gEeLaSph9bFYsb31c7kvM1R+rHGt67iRG zT8PLwdiIcNT/yUrksVCawE7JdeacVk2v1W5i2sDCCkNz9xqM6YmBwWxJTrNoN/aqcfH gq6uuOCQtOBSj9CLN1HJTmKGjCOS8rOY41TeF5dGPqt04Y1fToOO2fYZR6eEusXYDOvc XadQ== 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 :subject:date:message-id:reply-to; bh=ML6wRiyFlYJ0aSJ3m/RlR9qnqnqYeCYdx+C4vqE1q1o=; b=AaVVgNKlwyl8WwViYJkN1xkD6Q2ROmaaZpKTbqnVuGz4vfezZ94iJWoPvTR/Cvgsxy MDS3VRz7jifXHdoVpSGBGpW3AOouYOLqLZKMkyK8v2xYYthPy7t0rxwBr9/+VK8e9c0Y i7y7SblgiLTWQ+5e+VivHVCgayFhOLCexfRHhXyOJd9nhYkk8lLU/NGo/utkGdbGae1t NXasF+7TWJTCU9KZQDrEOpZXWXxoBIkRIjoElP6ZfXtkN1CXUl/16IUFZNycEk/fK4R6 cocxMukBJIhlojKjyG/BJ2pgpH5Qep5um+PFM3UYo26Uq0+P3lwcuC9QjDlt1qN2LWwj px+g== X-Gm-Message-State: AFqh2kpzk9TcB7OhOG/C/FhQouueTQjlk1FcAfepDMGE6wPrrJbNGul8 m+8GvMXRFEctlAzKzTdJXqjxoIzZfB7caIjr X-Received: by 2002:a50:fc15:0:b0:470:31fb:cdcc with SMTP id i21-20020a50fc15000000b0047031fbcdccmr44308754edr.6.1672869960630; Wed, 04 Jan 2023 14:06:00 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id dn5-20020a05640222e500b004610899742asm15387750edb.13.2023.01.04.14.05.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Jan 2023 14:06:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Song Gao , Antony Pavlov , Jan Kiszka , Marcel Apfelbaum , Hanna Reitz , Bernhard Beschow , BALATON Zoltan , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Paolo Bonzini , qemu-ppc@nongnu.org, Mark Burton , Richard Henderson , Magnus Damm , "Michael S. Tsirkin" , Bin Meng , Max Filippov , Aurelien Jarno , Eduardo Habkost , Palmer Dabbelt , Radoslaw Biernacki , Jiaxun Yang , "Edgar E. Iglesias" , Xiaojuan Yang , Peter Maydell , qemu-block@nongnu.org, qemu-riscv@nongnu.org, Yoshinori Sato , Alistair Francis , qemu-arm@nongnu.org, Leif Lindholm , Kevin Wolf Subject: [PATCH 08/20] hw/xtensa: Use generic DeviceState instead of PFlashCFI01 Date: Wed, 4 Jan 2023 23:04:37 +0100 Message-Id: <20230104220449.41337-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230104220449.41337-1-philmd@linaro.org> References: <20230104220449.41337-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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=unavailable 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 Nothing here requires access to PFlashCFI01 internal fields: use the inherited generic DeviceState. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bin Meng --- hw/xtensa/xtfpga.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index bce3a543b0..b039416fde 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -165,7 +165,7 @@ static void xtfpga_net_init(MemoryRegion *address_space, memory_region_add_subregion(address_space, buffers, ram); } -static PFlashCFI01 *xtfpga_flash_init(MemoryRegion *address_space, +static DeviceState *xtfpga_flash_init(MemoryRegion *address_space, const XtfpgaBoardDesc *board, DriveInfo *dinfo, int be) { @@ -183,7 +183,7 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion *address_space, sysbus_realize_and_unref(s, &error_fatal); memory_region_add_subregion(address_space, board->flash->base, sysbus_mmio_get_region(s, 0)); - return PFLASH_CFI01(dev); + return dev; } static uint64_t translate_phys_addr(void *opaque, uint64_t addr) @@ -231,7 +231,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine) XtensaMxPic *mx_pic = NULL; qemu_irq *extints; DriveInfo *dinfo; - PFlashCFI01 *flash = NULL; + DeviceState *flash = NULL; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *dtb_filename = machine->dtb; @@ -459,7 +459,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine) } } else { if (flash) { - MemoryRegion *flash_mr = pflash_cfi01_get_memory(DEVICE(flash)); + MemoryRegion *flash_mr = pflash_cfi01_get_memory(flash); MemoryRegion *flash_io = g_malloc(sizeof(*flash_io)); uint32_t size = env->config->sysrom.location[0].size;