Received: by 2002:a17:907:c68a:b0:84d:2074:29bb with SMTP id ue10csp244149ejc; Sat, 14 Jan 2023 09:07:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXuhEn3bHM3QikoKfn1QzC7mlMCY4mw9QWxBZVMzPjylAE+g08+lSNMVSoz8ISbQ+XB7Ivpl X-Received: by 2002:a0c:dc07:0:b0:532:27ca:8757 with SMTP id s7-20020a0cdc07000000b0053227ca8757mr20381203qvk.49.1673716075525; Sat, 14 Jan 2023 09:07:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673716075; cv=none; d=google.com; s=arc-20160816; b=R/T3YmRIQbj0cgRTYNRvGLVHmMpv/MFUvC/v5p210EhMTKNAwRvX4U3KrCxBUxoBBq D6mknTuUA+5/OaSnFmDkw4ZCXhBUkUaT65S1upiprCe8ipC45RyDqWZo/jTRz1CWBYbC jqtS6gf7Um0WdsLViZoFYrutg3RXyB0mD3EBzCslns8NckH5i1kDHil9UFvpnt4/63RG N2ND5uVMAtKJFH9oQ1Bp8IovBfcT8Nu+n/LXtVxrVN1EESJ+lI1dFygy0MS8YTaHdFF1 OgHlQ4jTtjeb+shbluJ0p3w1f1UyPG7Lj4sjilNQZtkOICoEQg1QkbYjKyXzcZsKY5IT BnBA== 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:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=xHAR4dj5s0zWF/rLLxJBPBX6N/CzkRTUdheh7+Xx3Fk=; b=GZd0zFbN36/oJ6ZXdwMWCnEcpiAXqTgpX0MoM6xEiyqROlIUIv1ZhgtT1qrAhnR9Vw ISEkzQN9x+9h/AgWsdhsB7aDT+2eaYfrSWr812P3qZu1i1yIJouEUQ/1v3elEFbkyRtE Og8xNhw6DJzf+u/9UHDgbs7XnVfvC1Z+PzK5dcv/A1xzqXrPCAS7iDeHSaisOW8ZFo2S E0esZqZw8b9Dh5djZRquV6ceN0Mo/QMHA9zuwkgQEKO6y+ykSGqFxzkCtlfj9BFeTk9q xCfyTOQRleVfnWAavBGYMF3GFqU4K+GiOuf8z5+SnGNdUrP1AxBmldwO3FG3eFfprvb3 uQsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@pjd.dev header.s=fm1 header.b=NV1nqovB; dkim=fail header.i=@messagingengine.com header.s=fm3 header.b=aIvGQLBH; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hu14-20020a056214234e00b004c77495007dsi14950185qvb.153.2023.01.14.09.07.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 14 Jan 2023 09:07:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@pjd.dev header.s=fm1 header.b=NV1nqovB; dkim=fail header.i=@messagingengine.com header.s=fm3 header.b=aIvGQLBH; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGk0F-0003q9-E3; Sat, 14 Jan 2023 12:07:35 -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 1pGk0E-0003pU-09; Sat, 14 Jan 2023 12:07:34 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGk0C-0006IF-AR; Sat, 14 Jan 2023 12:07:33 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 100B75C00ED; Sat, 14 Jan 2023 12:07:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 14 Jan 2023 12:07:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pjd.dev; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1673716051; x=1673802451; bh=xHAR4dj5s0 zWF/rLLxJBPBX6N/CzkRTUdheh7+Xx3Fk=; b=NV1nqovBVVvNs2aWGar3Vvy4gL VT1A+5a3uEFp7+MNWAwARE2PSOKm4PDuKwBxLgPvZpkicXvhW2GHBBYzgymJcE09 rTsnBCjOY37WteBIkKBU8KFctZYHckK9fXB1RA5Cc6pNLfYLtdbpwY/hElDWbgE7 7E9Q1ckqOkr8SvuTjpOzrNTAsnnEOSBywUAzdCce/QNs3Q3iuTqDsXnJieOwCG/n sHhse4Nb0aCQERPv8OimvKSvCoxbDOPTYjx6Z2Qis/+rzeyqHzlC3zeA6lXWkI0Z azr3zCA8tPSjbF4Zd3bxTa5B4Erhb8CjbHbsPPZH2vkzfkTAQFaggiiglFXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1673716051; x=1673802451; bh=xHAR4dj5s0zWF/rLLxJBPBX6N/Cz kRTUdheh7+Xx3Fk=; b=aIvGQLBH3ojr8geg7HkwlM0j85RSipbyFQaJt5+zYlFt Mv1vybdxPRpzUPvX/z+7dgCraZ+13Pn8nDH0x47JIxGkendHqI4lq6L2ybtdPJgJ AkvymWKrP2+D1Cf4HCSZ0G2JJq26Sm/zcBRGHWy0r4ThC88fLBKRPosPoKnNMkbV fIKrcP09nwb8dRWp3ts1rJi2M/9pYm0ub3DgdkIfhmPuBocN9heZnl/M9WfZcXXC 6JzwBti3K48eMm0f4KM2qZu7qzdOECBQ6rPha1wBGjqnVDt2fa4UNYcKbCWwct8Z b2t4z3ycixw+8yG9f5w0jLmhpiSuGDImufQr7FORhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddttddgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheprfgvthgvrhcuffgvlhgvvhhorhihrghsuceophgvthgvrhes phhjugdruggvvheqnecuggftrfgrthhtvghrnhepieehheejheeiveetvdfhkeevgeeiff dvieetuedtheekteegkeeijeeffeduheelnecuffhomhgrihhnpehgihhthhhusgdrtgho mhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvg htvghrsehpjhgurdguvghv X-ME-Proxy: Feedback-ID: i9e814621:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 14 Jan 2023 12:07:29 -0500 (EST) Date: Sat, 14 Jan 2023 09:07:27 -0800 From: Peter Delevoryas To: patrick@stwcx.xyz, clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, hskinnemoen@google.com, kfting@nuvoton.com, qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: Re: [PATCH 0/6] hw/nvram/eeprom_at24c: Cleanup + FRUID EEPROM init example Message-ID: References: <20230114170151.87833-1-peter@pjd.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230114170151.87833-1-peter@pjd.dev> Received-SPF: pass client-ip=66.111.4.28; envelope-from=peter@pjd.dev; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: IMG4/Xc+njoi On Sat, Jan 14, 2023 at 09:01:45AM -0800, Peter Delevoryas wrote: > This cleans up some of the code we have creating at24c-eeprom objects in the > Aspeed and Nuvoton files, and adds an example of how to initialize a FRUID > EEPROM with static data using I2C transfers. > > Initially I was going to propose a patch to update the at24c-eeprom realize > function to incorporate static data, but then I realized I could just > accomplish the same thing using i2c_send in board reset. The patch at the end > demonstrates this. 1. I messed up Joel's email on this thread, sorry about that. 2. I forgot to post the output of the test I used to verify this: qemu-system-aarch64 -machine fby35-bmc -nographic -mtdblock flash-fby35 ... root@bmc-oob:~# fruid-util bmc FRU Information : BMC --------------- : ------------------ Board Mfg Date : Mon Jan 10 21:42:00 2022 Board Mfg : XXXXXX Board Product : BMC Storage Module Board Serial : XXXXXXXXXXXXX Board Part Number : XXXXXXXXXXXXXX Board FRU ID : 1.0 Board Custom Data 1 : XXXXXXXXX Board Custom Data 2 : XXXXXXXXXXXXXXXXXX Product Manufacturer : XXXXXX Product Name : Yosemite V3.5 EVT2 Product Part Number : XXXXXXXXXXXXXX Product Version : EVT2 Product Serial : XXXXXXXXXXXXX Product Asset Tag : XXXXXXX Product FRU ID : 1.0 Product Custom Data 1 : XXXXXXXXX Product Custom Data 2 : Config A A reference flash-fby35 image can be found here: https://github.com/facebook/openbmc/releases/download/openbmc-e2294ff5d31d/fby35.mtd > > Thanks, > Peter > > Peter Delevoryas (6): > hw/nvram/eeprom_at24c: Add header w/ init helper > hw/arm/aspeed: Remove local copy of at24c_eeprom_init > hw/arm/aspeed: Replace aspeed_eeprom_init with at24c_eeprom_init > hw/arm/npcm7xx: Remove local copy of at24c_eeprom_init > hw/nvram/eeprom_at24c: Add I2C write helper > hw/arm/aspeed: Init fby35 BMC FRUID EEPROM > > hw/arm/aspeed.c | 154 +++++++++++++++++++------------- > hw/arm/npcm7xx_boards.c | 20 ++--- > hw/nvram/eeprom_at24c.c | 25 ++++++ > include/hw/nvram/eeprom_at24c.h | 12 +++ > 4 files changed, 135 insertions(+), 76 deletions(-) > create mode 100644 include/hw/nvram/eeprom_at24c.h > > -- > 2.39.0 > >