qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] c1b298: hw/misc/led: Add a LED device


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] c1b298: hw/misc/led: Add a LED device
Date: Wed, 28 Oct 2020 06:07:49 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c1b29826279b7405990ccb521d1fb5a24db2e58e
      
https://github.com/qemu/qemu/commit/c1b29826279b7405990ccb521d1fb5a24db2e58e
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M MAINTAINERS
    M hw/misc/Kconfig
    A hw/misc/led.c
    M hw/misc/meson.build
    M hw/misc/trace-events
    A include/hw/misc/led.h

  Log Message:
  -----------
  hw/misc/led: Add a LED device

Add a LED device which can be connected to a GPIO output.
They can also be dimmed with PWM devices. For now we do
not implement the dimmed mode, but in preparation of a
future implementation, we start using the LED intensity.

LEDs are limited to a fixed set of colors.

Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200912134041.946260-2-f4bug@amsat.org>


  Commit: ddb67f6402b8096f70ca68e3cffaddfd588b384d
      
https://github.com/qemu/qemu/commit/ddb67f6402b8096f70ca68e3cffaddfd588b384d
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M hw/misc/led.c
    M include/hw/misc/led.h
    M include/hw/qdev-core.h

  Log Message:
  -----------
  hw/misc/led: Allow connecting from GPIO output

Some devices expose GPIO lines.

Add a GPIO qdev input to our LED device, so we can
connect a GPIO output using qdev_connect_gpio_out().

When used with GPIOs, the intensity can only be either
minium or maximum. This depends of the polarity of the
GPIO (which can be inverted).
Declare the GpioPolarity type to model the polarity.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Message-Id: <20200912134041.946260-3-f4bug@amsat.org>


  Commit: 4aef43991afa70c3cb314881fd4bf0f3e1f8b41b
      
https://github.com/qemu/qemu/commit/4aef43991afa70c3cb314881fd4bf0f3e1f8b41b
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M hw/misc/led.c
    M hw/misc/trace-events

  Log Message:
  -----------
  hw/misc/led: Emit a trace event when LED intensity has changed

Track the LED intensity, and emit a trace event when it changes.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200912134041.946260-4-f4bug@amsat.org>


  Commit: 7cfbde5ea1cfeaf0834f4f43dc79eb24cdd52e1b
      
https://github.com/qemu/qemu/commit/7cfbde5ea1cfeaf0834f4f43dc79eb24cdd52e1b
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M hw/arm/Kconfig
    M hw/arm/aspeed.c

  Log Message:
  -----------
  hw/arm/aspeed: Add the 3 front LEDs drived by the PCA9552 #1

The Witherspoon has 3 LEDs connected to a PCA9552. Add them.
The names and reset values are taken from:
https://github.com/open-power/witherspoon-xml/blob/master/witherspoon.xml

Example booting obmc-phosphor-image:

  $ qemu-system-arm -M witherspoon-bmc -trace led_change_intensity
  1592693373.997015:led_change_intensity LED desc:'front-fault-4' color:green 
intensity 0% -> 100%
  1592693373.997632:led_change_intensity LED desc:'front-power-3' color:green 
intensity 0% -> 100%
  1592693373.998239:led_change_intensity LED desc:'front-id-5' color:green 
intensity 0% -> 100%
  1592693500.291805:led_change_intensity LED desc:'front-power-3' color:green 
intensity 100% -> 0%
  1592693500.312041:led_change_intensity LED desc:'front-power-3' color:green 
intensity 0% -> 100%
  1592693500.821254:led_change_intensity LED desc:'front-power-3' color:green 
intensity 100% -> 0%
  1592693501.331517:led_change_intensity LED desc:'front-power-3' color:green 
intensity 0% -> 100%
  1592693501.841367:led_change_intensity LED desc:'front-power-3' color:green 
intensity 100% -> 0%
  1592693502.350839:led_change_intensity LED desc:'front-power-3' color:green 
intensity 0% -> 100%
  1592693502.861134:led_change_intensity LED desc:'front-power-3' color:green 
intensity 100% -> 0%
  1592693503.371090:led_change_intensity LED desc:'front-power-3' color:green 
intensity 0% -> 100%

We notice the front-power LED starts to blink at a ~2Hz rate.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200912134041.946260-5-f4bug@amsat.org>


  Commit: 65ad1da23e9096418223f7a856992bd491dc7ec3
      
