All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-devel@nongnu.org
Cc: "Ryan Chen" <ryan_chen@aspeedtech.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Joel Stanley" <joel@jms.id.au>
Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH 1/2] hw/adc: Add basic Aspeed ADC model
Date: Wed, 24 May 2017 15:55:28 +1000	[thread overview]
Message-ID: <1495605328.7794.3.camel@aj.id.au> (raw)
In-Reply-To: <041887dc-c613-2bf3-e927-0381a7221b54@amsat.org>

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

On Wed, 2017-05-24 at 02:15 -0300, Philippe Mathieu-Daudé wrote:
> Hi Andrew,
> 
> On 05/22/2017 02:14 AM, Andrew Jeffery wrote:
> > On Mon, 2017-05-22 at 03:15 +0000, Ryan Chen wrote:
> > > In ASPEED SoC chip, all register access have following rule.
> > > Most of controller write access is only support 32bit access.
> > > Read is support 8bits/16bits/32bits.
> 
> This makes sens thinking about how a DMA controller can take advantage 
> of the ADC.
> 
> > 
> > Thanks for clearing that up Ryan.
> > 
> > Phil: I'll rework the model so the reads are 16-bits.
> 
> This shouldn't be necessary, QEMU is supposed to supports different 
> access size for different implemented size, so you can declare your 
> implementation as 32-bit and valid accesses from 8 to 32:
> 
>   static const MemoryRegionOps aspeed_adc_ops = {
>       .read = aspeed_adc_read,
>       .write = aspeed_adc_write,
>       .endianness = DEVICE_LITTLE_ENDIAN,
>       .valid.min_access_size = 1,
>       .valid.max_access_size = 4,
>       .valid.unaligned = false,
> +    .impl.min_access_size = 4,
> +    .impl.max_access_size = 4,
>   };
> 
> This way an I/O access from the CPU or a DMA could use 8/16-bit while 
> you keep a 32-bit implementation. The adjustment is done by 
> access_with_adjusted_size() from memory.c.
> 
> Afaik there is, however, no distinction between read/write different 
> access size in current QEMU MemoryRegionOps model.

Yep, I realised all of the above when I went to implement it. Thanks
for pointing it out though!

Andrew

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-05-24  5:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20  0:26 [Qemu-devel] [PATCH 0/2] hw/adc: Implement a basic Aspeed ADC model Andrew Jeffery
2017-05-20  0:26 ` [Qemu-devel] [PATCH 1/2] hw/adc: Add " Andrew Jeffery
2017-05-20  3:21   ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2017-05-22  0:23     ` Andrew Jeffery
2017-05-22  3:15       ` Ryan Chen
2017-05-22  5:14         ` Andrew Jeffery
2017-05-24  5:15           ` Philippe Mathieu-Daudé
2017-05-24  5:55             ` Andrew Jeffery [this message]
2017-05-20  0:26 ` [Qemu-devel] [PATCH 2/2] hw/arm: Integrate ADC model into Aspeed SoC Andrew Jeffery
2017-05-22 23:40   ` Alistair Francis
2017-05-20  0:51 ` [Qemu-devel] [PATCH 0/2] hw/adc: Implement a basic Aspeed ADC model no-reply
2017-05-20  1:00   ` Andrew Jeffery

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=1495605328.7794.3.camel@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=alistair@alistair23.me \
    --cc=clg@kaod.org \
    --cc=f4bug@amsat.org \
    --cc=joel@jms.id.au \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ryan_chen@aspeedtech.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 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.