From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63BCEC433E0 for ; Mon, 22 Jun 2020 06:50:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2BD9521532 for ; Mon, 22 Jun 2020 06:50:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BD9521532 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnGI8-0002yw-DS for qemu-devel@archiver.kernel.org; Mon, 22 Jun 2020 02:50:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnGHO-0002GH-DT for qemu-devel@nongnu.org; Mon, 22 Jun 2020 02:50:06 -0400 Received: from 5.mo69.mail-out.ovh.net ([46.105.43.105]:43544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnGHM-0002Hs-9i for qemu-devel@nongnu.org; Mon, 22 Jun 2020 02:50:06 -0400 Received: from player718.ha.ovh.net (unknown [10.108.54.209]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id 53A9E9689B for ; Mon, 22 Jun 2020 08:50:02 +0200 (CEST) Received: from kaod.org (lfbn-tou-1-921-245.w86-210.abo.wanadoo.fr [86.210.152.245]) (Authenticated sender: clg@kaod.org) by player718.ha.ovh.net (Postfix) with ESMTPSA id A1702137FE343; Mon, 22 Jun 2020 06:49:54 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-104R005d4bac214-8a1f-4a5f-a845-aac5f99c9e56,D5B34DF2F1998B4AFDB97B5973F1BB92C24DD330) smtp.auth=clg@kaod.org Subject: Re: [PATCH v4 6/8] hw/arm/aspeed: Describe each PCA9552 device To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , qemu-devel@nongnu.org References: <20200620225854.31160-1-f4bug@amsat.org> <20200620225854.31160-7-f4bug@amsat.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: <38918d0a-272f-c05c-6a03-c6ddd8cc592e@kaod.org> Date: Mon, 22 Jun 2020 08:49:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200620225854.31160-7-f4bug@amsat.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 6095903570880990123 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrudekuddguddtvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeevrogurhhitggpnfgvpgfiohgrthgvrhcuoegtlhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepkefhtedufeffvedvleejgeeghedvgeeuieeufeejueeltddugeduhedvveelgfehnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkpheptddrtddrtddrtddpkeeirddvuddtrdduhedvrddvgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjedukedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehqvghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhg Received-SPF: pass client-ip=46.105.43.105; envelope-from=clg@kaod.org; helo=5.mo69.mail-out.ovh.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/22 02:50:02 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Andrew Jeffery , Corey Minyard , qemu-arm@nongnu.org, Joel Stanley , Peter Maydell Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 6/21/20 12:58 AM, Philippe Mathieu-Daudé wrote: > We have 2 distinct PCA9552 devices. Set their description > to distinguish them when looking at the trace events. It's nice and usefull but couldn't we do the same with a QOM object name ? C. > > Description name taken from: > https://github.com/open-power/witherspoon-xml/blob/master/witherspoon.xml > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/arm/aspeed.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c > index 6b7533aeee..3d5dec4692 100644 > --- a/hw/arm/aspeed.c > +++ b/hw/arm/aspeed.c > @@ -508,12 +508,15 @@ static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) > { > AspeedSoCState *soc = &bmc->soc; > uint8_t *eeprom_buf = g_malloc0(8 * 1024); > + DeviceState *dev; > > /* Bus 3: TODO bmp280@77 */ > /* Bus 3: TODO max31785@52 */ > /* Bus 3: TODO dps310@76 */ > - i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), TYPE_PCA9552, > - 0x60); > + dev = i2c_try_create_slave(TYPE_PCA9552, 0x60); > + qdev_prop_set_string(dev, "description", "pca1"); > + i2c_realize_and_unref(dev, aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), > + &error_fatal); > > 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); > @@ -528,8 +531,10 @@ static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) > > smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), 0x51, > eeprom_buf); > - i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), TYPE_PCA9552, > - 0x60); > + dev = i2c_try_create_slave(TYPE_PCA9552, 0x60); > + qdev_prop_set_string(dev, "description", "pca0"); > + i2c_realize_and_unref(dev, aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), > + &error_fatal); > /* Bus 11: TODO ucd90160@64 */ > } > >