qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Alistair Francis <alistair.francis@xilinx.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com
Subject: Re: [Qemu-devel] [PATCH arm-midr v1 1/2] ARM: Convert MIDR to a property
Date: Mon, 13 Jan 2014 00:54:53 +0100	[thread overview]
Message-ID: <52D32B4D.1070205@suse.de> (raw)
In-Reply-To: <0dcbbf9ba6301afde428928238a06615cf936fd0.1389326614.git.alistair.francis@xilinx.com>

Am 13.01.2014 00:33, schrieb Alistair Francis:
> Convert the MIDR register to a property. This allows boards to later set
> a custom MIDR value. This has been done in such a way to maintain
> compatibility with all existing CPUs and boards
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
> I added the properties to the cpu->midr variable in a similar method to
> how Peter Crosthwaite did in his 'Fix Support for ARM CBAR and
> reset-hivecs' series.
> 
>  target-arm/cpu.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 408d207..bf625b0 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -249,10 +249,14 @@ static Property arm_cpu_reset_cbar_property =
>  static Property arm_cpu_reset_hivecs_property =
>              DEFINE_PROP_BOOL("reset-hivecs", ARMCPU, reset_hivecs, false);
>  
> +static Property arm_cpu_midr_property =
> +            DEFINE_PROP_UINT32("midr", ARMCPU, midr, 0);
> +
>  static void arm_cpu_post_init(Object *obj)
>  {
>      ARMCPU *cpu = ARM_CPU(obj);
>      Error *err = NULL;
> +    uint32_t temp = cpu->midr;
>  
>      if (arm_feature(&cpu->env, ARM_FEATURE_CBAR)) {
>          qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_cbar_property,
> @@ -265,6 +269,19 @@ static void arm_cpu_post_init(Object *obj)
>                                   &err);
>          assert_no_error(err);
>      }
> +
> +    /*
> +     * Initialise the midr property and set it to the original CPU MIDR
> +     * This is used to maintain compatibility with boards that don't set
> +     * a custom MIDR
> +     */
> +    qdev_property_add_static(DEVICE(obj), &arm_cpu_midr_property, &err);

This looks wrong to me. Use dc->props to add properties that are always
present. Any qdev_* functions shouldn't spread further than necessary.

> +    assert_no_error(err);

Further, this seems to conflict with Peter C.'s work of introducing
error_abort.

Andreas

> +    object_property_set_int(OBJECT(cpu), temp, "midr", &err);
> +    if (err) {
> +        error_report("%s", error_get_pretty(err));
> +        exit(1);
> +    }
>  }
>  
>  static void arm_cpu_finalizefn(Object *obj)
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2014-01-12 23:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-12 23:33 [Qemu-devel] [PATCH arm-midr v1 0/2] ARM-MIDR Make ARM-MIDR a property and use in Zynq Alistair Francis
2014-01-12 23:33 ` [Qemu-devel] [PATCH arm-midr v1 1/2] ARM: Convert MIDR to a property Alistair Francis
2014-01-12 23:54   ` Andreas Färber [this message]
2014-01-13  0:03     ` Peter Crosthwaite
2014-01-12 23:33 ` [Qemu-devel] [PATCH arm-midr v1 2/2] ZYNQ: Implement board MIDR control for Zynq Alistair Francis

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=52D32B4D.1070205@suse.de \
    --to=afaerber@suse.de \
    --cc=alistair.francis@xilinx.com \
    --cc=peter.crosthwaite@xilinx.com \
    --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 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).