From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 62854C433EF for ; Mon, 27 Jun 2022 16:11:14 +0000 (UTC) Received: from localhost ([::1]:44036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5rKT-0000l6-DM for qemu-devel@archiver.kernel.org; Mon, 27 Jun 2022 12:11:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5r6x-00028e-BL for qemu-devel@nongnu.org; Mon, 27 Jun 2022 11:57:15 -0400 Received: from 6.mo552.mail-out.ovh.net ([188.165.49.222]:52731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5r6v-0006ww-6q for qemu-devel@nongnu.org; Mon, 27 Jun 2022 11:57:15 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.1.108]) by mo552.mail-out.ovh.net (Postfix) with ESMTPS id 1C39E249DF; Mon, 27 Jun 2022 15:57:09 +0000 (UTC) Received: from kaod.org (37.59.142.96) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Mon, 27 Jun 2022 17:57:08 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-96R0014d870ca8-bebd-4dc7-9465-137165fafad5, D5BAD815273CE4794DDBC5929823026F491AE39B) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: <25db4069-b761-1d06-c7b3-e4d05d368480@kaod.org> Date: Mon, 27 Jun 2022 17:57:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 3/9] hw/arm/aspeed: qcom-dc-scm-v1: add block backed FRU device Content-Language: en-US To: Jae Hyun Yoo , Peter Maydell , Titus Rwantare , Andrew Jeffery , Joel Stanley CC: Graeme Gregory , Maheswara Kurapati , , References: <20220622172830.101210-1-quic_jaehyoo@quicinc.com> <20220622172830.101210-4-quic_jaehyoo@quicinc.com> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20220622172830.101210-4-quic_jaehyoo@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.96] X-ClientProxiedBy: DAG5EX1.mxp5.local (172.16.2.41) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: fa3722d6-3ffa-4d7e-b726-b488dbd39af9 X-Ovh-Tracer-Id: 15227796243274435375 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrudeghedgleejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeekteejtdelkeejvdevffduhfetteelieefgeefffeugffhfeekheffueefledujeenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddrleeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhnsggprhgtphhtthhopedupdhrtghpthhtohepqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghdpoffvtefjohhsthepmhhoheehvd Received-SPF: pass client-ip=188.165.49.222; envelope-from=clg@kaod.org; helo=6.mo552.mail-out.ovh.net 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, NICE_REPLY_A=-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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 6/22/22 19:28, Jae Hyun Yoo wrote: > From: Graeme Gregory > > The FRU device uses the index 0 device on bus IF_NONE. > > -drive file=$FRU,format=raw,if=none > > file must match FRU size of 128k > > Signed-off-by: Graeme Gregory Reviewed-by: Cédric Le Goater Thanks, C. > --- > hw/arm/aspeed.c | 22 +++++++++++++++++----- > 1 file changed, 17 insertions(+), 5 deletions(-) > > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c > index 785cc543d046..36d6b2c33e48 100644 > --- a/hw/arm/aspeed.c > +++ b/hw/arm/aspeed.c > @@ -992,17 +992,29 @@ static void fby35_i2c_init(AspeedMachineState *bmc) > */ > } > > +static void qcom_dc_scm_fru_init(I2CBus *bus, uint8_t addr, uint32_t rsize) > +{ > + I2CSlave *i2c_dev = i2c_slave_new("at24c-eeprom", addr); > + DeviceState *dev = DEVICE(i2c_dev); > + /* Use First Index for DC-SCM FRU */ > + DriveInfo *dinfo = drive_get(IF_NONE, 0, 0); > + > + qdev_prop_set_uint32(dev, "rom-size", rsize); > + > + if (dinfo) { > + qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo)); > + } > + > + i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort); > +} > + > static void qcom_dc_scm_bmc_i2c_init(AspeedMachineState *bmc) > { > AspeedSoCState *soc = &bmc->soc; > > i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 15), "tmp105", 0x4d); > > - uint8_t *eeprom_buf = g_malloc0(128 * 1024); > - if (eeprom_buf) { > - smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 15), 0x53, > - eeprom_buf); > - } > + qcom_dc_scm_fru_init(aspeed_i2c_get_bus(&soc->i2c, 15), 0x53, 128 * 1024); > } > > static bool aspeed_get_mmio_exec(Object *obj, Error **errp)