qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: peter.crosthwaite@xilinx.com
Cc: blauwirbel@gmail.com, peter.maydell@linaro.org,
	edgar.iglesias@gmail.com, qemu-devel@nongnu.org,
	kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 4/5] xilinx_devcfg: Zynq devcfg device model
Date: Wed, 29 May 2013 10:51:58 +0200	[thread overview]
Message-ID: <51A5C1AE.6070909@redhat.com> (raw)
In-Reply-To: <ec9a490e1bde245667fd70ee23ca9f02644296c6.1369374096.git.peter.crosthwaite@xilinx.com>

Il 24/05/2013 07:49, peter.crosthwaite@xilinx.com ha scritto:
> +static const MemoryRegionOps devcfg_reg_ops = {
> +    .read = register_read_memory_le,
> +    .write = register_write_memory_le,
> +    .endianness = DEVICE_LITTLE_ENDIAN,
> +    .valid = {
> +        .min_access_size = 4,
> +        .max_access_size = 4,

What happens if you have registers of mixed size within the same "bank"?

> +    }
> +};
> +
> +static void xilinx_devcfg_realize(DeviceState *dev, Error **errp)
> +{
> +    XilinxDevcfg *s = XILINX_DEVCFG(dev);
> +    const char *prefix = object_get_canonical_path(OBJECT(dev));
> +    int i;
> +
> +    for (i = 0; i < R_MAX; ++i) {
> +        RegisterInfo *r = &s->regs_info[i];
> +
> +        *r = (RegisterInfo) {
> +            .data = &s->regs[i],
> +            .data_size = sizeof(uint32_t),
> +            .access = &xilinx_devcfg_regs_info[i],
> +            .debug = XILINX_DEVCFG_ERR_DEBUG,
> +            .prefix = prefix,
> +            .opaque = s,
> +        };
> +        memory_region_init_io(&r->mem, &devcfg_reg_ops, r, "devcfg-regs", 4);

Could you add a register_init function that does register_reset +
memory_region_init_io?

> +        memory_region_add_subregion(&s->iomem, i * 4, &r->mem);

Paolo

  reply	other threads:[~2013-05-29  8:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24  5:46 [Qemu-devel] [PATCH v3 0/5] Data Driven device registers & Zynq DEVCFG peter.crosthwaite
2013-05-24  5:46 ` [Qemu-devel] [PATCH v3 1/5] bitops: Add ONES macro peter.crosthwaite
2013-05-24  5:47 ` [Qemu-devel] [PATCH v3 2/5] register: Add Register API peter.crosthwaite
2013-05-29 17:52   ` Edgar E. Iglesias
2013-05-24  5:48 ` [Qemu-devel] [PATCH v3 3/5] register: Add Memory API glue peter.crosthwaite
2013-05-24  5:49 ` [Qemu-devel] [PATCH v3 4/5] xilinx_devcfg: Zynq devcfg device model peter.crosthwaite
2013-05-29  8:51   ` Paolo Bonzini [this message]
2013-05-29 13:54     ` Peter Crosthwaite
2013-05-29 14:03       ` Paolo Bonzini
2013-05-29 17:04   ` Edgar E. Iglesias
2013-05-29 17:08     ` Paolo Bonzini
2013-05-30  7:15       ` Peter Crosthwaite
2013-05-30 13:08         ` Paolo Bonzini
2013-05-29 17:57   ` Anthony Liguori
2013-05-29 18:52     ` Anthony Liguori
2013-05-30  1:43     ` Peter Crosthwaite
2013-05-30 19:41       ` Anthony Liguori
2013-05-31 23:34         ` Peter Crosthwaite
2013-05-24  5:49 ` [Qemu-devel] [PATCH v3 5/5] xilinx_zynq: added devcfg to machine model peter.crosthwaite

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=51A5C1AE.6070909@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=kraxel@redhat.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).