From nobody Sat Apr 20 00:43:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1560200106; cv=none; d=zoho.com; s=zohoarc; b=JVe3klR5J67bmRWaRtKxdK60cEDTGzYvaM550ZKajsxWLoUWRhw7uhTqHfa0ArFedVC8gLoVeNTRe+66sYK7GfcXVf8a5fVLk0l3cCeRTOMBc+dteO8ExBF5/kKMWrmQ3zNxKokrKuvCpk6rMzJIEOWOPzfJXfH7WgiT0aO734c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560200106; 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:ARC-Authentication-Results; bh=iZyBrB2mjl5CDkgESEb+dw8MrHikdBIQun3w0Ru80Pc=; b=k8jbTSqja5ERpO386SoeKnP/OJIz7B/vKrCai/rQl8skgcA79rQiz/9BertOACNxT1DPKSOAHiLA+1yS+Xz7GqsueJJ0WP34mAba+FughCEVgY2P/a3i1Xk4RB69rphskH99eaKWmRl1ZbFnOIfLhYpfan8Ol5gp4Mbkb8oR1p0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1560200106739945.2168634243443; Mon, 10 Jun 2019 13:55:06 -0700 (PDT) Received: from localhost ([::1]:49664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haRJp-0002O2-PR for importer@patchew.org; Mon, 10 Jun 2019 16:55:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51863) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haRIV-0001jH-BF for qemu-devel@nongnu.org; Mon, 10 Jun 2019 16:53:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haRIU-0004cL-2L for qemu-devel@nongnu.org; Mon, 10 Jun 2019 16:53:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41138) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1haRIQ-0004VE-TE for qemu-devel@nongnu.org; Mon, 10 Jun 2019 16:53:40 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5AKXhZQ050216 for ; Mon, 10 Jun 2019 16:53:34 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t1x2kh9hh-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 10 Jun 2019 16:53:33 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Jun 2019 21:53:33 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 10 Jun 2019 21:53:29 +0100 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5AKrS0324510748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jun 2019 20:53:28 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4648C6A051; Mon, 10 Jun 2019 20:53:28 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C69136A04D; Mon, 10 Jun 2019 20:53:27 +0000 (GMT) Received: from habcap11p1.aus.stglabs.ibm.com (unknown [9.41.164.53]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 10 Jun 2019 20:53:27 +0000 (GMT) From: Adriana Kobylak To: clg@kaod.org, peter.maydell@linaro.org, andrew@aj.id.au, joel@jms.id.au, qemu-arm@nongnu.org Date: Mon, 10 Jun 2019 15:53:31 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19061020-0020-0000-0000-00000EF79DEF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011243; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01216112; UDB=6.00639395; IPR=6.00997212; MB=3.00027255; MTD=3.00000008; XFM=3.00000015; UTC=2019-06-10 20:53:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061020-0021-0000-0000-00006631EEBB Message-Id: <1560200011-70806-1-git-send-email-anoo@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-10_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906100139 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-001b2d01.pphosted.com id x5AKXhZQ050216 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH qemu v2] aspeed: Add support for the swift-bmc board 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: Adriana Kobylak , 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: Adriana Kobylak The Swift board is an OpenPOWER system hosting POWER processors. Add support for their BMC including the I2C devices as found on HW. Signed-off-by: Adriana Kobylak Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 33070a6..7fd0e0c 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -73,6 +73,17 @@ struct AspeedBoardState { SCU_AST2500_HW_STRAP_ACPI_ENABLE | \ SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER)) =20 +/* Swift hardware value: 0xF11AD206 */ +#define SWIFT_BMC_HW_STRAP1 ( \ + AST2500_HW_STRAP1_DEFAULTS | \ + SCU_AST2500_HW_STRAP_SPI_AUTOFETCH_ENABLE | \ + SCU_AST2500_HW_STRAP_GPIO_STRAP_ENABLE | \ + SCU_AST2500_HW_STRAP_UART_DEBUG | \ + SCU_AST2500_HW_STRAP_DDR4_ENABLE | \ + SCU_H_PLL_BYPASS_EN | \ + SCU_AST2500_HW_STRAP_ACPI_ENABLE | \ + SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER)) + /* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) */ #define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1 =20 @@ -287,6 +298,35 @@ static void romulus_bmc_i2c_init(AspeedBoardState *bmc) i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "ds1338", = 0x32); } =20 +static void swift_bmc_i2c_init(AspeedBoardState *bmc) +{ + AspeedSoCState *soc =3D &bmc->soc; + + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), "pca9552", = 0x60); + + /* The swift board expects a TMP275 but a TMP105 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "tmp105", 0= x48); + /* The swift board expects a pca9551 but a pca9552 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "pca9552", = 0x60); + + /* The swift board expects an Epson RX8900 RTC but a ds1338 is compati= ble */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "ds1338", 0= x32); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", = 0x60); + + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "tmp423", 0= x4c); + /* The swift board expects a pca9539 but a pca9552 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "pca9552", = 0x74); + + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 10), "tmp423", = 0x4c); + /* The swift board expects a pca9539 but a pca9552 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 10), "pca9552", + 0x74); + + /* The swift board expects a TMP275 but a TMP105 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", = 0x48); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", = 0x4a); +} + static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) { AspeedSoCState *soc =3D &bmc->soc; @@ -378,6 +418,16 @@ static const AspeedBoardConfig aspeed_boards[] =3D { .i2c_init =3D romulus_bmc_i2c_init, .ram =3D 512 * MiB, }, { + .name =3D MACHINE_TYPE_NAME("swift-bmc"), + .desc =3D "OpenPOWER Swift BMC (ARM1176)", + .soc_name =3D "ast2500-a1", + .hw_strap1 =3D SWIFT_BMC_HW_STRAP1, + .fmc_model =3D "mx66l1g45g", + .spi_model =3D "mx66l1g45g", + .num_cs =3D 2, + .i2c_init =3D swift_bmc_i2c_init, + .ram =3D 512 * MiB, + }, { .name =3D MACHINE_TYPE_NAME("witherspoon-bmc"), .desc =3D "OpenPOWER Witherspoon BMC (ARM1176)", .soc_name =3D "ast2500-a1", --=20 1.8.3.1