mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: "linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>,
	"ezequiel.garcia@free-electrons.com" 
	<ezequiel.garcia@free-electrons.com>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	"thomas.petazzoni@free-electrons.com" 
	<thomas.petazzoni@free-electrons.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: supplementing IO accessors with 64 bit capability
Date: Fri, 24 Oct 2014 17:16:34 +0100	[thread overview]
Message-ID: <20141024161634.GG20534@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <CANLsYkz+UZv+vd9hbQOTNvsdyR7MyMrb0DxCOpMcgCr+1NQR5Q@mail.gmail.com>

On Fri, Oct 24, 2014 at 04:05:13PM +0100, Mathieu Poirier wrote:
> On 24 October 2014 03:28, Catalin Marinas <catalin.marinas@arm.com> wrote:
> > On Wed, Oct 22, 2014 at 08:10:27PM +0100, Mathieu Poirier wrote:
> >> On 22 October 2014 18:44, Catalin Marinas <catalin.marinas@arm.com> wrote:
> >> > On Wed, Oct 22, 2014 at 05:06:23PM +0100, mathieu.poirier@linaro.org wrote:
> >> >> +static inline void __raw_writeq(u64 val, volatile void __iomem *addr)
> >> >> +{
> >> >> +     asm volatile("strd %1, %0"
> >> >> +                  : "+Qo" (*(volatile u64 __force *)addr)
> >> >> +                  : "r" (val));
> >> >> +}
> >> >> +
> >> >> +static inline u64 __raw_readq(const volatile void __iomem *addr)
> >> >> +{
> >> >> +     u64 val;
> >> >> +     asm volatile("ldrd %1, %0"
> >> >> +                  : "+Qo" (*(volatile u64 __force *)addr),
> >> >> +                    "=r" (val));
> >> >> +     return val;
> >> >> +}
> >> >> +#endif
> >> >
> >> > I'm curious why you need these. Do you have a device that needs a 64-bit
> >> > single access or you are trying to read two consecutive registers?
> >>
> >> The fundamental data size of Coresight STM32 for ARMv7 is
> >> implementation defined and can be 32 or 64bit.  As such stimulus ports
> >> can support transaction sizes of up to 64 bit.
> >
> > The STM programmer's model spec recommends something else (though I find
> > the "3.6 Data sizes" chapter a bit confusing):
> >
> >   To ensure that code is portable between processor micro-architectures
> >   and system implementations, ARM recommends that only the native data
> >   size of the machine is used, and smaller sizes. For the 32-bit ARMv7
> >   architecture, only 8, 16, and 32-bit transfers are recommended. For an
> >   ARMv8 processor that supports the AArch64 Execution state, it is
> >   recommended that the fundamental data size of 64-bits is implemented.
> >
> > Which means that you should not use readq/writeq on a 32-bit system.
> 
> Not quite.  ARM documentation IHI0054B (ARM System Trace Macrocell:
> Programmers' Model Architecture Specification) stipulate that "For
> systems with an ARMv7 processor, ARM recommends configuration 1 or
> configuration 2.", where configuration 2 has a fundamental size of 64
> bit.

As I said, it's confusing. Anyway, you can go ahead and add the
readq/writeq for ARMv6 and later, though it won't be guaranteed to have
a 64-bit access, it depends on the bus.

BTW, do you need to define the non-relaxed accessors as well? That would
be readq/writeq.

-- 
Catalin

  reply	other threads:[~2014-10-24 16:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 16:06 mathieu.poirier
2014-10-22 16:11 ` Russell King - ARM Linux
2014-10-22 16:22   ` Mathieu Poirier
2014-10-22 17:19     ` Russell King - ARM Linux
2014-10-22 17:55       ` Mathieu Poirier
2014-10-22 16:44 ` Catalin Marinas
2014-10-22 19:10   ` Mathieu Poirier
2014-10-24  9:28     ` Catalin Marinas
2014-10-24 15:05       ` Mathieu Poirier
2014-10-24 16:16         ` Catalin Marinas [this message]
2014-10-24 17:54           ` Mathieu Poirier
2014-10-27 15:54           ` Will Deacon
2014-10-27 22:14             ` Mathieu Poirier
2014-10-28 12:23               ` Will Deacon
2014-10-23 19:47   ` Nicolas Pitre
2014-10-23 19:51     ` Russell King - ARM Linux
2014-10-23 20:15       ` Nicolas Pitre
2014-10-24 10:37         ` Arnd Bergmann
2014-10-24  9:23     ` Catalin Marinas

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=20141024161634.GG20534@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mathieu.poirier@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=thomas.petazzoni@free-electrons.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

all inboxes | Powered by JetHome®