From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: peter.maydell@linaro.org, alistair.francis@xilinx.com,
qemu-devel@nongnu.org, zach.pfeffer@xilinx.com, jues@xilinx.com
Subject: Re: [Qemu-devel] [PATCH target-arm v3 7/7] arm: xlnx-zynqmp: Add 2xCortexR5 CPUs
Date: Wed, 17 Jun 2015 10:54:07 +1000 [thread overview]
Message-ID: <20150617005407.GB30423@toto> (raw)
In-Reply-To: <da34128c73ca13fc4f8c3293e1a33d1e1e345655.1434501320.git.peter.crosthwaite@xilinx.com>
On Tue, Jun 16, 2015 at 05:36:19PM -0700, Peter Crosthwaite wrote:
> Add the 2xCortexR5 CPUs to zynqmp board. They are powered off on reset
> (this is true of real hardware) by default or selectable as the boot
> processor.
Hi Peter,
I think it would be good if you could model at least a minimal
way to release the R5s from reset the "real" way. The R5s are
not covered by PSCI in real code and not all code uses PSCI,
in particular not any R5 code.
How would the R5s be useful with upstream with this version?
Maybe I'm missing something.
Cheers,
Edgar
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
> changed since v2:
> Add boot-cpu start-powered-off conditional
> changed since v1:
> s/rcpu/rpu-cpu/
>
> hw/arm/xlnx-zynqmp.c | 34 ++++++++++++++++++++++++++++++++++
> include/hw/arm/xlnx-zynqmp.h | 2 ++
> 2 files changed, 36 insertions(+)
>
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 0c966da..5e72078 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -71,6 +71,13 @@ static void xlnx_zynqmp_init(Object *obj)
> &error_abort);
> }
>
> + for (i = 0; i < XLNX_ZYNQMP_NUM_RPU_CPUS; i++) {
> + object_initialize(&s->rpu_cpu[i], sizeof(s->rpu_cpu[i]),
> + "cortex-r5-" TYPE_ARM_CPU);
> + object_property_add_child(obj, "rpu-cpu[*]", OBJECT(&s->rpu_cpu[i]),
> + &error_abort);
> + }
> +
> object_initialize(&s->gic, sizeof(s->gic), TYPE_ARM_GIC);
> qdev_set_parent_bus(DEVICE(&s->gic), sysbus_get_default());
>
> @@ -163,6 +170,33 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
> qdev_connect_gpio_out(DEVICE(&s->apu_cpu[i]), 1, irq);
> }
>
> + for (i = 0; i < XLNX_ZYNQMP_NUM_RPU_CPUS; i++) {
> + char *name;
> +
> + name = object_get_canonical_path_component(OBJECT(&s->rpu_cpu[i]));
> + if (strcmp(name, boot_cpu)) {
> + /* Secondary CPUs start in PSCI powered-down state */
> + object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true,
> + "start-powered-off", &error_abort);
> + } else {
> + s->boot_cpu_ptr = &s->rpu_cpu[i];
> + }
> +
> + object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
> + &err);
> + if (err != NULL) {
> + error_propagate(errp, err);
> + return;
> + }
> +
> + object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
> + &err);
> + if (err) {
> + error_propagate((errp), (err));
> + return;
> + }
> + }
> +
> if (!s->boot_cpu_ptr) {
> error_setg(errp, "ZynqMP Boot cpu %s not found\n", boot_cpu);
> return;
> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
> index 4f14a22..c379632 100644
> --- a/include/hw/arm/xlnx-zynqmp.h
> +++ b/include/hw/arm/xlnx-zynqmp.h
> @@ -28,6 +28,7 @@
> TYPE_XLNX_ZYNQMP)
>
> #define XLNX_ZYNQMP_NUM_APU_CPUS 4
> +#define XLNX_ZYNQMP_NUM_RPU_CPUS 2
> #define XLNX_ZYNQMP_NUM_GEMS 4
> #define XLNX_ZYNQMP_NUM_UARTS 2
>
> @@ -48,6 +49,7 @@ typedef struct XlnxZynqMPState {
>
> /*< public >*/
> ARMCPU apu_cpu[XLNX_ZYNQMP_NUM_APU_CPUS];
> + ARMCPU rpu_cpu[XLNX_ZYNQMP_NUM_RPU_CPUS];
> GICState gic;
> MemoryRegion gic_mr[XLNX_ZYNQMP_GIC_REGIONS][XLNX_ZYNQMP_GIC_ALIASES];
> CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS];
> --
> 2.4.3.3.g905f831
>
next prev parent reply other threads:[~2015-06-17 0:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 0:35 [Qemu-devel] [PATCH target-arm v3 0/7] ARM Cortex R5 Support Peter Crosthwaite
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 1/7] target-arm/helper.c: define MPUIR register Peter Crosthwaite
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 2/7] target-arm: Add registers for PMSAv7 Peter Crosthwaite
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 3/7] target-arm: Implement PMSAv7 MPU Peter Crosthwaite
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 4/7] target-arm: Add support for Cortex-R5 Peter Crosthwaite
2015-06-17 1:16 ` Edgar E. Iglesias
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 5/7] arm: xlnx-zynqmp: Preface CPU variables with "apu" Peter Crosthwaite
2015-06-17 1:17 ` Edgar E. Iglesias
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 6/7] arm: xlnx-zynqmp: Add boot-cpu property Peter Crosthwaite
2015-06-17 0:36 ` [Qemu-devel] [PATCH target-arm v3 7/7] arm: xlnx-zynqmp: Add 2xCortexR5 CPUs Peter Crosthwaite
2015-06-17 0:54 ` Edgar E. Iglesias [this message]
2015-06-17 1:09 ` Peter Crosthwaite
2015-06-17 1:12 ` Edgar E. Iglesias
2015-06-17 1:21 ` Peter Crosthwaite
2015-06-17 1:32 ` Edgar E. Iglesias
2015-06-18 21:03 ` [Qemu-devel] [PATCH target-arm v3 0/7] ARM Cortex R5 Support Peter Maydell
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=20150617005407.GB30423@toto \
--to=edgar.iglesias@xilinx.com \
--cc=alistair.francis@xilinx.com \
--cc=jues@xilinx.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=zach.pfeffer@xilinx.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).