[{"id":1782368,"web_url":"http://patchwork.ozlabs.org/comment/1782368/","msgid":"<1507508929.5452.148.camel@aj.id.au>","list_archive_url":null,"date":"2017-10-09T00:28:49","subject":"Re: [Qemu-devel] [PATCH v2 2/6] aspeed: add an I2C RTC device to\n\tall machines","submitter":{"id":68332,"url":"http://patchwork.ozlabs.org/api/people/68332/","name":"Andrew Jeffery","email":"andrew@aj.id.au"},"content":"On Wed, 2017-09-20 at 09:01 +0200, Cédric Le Goater wrote:\n> The AST2500 EVB does not have an RTC but we can pretend that one is\n> plugged on the I2C bus header.\n> \n> The romulus and witherspoon boards expects an Epson RX8900 I2C RTC but\n> a ds1338 is good enough for the basic features we need.\n> \n> Signed-off-by: Cédric Le Goater <clg@kaod.org>\n\nReviewed-by: Andrew Jeffery <andrew@aj.id.au>\n\n> ---\n>  hw/arm/aspeed.c | 19 +++++++++++++++++++\n>  1 file changed, 19 insertions(+)\n> \n> diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c\n> index 81f522f711ae..362b683e9021 100644\n> --- a/hw/arm/aspeed.c\n> +++ b/hw/arm/aspeed.c\n> @@ -89,6 +89,7 @@ enum {\n>  \n>  static void palmetto_bmc_i2c_init(AspeedBoardState *bmc);\n>  static void ast2500_evb_i2c_init(AspeedBoardState *bmc);\n> +static void romulus_bmc_i2c_init(AspeedBoardState *bmc);\n>  static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc);\n>  \n>  static const AspeedBoardConfig aspeed_boards[] = {\n> @@ -114,6 +115,7 @@ static const AspeedBoardConfig aspeed_boards[] = {\n>          .fmc_model = \"n25q256a\",\n>          .spi_model = \"mx66l1g45g\",\n>          .num_cs    = 2,\n> +        .i2c_init  = romulus_bmc_i2c_init,\n>      },\n>      [WITHERSPOON_BMC]  = {\n>          .soc_name  = \"ast2500-a1\",\n> @@ -298,6 +300,10 @@ static void ast2500_evb_i2c_init(AspeedBoardState *bmc)\n>  \n>      /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */\n>      i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), \"tmp105\", 0x4d);\n> +\n> +    /* The AST2500 EVB does not have an RTC. Let's pretend that one is\n> +     * plugged on the I2C bus header */\n> +    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), \"ds1338\", 0x32);\n>  }\n>  \n>  static void ast2500_evb_init(MachineState *machine)\n> @@ -325,6 +331,15 @@ static const TypeInfo ast2500_evb_type = {\n>      .class_init = ast2500_evb_class_init,\n>  };\n>  \n> +static void romulus_bmc_i2c_init(AspeedBoardState *bmc)\n> +{\n> +    AspeedSoCState *soc = &bmc->soc;\n> +\n> +    /* The romulus board expects Epson RX8900 I2C RTC but a ds1338 is\n> +     * good enough */\n> +    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), \"ds1338\", 0x32);\n> +}\n> +\n>  static void romulus_bmc_init(MachineState *machine)\n>  {\n>      aspeed_board_init(machine, &aspeed_boards[ROMULUS_BMC]);\n> @@ -358,6 +373,10 @@ static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc)\n>      i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 5), \"tmp423\", 0x4c);\n>  \n>      i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), \"tmp105\", 0x4a);\n> +\n> +    /* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is\n> +     * good enough */\n> +    i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), \"ds1338\", 0x32);\n>  }\n>  \n>  static void witherspoon_bmc_init(MachineState *machine)","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"GWbFOuDK\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"hbA+mUTS\"; \n\tdkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y9LjG13pPz9t2d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  9 Oct 2017 11:29:32 +1100 (AEDT)","from localhost ([::1]:55588 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1e1Lwn-0003XP-N8\n\tfor incoming@patchwork.ozlabs.org; Sun, 08 Oct 2017 20:29:29 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46782)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <andrew@aj.id.au>) id 1e1LwO-0003TU-9c\n\tfor qemu-devel@nongnu.org; Sun, 08 Oct 2017 20:29:05 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <andrew@aj.id.au>) id 1e1LwN-00047J-9Y\n\tfor qemu-devel@nongnu.org; Sun, 08 Oct 2017 20:29:04 -0400","from out1-smtp.messagingengine.com ([66.111.4.25]:40321)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <andrew@aj.id.au>)\n\tid 1e1LwG-00041r-Uk; Sun, 08 Oct 2017 20:28:57 -0400","from compute4.internal (compute4.nyi.internal [10.202.2.44])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 4484E20A52;\n\tSun,  8 Oct 2017 20:28:55 -0400 (EDT)","from frontend2 ([10.202.2.161])\n\tby compute4.internal (MEProxy); Sun, 08 Oct 2017 20:28:55 -0400","from keelia (unknown [203.0.153.9])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id C4D2B2413F;\n\tSun,  8 Oct 2017 20:28:52 -0400 (EDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=cc\n\t:content-type:date:from:in-reply-to:message-id:mime-version\n\t:references:subject:to:x-me-sender:x-me-sender:x-sasl-enc\n\t:x-sasl-enc; s=fm1; bh=qAhE5kDYiu9lYmoJXYvzL7LVvFsD2qjjHCQnhVgyQ\n\tB0=; b=GWbFOuDKy6IKpkKaJ5vRttnfOc5/ExSO/DnRZWqN9n3vuYWJ7tSTSB8nR\n\tnD3yk5O1X5z6GR3Rw31ba/Ndzwm6UYNuO0hsjrhqT2ELTOMOJr1nPzkHXe1/ty6E\n\tgncZ96hKSH/Pe+R/wMPg4mk7M1wT9QyQFr8J5s+9H3OjAjqp0z6wYXKRwV7XR6EX\n\tUySc5BxQTrH8Vr8HTmXJo1auRQUgbRte/5uhIkWgTsRq268u/kfFEBqydBZeOQm8\n\t1UkMLpXepv/LLj53s56VKKjD5zjnSJs1pRA/KJoS0EHcJbY8lzmkD5yr21I6qXR2\n\t7GZjhkEv9HRpQk7u6KHpkUO0nlJIQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:content-type:date:from:in-reply-to\n\t:message-id:mime-version:references:subject:to:x-me-sender\n\t:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=qAhE5kDYiu9lYmoJXY\n\tvzL7LVvFsD2qjjHCQnhVgyQB0=; b=hbA+mUTSGaUFiEbmYsZlsa2zRDuMQxSZND\n\t9LGEpk91OBSyxrEofPcJbwTpYOd/mSp0gifAqqC9/uztYyfI0UHxdzXjyJ87K3u+\n\thTbvZPIsFEyDSsy/wrh+zG/KNstEWNX6Siz0nvl0nDFmPE5htwSKzUvxm2Z/mlca\n\t3lN1SYWWDhdaHqCd9MTiTxn3rQcw6DzP9IpuA4xuI4+MC3evPeBwEdvUFQLYb0yA\n\t+zPex+SEvwALmj0P05SVtcwjC8I55obdwVkRIcppmf05F1IEx4E3bZ47OFXISXf/\n\tK7SycFAZ/hXNJfJl6Ab254SBNp4l3vgcwG9QeygvvKezTeahuPDQ=="],"X-ME-Sender":"<xms:x8LaWRYH5iL_HrG1a6vxED8h6IVbzs4GS8EEolminho1AqkYwSQUig>","X-Sasl-enc":"wAKZZqByiD+sD2xVBr+TJ/n0oBb5jNh2OPpP8+fRfa9i 1507508934","Message-ID":"<1507508929.5452.148.camel@aj.id.au>","From":"Andrew Jeffery <andrew@aj.id.au>","To":"=?iso-8859-1?q?C=E9dric?= Le Goater <clg@kaod.org>, Peter Maydell\n\t<peter.maydell@linaro.org>","Date":"Mon, 09 Oct 2017 10:58:49 +1030","In-Reply-To":"<20170920070135.31379-3-clg@kaod.org>","References":"<20170920070135.31379-1-clg@kaod.org>\n\t<20170920070135.31379-3-clg@kaod.org>","Content-Type":"multipart/signed; micalg=\"pgp-sha512\";\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"=-/dT+XB7iCO0KsHsc2QRx\"","X-Mailer":"Evolution 3.22.6-1ubuntu1 ","Mime-Version":"1.0","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"66.111.4.25","Subject":"Re: [Qemu-devel] [PATCH v2 2/6] aspeed: add an I2C RTC device to\n\tall machines","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>,\n\tqemu-arm@nongnu.org, qemu-devel@nongnu.org, Joel Stanley <joel@jms.id.au>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]