From nobody Tue Feb 10 08:35:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@quicinc.com; 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=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1658167675; cv=none; d=zohomail.com; s=zohoarc; b=dw4eG7UYzQmakZdSdj69D9fQ/dzU59rwOclf6IwYJC9LZauin6pMclqux1Kw9aKBskUf0sM4C/jKWI/h48dR0hyYYWZHfUDhrJEeioIrjpX8P0XYBl2Lw1DUh8bq1KYLX536n4RTlgPMLnXDlPjDvgx1AbDtbUQ6qzVnXkb8gwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658167675; 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=VGAQEGl0R3qJg+hEG/9ZGi2HYb+00Y1yj5AbSyb2RQs=; b=Q80KoPhuZdhjTvKV90DpZyV6vRAyi6Mq1+zYamgIm+G4yMyuOGsl05jZ9yktZCCd3UsL8Uic3tQr1Td82IfWAjojhEFUbmoOiZOgNlUR9JF8PdqEFqCt2l5EphKMqXyUOhOYyK1pRZx5fn52w1aOfSH1qcn8Sn8E0pkSTmMZJQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@quicinc.com; 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 1658167675273706.1283734743565; Mon, 18 Jul 2022 11:07:55 -0700 (PDT) Received: from localhost ([::1]:38986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDV9u-0002KU-2S for importer@patchew.org; Mon, 18 Jul 2022 14:07:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDUvT-0001HA-Cz; Mon, 18 Jul 2022 13:52:59 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:44869) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1oDUvR-0006I7-8k; Mon, 18 Jul 2022 13:52:58 -0400 Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 18 Jul 2022 10:52:53 -0700 Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 10:52:53 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 18 Jul 2022 10:52:52 -0700 Received: from maru.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 18 Jul 2022 10:52:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1658166777; x=1689702777; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wBL5eIXET/saimeqReQtF8ldnTmu3BCakneBWwG8WqA=; b=qoveAK8Fi47krX5NiZk3n/68JhUma5xCEm2whuGEtT6KRQ7W10LXv2mk vmg6Mt3z2zhQ4tHTiPfMhd4+QqbLQRQb43hHQWTgJ98FVLU6HYk32fIEn N6S6ia41QG+RB+7+Nak3UTWHkVF9xPUEk1gnP/MHe2jcbPOqgRIzas6fQ g=; X-QCInternal: smtphost From: Jae Hyun Yoo To: Peter Maydell , Markus Armbruster , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Titus Rwantare , Andrew Jeffery , "Joel Stanley" , Patrick Venture , Hao Wu CC: Graeme Gregory , Jae Hyun Yoo , , Subject: [PATCH v2] aspeed: qcom: add block backed FRU devices Date: Mon, 18 Jul 2022 10:52:14 -0700 Message-ID: <20220718175214.2087644-1-quic_jaehyoo@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) 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=199.106.114.38; envelope-from=quic_jaehyoo@quicinc.com; helo=alexa-out-sd-01.qualcomm.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_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @quicinc.com) X-ZM-MESSAGEID: 1658167676487100001 From: Graeme Gregory The FRU devices for dc-scm-v1 and firework on bus IF_NONE. -drive file=3D$DC_SCM_FRU,format=3Draw,if=3Dnone,unit=3D0 -drive file=3D$FIREWORK_FRU,format=3Draw,if=3Dnone,unit=3D1 file must match FRU size of 128k Signed-off-by: Graeme Gregory Signed-off-by: Jae Hyun Yoo Reviewed-by: C=EF=BF=BDdric Le Goater --- Changes in v2: * Changed 'qcom_dc_scm_fru_init' to a generic one so that it can be used by other machines too. (Patrick) Discussions on v1: https://lore.kernel.org/qemu-devel/20220622172830.101210-4-quic_jaehyoo@qui= cinc.com/ This single patch was dropped from the series so I'm sending it again as a separate patch. hw/arm/aspeed.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 4193a3d23d1d..aa9efd4c9723 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -440,6 +440,23 @@ static void at24c_eeprom_init(I2CBus *bus, uint8_t add= r, uint32_t rsize) i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort); } =20 +static void at24c_eeprom_init_from_drive(I2CBus *i2c_bus, uint8_t addr, + uint32_t rsize, int drv_bus, + int drv_unit) +{ + I2CSlave *i2c_dev =3D i2c_slave_new("at24c-eeprom", addr); + DeviceState *dev =3D DEVICE(i2c_dev); + DriveInfo *dinfo =3D drive_get(IF_NONE, drv_bus, drv_unit); + + 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, i2c_bus, &error_abort); +} + static void palmetto_bmc_i2c_init(AspeedMachineState *bmc) { AspeedSoCState *soc =3D &bmc->soc; @@ -975,6 +992,9 @@ static void qcom_dc_scm_bmc_i2c_init(AspeedMachineState= *bmc) AspeedSoCState *soc =3D &bmc->soc; =20 i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 15), "tmp105", 0= x4d); + + at24c_eeprom_init_from_drive(aspeed_i2c_get_bus(&soc->i2c, 15), 0x53, + 128 * 1024, 0, 0); } =20 static void qcom_dc_scm_firework_i2c_init(AspeedMachineState *bmc) @@ -987,6 +1007,10 @@ static void qcom_dc_scm_firework_i2c_init(AspeedMachi= neState *bmc) =20 /* Now create the Firework specific hardware */ =20 + /* I2C4 */ + at24c_eeprom_init_from_drive(aspeed_i2c_get_bus(&soc->i2c, 4), 0x50, + 128 * 1024, 0, 1); + /* I2C7 CPUVR MUX */ cpuvr_mux =3D i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70); --=20 2.25.1