From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.223.197.9 with SMTP id q9csp6921289wrf; Thu, 19 Oct 2017 08:15:54 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RVY56lq71LxtyYr2J54xoUWJDlW05MPVAyDp7HDUtWH7+LB9Ah1pXIxnkw/TDz7C2gC90C X-Received: by 10.55.159.146 with SMTP id i140mr2190015qke.255.1508426154524; Thu, 19 Oct 2017 08:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508426154; cv=none; d=google.com; s=arc-20160816; b=IQhq0+XwyO8h6jQfwRvx6vmO6921HCtOWvyCmKcs85djyZgpJk7eUv8zeUfao+WxBC ZrhCn81aMnl5QYb3Qc/WlM5hWyEK4YpZwU/760i/aS14DN0+esosGfa86nrjBkBRFyvR qJk3+ilSFJlodJ65q7FaqGRIRK5TRffdy3XMQ7g3GgbPXEg4CKMdms99vkR0tqf0VV9z YBSq9I0L9ADiPoc++Ea/pmcTF08fNlLGJFCTcKF2nrYhY5oudZR9pW1UmdTLuGsPJspu FSLYEuzuFIye+occW9w9yopCZFwhNBJ5l3guXz2foxsWLI16sUeL+yt+VmcWy4j/dPZR LjBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=5dNSsKk1YvxHUuDfLkm8nK7Dli2RzxuRU6dx7ubnIiA=; b=jnJSXke4hdGSU6ADQLVHVSoDDWlEpe/NUzuNK67cdvPtDXzYtyk3PyfRoV1QshCilb u2ptZNLCYibe7ycL/rwo3hKx22E4Tn3IiyNdgEPOZpQDCYLukLo7bkw52TZzUkJDwoVY 2wYCNo+YW0nTo/BWEoPCymV6AcdFkjfBsE6XB5Lptqm2wM+VMhwxo8sKY5ki4xHF4gpb oqG59yb6cypF8bl2R6PLubxIZnLj0swNBbhq6l0u7GbrzWqBsmzLChVFi216wumX0U9w hvrRr+a/DauddjXmFObKVHIJ8giPHzEArKpePNSKfHlzZ+zVdsikiy/SR89w5aKBxdNM dKYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f7si1605918qke.224.2017.10.19.08.15.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 19 Oct 2017 08:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Received: from localhost ([::1]:49644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5CY4-00033j-7q for alex.bennee@linaro.org; Thu, 19 Oct 2017 11:15:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5CVi-0001DS-DH for qemu-arm@nongnu.org; Thu, 19 Oct 2017 11:13:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5CVf-0001IK-GG for qemu-arm@nongnu.org; Thu, 19 Oct 2017 11:13:24 -0400 Received: from 10.mo5.mail-out.ovh.net ([46.105.52.148]:59724) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5CVf-0001Gb-9h for qemu-arm@nongnu.org; Thu, 19 Oct 2017 11:13:23 -0400 Received: from player786.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 5DA78146135 for ; Thu, 19 Oct 2017 17:13:22 +0200 (CEST) Received: from zorba.kaod.org (LFbn-1-2231-173.w90-76.abo.wanadoo.fr [90.76.52.173]) (Authenticated sender: clg@kaod.org) by player786.ha.ovh.net (Postfix) with ESMTPSA id 2941B80080; Thu, 19 Oct 2017 17:13:15 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Date: Thu, 19 Oct 2017 17:12:44 +0200 Message-Id: <20171019151249.13663-4-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171019151249.13663-1-clg@kaod.org> References: <20171019151249.13663-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Ovh-Tracer-Id: 13912182201811897105 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedttddrudekgdekjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.52.148 Subject: [Qemu-arm] [PATCH v5 3/8] aspeed: add support for the witherspoon-bmc board X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Joel Stanley Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: 1nx6tlyTAzmr The Witherspoon boards are OpenPOWER system hosting POWER9 Processors. Let's add support for their BMC including a couple of I2C devices as found on real HW. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery --- Changes since v2: - removed 'ignore_memory_transaction_failures' flag on the machine. - Added a comment on the I2C device used. hw/arm/aspeed.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 91c23968f685..f2fc9884dba6 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -46,6 +46,7 @@ enum { PALMETTO_BMC, AST2500_EVB, ROMULUS_BMC, + WITHERSPOON_BMC, }; =20 /* Palmetto hardware value: 0x120CE416 */ @@ -83,8 +84,12 @@ enum { SCU_AST2500_HW_STRAP_ACPI_ENABLE | = \ SCU_HW_STRAP_SPI_MODE(SCU_HW_STRAP_SPI_MASTER)) =20 +/* Witherspoon hardware value: 0xF10AD216 (but use romulus definition) *= / +#define WITHERSPOON_BMC_HW_STRAP1 ROMULUS_BMC_HW_STRAP1 + static void palmetto_bmc_i2c_init(AspeedBoardState *bmc); static void ast2500_evb_i2c_init(AspeedBoardState *bmc); +static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc); =20 static const AspeedBoardConfig aspeed_boards[] =3D { [PALMETTO_BMC] =3D { @@ -110,6 +115,14 @@ static const AspeedBoardConfig aspeed_boards[] =3D { .spi_model =3D "mx66l1g45g", .num_cs =3D 2, }, + [WITHERSPOON_BMC] =3D { + .soc_name =3D "ast2500-a1", + .hw_strap1 =3D WITHERSPOON_BMC_HW_STRAP1, + .fmc_model =3D "mx25l25635e", + .spi_model =3D "mx66l1g45g", + .num_cs =3D 2, + .i2c_init =3D witherspoon_bmc_i2c_init, + }, }; =20 #define FIRMWARE_ADDR 0x0 @@ -352,11 +365,47 @@ static const TypeInfo romulus_bmc_type =3D { .class_init =3D romulus_bmc_class_init, }; =20 +static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) +{ + AspeedSoCState *soc =3D &bmc->soc; + + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "tmp423",= 0x4c); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 5), "tmp423",= 0x4c); + + /* The Witherspoon expects a TMP275 but a TMP105 is compatible */ + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "tmp105",= 0x4a); +} + +static void witherspoon_bmc_init(MachineState *machine) +{ + aspeed_board_init(machine, &aspeed_boards[WITHERSPOON_BMC]); +} + +static void witherspoon_bmc_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->desc =3D "OpenPOWER Witherspoon BMC (ARM1176)"; + mc->init =3D witherspoon_bmc_init; + mc->max_cpus =3D 1; + mc->no_sdcard =3D 1; + mc->no_floppy =3D 1; + mc->no_cdrom =3D 1; + mc->no_parallel =3D 1; +} + +static const TypeInfo witherspoon_bmc_type =3D { + .name =3D MACHINE_TYPE_NAME("witherspoon-bmc"), + .parent =3D TYPE_MACHINE, + .class_init =3D witherspoon_bmc_class_init, +}; + static void aspeed_machine_init(void) { type_register_static(&palmetto_bmc_type); type_register_static(&ast2500_evb_type); type_register_static(&romulus_bmc_type); + type_register_static(&witherspoon_bmc_type); } =20 type_init(aspeed_machine_init) --=20 2.13.6