From nobody Sat May 18 05:04:53 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=1588790422; cv=none; d=zohomail.com; s=zohoarc; b=I3MdZKgmXwNw8W2PEMldAa+hGNkXTQKmC/IXqbAQvjesciHK5IinW32uOL9WDH5BS0xCaMJC2/XLGYiabqx9SJ6ctFOCPKDOaOATHZ3uBBdPbwEErynSlMWt9tnzhMY+f/ye954O08gK+CSJ0FGLTP6gKs4Ype151PnaI7Lw6To= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588790422; 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; bh=l1hDY85fQqEkJ5nyfvKU1QkI/YgipGbBsH+gneoMgfo=; b=OycfOPts2oF1svX4Q+dRFVlFG19Q1LZCGo1kepHAuW9njgfAyPHapv0WgdxQ+FCEolVGaK/7jQIsCLiNnwmnjuHV1d6hxrOhTPDIAhbrspk+wfN+T5BYo6id7bvCPh5udgWTozS8PFSGhIaOPDyUggODLKH7l7g4XJNZNS00h3c= 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 1588790421867143.14916017286941; Wed, 6 May 2020 11:40:21 -0700 (PDT) Received: from localhost ([::1]:50006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWOxv-00007c-RT for importer@patchew.org; Wed, 06 May 2020 14:40:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWOqK-0007WS-J4; Wed, 06 May 2020 14:32:28 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:36135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWOqI-0006MP-QN; Wed, 06 May 2020 14:32:28 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 37D025E2; Wed, 6 May 2020 14:32:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 06 May 2020 14:32:24 -0400 Received: from localhost (mobile-166-176-123-220.mycingular.net [166.176.123.220]) by mail.messagingengine.com (Postfix) with ESMTPA id 3C54A328005A; Wed, 6 May 2020 14:32:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stwcx.xyz; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm1; bh= l1hDY85fQqEkJ5nyfvKU1QkI/YgipGbBsH+gneoMgfo=; b=WsLc+cUYdZ0+y3/l NT3oRe6MF98IH3DiW/wnv4ZGad9iUjjdWeogJT0foAyu0gtyBQ/LjqwgwlgiS8M/ ToHB2YE/CihTCwKgIDrujIYfLuy1wnjlSelxEeM0m9YLjll8F/9EaNyLlub23TlZ Zwt97BKpcr1qoGWUyjgUzhhhDJw60DqJ3gIKxWJZEHcrnnoCsmiJVWIkhRKRmcJc Pf8HOIopgykkGWzndbqGNxFo5MGB71cc+P8OnnPvYUU0ctUGraXQ1r3nX3UgdNtj cPspmxeuLHxOCEbXVqUhXcFYw2h2od4z497R/96tMxGgRImhaUM22O41Yzkomym0 9dU9og== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=l1hDY85fQqEkJ5nyfvKU1QkI/YgipGbBsH+gneoMg fo=; b=Nij8Wfbq/HKICkqp3KFLbOPZLQi5Xm1qiMOZTzR/FXkQBpEDNZ6kumfuu hr37+0YJORQIwDpAHd3XNBvHPcmg4xg5+gsnZjy/iuP3pA8WrvpJ0czE1faVMQGn PGe8zRmfYSLLgveOjTRUEitO+vvsa1SU2vcQLfZhZgfdtK2SCgao29e88o/CJner kMxaNoCWGGE5KAg53mxGa7ZSCT2zlZbPX3AYGNqCTnyEstgfz7BgWS+GT61+LLx8 RXnK67y8nmMVcnPhl5ROFq1LBl89iiWobD1fWdWA+hu0Orup0NTPmf5stlmWckRq F+vB+FVxe4+K0FN/kAQljlSygF43Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeekgdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne hmihhsshhinhhgucfvqfcufhhivghlugculdeftddmnegfrhhlucfvnfffucdlvdefmden ucfjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefrrghtrh hitghkucghihhllhhirghmshcuoehprghtrhhitghksehsthiftgigrdighiiiqeenucgg tffrrghtthgvrhhnpefghfeluefgvdelhefhvddvtdejudekueeuheevudeludfhtdekge etkeejiedvtdenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeduieeirddu jeeirdduvdefrddvvddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphgrthhrihgtkhesshhtfigtgidrgiihii X-ME-Proxy: From: Patrick Williams To: Subject: [PATCH v3] aspeed: Add support for the sonorapass-bmc board Date: Wed, 6 May 2020 13:32:19 -0500 Message-Id: <20200506183219.2166987-1-patrick@stwcx.xyz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200506173035.2154053-1-patrick@stwcx.xyz> References: <20200506173035.2154053-1-patrick@stwcx.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=64.147.123.19; envelope-from=patrick@stwcx.xyz; helo=wout3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 13:30:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: Peter Maydell , Andrew Jeffery , Amithash Prasad , "open list:All patches CC here" , Patrick Williams , "open list:ASPEED BMCs" , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Vijay Khemka , Joel Stanley Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Sonora Pass is a 2 socket x86 motherboard designed by Facebook and supported by OpenBMC. Strapping configuration was obtained from hardware and i2c configuration is based on dts found at: https://github.com/facebook/openbmc-linux/blob/1633c87b8ba7c162095787c98897= 9b748ba65dc8/arch/arm/boot/dts/aspeed-bmc-facebook-sonorapass.dts Booted a test image of http://github.com/facebook/openbmc to login prompt. Signed-off-by: Patrick Williams Reviewed-by: Amithash Prasad Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 6f4d7075c4..74c46681e8 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -74,6 +74,21 @@ struct AspeedBoardState { SCU_AST2500_HW_STRAP_ACPI_ENABLE | \ SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER)) =20 +/* Sonorapass hardware value: 0xF100D216 */ +#define SONORAPASS_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_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_BIOS_ROM | \ + SCU_HW_STRAP_VGA_SIZE_SET(VGA_16M_DRAM) | \ + SCU_AST2500_HW_STRAP_RESERVED1) + /* Swift hardware value: 0xF11AD206 */ #define SWIFT_BMC_HW_STRAP1 ( \ AST2500_HW_STRAP1_DEFAULTS | \ @@ -434,6 +449,49 @@ static void swift_bmc_i2c_init(AspeedBoardState *bmc) i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 12), "tmp105", = 0x4a); } =20 +static void sonorapass_bmc_i2c_init(AspeedBoardState *bmc) +{ + AspeedSoCState *soc =3D &bmc->soc; + + /* bus 2 : */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), "tmp105", 0= x48); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), "tmp105", 0= x49); + /* bus 2 : pca9546 @ 0x73 */ + + /* bus 3 : pca9548 @ 0x70 */ + + /* bus 4 : */ + uint8_t *eeprom4_54 =3D g_malloc0(8 * 1024); + smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), 0x54, + eeprom4_54); + /* PCA9539 @ 0x76, but PCA9552 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "pca9552", = 0x76); + /* PCA9539 @ 0x77, but PCA9552 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "pca9552", = 0x77); + + /* bus 6 : */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0= x48); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 6), "tmp105", 0= x49); + /* bus 6 : pca9546 @ 0x73 */ + + /* bus 8 : */ + uint8_t *eeprom8_56 =3D g_malloc0(8 * 1024); + smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), 0x56, + eeprom8_56); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", = 0x60); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 8), "pca9552", = 0x61); + /* bus 8 : adc128d818 @ 0x1d */ + /* bus 8 : adc128d818 @ 0x1f */ + + /* bus 13 : pca9548 @ 0x71 + * - channel 3: + * - tmm421 @ 0x4c + * - tmp421 @ 0x4e + * - tmp421 @ 0x4f + */ + +} + static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) { AspeedSoCState *soc =3D &bmc->soc; @@ -552,6 +610,21 @@ static void aspeed_machine_romulus_class_init(ObjectCl= ass *oc, void *data) mc->default_ram_size =3D 512 * MiB; }; =20 +static void aspeed_machine_sonorapass_class_init(ObjectClass *oc, void *da= ta) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(oc); + + mc->desc =3D "OCP SonoraPass BMC (ARM1176)"; + amc->soc_name =3D "ast2500-a1"; + amc->hw_strap1 =3D SONORAPASS_BMC_HW_STRAP1; + amc->fmc_model =3D "mx66l1g45g"; + amc->spi_model =3D "mx66l1g45g"; + amc->num_cs =3D 2; + amc->i2c_init =3D sonorapass_bmc_i2c_init; + mc->default_ram_size =3D 512 * MiB; +}; + static void aspeed_machine_swift_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -631,6 +704,10 @@ static const TypeInfo aspeed_machine_types[] =3D { .name =3D MACHINE_TYPE_NAME("swift-bmc"), .parent =3D TYPE_ASPEED_MACHINE, .class_init =3D aspeed_machine_swift_class_init, + }, { + .name =3D MACHINE_TYPE_NAME("sonorapass-bmc"), + .parent =3D TYPE_ASPEED_MACHINE, + .class_init =3D aspeed_machine_sonorapass_class_init, }, { .name =3D MACHINE_TYPE_NAME("witherspoon-bmc"), .parent =3D TYPE_ASPEED_MACHINE, --=20 2.26.2