qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/3] Add a host power device


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 0/3] Add a host power device
Date: Tue, 20 Sep 2022 01:09:47 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

Hi Jian,

On 19/9/22 19:21, Jian Zhang wrote:
This patchset adds a host power device and added it into the g220a
mahcine. The BMC have a important is to control the power of the host,
usually it is nessary in a hardware platform.

The BMC(soc) usually had a output pin to control the power of the host,
and a input pin to get the power status of the host.

The host power device is a generic device to simulate the host power,
accept the power control command from the BMC and report the power
status.

Test on the g220a machine, the host power control command can be simply
work.

Jian Zhang (3):
   hw/gpio/aspeed_gpio: Add gpios in/out init
   hw/misc/host_power: Add a simple host power device
   hw/arm/aspeed: g220a: Add host-power device

"power-good" is just a TYPE_LED object, but it doesn't seem you are
really interested in using it.

My understanding of your "power-button" is a latching switch.

This could be indeed useful. I'd name this model TYPE_LATCHING_SWITCH
and put it in hw/misc/latching-switch.c (since it is external to a
SoC). It has one input and one output. Naming them is not particularly
useful IMHO. The triggering edge should be a property (it might have
a default, positive/negative), and the switch state must to be in
vmstate for the object to be migratable.

("power-good"/"power-button" is what this particular board choose to
use the latch switch input/output for).

Do you mind renaming your series accordingly ("latching switch"),
and adding the vmstate?

Also I'd reorder your series as 2,1,3:
- introduce the new device
- prepare aspeed_gpio
- wire aspeed_g220a

Regards,

Phil.



reply via email to

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