https://github.com/qemu/qemu/commit/65ad1da23e9096418223f7a856992bd491dc7ec3
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M hw/misc/Kconfig
    M hw/misc/mps2-fpgaio.c
    M hw/misc/trace-events
    M include/hw/misc/mps2-fpgaio.h

  Log Message:
  -----------
  hw/misc/mps2-fpgaio: Use the LED device

Per the 'ARM MPS2 and MPS2+ FPGA Prototyping Boards Technical
Reference Manual' (100112_0200_07_en):

  2.1  Overview of the MPS2 and MPS2+ hardware

       The MPS2 and MPS2+ FPGA Prototyping Boards contain the
       following components and interfaces:

       * User switches and user LEDs:

         - Two green LEDs and two push buttons that connect to
           the FPGA.
         - Eight green LEDs and one 8-way dip switch that connect
           to the MCC.

Add the 2 LEDs connected to the FPGA.

This replaces the 'mps2_fpgaio_leds' trace events by the generic
'led_set_intensity' event.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Message-Id: <20200912134041.946260-6-f4bug@amsat.org>


  Commit: 435db7ebf54cbae68e45ad0bbf4ff6e9019557aa
      
https://github.com/qemu/qemu/commit/435db7ebf54cbae68e45ad0bbf4ff6e9019557aa
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M hw/misc/Kconfig
    M hw/misc/mps2-scc.c
    M hw/misc/trace-events
    M include/hw/misc/mps2-scc.h

  Log Message:
  -----------
  hw/misc/mps2-scc: Use the LED device

Per the 'ARM MPS2 and MPS2+ FPGA Prototyping Boards Technical
Reference Manual' (100112_0200_07_en):

  2.1  Overview of the MPS2 and MPS2+ hardware

       The MPS2 and MPS2+ FPGA Prototyping Boards contain the
       following components and interfaces:

       * User switches and user LEDs:

         - Two green LEDs and two push buttons that connect to
           the FPGA.
         - Eight green LEDs and one 8-way dip switch that connect
           to the MCC.

Add the 8 LEDs connected to the MCC.

This replaces the 'mps2_scc_leds' trace events by the generic
'led_set_intensity' event.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Message-Id: <20200912134041.946260-7-f4bug@amsat.org>


  Commit: 06972067c48fc21a47445b5d706368f1129f216f
      
https://github.com/qemu/qemu/commit/06972067c48fc21a47445b5d706368f1129f216f
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2020-10-26 (Mon, 26 Oct 2020)

  Changed paths:
    M hw/arm/Kconfig
    M hw/arm/tosa.c

  Log Message:
  -----------
  hw/arm/tosa: Replace fprintf() calls by LED devices

The recently added LED device reports LED status changes with
the 'led_set_intensity' trace event. It is less invasive than
the fprintf() calls. We need however to have a binary built
with tracing support.

Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200912134041.946260-8-f4bug@amsat.org>


  Commit: cddfbe07749a44f83d0f8241fff7ca96a6631882
      
https://github.com/qemu/qemu/commit/cddfbe07749a44f83d0f8241fff7ca96a6631882
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M MAINTAINERS
    M hw/arm/Kconfig
    M hw/arm/aspeed.c
    M hw/arm/tosa.c
    M hw/misc/Kconfig
    A hw/misc/led.c
    M hw/misc/meson.build
    M hw/misc/mps2-fpgaio.c
    M hw/misc/mps2-scc.c
    M hw/misc/trace-events
    A include/hw/misc/led.h
    M include/hw/misc/mps2-fpgaio.h
    M include/hw/misc/mps2-scc.h
    M include/hw/qdev-core.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/philmd-gitlab/tags/led-api-20201026' 
into staging

API to model LED.

CI jobs results:
. https://cirrus-ci.com/build/4879251751043072
. https://gitlab.com/philmd/qemu/-/pipelines/207661784
. https://travis-ci.org/github/philmd/qemu/builds/738958191
. https://app.shippable.com/github/philmd/qemu/runs/891/summary/console

# gpg: Signature made Mon 26 Oct 2020 22:03:59 GMT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" 
[full]
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* remotes/philmd-gitlab/tags/led-api-20201026:
  hw/arm/tosa: Replace fprintf() calls by LED devices
  hw/misc/mps2-scc: Use the LED device
  hw/misc/mps2-fpgaio: Use the LED device
  hw/arm/aspeed: Add the 3 front LEDs drived by the PCA9552 #1
  hw/misc/led: Emit a trace event when LED intensity has changed
  hw/misc/led: Allow connecting from GPIO output
  hw/misc/led: Add a LED device

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/cfc110564994...cddfbe07749a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]