{"id":816074,"url":"http://patchwork.ozlabs.org/api/patches/816074/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920070135.31379-5-clg@kaod.org/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920070135.31379-5-clg@kaod.org>","list_archive_url":null,"date":"2017-09-20T07:01:33","name":"[v2,4/6] aspeed: Add EEPROM I2C devices","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"38729bbf18a1d17183bbf7d3d276ef9d56b254e7","submitter":{"id":68548,"url":"http://patchwork.ozlabs.org/api/people/68548/?format=json","name":"Cédric Le Goater","email":"clg@kaod.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920070135.31379-5-clg@kaod.org/mbox/","series":[{"id":4038,"url":"http://patchwork.ozlabs.org/api/series/4038/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4038","date":"2017-09-20T07:01:29","name":"aspeed: add a witherspoon-bmc machine","version":2,"mbox":"http://patchwork.ozlabs.org/series/4038/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816074/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816074/checks/","tags":{},"related":[],"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>)","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 3xxrPV60Nvz9s7p\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 17:06:06 +1000 (AEST)","from localhost ([::1]:47125 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 1duZ5A-0007dd-Qq\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 03:06:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47963)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1duZ1l-000578-Hz\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:02:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1duZ1f-0000MX-M6\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:02:33 -0400","from 7.mo2.mail-out.ovh.net ([188.165.48.182]:38222)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <clg@kaod.org>) id 1duZ1f-0000Lc-Gb\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:02:27 -0400","from player157.ha.ovh.net (b9.ovh.net [213.186.33.59])\n\tby mo2.mail-out.ovh.net (Postfix) with ESMTP id 6D1A9AC125\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 09:02:26 +0200 (CEST)","from zorba.kaod.org.com (LFbn-1-2231-173.w90-76.abo.wanadoo.fr\n\t[90.76.52.173]) (Authenticated sender: clg@kaod.org)\n\tby player157.ha.ovh.net (Postfix) with ESMTPSA id 384C850008E;\n\tWed, 20 Sep 2017 09:02:19 +0200 (CEST)"],"From":"=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>","To":"Peter Maydell <peter.maydell@linaro.org>","Date":"Wed, 20 Sep 2017 09:01:33 +0200","Message-Id":"<20170920070135.31379-5-clg@kaod.org>","X-Mailer":"git-send-email 2.13.5","In-Reply-To":"<20170920070135.31379-1-clg@kaod.org>","References":"<20170920070135.31379-1-clg@kaod.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","X-Ovh-Tracer-Id":"1333628440827431697","X-VR-SPAMSTATE":"OK","X-VR-SPAMSCORE":"-100","X-VR-SPAMCAUSE":"gggruggvucftvghtrhhoucdtuddrfeelledrheekgdduudejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"188.165.48.182","Subject":"[Qemu-devel] [PATCH v2 4/6] aspeed: Add EEPROM I2C devices","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":"Andrew Jeffery <andrew@aj.id.au>, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?b?w6k=?= <f4bug@amsat.org>,\n\tqemu-devel@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_?=\n\t=?utf-8?q?Goater?= <clg@kaod.org>, \tJoel 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>"},"content":"The Aspeed boards have at least one EEPROM to hold the Vital Product\nData (VPD).\n\nSigned-off-by: Cédric Le Goater <clg@kaod.org>\n---\n\nChanges since v1:\n\n - fixed palmetto EEPROM size\n - used smbus_eeprom_init_one()\n\nhw/arm/aspeed.c | 13 +++++++++++++\n 1 file changed, 13 insertions(+)","diff":"diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c\nindex 362b683e9021..462f8008cff5 100644\n--- a/hw/arm/aspeed.c\n+++ b/hw/arm/aspeed.c\n@@ -17,6 +17,7 @@\n #include \"hw/arm/arm.h\"\n #include \"hw/arm/aspeed_soc.h\"\n #include \"hw/boards.h\"\n+#include \"hw/i2c/smbus.h\"\n #include \"qemu/log.h\"\n #include \"sysemu/block-backend.h\"\n #include \"sysemu/blockdev.h\"\n@@ -255,11 +256,15 @@ static void palmetto_bmc_i2c_init(AspeedBoardState *bmc)\n {\n     AspeedSoCState *soc = &bmc->soc;\n     DeviceState *dev;\n+    uint8_t *eeprom_buf = g_malloc0(32 * 1024);\n \n     /* The palmetto platform expects a ds3231 RTC but a ds1338 is\n      * enough to provide basic RTC features. Alarms will be missing */\n     i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), \"ds1338\", 0x68);\n \n+    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), 0x50,\n+                          eeprom_buf);\n+\n     /* add a TMP423 temperature sensor */\n     dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2),\n                            \"tmp423\", 0x4c);\n@@ -297,6 +302,10 @@ static const TypeInfo palmetto_bmc_type = {\n static void ast2500_evb_i2c_init(AspeedBoardState *bmc)\n {\n     AspeedSoCState *soc = &bmc->soc;\n+    uint8_t *eeprom_buf = g_malloc0(8 * 1024);\n+\n+    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), 0x50,\n+                          eeprom_buf);\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@@ -368,6 +377,7 @@ static const TypeInfo romulus_bmc_type = {\n static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc)\n {\n     AspeedSoCState *soc = &bmc->soc;\n+    uint8_t *eeprom_buf = g_malloc0(8 * 1024);\n \n     i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), \"tmp423\", 0x4c);\n     i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 5), \"tmp423\", 0x4c);\n@@ -377,6 +387,9 @@ static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc)\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+    smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), 0x51,\n+                          eeprom_buf);\n }\n \n static void witherspoon_bmc_init(MachineState *machine)\n","prefixes":["v2","4/6"]}