From nobody Tue May 7 23:23:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1593167441; cv=none; d=zohomail.com; s=zohoarc; b=nprFcXNrMAWaC8KTYMFEQt38Aa169tMOxqVcqNWhbT0lcm9+YFld3/V3b98Gz5278zzPNPNiXqwm08pQ4+Unx3HfaDld1d9X7FOVNObbMy+apxALt3RdPSQuytKR/p1SxlwrG32y+VLDBLMQjvM3kcbPmkVsRkP9u+5sRhJuFTY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593167441; 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:To; bh=I4gUsATQ2ZD6rXbZ6R4i9ZHkTxgbVpcNWZTvIvkVuAY=; b=k+5vLIbqNSHhbMyyqJZLwBggIoKuCNFgsxKgcXaeZtJuOYkJ2zjDWui5S7tNi/pBTppMic/1aft/YJX/RzByzXF1laASmSoR0lK7Pf1GTUBPPfF2PfU5EmJlfo6TZXzzpb85Ye6GzUoIXom6dMMCD/trrTYD4supQSMUXq2dMEw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1593167441390238.73825981903826; Fri, 26 Jun 2020 03:30:41 -0700 (PDT) Received: from localhost ([::1]:47344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jold2-0000t8-4A for importer@patchew.org; Fri, 26 Jun 2020 06:30:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jolaJ-0005sV-TG; Fri, 26 Jun 2020 06:27:51 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:55948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jolaI-0001wJ-A8; Fri, 26 Jun 2020 06:27:51 -0400 Received: by mail-wm1-x32c.google.com with SMTP id g75so8325794wme.5; Fri, 26 Jun 2020 03:27:49 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id f13sm15598194wmb.33.2020.06.26.03.27.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 03:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I4gUsATQ2ZD6rXbZ6R4i9ZHkTxgbVpcNWZTvIvkVuAY=; b=bkHs/KL4fX9D5GqDcxYvskU1Wc0cfcbxUgEU2ntVl/B4gqdtcDcPxlShUtiiJiuIaX Vr/P7J+J0ITHX3Pe9n4ib+kxuzqTJV3Z5pWVj1jttiIXE4fwqVNqFoRlm9x+aL8Qqks7 Hi7TO8RjuDoExRyHrK02W3CCNIyL6Jg/lUoXVVtTDmYsE3nY+nBbNFxR/4pPIsKESxvu sH2vNsKc7xYVI/9ozcSL2YL7q3KSv9wkAM+Am9hVw+Hcj4yz2bK10LDSuv9Imb0Fyi6L /AuImvGENJTXej+oISnWC4KaSDy3sQl2JsL67CvXtYNxwq4+jsynnwpHGT3ssMtkbpWQ Pikw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=I4gUsATQ2ZD6rXbZ6R4i9ZHkTxgbVpcNWZTvIvkVuAY=; b=h/tNTIBd7p3EBb1FItfUcqc5YlNl3Ae1RjBGV39suxe4OoEWxxKZyoT1yxLpoXzs63 rNEtxpXsGWqXEeFy+Tptdr1jhtkxHJWzQQjrgqgWPUWCCyVNQpQ1M0HQntXlZvjwssDw YycPOGtWm3vHxbgIp+UAOCwJqCQp7nI/FB6uRxOGmwPuq0jZWhSFnir/2vaVsV7v5hRF qZu8B/fEHQoN5efAgzf+44FJ/huIs9mde0tCuxBQ8mdhQHjvRL4Sbg71K7OsqFc6T/KK j0nKHN8VENmPDaEtBHuMXzdXOgHvpyYS6A7U7vfsaLznlaFdrlNyCHuLFA9mAhCjDmkL AIHA== X-Gm-Message-State: AOAM5310BAMgDq21vKfv+DEMXWLjp0TzSq1bb9Z3OghYYu9ROuj4dLEA V9jWOJZc9IhFnDoDLUFpm6c= X-Google-Smtp-Source: ABdhPJxyL9hVvmZLGKBAE5GQThkXql4poC2yev5Cyb0fhH7rywCnXTqInC6vF5XY6itOJiy6vnTNVA== X-Received: by 2002:a1c:a74c:: with SMTP id q73mr2604260wme.96.1593167268649; Fri, 26 Jun 2020 03:27:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [RFC PATCH 1/3] hw/i2c/smbus_eeprom: Set QOM parent Date: Fri, 26 Jun 2020 12:27:42 +0200 Message-Id: <20200626102744.15053-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200626102744.15053-1-f4bug@amsat.org> References: <20200626102744.15053-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::32c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x32c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, 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: Corey Minyard , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Markovic , qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Aspeed change pending latest ARM pull-request, so meanwhile sending as RFC. --- include/hw/i2c/smbus_eeprom.h | 9 ++++++--- hw/i2c/smbus_eeprom.c | 13 ++++++++++--- hw/mips/fuloong2e.c | 2 +- hw/ppc/sam460ex.c | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/hw/i2c/smbus_eeprom.h b/include/hw/i2c/smbus_eeprom.h index 68b0063ab6..037612bbbb 100644 --- a/include/hw/i2c/smbus_eeprom.h +++ b/include/hw/i2c/smbus_eeprom.h @@ -26,9 +26,12 @@ #include "exec/cpu-common.h" #include "hw/i2c/i2c.h" =20 -void smbus_eeprom_init_one(I2CBus *bus, uint8_t address, uint8_t *eeprom_b= uf); -void smbus_eeprom_init(I2CBus *bus, int nb_eeprom, - const uint8_t *eeprom_spd, int size); +void smbus_eeprom_init_one(Object *parent_obj, const char *child_name, + I2CBus *smbus, uint8_t address, + uint8_t *eeprom_buf); +void smbus_eeprom_init(Object *parent_obj, const char *child_name_prefix, + I2CBus *smbus, int nb_eeprom, + const uint8_t *eeprom_spd, int eeprom_spd_size); =20 enum sdram_type { SDR =3D 0x4, DDR =3D 0x7, DDR2 =3D 0x8 }; uint8_t *spd_data_generate(enum sdram_type type, ram_addr_t size); diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index b7def9eeb8..879fd7c416 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -165,7 +165,9 @@ static void smbus_eeprom_register_types(void) =20 type_init(smbus_eeprom_register_types) =20 -void smbus_eeprom_init_one(I2CBus *smbus, uint8_t address, uint8_t *eeprom= _buf) +void smbus_eeprom_init_one(Object *parent_obj, const char *child_name, + I2CBus *smbus, uint8_t address, + uint8_t *eeprom_buf) { DeviceState *dev; =20 @@ -173,10 +175,12 @@ void smbus_eeprom_init_one(I2CBus *smbus, uint8_t add= ress, uint8_t *eeprom_buf) qdev_prop_set_uint8(dev, "address", address); /* FIXME: use an array of byte or block backend property? */ SMBUS_EEPROM(dev)->init_data =3D eeprom_buf; + object_property_add_child(parent_obj, child_name, OBJECT(dev)); qdev_realize_and_unref(dev, (BusState *)smbus, &error_fatal); } =20 -void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, +void smbus_eeprom_init(Object *parent_obj, const char *child_name_prefix, + I2CBus *smbus, int nb_eeprom, const uint8_t *eeprom_spd, int eeprom_spd_size) { int i; @@ -189,8 +193,11 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, } =20 for (i =3D 0; i < nb_eeprom; i++) { - smbus_eeprom_init_one(smbus, 0x50 + i, + char *name =3D g_strdup_printf("%s-%d", child_name_prefix, i); + + smbus_eeprom_init_one(parent_obj, name, smbus, 0x50 + i, eeprom_buf + (i * SMBUS_EEPROM_SIZE)); + g_free(name); } } =20 diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index 8ca31e5162..304a096c6a 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -377,7 +377,7 @@ static void mips_fuloong2e_init(MachineState *machine) =20 /* Populate SPD eeprom data */ spd_data =3D spd_data_generate(DDR, machine->ram_size); - smbus_eeprom_init_one(smbus, 0x50, spd_data); + smbus_eeprom_init_one(OBJECT(machine->ram), "spd", smbus, 0x50, spd_da= ta); =20 mc146818_rtc_init(isa_bus, 2000, NULL); =20 diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 1a106a68de..064d07f4e2 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -337,7 +337,7 @@ static void sam460ex_init(MachineState *machine) spd_data =3D spd_data_generate(ram_sizes[0] < 128 * MiB ? DDR : DDR2, ram_sizes[0]); spd_data[20] =3D 4; /* SO-DIMM module */ - smbus_eeprom_init_one(i2c, 0x50, spd_data); + smbus_eeprom_init_one(OBJECT(machine->ram), "spd", i2c, 0x50, spd_data= ); /* RTC */ i2c_create_slave(i2c, "m41t80", 0x68); =20 --=20 2.21.3 From nobody Tue May 7 23:23:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1593167345; cv=none; d=zohomail.com; s=zohoarc; b=W+iPOd9aQlLCSRhv+3HFj1lQR87TMfx2dSRTNNb+nIP8cZsJwMclHFtv94RGBf5n4CiUYYdBaqE3xJfvnXB2zCrzawtQERPECwKI0hMqKBRGCEL82iZrRzwxou/DReMj6aU/VPDt3PyAMbw7wVUuMsYJbHdbG+lIgh0NwNSAZ7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593167345; 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:To; bh=+RGAeI2YQi8BvYPpg0jL49kCXhZNllGvIOiiTVLYTbU=; b=k1VDwXvAaRwi6dhyaJm5HdZ+OsCga1tRr9fQlPhn4SCKY3lgq93ePwqIfQW7E6qQCKnenM6q2fIQu6gievY+ogPhbAIS4bsciUl0k/4PAnwprdnecbzQspV/8Rr9uGWMZqlaWkb4mbmGUd36CF6PUnFbRlOoKZr4HVdv8G1AhzY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1593167345477594.8447274783425; Fri, 26 Jun 2020 03:29:05 -0700 (PDT) Received: from localhost ([::1]:42504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jolbU-0007LS-2X for importer@patchew.org; Fri, 26 Jun 2020 06:29:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jolaL-0005uq-7V; Fri, 26 Jun 2020 06:27:53 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:39116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jolaJ-0001wn-M5; Fri, 26 Jun 2020 06:27:52 -0400 Received: by mail-wm1-x336.google.com with SMTP id t194so8871806wmt.4; Fri, 26 Jun 2020 03:27:50 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id f13sm15598194wmb.33.2020.06.26.03.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 03:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+RGAeI2YQi8BvYPpg0jL49kCXhZNllGvIOiiTVLYTbU=; b=ApazatZNqHn4k3MF99XvzH6lKw+NE+uFPAQ81Qn9DLjU5UUsUQa+wVjkig55QJbdqY pDVGeXypbBunazp0cYlSFI0WjVkVz2SFQmHY3onQ09A4RZfQjpvj1PABoxED+iqGaJc0 dgQnJaV8vB0y3LLtBgccyA1In9/goyxttNzWIQN3VjjpNUqrs6KQyAW4za7u43J8eDCy emMWeRXEO2nCdU2K/B1A/VE0XKT6pZNyqrZvI39u/gSvg7TT8KMSgUE5nQg0V/1qq137 TBZWtNNtoDPgGZmFWRkEz4YFpgjpMej7O4rHQy3YGqqUQnu2niHVeIYgriPIFy1BIV+c 7Stg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+RGAeI2YQi8BvYPpg0jL49kCXhZNllGvIOiiTVLYTbU=; b=PVAouLlGN4vtQTwZlNpoaShMn4giUMI/gbJjhMy7sCDRunRvPrYjRaZhqtn1UGfSOg +X9aYURFoeYxzNMlG/7X5RD4zSLmSVeGg2VxMPZWpRg7TS5PuCeboU44mjn7HYNkaEGH SCfSu3EDGIJzb5kR7xPOr1dHmBrl0xj6W93cfCLkM8AZAuxbnzMbxQ+ZlSRIij4xczsS XpmdQFNC373VRMn8mjl2xW/Z1EyMfAEqqF2YVEBXSks7o7B++C2/WaFTuRRbIqiDi0rb UAaSa/XCBuPA4lnA7lOPAHvE84iiDrtiX/iOkj5egPNCQ+YMEDfM+LglH6rZFvdphKF8 3E9g== X-Gm-Message-State: AOAM531fJGKh//KEKej8EJyr+ti48DrrA+QLWWFydVi4VuYfNjyBjnhn W9pJxFVgtL5N3kiHuR6CwIo= X-Google-Smtp-Source: ABdhPJyvasXasrsn1HBuFEDzvGxvu1XYBhfFf3I3PaMAgWraoex16kxPbF1KY0Vp3kRGf47v+1kWLg== X-Received: by 2002:a1c:8094:: with SMTP id b142mr962291wmd.122.1593167270036; Fri, 26 Jun 2020 03:27:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [RFC PATCH 2/3] hw/i2c/smbus_eeprom: Add description based on child name Date: Fri, 26 Jun 2020 12:27:43 +0200 Message-Id: <20200626102744.15053-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200626102744.15053-1-f4bug@amsat.org> References: <20200626102744.15053-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::336; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, 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: Corey Minyard , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Markovic , qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/smbus_eeprom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 879fd7c416..22ba7b20d4 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -47,6 +47,7 @@ typedef struct SMBusEEPROMDevice { uint8_t *init_data; uint8_t offset; bool accessed; + char *description; } SMBusEEPROMDevice; =20 static uint8_t eeprom_receive_byte(SMBusDevice *dev) @@ -134,7 +135,9 @@ static void smbus_eeprom_realize(DeviceState *dev, Erro= r **errp) smbus_eeprom_reset(dev); if (eeprom->init_data =3D=3D NULL) { error_setg(errp, "init_data cannot be NULL"); + return; } + eeprom->description =3D object_get_canonical_path_component(OBJECT(dev= )); } =20 static void smbus_eeprom_class_initfn(ObjectClass *klass, void *data) --=20 2.21.3 From nobody Tue May 7 23:23:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1593167356; cv=none; d=zohomail.com; s=zohoarc; b=n4Ogkea9/oBb5d5hluJEMbKg+cAsUeiR5hN2vDFWkLhWlCFfRHaH7uT79f4aau/uc48fZvxZqMwVYeBqqQNLsnqzc+A/kAMA7l/s04uSzYZwyy9gj3Of73v3+6htKzVT8cUg99fZ/kKrI/femEMnBm9JEeSPK+LMT2OGA4Nm4kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593167356; 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:To; bh=WXNiHmUXIOAvwV9mGyjf+bIvI09PaBvr0Sfo8hj14FI=; b=SAXhUkaBp6XF+0Q4TGgKh9WFQ923VBN5tsNIEGfXZAMFb1H8pI3lsTJs8NMl+iDCJrkPnDTiUiipb1NGiTUTdNjjKz2LpSsuC5ubOBuvyGlq3yqzQcfk5xojaOqZukP91VFIDdk7EFo9P0aqG7LPc2yyl4x9h6vRcQU347LaaH4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1593167356700170.57698565507997; Fri, 26 Jun 2020 03:29:16 -0700 (PDT) Received: from localhost ([::1]:43450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jolbf-0007ik-A8 for importer@patchew.org; Fri, 26 Jun 2020 06:29:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jolaN-0005zU-4R; Fri, 26 Jun 2020 06:27:55 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:46391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jolaL-0001xU-C7; Fri, 26 Jun 2020 06:27:54 -0400 Received: by mail-wr1-x443.google.com with SMTP id r12so8916180wrj.13; Fri, 26 Jun 2020 03:27:52 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id f13sm15598194wmb.33.2020.06.26.03.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 03:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WXNiHmUXIOAvwV9mGyjf+bIvI09PaBvr0Sfo8hj14FI=; b=Fzhf9QkiVyLuqxX5k7JOE/qlSoygikWVdKv3N2W9Q416icqvpj9iFcofOTmSxgxGaE 8+1ACpl8lIiWEWV3kzT8gzaS1MCSMVs0bhHzMrDCo7R5G/V1U3khbnGQPCA+QHqzZ3jK T+enfWht8QU0Mc+ftp5SLr/hlZxWhOVILJ+tAomejAoKz7apNWSWdCw/2kmQgIj/LRR9 zLDp4xHxrJU73ro/9Mbbtg/xINZoedCtpuw6hl9aohNoiurbooB8cv6DGk1TZ5pxaskd jPIKeZTTQdYudsFWfXHtPqM9JvEtIwiUF6WvAMcdYVwM7Gw75V0RCumQI6+WCs3XZ2aw dsQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WXNiHmUXIOAvwV9mGyjf+bIvI09PaBvr0Sfo8hj14FI=; b=I8V8nuqDIvjbz4yFpQIAIkoROxN/BvHDooa59TyfTM+8y5GKGJzxafFK5H0f0Vsd/x HcCNLMpoNNjSZ38KU+tMHZ0UNFG5gomtxpbCMqRaZ9rGHd4olJJgU9d+lQwALZzyJehi 5oXywA7KQSRw55TDeIZsKtplruHi4sIrEWgHE9jQpR7oiOrMT7vxb9XHgedWt5UOvxuG qOWzA5aLAMa85dHqWH3pdogp/64TbheuyFV0M0Q2zZGGnihGC7T7Da+zHJLLA6rUjbvj Sp3K9TZGPKyJqkn87eFzoGKs9H/DvvUzvAJDots6eeQaCyjtpsFl2HMMwgdmO8g9urtu 9JoA== X-Gm-Message-State: AOAM531IEmlp4heerj8onychaIr1AmDNtnkUDh/7eV29Fx2O3t2On++X 65/fmKbVsUVSevPMk67Bqj8= X-Google-Smtp-Source: ABdhPJz9a3dt9hKB02TzUdc+DvSa3raTI8WgB9HyrzRIN971FG8OKzagewRKZrq+/NdjV0LF5t1FaQ== X-Received: by 2002:adf:efc6:: with SMTP id i6mr2904546wrp.303.1593167271726; Fri, 26 Jun 2020 03:27:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Markus Armbruster , qemu-devel@nongnu.org Subject: [RFC PATCH 3/3] hw/i2c/smbus_eeprom: Trace reset() event Date: Fri, 26 Jun 2020 12:27:44 +0200 Message-Id: <20200626102744.15053-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200626102744.15053-1-f4bug@amsat.org> References: <20200626102744.15053-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, 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: Corey Minyard , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Markovic , qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/smbus_eeprom.c | 2 ++ hw/i2c/trace-events | 3 +++ 2 files changed, 5 insertions(+) diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 22ba7b20d4..7a0e1e7455 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -31,6 +31,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "hw/i2c/smbus_eeprom.h" +#include "trace.h" =20 //#define DEBUG =20 @@ -124,6 +125,7 @@ static void smbus_eeprom_reset(DeviceState *dev) { SMBusEEPROMDevice *eeprom =3D SMBUS_EEPROM(dev); =20 + trace_smbus_eeprom_reset(eeprom->description); memcpy(eeprom->data, eeprom->init_data, SMBUS_EEPROM_SIZE); eeprom->offset =3D 0; } diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index 08db8fa689..0539c9e111 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -14,3 +14,6 @@ aspeed_i2c_bus_read(uint32_t busid, uint64_t offset, unsi= gned size, uint64_t val aspeed_i2c_bus_write(uint32_t busid, uint64_t offset, unsigned size, uint6= 4_t value) "bus[%d]: To 0x%" PRIx64 " of size %u: 0x%" PRIx64 aspeed_i2c_bus_send(const char *mode, int i, int count, uint8_t byte) "%s = send %d/%d 0x%02x" aspeed_i2c_bus_recv(const char *mode, int i, int count, uint8_t byte) "%s = recv %d/%d 0x%02x" + +# smbus_eeprom.c +smbus_eeprom_reset(const char *description) "'%s': reset" --=20 2.21.3