[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip imple
From: |
li guang |
Subject: |
Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation |
Date: |
Tue, 09 Apr 2013 16:14:34 +0800 |
在 2013-04-08一的 10:21 +0100,Peter Maydell写道:
> On 8 April 2013 01:32, li guang <address@hidden> wrote:
> > 在 2013-04-05五的 10:23 +0100,Peter Maydell写道:
> >> QEMU is fundamentally modelling real hardware platforms,
> >> not abstract devices. You have to model a real power
> >> controller to at least some extent, because that's what
> >> guest OSes expect to be interacting with, and what
> >> device and board hardware models expect to be dealing with.
> >
> > Hmm, let me see ...
> > but you know, in my mind OS mostly dose not care more about power
> > controller, for example, if OS want to reset, it just issues a command
> > or writes a special value to register in a chip(not power controller),
> > like PC, one of reset path is to issue a KBC reset command to IO
> > register 0x64. so it seems OS has no idea about power controller(chip),
>
> This is architecture specific, which is my point. You can
> provide generic mechanisms for making it easier to implement
> power control, but you have to be clear about what is generic
> (and optional) mechanism and what is board and hardware specific.
>
The approach of power-control may be specific for architectures,
but, I think the thought beneath is common, e.g. for some ARM and MIPS
platforms, OS issue commands to a embedded controller's firmware,
then this firmware will help to do the real power-control job(
on/off, of course no suspend), and also, there are some platforms
directly generate power signals on some specific GPIOs then,
these signals via a power chip will affect other devices.
1. 2.
----- -----
| OS | | OS |
--+-- -----
|on/off |on/off
---------------------------------------------
| -----+----- -----+----- |
| | firmware | | GPIO | |
| -----+----- -----+----- |
---------+----------------- | | part 2
|on/off | |on/off |
+------+------+ | ----+----- |
| | | | |power chip| |
------ ----- ---- | ---------- |
| dev0 ||dev1 ||dev2| --------|on/off---
------ ----- ---- +------+------+
| | |
------ ----- ----
| dev0 ||dev1 ||dev2|
------ ----- ----
so, in graph 1, firmware acts like the power chip and related gpios
in graph 2, then, I boldly assume a conceptual power chip exist,
it can either be part 2 of graph 1 or 2.
as you said, qemu should only model real hardware,
I am confused, can the demonstration above part 2 be consider a
real hardware? but it does not have vendor and dev-id ...
and it's not real hardware? but it dose work just same with
real hardware.
- Re: [Qemu-devel] [PATCH][RFC v2 3/7] vl: create power chip device, (continued)
- [Qemu-devel] [PATCH][RFC v2 5/7] qdev: add power_signal_in for DeviceState, liguang, 2013/04/05
- [Qemu-devel] [PATCH][RFC v2 4/7] sysemu: remove PowerReason in sysemu.h, liguang, 2013/04/05
- [Qemu-devel] [PATCH][RFC v2 7/7] vl: run power_management, liguang, 2013/04/05
- [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, liguang, 2013/04/05
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, Peter Maydell, 2013/04/05
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, li guang, 2013/04/05
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, Peter Maydell, 2013/04/05
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, li guang, 2013/04/07
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, Peter Maydell, 2013/04/08
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation,
li guang <=
- Re: [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation, Paolo Bonzini, 2013/04/09
[Qemu-devel] [PATCH][RFC v2 6/7] ich9: refactor wakeup/reset function, liguang, 2013/04/05