From: Leon Alrae <leon.alrae@imgtec.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/mips: add initial Cluster Power Controller support
Date: Tue, 1 Mar 2016 10:58:50 +0000 [thread overview]
Message-ID: <56D575EA.3010008@imgtec.com> (raw)
In-Reply-To: <CAFEAcA8e7UesumeX0YcGba1LfyCaEiMBykeYCs9WgpdjTboysQ@mail.gmail.com>
On 26/02/16 16:49, Peter Maydell wrote:
> On 26 February 2016 at 16:19, Leon Alrae <leon.alrae@imgtec.com> wrote:
>> Cluster Power Controller (CPC) is responsible for power management in
>> multiprocessing system. It provides registers to control the power and the
>> clock frequency of the individual elements in the system.
>>
>> This patch implements only three registers that are used to control the
>> power state of each VP on a single core:
>> * VP Run is a write-only register used to set each VP to the run state
>> * VP Stop is a write-only register used to set each VP to the suspend state
>> * VP Running is a read-only register indicating the run state of each VP
>>
>> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
>> ---
>> default-configs/mips-softmmu.mak | 1 +
>> default-configs/mips64-softmmu.mak | 1 +
>> default-configs/mips64el-softmmu.mak | 1 +
>> default-configs/mipsel-softmmu.mak | 1 +
>
> A separate thing, but maybe it would be worth having a mips-softmmu-common.mak
> that all the mips*-softmmu.mak include to avoid having to repeat CONFIG defines
> in four places like this.
Good idea. I'll prepare a separate patch for that.
And the comments below will be addressed in v2 (it'll also include few
extra changes).
Thanks,
Leon
>
>> +static void mips_cpc_init(Object *obj)
>> +{
>> + SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>> + MIPSCPCState *s = MIPS_CPC(obj);
>> +
>> + memory_region_init_io(&s->mr, OBJECT(s), &cpc_ops, s, "mips-cpc",
>> + CPC_ADDRSPACE_SZ);
>> + sysbus_init_mmio(sbd, &s->mr);
>> +}
>> +
>> +static const TypeInfo mips_cpc_info = {
>> + .name = TYPE_MIPS_CPC,
>> + .parent = TYPE_SYS_BUS_DEVICE,
>> + .instance_size = sizeof(MIPSCPCState),
>> + .instance_init = mips_cpc_init,
>> +};
>
> I suspect you need a reset method.
>
>> +
>> +static void mips_cpc_register_types(void)
>> +{
>> + type_register_static(&mips_cpc_info);
>> +}
>> +
>> +type_init(mips_cpc_register_types)
>
>> +typedef struct MIPSCPCState {
>> + SysBusDevice parent_obj;
>> +
>> + MemoryRegion mr;
>> + uint64_t vp_running; /* Indicates which VP's are in the run state */
>
> This is state, so you need a VMState structure to migrate it correctly.
>
>> +} MIPSCPCState;
>> +
>> +#endif /* MIPS_CPC_H */
>> --
>> 2.1.0
>
> thanks
> -- PMM
>
next prev parent reply other threads:[~2016-03-01 10:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 16:19 [Qemu-devel] [PATCH 0/2] hw/mips: implement Cluster Power Controller Leon Alrae
2016-02-26 16:19 ` [Qemu-devel] [PATCH 1/2] hw/mips: add initial Cluster Power Controller support Leon Alrae
2016-02-26 16:49 ` Peter Maydell
2016-03-01 10:58 ` Leon Alrae [this message]
2016-02-26 16:19 ` [Qemu-devel] [PATCH 2/2] hw/mips_malta: add CPC to the Malta board Leon Alrae
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=56D575EA.3010008@imgtec.com \
--to=leon.alrae@imgtec.com \
--cc=aurelien@aurel32.net \
--cc=peter.maydell@linaro.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.