From patchwork Mon Nov 22 06:52:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1557888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=pTv4RZv1; dkim=pass (2048-bit key; unprotected) header.d=opensource.wdc.com header.i=@opensource.wdc.com header.a=rsa-sha256 header.s=dkim header.b=ekYr7c98; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyHyy6SwNz9sRN for ; Mon, 22 Nov 2021 17:52:58 +1100 (AEDT) Received: from localhost ([::1]:59028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mp3CC-0002lV-BV for incoming@patchwork.ozlabs.org; Mon, 22 Nov 2021 01:52:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mp3Bp-0002jn-NJ for qemu-devel@nongnu.org; Mon, 22 Nov 2021 01:52:33 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:25837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mp3Bo-0000Vo-2V for qemu-devel@nongnu.org; Mon, 22 Nov 2021 01:52:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1637563951; x=1669099951; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J4RVaIXiZlC88P0KMhxzAepJviOnkaBhT2olHvuWdpo=; b=pTv4RZv1LjQRghJW1TGPjH6GUEZY6qWK2mLzluOj3YW+RL4mecpQTxRq tdeHE3tjZOb2SQXOI5YRqClEO9MxSqZ4DEaPZRi7bD27y8GTkX/i1aEEW sCCXGc4tJsAfrgkVR2Bou1chohcu1+RaqO3nzHGo3Z290P+HkrVSBPrB9 CyTLt8T7J2AnFy0j0sbHjszpbO5smV+KHL1IulqCrLQBiak/661pEtVVk W/yp2VXDJktq5md0/64H95mziFUU1eoQggjzWckRdzuWvMNmGtn4xCGNA +9BVPJta2ymiS8zS9Xhc3tyEuzvS6qBk+6iT2BScew39gYKcl2COyJCyc g==; X-IronPort-AV: E=Sophos;i="5.87,254,1631548800"; d="scan'208";a="298113496" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 22 Nov 2021 14:52:29 +0800 IronPort-SDR: kjDXD1TZgEU4Ho6CSZ8V3ja5a2+/X5e8G32rrzYrji+UuJab9miUqE/JfQkhFiqnj/rwUy9Hg0 +MB2cF9tV53x29SHqqt2Mr0pLVHxP5+hC1SbaTzGAnCblxGu5TAXgK6XEgpjJITQbGj05x/PTj axMM04EK/u85JsL61uzkyIhnFgxNu7FArQ5/HqIVafh9zMysf8gAXUVVNqNH2xZWpwEobHmRxP KsdfQUng8hsC1QmcWeSvqJnCWmxzSH3SCDsRG6xrb70u9nXq9i49OuM5EhRdkbGTkRFLeicBFr PDWReGLd7ZY/vwf57G6oRVYW Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2021 22:25:53 -0800 IronPort-SDR: DQzxJCb83O1tOnu6PFOs/lH7OnzjHQwxIsVKD6jNWHPGO0LQi9gQtDztMgo/unOoiOrST49nD+ CuCdR5vByk0CBKBCwv7g+ILPwhQi647FQjEw9IX1cu4QFV4Nd9U6gywgaOu6HpRFu7KVDfvAdw DHyijHnVlewccuNQROzR90ggb2g/yyWYs4ujfUin5yQPpWKftzFrPtWMCnXm3c7+XLM2Y1h5id 2bVkjj/D8CuYWowOjk5Q/CCSRr1xPV15xcLQWCXRncD6+mtXuMv1WjzJmS5oQVdSwtZCBe1h4A rMY= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2021 22:52:30 -0800 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4HyHyP5Mq6z1RtVn for ; Sun, 21 Nov 2021 22:52:29 -0800 (PST) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :subject:to:from; s=dkim; t=1637563949; x=1640155950; bh=J4RVaIX iZlC88P0KMhxzAepJviOnkaBhT2olHvuWdpo=; b=ekYr7c986b+UhFLIhB4wBPr XMRVbnWhhpfmmGuzepHjaHrFAWL0JgmwsSf4vKsvwMcgFIv4Sjt4aBwPYkG+R3aB gfYRVD9K7XdFll6YJE70TzC0ddYPsBWW/UEBJdfuEOxUrfzpyvijS+RP/QWClX/O 1KodMfuTWOn1BfBRFuACzM7VtnYIJAm/ahmmUSm+7SiDgkPSCxrZlSW6xSiXunZp WDTanbJ10ixaK1lu+gLKyF31oTr4ThyESPDNhIAP4Z2ybar8imWjjj6CE3JMgFDF KBKTiKcMvp2qgwGxt+dTuFOBaPDayVMFMfWQo3zSUVGGW+A91kiujetNkU/E0Cg= = X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id G8bmjMhgkn_O for ; Sun, 21 Nov 2021 22:52:29 -0800 (PST) Received: from toolbox.alistair23.me (unknown [10.225.165.60]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4HyHyK3x3Jz1RtVl; Sun, 21 Nov 2021 22:52:25 -0800 (PST) From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Thomas Huth , =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= , Markus Armbruster , Alistair Francis Subject: [PULL 1/2] hw/misc/sifive_u_otp: Use IF_PFLASH for the OTP device instead of IF_NONE Date: Mon, 22 Nov 2021 16:52:05 +1000 Message-Id: <20211122065206.83544-2-alistair.francis@opensource.wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211122065206.83544-1-alistair.francis@opensource.wdc.com> References: <20211122065206.83544-1-alistair.francis@opensource.wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=68.232.141.245; envelope-from=prvs=953023fde=alistair.francis@opensource.wdc.com; helo=esa1.hgst.iphmx.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_PASS=-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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth Configuring a drive with "if=none" is meant for creation of a backend only, it should not get automatically assigned to a device frontend. Use "if=pflash" 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é Reviewed-by: Markus Armbruster Reviewed-by: Alistair Francis Message-id: 20211119102549.217755-1-thuth@redhat.com Signed-off-by: Alistair Francis --- 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=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. +``-drive if=none`` for the sifive_u OTP device (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Using ``-drive if=none`` to configure the OTP device of the sifive_u +RISC-V machine is deprecated. Use ``-drive if=pflash`` instead. + 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, Error **errp) TYPE_SIFIVE_U_OTP, SIFIVE_U_OTP_REG_SIZE); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mmio); - dinfo = drive_get_next(IF_NONE); + dinfo = drive_get_next(IF_PFLASH); + if (!dinfo) { + dinfo = drive_get_next(IF_NONE); + if (dinfo) { + warn_report("using \"-drive if=none\" for the OTP is deprecated, " + "use \"-drive if=pflash\" instead."); + } + } if (dinfo) { int ret; uint64_t perm; From patchwork Mon Nov 22 06:52:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1557890 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=hEWVnBzs; dkim=pass (2048-bit key; unprotected) header.d=opensource.wdc.com header.i=@opensource.wdc.com header.a=rsa-sha256 header.s=dkim header.b=lhXQAveb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyJHc2BZZz9sXN for ; Mon, 22 Nov 2021 18:07:22 +1100 (AEDT) Received: from localhost ([::1]:38860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mp3Q5-0000Wp-T4 for incoming@patchwork.ozlabs.org; Mon, 22 Nov 2021 02:07:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mp3Pk-0000WX-7P for qemu-devel@nongnu.org; Mon, 22 Nov 2021 02:06:56 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:48086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mp3Ph-0002Rl-7p for qemu-devel@nongnu.org; Mon, 22 Nov 2021 02:06:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1637564813; x=1669100813; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B8XLaqe/EnhVUtAn4n7SKkuQvnkv7yQ5WRmzqO99/C8=; b=hEWVnBzsmILF2cBEBR4D49SVw/ae0beFv5GriFsyWuhkkGoQJ5ASE0Vp +rjy9PKXWEuCVUUMi2Uaci0Lo5fKOrTRWnvtlylJlqz990QtOX655EYiE K3J6RQx0VLGfWqxA70Bvyp+NFCQbqsBKwvH7bWqMy5fP1Gvqt9DEZ+Y2g kb6EUijEWeVjOlBbNrMXW2q8NSyh5QK9hazMJCPoHnuExe3etcKHsdYu4 uOv1R/4Vx2ukrcmkYYOA19vBmQn+4RR/ZaK0mNCvumIlBYj6ne5SKQ+XJ BcKjIwQSQdZbLSk+bEOxXE401xrAPocFTdO2/EfyDOlWITj5pXwXkvRyV A==; X-IronPort-AV: E=Sophos;i="5.87,254,1631548800"; d="scan'208";a="290218412" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 22 Nov 2021 15:06:51 +0800 IronPort-SDR: Y2JqrLtb/EG9Hy8T1mI8JPJWCy3HK3lR76XB4Z1fyTiKrgEMr6C6CrfkquOFweKgiTwJEIam2d 7767GP66P5AiojAUT5J/BfUAMrV8NK9hyk04N/WUuxlpJlOMWmSFRgO6dl+AOVOB/EiUtJ7yoH UuHVkcY0vp7Skb3jbXdL+wfpMtENBgeCvWe5DJ3RrDhJogWqfTvfusQ97Dbv62Zg4O9jTFmcHw FCP5tPxTE/PqRMZLuaILUtwc+bvjgc/2baq2BFu57wy5JMhU75bbmIa6vzugrlLYc0UPv8wfFJ yqJ5vHNLeRHn9gpZJpV8pNuq Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2021 22:41:47 -0800 IronPort-SDR: pxROdnzy3fNpWZiM0ylw5csIaNme6V7dwPRzwssVVft2bvyxzHITS3n63GRKVRCKZOukHTLLqL Ap6VkLh1/RLNpF8c8P2ZA5EFqAxdSKGabEM3M7sso23k/wLo5AfWzRByyFxbQ1HVLXD2zuYVkF nrm8xmf3iinmkZOure/rN1NrKiv+IEFlAP1mb+R2gT5eKIc6/K95OlnDqZ7MeiXr1SpiSNMlLn NRLhBrWjHrgr8a7lAMlKW6dsLbC342zI14VdHAeVgZ7wyS/Tc46bVEPX0yFU6w2EO+te19PzXn ZlI= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2021 23:06:52 -0800 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4HyHyY4QVWz1RtVm for ; Sun, 21 Nov 2021 22:52:37 -0800 (PST) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :subject:to:from; s=dkim; t=1637563957; x=1640155958; bh=B8XLaqe /EnhVUtAn4n7SKkuQvnkv7yQ5WRmzqO99/C8=; b=lhXQAvebcoDu3Ux+BBf1DhL WAKOz/83uPWix3vyEN/dg5i8Wq6BKlg5TfQ4f+DDy+FuiU5O2IvGEIzegqUGZlpO db1CKDtWYSZyqXD+Mm0CbVfAWbpQS2/6JYKMl+51OiG1xJcO01r6Me9elLixammJ vJjXtchaFw+z7RtFbJy6My50cAAS2JQ/MG1sIBFTG5sB0ScW4lnRM9eADUkfc5zD 8wmMar3Y4oD3KnSiWLhrr04rT/hMFuLKq2HLCsaNyxcG2Hx2pUG1jXvEg3O6Cyp6 dfFX1pjm62iUCGRA/DAkZqVgctPhJWYsoAJyqlUrcFV5eKK/muElroNxDCd87/w= = X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kLaJmbuqyatm for ; Sun, 21 Nov 2021 22:52:37 -0800 (PST) Received: from toolbox.alistair23.me (unknown [10.225.165.60]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4HyHyV2dQrz1RtVl; Sun, 21 Nov 2021 22:52:33 -0800 (PST) From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis Subject: [PULL 2/2] hw/misc/sifive_u_otp: Do not reset OTP content on hardware reset Date: Mon, 22 Nov 2021 16:52:06 +1000 Message-Id: <20211122065206.83544-3-alistair.francis@opensource.wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211122065206.83544-1-alistair.francis@opensource.wdc.com> References: <20211122065206.83544-1-alistair.francis@opensource.wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=68.232.143.124; envelope-from=prvs=953023fde=alistair.francis@opensource.wdc.com; helo=esa2.hgst.iphmx.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_PASS=-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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Once a "One Time Programmable" is programmed, it shouldn't be reset. Do not re-initialize the OTP content in the DeviceReset handler, initialize it once in the DeviceRealize one. Fixes: 9fb45c62ae8 ("riscv: sifive: Implement a model for SiFive FU540 OTP") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20211119104757.331579-1-f4bug@amsat.org> Signed-off-by: Alistair Francis --- hw/misc/sifive_u_otp.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/misc/sifive_u_otp.c b/hw/misc/sifive_u_otp.c index cf6098ff2c..52fdb750c0 100644 --- a/hw/misc/sifive_u_otp.c +++ b/hw/misc/sifive_u_otp.c @@ -242,14 +242,10 @@ static void sifive_u_otp_realize(DeviceState *dev, Error **errp) if (blk_pread(s->blk, 0, s->fuse, filesize) != filesize) { error_setg(errp, "failed to read the initial flash content"); + return; } } } -} - -static void sifive_u_otp_reset(DeviceState *dev) -{ - SiFiveUOTPState *s = SIFIVE_U_OTP(dev); /* Initialize all fuses' initial value to 0xFFs */ memset(s->fuse, 0xff, sizeof(s->fuse)); @@ -266,13 +262,15 @@ static void sifive_u_otp_reset(DeviceState *dev) serial_data = s->serial; if (blk_pwrite(s->blk, index * SIFIVE_U_OTP_FUSE_WORD, &serial_data, SIFIVE_U_OTP_FUSE_WORD, 0) < 0) { - error_report("write error index<%d>", index); + error_setg(errp, "failed to write index<%d>", index); + return; } serial_data = ~(s->serial); if (blk_pwrite(s->blk, (index + 1) * SIFIVE_U_OTP_FUSE_WORD, &serial_data, SIFIVE_U_OTP_FUSE_WORD, 0) < 0) { - error_report("write error index<%d>", index + 1); + error_setg(errp, "failed to write index<%d>", index + 1); + return; } } @@ -286,7 +284,6 @@ static void sifive_u_otp_class_init(ObjectClass *klass, void *data) device_class_set_props(dc, sifive_u_otp_properties); dc->realize = sifive_u_otp_realize; - dc->reset = sifive_u_otp_reset; } static const TypeInfo sifive_u_otp_info = {