From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Corey Minyard" <cminyard@mvista.com>,
"Andrew Jeffery" <andrew@aj.id.au>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-arm@nongnu.org, "Joel Stanley" <joel@jms.id.au>,
"Cédric Le Goater" <clg@kaod.org>
Subject: [PATCH v5 0/9] hw/misc/pca9552: Trace GPIO change events
Date: Mon, 22 Jun 2020 20:34:19 +0200 [thread overview]
Message-ID: <20200622183428.12255-1-f4bug@amsat.org> (raw)
This series add trace events to better display GPIO changes.
We'll continue in the following series by connecting LEDs to
these GPIOs.
This helps me to work on a generic LED device, see:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg711917.html
Since v4: Addressed Cédric review comments
- Extract PCA955xClass
- Add/use pca955x_pins_get_status() method instead of keeping
cached value in PCA955xState
Example when booting an obmc-phosphor-image, we can see the LED #14
(front-power LED) starting to blink.
- ASCII LED bar view:
$ qemu-system-arm -M witherspoon-bmc -trace pca955x_gpio_status
1592689902.327837:pca955x_gpio_status pca-unspecified GPIOs 0-15 [*...............]
1592689902.329934:pca955x_gpio_status pca-unspecified GPIOs 0-15 [**..............]
1592689902.330717:pca955x_gpio_status pca-unspecified GPIOs 0-15 [***.............]
1592689902.331431:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****............]
1592689902.332163:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........*..]
1592689902.332888:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........**.]
1592689902.333629:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........***]
1592690032.793289:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........*.*]
1592690033.303163:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........***]
1592690033.812962:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........*.*]
1592690034.323234:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........***]
1592690034.832922:pca955x_gpio_status pca-unspecified GPIOs 0-15 [****.........*.*]
- Only display GPIOs which status changes:
$ qemu-system-arm -M witherspoon-bmc -trace pca955x_gpio_change
1592690552.687372:pca955x_gpio_change pca1 GPIO id:0 status: 0 -> 1
1592690552.690169:pca955x_gpio_change pca1 GPIO id:1 status: 0 -> 1
1592690552.691673:pca955x_gpio_change pca1 GPIO id:2 status: 0 -> 1
1592690552.696886:pca955x_gpio_change pca1 GPIO id:3 status: 0 -> 1
1592690552.698614:pca955x_gpio_change pca1 GPIO id:13 status: 0 -> 1
1592690552.699833:pca955x_gpio_change pca1 GPIO id:14 status: 0 -> 1
1592690552.700842:pca955x_gpio_change pca1 GPIO id:15 status: 0 -> 1
1592690683.841921:pca955x_gpio_change pca1 GPIO id:14 status: 1 -> 0
1592690683.861660:pca955x_gpio_change pca1 GPIO id:14 status: 0 -> 1
1592690684.371460:pca955x_gpio_change pca1 GPIO id:14 status: 1 -> 0
1592690684.882115:pca955x_gpio_change pca1 GPIO id:14 status: 0 -> 1
1592690685.391411:pca955x_gpio_change pca1 GPIO id:14 status: 1 -> 0
1592690685.901391:pca955x_gpio_change pca1 GPIO id:14 status: 0 -> 1
For information about how to test the obmc-phosphor-image, see:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg712911.html
$ git backport-diff -u v4
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively
001/9:[----] [--] 'hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref()'
002/9:[down] 'hw/misc/pca9552: Rename 'nr_leds' as 'pin_count''
003/9:[down] 'hw/misc/pca9552: Rename generic code as pca955x'
004/9:[down] 'hw/misc/pca9552: Add generic PCA955xClass, parent of TYPE_PCA9552'
005/9:[0007] [FC] 'hw/misc/pca9552: Add a 'description' property for debugging purpose'
006/9:[0031] [FC] 'hw/misc/pca9552: Trace GPIO High/Low events'
007/9:[----] [--] 'hw/arm/aspeed: Describe each PCA9552 device'
008/9:[0008] [FC] 'hw/misc/pca9552: Trace GPIO change events'
009/9:[0005] [FC] 'hw/misc/pca9552: Model qdev output GPIOs'
Based-on: <20200620162818.22340-1-f4bug@amsat.org>
Philippe Mathieu-Daudé (9):
hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref()
hw/misc/pca9552: Rename 'nr_leds' as 'pin_count'
hw/misc/pca9552: Rename generic code as pca955x
hw/misc/pca9552: Add generic PCA955xClass, parent of TYPE_PCA9552
hw/misc/pca9552: Add a 'description' property for debugging purpose
hw/misc/pca9552: Trace GPIO High/Low events
hw/arm/aspeed: Describe each PCA9552 device
hw/misc/pca9552: Trace GPIO change events
hw/misc/pca9552: Model qdev output GPIOs
include/hw/i2c/i2c.h | 2 +
include/hw/misc/pca9552.h | 16 +--
hw/arm/aspeed.c | 13 ++-
hw/i2c/core.c | 18 +++-
hw/misc/pca9552.c | 216 ++++++++++++++++++++++++++++----------
hw/misc/trace-events | 4 +
6 files changed, 202 insertions(+), 67 deletions(-)
--
2.21.3
next reply other threads:[~2020-06-22 18:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 18:34 Philippe Mathieu-Daudé [this message]
2020-06-22 18:34 ` [PATCH v5 1/9] hw/i2c/core: Add i2c_try_create_slave() and i2c_realize_and_unref() Philippe Mathieu-Daudé
2020-06-22 20:46 ` Corey Minyard
2020-06-23 6:06 ` Cédric Le Goater
2020-06-23 8:01 ` Markus Armbruster
2020-06-23 11:04 ` Philippe Mathieu-Daudé
2020-06-23 13:28 ` Markus Armbruster
2020-06-22 18:34 ` [PATCH v5 2/9] hw/misc/pca9552: Rename 'nr_leds' as 'pin_count' Philippe Mathieu-Daudé
2020-06-23 5:57 ` Cédric Le Goater
2020-06-22 18:34 ` [PATCH v5 3/9] hw/misc/pca9552: Rename generic code as pca955x Philippe Mathieu-Daudé
2020-06-23 5:58 ` Cédric Le Goater
2020-06-22 18:34 ` [PATCH v5 4/9] hw/misc/pca9552: Add generic PCA955xClass, parent of TYPE_PCA9552 Philippe Mathieu-Daudé
2020-06-23 6:02 ` Cédric Le Goater
2020-06-22 18:34 ` [PATCH v5 5/9] hw/misc/pca9552: Add a 'description' property for debugging purpose Philippe Mathieu-Daudé
2020-06-22 18:34 ` [PATCH v5 6/9] hw/misc/pca9552: Trace GPIO High/Low events Philippe Mathieu-Daudé
2020-06-23 6:03 ` Cédric Le Goater
2020-06-22 18:34 ` [PATCH v5 7/9] hw/arm/aspeed: Describe each PCA9552 device Philippe Mathieu-Daudé
2020-06-23 6:07 ` Cédric Le Goater
2020-06-23 8:43 ` Markus Armbruster
2020-06-22 18:34 ` [PATCH v5 8/9] hw/misc/pca9552: Trace GPIO change events Philippe Mathieu-Daudé
2020-06-23 6:04 ` Cédric Le Goater
2020-06-22 18:34 ` [PATCH v5 9/9] hw/misc/pca9552: Model qdev output GPIOs Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200622183428.12255-1-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=andrew@aj.id.au \
--cc=clg@kaod.org \
--cc=cminyard@mvista.com \
--cc=joel@jms.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.