From nobody Sat May 18 13:16:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 ARC-Seal: i=1; a=rsa-sha256; t=1607633634; cv=none; d=zohomail.com; s=zohoarc; b=A3tmx05Qamu4NKYEagoZ0CuatW3BcSDtiezIp+OnyFvW6u3ylLCGVx9Cs0euaQc0ek0k0cM2pWiZDpG7y6a76SY2cmbT3kqnJez472Hu04qgmnb8RYI3G56F5pJpWToD76M4Vhd1304xdT5Orgx6Tu16Tb6pDEm5zvYWEgDrGwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607633634; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s0g8Hisu5QnMXQl3G9SFrWyi8N7N1uC4/XJFfrEtItg=; b=DEsoig2kUyjjjdAgwRGP1qCfv0O14JJ53upU4zGgM9+lamfAK8fBxgwaxvijLkeA+mwmcN7HzZKe7XUyP9ow1oODLdFZnlswdWGKlaDnrC/tKnem14kI1cWD+jCJClgM5dAMmjD0refFSUKEKhnOjQ5rxi1ZxqeI/hkom8IFT0o= ARC-Authentication-Results: i=1; mx.zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607633634364842.4136374042733; Thu, 10 Dec 2020 12:53:54 -0800 (PST) Received: from localhost ([::1]:55910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knLe7-0005tP-0D for importer@patchew.org; Thu, 10 Dec 2020 08:06:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLQ6-0001eX-8Y; Thu, 10 Dec 2020 07:51:42 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:3856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLQ2-0001TD-Kr; Thu, 10 Dec 2020 07:51:41 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BACWfDX154770; Thu, 10 Dec 2020 07:51:25 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 35bkqx0hew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 07:51:24 -0500 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0BACaeA7173241; Thu, 10 Dec 2020 07:51:24 -0500 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 35bkqx0he4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 07:51:24 -0500 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BACYvls029141; Thu, 10 Dec 2020 12:51:21 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06fra.de.ibm.com with ESMTP id 3581fhk0fr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 12:51:21 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BACpJlv33423816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Dec 2020 12:51:19 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 281B0A404D; Thu, 10 Dec 2020 12:51:19 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD528A405B; Thu, 10 Dec 2020 12:51:18 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 10 Dec 2020 12:51:18 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-158-23.de.ibm.com [9.145.158.23]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id CFA03220188; Thu, 10 Dec 2020 13:51:17 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PULL 1/5] hw/misc: add an EMC141{3,4} device model Date: Thu, 10 Dec 2020 13:51:11 +0100 Message-Id: <20201210125115.1812083-2-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201210125115.1812083-1-clg@kaod.org> References: <20201210125115.1812083-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-10_05:2020-12-09, 2020-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 mlxscore=0 adultscore=0 clxscore=1034 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012100080 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: softfail client-ip=148.163.156.1; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , qemu-devel@nongnu.org, John Wang , Joel Stanley , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: John Wang Largely inspired by the TMP421 temperature sensor, here is a model for the EMC1413/EMC1414 temperature sensors. Specs can be found here : http://ww1.microchip.com/downloads/en/DeviceDoc/20005274A.pdf Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: John Wang Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20201122105134.671-1-wangzhiqiang.bj@bytedance.com> Signed-off-by: C=C3=A9dric Le Goater --- include/hw/misc/emc141x_regs.h | 37 ++++ hw/misc/emc141x.c | 326 +++++++++++++++++++++++++++++++++ tests/qtest/emc141x-test.c | 81 ++++++++ hw/arm/Kconfig | 1 + hw/misc/Kconfig | 4 + hw/misc/meson.build | 1 + tests/qtest/meson.build | 1 + 7 files changed, 451 insertions(+) create mode 100644 include/hw/misc/emc141x_regs.h create mode 100644 hw/misc/emc141x.c create mode 100644 tests/qtest/emc141x-test.c diff --git a/include/hw/misc/emc141x_regs.h b/include/hw/misc/emc141x_regs.h new file mode 100644 index 000000000000..0560fb7c5c1e --- /dev/null +++ b/include/hw/misc/emc141x_regs.h @@ -0,0 +1,37 @@ +/* + * SMSC EMC141X temperature sensor. + * + * Browse the data sheet: + * + * http://ww1.microchip.com/downloads/en/DeviceDoc/20005274A.pdf + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * later. See the COPYING file in the top-level directory. + */ + +#ifndef TMP105_REGS_H +#define TMP105_REGS_H + +#define EMC1413_DEVICE_ID 0x21 +#define EMC1414_DEVICE_ID 0x25 +#define MANUFACTURER_ID 0x5d +#define REVISION 0x04 + +/* the EMC141X registers */ +#define EMC141X_TEMP_HIGH0 0x00 +#define EMC141X_TEMP_HIGH1 0x01 +#define EMC141X_TEMP_HIGH2 0x23 +#define EMC141X_TEMP_HIGH3 0x2a +#define EMC141X_TEMP_MAX_HIGH0 0x05 +#define EMC141X_TEMP_MIN_HIGH0 0x06 +#define EMC141X_TEMP_MAX_HIGH1 0x07 +#define EMC141X_TEMP_MIN_HIGH1 0x08 +#define EMC141X_TEMP_MAX_HIGH2 0x15 +#define EMC141X_TEMP_MIN_HIGH2 0x16 +#define EMC141X_TEMP_MAX_HIGH3 0x2c +#define EMC141X_TEMP_MIN_HIGH3 0x2d +#define EMC141X_DEVICE_ID 0xfd +#define EMC141X_MANUFACTURER_ID 0xfe +#define EMC141X_REVISION 0xff + +#endif diff --git a/hw/misc/emc141x.c b/hw/misc/emc141x.c new file mode 100644 index 000000000000..f7c53d48a421 --- /dev/null +++ b/hw/misc/emc141x.c @@ -0,0 +1,326 @@ +/* + * SMSC EMC141X temperature sensor. + * + * Copyright (c) 2020 Bytedance Corporation + * Written by John Wang + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 or + * (at your option) version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#include "qemu/osdep.h" +#include "hw/i2c/i2c.h" +#include "migration/vmstate.h" +#include "qapi/error.h" +#include "qapi/visitor.h" +#include "qemu/module.h" +#include "qom/object.h" +#include "hw/misc/emc141x_regs.h" + +#define SENSORS_COUNT_MAX 4 + +struct EMC141XState { + I2CSlave parent_obj; + struct { + uint8_t raw_temp_min; + uint8_t raw_temp_current; + uint8_t raw_temp_max; + } sensor[SENSORS_COUNT_MAX]; + uint8_t len; + uint8_t data; + uint8_t pointer; +}; + +struct EMC141XClass { + I2CSlaveClass parent_class; + uint8_t model; + unsigned sensors_count; +}; + +#define TYPE_EMC141X "emc141x" +OBJECT_DECLARE_TYPE(EMC141XState, EMC141XClass, EMC141X) + +static void emc141x_get_temperature(Object *obj, Visitor *v, const char *n= ame, + void *opaque, Error **errp) +{ + EMC141XState *s =3D EMC141X(obj); + EMC141XClass *sc =3D EMC141X_GET_CLASS(s); + int64_t value; + unsigned tempid; + + if (sscanf(name, "temperature%u", &tempid) !=3D 1) { + error_setg(errp, "error reading %s: %s", name, g_strerror(errno)); + return; + } + + if (tempid >=3D sc->sensors_count) { + error_setg(errp, "error reading %s", name); + return; + } + + value =3D s->sensor[tempid].raw_temp_current * 1000; + + visit_type_int(v, name, &value, errp); +} + +static void emc141x_set_temperature(Object *obj, Visitor *v, const char *n= ame, + void *opaque, Error **errp) +{ + EMC141XState *s =3D EMC141X(obj); + EMC141XClass *sc =3D EMC141X_GET_CLASS(s); + int64_t temp; + unsigned tempid; + + if (!visit_type_int(v, name, &temp, errp)) { + return; + } + + if (sscanf(name, "temperature%u", &tempid) !=3D 1) { + error_setg(errp, "error reading %s: %s", name, g_strerror(errno)); + return; + } + + if (tempid >=3D sc->sensors_count) { + error_setg(errp, "error reading %s", name); + return; + } + + s->sensor[tempid].raw_temp_current =3D temp / 1000; +} + +static void emc141x_read(EMC141XState *s) +{ + EMC141XClass *sc =3D EMC141X_GET_CLASS(s); + switch (s->pointer) { + case EMC141X_DEVICE_ID: + s->data =3D sc->model; + break; + case EMC141X_MANUFACTURER_ID: + s->data =3D MANUFACTURER_ID; + break; + case EMC141X_REVISION: + s->data =3D REVISION; + break; + case EMC141X_TEMP_HIGH0: + s->data =3D s->sensor[0].raw_temp_current; + break; + case EMC141X_TEMP_HIGH1: + s->data =3D s->sensor[1].raw_temp_current; + break; + case EMC141X_TEMP_HIGH2: + s->data =3D s->sensor[2].raw_temp_current; + break; + case EMC141X_TEMP_HIGH3: + s->data =3D s->sensor[3].raw_temp_current; + break; + case EMC141X_TEMP_MAX_HIGH0: + s->data =3D s->sensor[0].raw_temp_max; + break; + case EMC141X_TEMP_MAX_HIGH1: + s->data =3D s->sensor[1].raw_temp_max; + break; + case EMC141X_TEMP_MAX_HIGH2: + s->data =3D s->sensor[2].raw_temp_max; + break; + case EMC141X_TEMP_MAX_HIGH3: + s->data =3D s->sensor[3].raw_temp_max; + break; + case EMC141X_TEMP_MIN_HIGH0: + s->data =3D s->sensor[0].raw_temp_min; + break; + case EMC141X_TEMP_MIN_HIGH1: + s->data =3D s->sensor[1].raw_temp_min; + break; + case EMC141X_TEMP_MIN_HIGH2: + s->data =3D s->sensor[2].raw_temp_min; + break; + case EMC141X_TEMP_MIN_HIGH3: + s->data =3D s->sensor[3].raw_temp_min; + break; + default: + s->data =3D 0; + } +} + +static void emc141x_write(EMC141XState *s) +{ + switch (s->pointer) { + case EMC141X_TEMP_MAX_HIGH0: + s->sensor[0].raw_temp_max =3D s->data; + break; + case EMC141X_TEMP_MAX_HIGH1: + s->sensor[1].raw_temp_max =3D s->data; + break; + case EMC141X_TEMP_MAX_HIGH2: + s->sensor[2].raw_temp_max =3D s->data; + break; + case EMC141X_TEMP_MAX_HIGH3: + s->sensor[3].raw_temp_max =3D s->data; + break; + case EMC141X_TEMP_MIN_HIGH0: + s->sensor[0].raw_temp_min =3D s->data; + break; + case EMC141X_TEMP_MIN_HIGH1: + s->sensor[1].raw_temp_min =3D s->data; + break; + case EMC141X_TEMP_MIN_HIGH2: + s->sensor[2].raw_temp_min =3D s->data; + break; + case EMC141X_TEMP_MIN_HIGH3: + s->sensor[3].raw_temp_min =3D s->data; + break; + default: + s->data =3D 0; + } +} + +static uint8_t emc141x_rx(I2CSlave *i2c) +{ + EMC141XState *s =3D EMC141X(i2c); + + if (s->len =3D=3D 0) { + s->len++; + return s->data; + } else { + return 0xff; + } +} + +static int emc141x_tx(I2CSlave *i2c, uint8_t data) +{ + EMC141XState *s =3D EMC141X(i2c); + + if (s->len =3D=3D 0) { + /* first byte is the reg pointer */ + s->pointer =3D data; + s->len++; + } else if (s->len =3D=3D 1) { + s->data =3D data; + emc141x_write(s); + } + + return 0; +} + +static int emc141x_event(I2CSlave *i2c, enum i2c_event event) +{ + EMC141XState *s =3D EMC141X(i2c); + + if (event =3D=3D I2C_START_RECV) { + emc141x_read(s); + } + + s->len =3D 0; + return 0; +} + +static const VMStateDescription vmstate_emc141x =3D { + .name =3D "EMC141X", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(len, EMC141XState), + VMSTATE_UINT8(data, EMC141XState), + VMSTATE_UINT8(pointer, EMC141XState), + VMSTATE_I2C_SLAVE(parent_obj, EMC141XState), + VMSTATE_END_OF_LIST() + } +}; + +static void emc141x_reset(DeviceState *dev) +{ + EMC141XState *s =3D EMC141X(dev); + int i; + + for (i =3D 0; i < SENSORS_COUNT_MAX; i++) { + s->sensor[i].raw_temp_max =3D 0x55; + } + s->pointer =3D 0; + s->len =3D 0; +} + +static void emc141x_initfn(Object *obj) +{ + object_property_add(obj, "temperature0", "int", + emc141x_get_temperature, + emc141x_set_temperature, NULL, NULL); + object_property_add(obj, "temperature1", "int", + emc141x_get_temperature, + emc141x_set_temperature, NULL, NULL); + object_property_add(obj, "temperature2", "int", + emc141x_get_temperature, + emc141x_set_temperature, NULL, NULL); + object_property_add(obj, "temperature3", "int", + emc141x_get_temperature, + emc141x_set_temperature, NULL, NULL); +} + +static void emc141x_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + I2CSlaveClass *k =3D I2C_SLAVE_CLASS(klass); + + dc->reset =3D emc141x_reset; + k->event =3D emc141x_event; + k->recv =3D emc141x_rx; + k->send =3D emc141x_tx; + dc->vmsd =3D &vmstate_emc141x; +} + +static void emc1413_class_init(ObjectClass *klass, void *data) +{ + EMC141XClass *ec =3D EMC141X_CLASS(klass); + + emc141x_class_init(klass, data); + ec->model =3D EMC1413_DEVICE_ID; + ec->sensors_count =3D 3; +} + +static void emc1414_class_init(ObjectClass *klass, void *data) +{ + EMC141XClass *ec =3D EMC141X_CLASS(klass); + + emc141x_class_init(klass, data); + ec->model =3D EMC1414_DEVICE_ID; + ec->sensors_count =3D 4; +} + +static const TypeInfo emc141x_info =3D { + .name =3D TYPE_EMC141X, + .parent =3D TYPE_I2C_SLAVE, + .instance_size =3D sizeof(EMC141XState), + .class_size =3D sizeof(EMC141XClass), + .instance_init =3D emc141x_initfn, + .abstract =3D true, +}; + +static const TypeInfo emc1413_info =3D { + .name =3D "emc1413", + .parent =3D TYPE_EMC141X, + .class_init =3D emc1413_class_init, +}; + +static const TypeInfo emc1414_info =3D { + .name =3D "emc1414", + .parent =3D TYPE_EMC141X, + .class_init =3D emc1414_class_init, +}; + +static void emc141x_register_types(void) +{ + type_register_static(&emc141x_info); + type_register_static(&emc1413_info); + type_register_static(&emc1414_info); +} + +type_init(emc141x_register_types) diff --git a/tests/qtest/emc141x-test.c b/tests/qtest/emc141x-test.c new file mode 100644 index 000000000000..714058806a71 --- /dev/null +++ b/tests/qtest/emc141x-test.c @@ -0,0 +1,81 @@ +/* + * QTest testcase for the EMC141X temperature sensor + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" + +#include "libqtest-single.h" +#include "libqos/qgraph.h" +#include "libqos/i2c.h" +#include "qapi/qmp/qdict.h" +#include "hw/misc/emc141x_regs.h" + +#define EMC1414_TEST_ID "emc1414-test" + +static int qmp_emc1414_get_temperature(const char *id) +{ + QDict *response; + int ret; + + response =3D qmp("{ 'execute': 'qom-get', 'arguments': { 'path': %s, " + "'property': 'temperature0' } }", id); + g_assert(qdict_haskey(response, "return")); + ret =3D qdict_get_int(response, "return"); + qobject_unref(response); + return ret; +} + +static void qmp_emc1414_set_temperature(const char *id, int value) +{ + QDict *response; + + response =3D qmp("{ 'execute': 'qom-set', 'arguments': { 'path': %s, " + "'property': 'temperature0', 'value': %d } }", id, valu= e); + g_assert(qdict_haskey(response, "return")); + qobject_unref(response); +} + +static void send_and_receive(void *obj, void *data, QGuestAllocator *alloc) +{ + uint16_t value; + QI2CDevice *i2cdev =3D (QI2CDevice *)obj; + + value =3D qmp_emc1414_get_temperature(EMC1414_TEST_ID); + g_assert_cmpuint(value, =3D=3D, 0); + + value =3D i2c_get8(i2cdev, EMC141X_TEMP_HIGH0); + g_assert_cmphex(value, =3D=3D, 0); + + /* The default max value is 85C, 0x55=3D85 */ + value =3D i2c_get8(i2cdev, EMC141X_TEMP_MAX_HIGH0); + g_assert_cmphex(value, =3D=3D, 0x55); + + value =3D i2c_get8(i2cdev, EMC141X_TEMP_MIN_HIGH0); + g_assert_cmphex(value, =3D=3D, 0); + + /* 3000mc =3D 30C */ + qmp_emc1414_set_temperature(EMC1414_TEST_ID, 30000); + value =3D qmp_emc1414_get_temperature(EMC1414_TEST_ID); + g_assert_cmpuint(value, =3D=3D, 30000); + + value =3D i2c_get8(i2cdev, EMC141X_TEMP_HIGH0); + g_assert_cmphex(value, =3D=3D, 30); + +} + +static void emc1414_register_nodes(void) +{ + QOSGraphEdgeOptions opts =3D { + .extra_device_opts =3D "id=3D" EMC1414_TEST_ID ",address=3D0x70" + }; + add_qi2c_address(&opts, &(QI2CAddress) { 0x70 }); + + qos_node_create_driver("emc1414", i2c_device_create); + qos_node_consumes("emc1414", "i2c-bus", &opts); + + qos_add_test("tx-rx", "emc1414", send_and_receive, NULL); +} +libqos_init(emc1414_register_nodes); diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index e69a9009cf0a..eb8a8844cf86 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -407,6 +407,7 @@ config ASPEED_SOC select SSI_M25P80 select TMP105 select TMP421 + select EMC141X select UNIMP select LED =20 diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig index dc44dc14f625..cf18ac08e666 100644 --- a/hw/misc/Kconfig +++ b/hw/misc/Kconfig @@ -13,6 +13,10 @@ config TMP421 bool depends on I2C =20 +config EMC141X + bool + depends on I2C + config ISA_DEBUG bool depends on ISA_BUS diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 1cd48e8a0fb5..ce15ffceb958 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -9,6 +9,7 @@ softmmu_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('= pci-testdev.c')) softmmu_ss.add(when: 'CONFIG_SGA', if_true: files('sga.c')) softmmu_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105.c')) softmmu_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c')) +softmmu_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c')) softmmu_ss.add(when: 'CONFIG_UNIMP', if_true: files('unimp.c')) softmmu_ss.add(when: 'CONFIG_EMPTY_SLOT', if_true: files('empty_slot.c')) softmmu_ss.add(when: 'CONFIG_LED', if_true: files('led.c')) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index c19f1c85034f..d776befd6ee2 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -188,6 +188,7 @@ qos_test_ss.add( 'sdhci-test.c', 'spapr-phb-test.c', 'tmp105-test.c', + 'emc141x-test.c', 'usb-hcd-ohci-test.c', 'virtio-test.c', 'virtio-blk-test.c', --=20 2.26.2 From nobody Sat May 18 13:16:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 ARC-Seal: i=1; a=rsa-sha256; t=1607605200; cv=none; d=zohomail.com; s=zohoarc; b=je5gYn9AddKX8tHBMdK/HTr0IWJUNbXTd7Yr0zLS4NyiJy3xsys5XVPCMhqlIPPav5LJoKXDgSdO7cKE//Qku496bhpQ72AIwdqYEs0yO7Aee2TG1lrJmvqb+IjKoEMvJ6x5oJe8N4goVj5fdsCxXKwIGyJ6SkjD0y0T4rWUt1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607605200; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+tap3zqfLA44r78sq725zKdz5Uc9+h+tHBfSsJY0fyo=; b=Su8YqdC+S+aZ4PfLNYTMFgy2wJiqsURbtKScOyNkwC5Hi/b9qUGzJlNbmK9tIL3gXLKx1/oKr2phWcuBuh/fQO3w6l514Q6E1PFo74vraJVss+8iiEMdeE82uFYKflDpvZ23aPnsZI1QuT+RFxLBDjFZh492HtnXH5GLJgi43fk= ARC-Authentication-Results: i=1; mx.zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607605200790110.13780704574242; Thu, 10 Dec 2020 05:00:00 -0800 (PST) Received: from localhost ([::1]:45318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knLY7-0001LR-Cc for importer@patchew.org; Thu, 10 Dec 2020 07:59:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLQ2-0001bn-Gq; Thu, 10 Dec 2020 07:51:40 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:16582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLPy-0001Rl-CM; Thu, 10 Dec 2020 07:51:36 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BACXMqg163897; Thu, 10 Dec 2020 07:51:24 -0500 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 35bfm3y6cg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 07:51:23 -0500 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BACXOVK028225; Thu, 10 Dec 2020 12:51:22 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06fra.de.ibm.com with ESMTP id 3581fhk0fs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 12:51:21 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BACpJwJ26542412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Dec 2020 12:51:19 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C36CD11C052; Thu, 10 Dec 2020 12:51:19 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 809F111C04A; Thu, 10 Dec 2020 12:51:19 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av25.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 10 Dec 2020 12:51:19 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-158-23.de.ibm.com [9.145.158.23]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id B4659220156; Thu, 10 Dec 2020 13:51:18 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PULL 2/5] aspeed: Add support for the g220a-bmc board Date: Thu, 10 Dec 2020 13:51:12 +0100 Message-Id: <20201210125115.1812083-3-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201210125115.1812083-1-clg@kaod.org> References: <20201210125115.1812083-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-10_05:2020-12-09, 2020-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 clxscore=1034 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 impostorscore=0 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012100082 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: softfail client-ip=148.163.158.5; envelope-from=clg@kaod.org; helo=mx0b-001b2d01.pphosted.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , qemu-devel@nongnu.org, John Wang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Joel Stanley Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: John Wang G220A is a 2 socket x86 motherboard supported by OpenBMC. Strapping configuration was obtained from hardware. Signed-off-by: John Wang Reviewed-by: C=C3=A9dric Le Goater Reviewed-by: Joel Stanley Message-Id: <20201122105134.671-2-wangzhiqiang.bj@bytedance.com> Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 0ef3f6b412fe..aee00ba8d682 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -121,6 +121,20 @@ struct AspeedMachineState { SCU_AST2500_HW_STRAP_ACPI_ENABLE | \ SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER)) =20 +#define G220A_BMC_HW_STRAP1 ( \ + SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE | \ + SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE | \ + SCU_AST2500_HW_STRAP_UART_DEBUG | \ + SCU_AST2500_HW_STRAP_RESERVED28 | \ + SCU_AST2500_HW_STRAP_DDR4_ENABLE | \ + SCU_HW_STRAP_2ND_BOOT_WDT | \ + SCU_HW_STRAP_VGA_CLASS_CODE | \ + SCU_HW_STRAP_LPC_RESET_PIN | \ + SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER) | \ + SCU_AST2500_HW_STRAP_SET_AXI_AHB_RATIO(AXI_AHB_RATIO_2_1) | \ + SCU_HW_STRAP_VGA_SIZE_SET(VGA_64M_DRAM) | \ + SCU_AST2500_HW_STRAP_RESERVED1) + /* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) */ #define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1 =20 @@ -579,6 +593,30 @@ static void witherspoon_bmc_i2c_init(AspeedMachineStat= e *bmc) /* Bus 11: TODO ucd90160@64 */ } =20 +static void g220a_bmc_i2c_init(AspeedMachineState *bmc) +{ + AspeedSoCState *soc =3D &bmc->soc; + DeviceState *dev; + + dev =3D DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 3= ), + "emc1413", 0x4c)); + object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abo= rt); + object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abo= rt); + object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abo= rt); + + dev =3D DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1= 2), + "emc1413", 0x4c)); + object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abo= rt); + object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abo= rt); + object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abo= rt); + + dev =3D DEVICE(i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 1= 3), + "emc1413", 0x4c)); + object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abo= rt); + object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abo= rt); + object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abo= rt); +} + static bool aspeed_get_mmio_exec(Object *obj, Error **errp) { return ASPEED_MACHINE(obj)->mmio_exec; @@ -818,6 +856,24 @@ static void aspeed_machine_tacoma_class_init(ObjectCla= ss *oc, void *data) aspeed_soc_num_cpus(amc->soc_name); }; =20 +static void aspeed_machine_g220a_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(oc); + + mc->desc =3D "Bytedance G220A BMC (ARM1176)"; + amc->soc_name =3D "ast2500-a1"; + amc->hw_strap1 =3D G220A_BMC_HW_STRAP1; + amc->fmc_model =3D "n25q512a"; + amc->spi_model =3D "mx25l25635e"; + amc->num_cs =3D 2; + amc->macs_mask =3D ASPEED_MAC1_ON | ASPEED_MAC2_ON; + amc->i2c_init =3D g220a_bmc_i2c_init; + mc->default_ram_size =3D 1024 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); +}; + static const TypeInfo aspeed_machine_types[] =3D { { .name =3D MACHINE_TYPE_NAME("palmetto-bmc"), @@ -855,6 +911,10 @@ static const TypeInfo aspeed_machine_types[] =3D { .name =3D MACHINE_TYPE_NAME("tacoma-bmc"), .parent =3D TYPE_ASPEED_MACHINE, .class_init =3D aspeed_machine_tacoma_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("g220a-bmc"), + .parent =3D TYPE_ASPEED_MACHINE, + .class_init =3D aspeed_machine_g220a_class_init, }, { .name =3D TYPE_ASPEED_MACHINE, .parent =3D TYPE_MACHINE, --=20 2.26.2 From nobody Sat May 18 13:16:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 ARC-Seal: i=1; a=rsa-sha256; t=1607626338; cv=none; d=zohomail.com; s=zohoarc; b=E2Iek9PX2t9l9vY3Hwrz0O0iOjjcBV9J/wDnHUP6LLxQ155XlaOVPFo2aweTz0N652ArGUGY73y2PA1I2Ozqz083E5dHebKvJSTG4wh4DPXKFAmPTEF+cYAacEJRw50Wrste0dfE03/s5ldEKsAVS1fBlNuAptikZBm/84g+mmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607626338; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LuklwB7eU9dVj1vtrAhmx/P3/HUfmtdHfystlM8tVjo=; b=g9GAgTaNVTwBfEHUohhlRZDUbkYhXK0WNN20sc6yd2TEJz0BDMDD6DkpwArXHTIAf+z482HGF6Z9SaN0xDyixpv9GtfbUkjyLJjowswWuS/Jf23wQ/kiJMPQmMMq44GyZJEjd0RHU51S6iLUHjn5XnxWT+67YZ5J6Emd0s/uwbM= ARC-Authentication-Results: i=1; mx.zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607626338771105.11792415006994; Thu, 10 Dec 2020 10:52:18 -0800 (PST) Received: from localhost ([::1]:49652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knLrB-0006rC-Pe for importer@patchew.org; Thu, 10 Dec 2020 08:19:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLR9-00034G-JK; Thu, 10 Dec 2020 07:52:47 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLR8-0001oE-5g; Thu, 10 Dec 2020 07:52:47 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BACXD6g067315; Thu, 10 Dec 2020 07:52:39 -0500 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 35bkbkhbds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 07:52:39 -0500 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BACqXiZ021407; Thu, 10 Dec 2020 12:52:37 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03fra.de.ibm.com with ESMTP id 3581u8rhyx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 12:52:37 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BACpK6w21299688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Dec 2020 12:51:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F0FF52051; Thu, 10 Dec 2020 12:51:20 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av21.portsmouth.uk.ibm.com (Postfix) with SMTP id 33F355204F; Thu, 10 Dec 2020 12:51:20 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-158-23.de.ibm.com [9.145.158.23]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 779BE220188; Thu, 10 Dec 2020 13:51:19 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PULL 3/5] ast2600: SRAM is 89KB Date: Thu, 10 Dec 2020 13:51:13 +0100 Message-Id: <20201210125115.1812083-4-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201210125115.1812083-1-clg@kaod.org> References: <20201210125115.1812083-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-10_05:2020-12-09, 2020-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=793 spamscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 clxscore=1034 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012100082 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: softfail client-ip=148.163.156.1; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Joel Stanley , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Joel Stanley On the AST2600A1, the SRAM size was increased to 89KB. Fixes: 7582591ae745 ("aspeed: Support AST2600A1 silicon revision") Signed-off-by: Joel Stanley Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20201112012113.835858-1-joel@jms.id.au> Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast2600.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 1450bde7cf26..12e4a16d3765 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -481,7 +481,7 @@ static void aspeed_soc_ast2600_class_init(ObjectClass *= oc, void *data) sc->name =3D "ast2600-a1"; sc->cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a7"); sc->silicon_rev =3D AST2600_A1_SILICON_REV; - sc->sram_size =3D 0x10000; + sc->sram_size =3D 0x16400; sc->spis_num =3D 2; sc->ehcis_num =3D 2; sc->wdts_num =3D 4; --=20 2.26.2 From nobody Sat May 18 13:16:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 ARC-Seal: i=1; a=rsa-sha256; t=1607607472; cv=none; d=zohomail.com; s=zohoarc; b=b3qH/CmIxwQB1twm/B70Ktmu3WeZ3aTWkvU4L3VicoiKlczrxrIbCH6Yx4HkbaWu14BPId2vIeJ7tk0uT/cFRrtfa+Xe5DFT7urU6FrjbkpE/aJs2bokgQYNPP5TawdBzd4ZfoKNxuZb0Nmop4pj3hyiFkLgeMGltSyq/IiZ4Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607607472; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vQFjJx5o2GAkHtAq6tVODyCc2thCgEmuWGwkLthniEE=; b=IqRSh8s5ct5ZOiu8xwqxqI0zT47QZD5oC9k8ZHnLvJzw2YpIKWSvbJ6vO8446yHxfhQxxdwVMlG0EFu2O3tCYj9RARt1McKRJOzTAapugL1dGehDmILKvJQLZf1rmVMbeSDiRJQeI1/1JViTx5cp7EHoRsRCCjzyvcRaZ5Zgcb0= ARC-Authentication-Results: i=1; mx.zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607607472181698.898597212301; Thu, 10 Dec 2020 05:37:52 -0800 (PST) Received: from localhost ([::1]:32846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knLgw-00087L-Bm for importer@patchew.org; Thu, 10 Dec 2020 08:09:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLQ9-0001nj-LG; Thu, 10 Dec 2020 07:51:45 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLQ7-0001UU-DH; Thu, 10 Dec 2020 07:51:45 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BAC48Ea001075; Thu, 10 Dec 2020 07:51:25 -0500 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 35bj9m37uw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 07:51:25 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BACVQ4f003655; Thu, 10 Dec 2020 12:51:23 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03ams.nl.ibm.com with ESMTP id 3581u85sxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 12:51:23 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BACpLMY17170912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Dec 2020 12:51:21 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 42DF811C04A; Thu, 10 Dec 2020 12:51:21 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00B4011C054; Thu, 10 Dec 2020 12:51:21 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av25.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 10 Dec 2020 12:51:20 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-158-23.de.ibm.com [9.145.158.23]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 34995220156; Thu, 10 Dec 2020 13:51:20 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PULL 4/5] aspeed/smc: Add support for address lane disablement Date: Thu, 10 Dec 2020 13:51:14 +0100 Message-Id: <20201210125115.1812083-5-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201210125115.1812083-1-clg@kaod.org> References: <20201210125115.1812083-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-10_05:2020-12-09, 2020-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=652 malwarescore=0 phishscore=0 impostorscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1034 suspectscore=0 spamscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012100080 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: softfail client-ip=148.163.156.1; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Chin-Ting Kuo , qemu-devel@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Joel Stanley Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The controller can be configured to disable or enable address and data byte lanes when issuing commands. This is useful in read command mode to send SPI NOR commands that don't have an address space, such as RDID. It's a good way to have a unified read operation for registers and flash contents accesses. A new SPI driver proposed by Aspeed makes use of this feature. Add support for address lanes to start with. We will do the same for the data lanes if they are controlled one day. Cc: Chin-Ting Kuo Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Joel Stanley Message-Id: <20201120161547.740806-2-clg@kaod.org> Signed-off-by: C=C3=A9dric Le Goater --- hw/ssi/aspeed_smc.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 795784e5f364..e3d5e26058c0 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/aspeed_smc.c @@ -71,6 +71,16 @@ #define INTR_CTRL_CMD_ABORT_EN (1 << 2) #define INTR_CTRL_WRITE_PROTECT_EN (1 << 1) =20 +/* Command Control Register */ +#define R_CE_CMD_CTRL (0x0C / 4) +#define CTRL_ADDR_BYTE0_DISABLE_SHIFT 4 +#define CTRL_DATA_BYTE0_DISABLE_SHIFT 0 + +#define aspeed_smc_addr_byte_enabled(s, i) \ + (!((s)->regs[R_CE_CMD_CTRL] & (1 << (CTRL_ADDR_BYTE0_DISABLE_SHIFT + (= i))))) +#define aspeed_smc_data_byte_enabled(s, i) \ + (!((s)->regs[R_CE_CMD_CTRL] & (1 << (CTRL_DATA_BYTE0_DISABLE_SHIFT + (= i))))) + /* CEx Control Register */ #define R_CTRL0 (0x10 / 4) #define CTRL_IO_QPI (1 << 31) @@ -702,19 +712,17 @@ static void aspeed_smc_flash_setup(AspeedSMCFlash *fl= , uint32_t addr) { const AspeedSMCState *s =3D fl->controller; uint8_t cmd =3D aspeed_smc_flash_cmd(fl); - int i; + int i =3D aspeed_smc_flash_is_4byte(fl) ? 4 : 3; =20 /* Flash access can not exceed CS segment */ addr =3D aspeed_smc_check_segment_addr(fl, addr); =20 ssi_transfer(s->spi, cmd); - - if (aspeed_smc_flash_is_4byte(fl)) { - ssi_transfer(s->spi, (addr >> 24) & 0xff); + while (i--) { + if (aspeed_smc_addr_byte_enabled(s, i)) { + ssi_transfer(s->spi, (addr >> (i * 8)) & 0xff); + } } - ssi_transfer(s->spi, (addr >> 16) & 0xff); - ssi_transfer(s->spi, (addr >> 8) & 0xff); - ssi_transfer(s->spi, (addr & 0xff)); =20 /* * Use fake transfers to model dummy bytes. The value should @@ -988,6 +996,7 @@ static uint64_t aspeed_smc_read(void *opaque, hwaddr ad= dr, unsigned int size) (addr >=3D s->r_timings && addr < s->r_timings + s->ctrl->nregs_timings) || addr =3D=3D s->r_ce_ctrl || + addr =3D=3D R_CE_CMD_CTRL || addr =3D=3D R_INTR_CTRL || addr =3D=3D R_DUMMY_DATA || (s->ctrl->has_dma && addr =3D=3D R_DMA_CTRL) || @@ -1276,6 +1285,8 @@ static void aspeed_smc_write(void *opaque, hwaddr add= r, uint64_t data, if (value !=3D s->regs[R_SEG_ADDR0 + cs]) { aspeed_smc_flash_set_segment(s, cs, value); } + } else if (addr =3D=3D R_CE_CMD_CTRL) { + s->regs[addr] =3D value & 0xff; } else if (addr =3D=3D R_DUMMY_DATA) { s->regs[addr] =3D value & 0xff; } else if (addr =3D=3D R_INTR_CTRL) { --=20 2.26.2 From nobody Sat May 18 13:16:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 ARC-Seal: i=1; a=rsa-sha256; t=1607608433; cv=none; d=zohomail.com; s=zohoarc; b=LJ3tT48JEIuKiXyZbIjy4o6TUENZP83x7POM0rhewxPMXdVjpmTvIsGrRc4C7qpCsCohFLaEiS//pJ70Mpsfz+AP6H+tL1IrAtgPoxhHhO1kXtCixFUjvsKg+BxUl+2zVPYfAyNbdpFrrKJuN48D21HLmXZ6UdQIMJfydVWeGH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607608433; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4rNqcdIR3S5Yfc67b0YZAFbchIomURlngsWwQ46t3jE=; b=B4DzDebptOIwX5TNlsbTLRqH5i5XdCmCz0kmrSGtZpiiGBS0hddMmZtQV4joDmqFKs5d7VH4qS+fApBb5uuIJr7TXLrLo1sTXFeOZ0CTUvfrBZtq8lGhp0zdvgSa4i0Z4Vpbl+Vy97I9ppnd2M+0nnl7PY/1RAWoBv2d1tyQHMM= ARC-Authentication-Results: i=1; mx.zohomail.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607608433549181.08688665232307; Thu, 10 Dec 2020 05:53:53 -0800 (PST) Received: from localhost ([::1]:47568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knMOG-0008DL-6Y for importer@patchew.org; Thu, 10 Dec 2020 08:53:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLQ2-0001bp-K9; Thu, 10 Dec 2020 07:51:40 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:26740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knLPz-0001Sn-4V; Thu, 10 Dec 2020 07:51:37 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0BACWrO6175135; Thu, 10 Dec 2020 07:51:26 -0500 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 35bk7csp2b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 07:51:26 -0500 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0BACXPRl028231; Thu, 10 Dec 2020 12:51:24 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06fra.de.ibm.com with ESMTP id 3581fhk0fv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Dec 2020 12:51:24 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0BACpMRe59376008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Dec 2020 12:51:22 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F37FAA4059; Thu, 10 Dec 2020 12:51:21 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA292A4057; Thu, 10 Dec 2020 12:51:21 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 10 Dec 2020 12:51:21 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-158-23.de.ibm.com [9.145.158.23]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id EC510220188; Thu, 10 Dec 2020 13:51:20 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PULL 5/5] aspeed: g220a-bmc: Add an FRU Date: Thu, 10 Dec 2020 13:51:15 +0100 Message-Id: <20201210125115.1812083-6-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201210125115.1812083-1-clg@kaod.org> References: <20201210125115.1812083-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-10_05:2020-12-09, 2020-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1034 priorityscore=1501 suspectscore=0 malwarescore=0 bulkscore=0 mlxlogscore=702 impostorscore=0 lowpriorityscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012100080 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: softfail client-ip=148.163.158.5; envelope-from=clg@kaod.org; helo=mx0b-001b2d01.pphosted.com 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , qemu-devel@nongnu.org, John Wang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Joel Stanley Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: John Wang Add an eeprom device and fill it with fru information $ ipmitool fru print 0 Product Manufacturer : Bytedance Product Name : G220A Signed-off-by: John Wang Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20201210103607.556-1-wangzhiqiang.bj@bytedance.com> Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index aee00ba8d682..bfe2051cfed4 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -615,6 +615,18 @@ static void g220a_bmc_i2c_init(AspeedMachineState *bmc) object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abo= rt); object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abo= rt); object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abo= rt); + + static uint8_t eeprom_buf[2 * 1024] =3D { + 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xfe, + 0x01, 0x06, 0x00, 0xc9, 0x42, 0x79, 0x74, 0x65, + 0x64, 0x61, 0x6e, 0x63, 0x65, 0xc5, 0x47, 0x32, + 0x32, 0x30, 0x41, 0xc4, 0x41, 0x41, 0x42, 0x42, + 0xc4, 0x43, 0x43, 0x44, 0x44, 0xc4, 0x45, 0x45, + 0x46, 0x46, 0xc4, 0x48, 0x48, 0x47, 0x47, 0xc1, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, + }; + smbus_eeprom_init_one(aspeed_i2c_get_bus(&soc->i2c, 4), 0x57, + eeprom_buf); } =20 static bool aspeed_get_mmio_exec(Object *obj, Error **errp) --=20 2.26.2