From nobody Fri Sep 20 22:14:56 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637317729; cv=none; d=zohomail.com; s=zohoarc; b=NUT+ehqSt0JwXA+2WYDXr3K+AmoRJPsalqhd0+MGIgZ4EQt6MxbKGbJsxGPSr8pPCQJvaTD95/MrxlJE01CA5gKVfWeVdx67A78vkjX7COzlWNEuC17ZtrtKRMl1BIrW45hwao+U/B3DcoFuvXkHJkrIugEyAc2QbUJhzcSUaBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637317729; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ZnsIxDJfxVC4Whf+bLr3CZwu5K/BN1hucIFa96vdynw=; b=btP8jac0mUrrMRmr/3B0VCMYhDM3OWbIGdOXgs330YlMSEggLxW9zYyjoJvFmXJxWKniqKhdyILm0pe389qKSrrC+XOm59NDsLAFnajpYiYtdBM3yDxRhccEP+kMMNHgLyXEey5Uptb+h1/SdHMZP325ZqgcwuJTIpjg3E2Rao0= 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 1637317729661344.447120329908; Fri, 19 Nov 2021 02:28:49 -0800 (PST) Received: from localhost ([::1]:40684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mo18S-0002dZ-Cd for importer@patchew.org; Fri, 19 Nov 2021 05:28:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo166-0000z8-EL for qemu-devel@nongnu.org; Fri, 19 Nov 2021 05:26:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mo164-00016p-HD for qemu-devel@nongnu.org; Fri, 19 Nov 2021 05:26:22 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-148-ipAJ8fh_P5aKdP-H-oC9iw-1; Fri, 19 Nov 2021 05:26:16 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9CE991808318; Fri, 19 Nov 2021 10:26:15 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 527BA1970E; Fri, 19 Nov 2021 10:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637317580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZnsIxDJfxVC4Whf+bLr3CZwu5K/BN1hucIFa96vdynw=; b=D2saLfEFxsNoVgTiAlmqqBN4OWYb4YAcA4LQrpxcWm6tk4PS1ROtn26vFUxolC6hiaOK/0 ktquQoBv6nMHMv0JMSvYX7zFfLdEZatIURl/K0I9/BZQlmTMylpDRMFdaFp5A01/KtNtGd jT6HbhzpJlwl71npnsEH/4h4WAB1SLY= X-MC-Unique: ipAJ8fh_P5aKdP-H-oC9iw-1 From: Thomas Huth To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org, Alistair Francis , Bin Meng , Palmer Dabbelt Subject: [PATCH for-6.2] hw/misc/sifive_u_otp: Use IF_PFLASH for the OTP device instead of IF_NONE Date: Fri, 19 Nov 2021 11:25:49 +0100 Message-Id: <20211119102549.217755-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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: , Cc: Peter Maydell , armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637317731785100001 Content-Type: text/plain; charset="utf-8" Configuring a drive with "if=3Dnone" is meant for creation of a backend only, it should not get automatically assigned to a device frontend. Use "if=3Dpflash" for the One-Time-Programmable device instead (like it is e.g. also done for the efuse device in hw/arm/xlnx-zcu102.c). Since the old way of configuring the device has already been published with the previous QEMU versions, we cannot remove this immediately, but have to deprecate it and support it for at least two more releases. Signed-off-by: Thomas Huth Acked-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Reviewed-by: Markus Armbruster --- docs/about/deprecated.rst | 6 ++++++ hw/misc/sifive_u_otp.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index c03fcf951f..ff7488cb63 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -192,6 +192,12 @@ as short-form boolean values, and passed to plugins as= ``arg_name=3Don``. However, short-form booleans are deprecated and full explicit ``arg_name= =3Don`` form is preferred. =20 +``-drive if=3Dnone`` for the sifive_u OTP device (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Using ``-drive if=3Dnone`` to configure the OTP device of the sifive_u +RISC-V machine is deprecated. Use ``-drive if=3Dpflash`` instead. + =20 QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/hw/misc/sifive_u_otp.c b/hw/misc/sifive_u_otp.c index 18aa0bd55d..cf6098ff2c 100644 --- a/hw/misc/sifive_u_otp.c +++ b/hw/misc/sifive_u_otp.c @@ -209,7 +209,14 @@ static void sifive_u_otp_realize(DeviceState *dev, Err= or **errp) TYPE_SIFIVE_U_OTP, SIFIVE_U_OTP_REG_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio); =20 - dinfo =3D drive_get_next(IF_NONE); + dinfo =3D drive_get_next(IF_PFLASH); + if (!dinfo) { + dinfo =3D drive_get_next(IF_NONE); + if (dinfo) { + warn_report("using \"-drive if=3Dnone\" for the OTP is depreca= ted, " + "use \"-drive if=3Dpflash\" instead."); + } + } if (dinfo) { int ret; uint64_t perm; --=20 2.27.0