public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: M.Mann@arkona-technologies.de (Matthias Mann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: asm: add readq/writeq methods
Date: Sat, 07 Dec 2013 23:02:48 +0100	[thread overview]
Message-ID: <52A39B08.8090205@arkona-technologies.de> (raw)
In-Reply-To: <yw1xd2l8l4oc.fsf@unicorn.mansr.com>

M?ns Rullg?rd wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
>> On 7 December 2013 16:05, Matthias Mann <M.Mann@arkona-technologies.de> wrote:
>>> Add readq/writeq methods for 32 bit ARM to allow transfering 64 bit words over
>>> PCIe as a single transfer.
>>> +#if __LINUX_ARM_ARCH__ >= 5
>>> +static inline u64 __raw_readq(const volatile void __iomem *addr)
>>> +{
>>> +       u64 val;
>>> +#if __LITTLE_ENDIAN
>>> +       asm volatile("ldrd %Q1, %R1, %0"
>>> +                    : "+Q" (*(volatile u64 __force *)addr),
>>> +                      "=r" (val));
>>> +#else
>>> +       asm volatile("ldrd %R1, %Q1, %0"
>>> +                    : "+Q" (*(volatile u64 __force *)addr),
>>> +                      "=r" (val));
>>> +#endif
>>> +       return val;
>>> +}
>> Given that ldrd/strd accesses are only a single 64 bit access
>> on CPUs with LPAE (on non-LPAE CPUs they may be
>> implemented as just a pair of 32 bit accesses) should the
>> condition be stricter than just __LINUX_ARM_ARCH__ >= 5 ?
> What do actual CPUs, e.g. the A9, do?
>
I've tested that on an Freescale i.MX6D which is a Cortex-A9 with an Altera Arria V GZ FPGA connected via PCIe. Using strd / ldrd I see a 64 bit TLP (length = 2) on the PCIe interface (this is on an uncachable 32 bit BAR).

      reply	other threads:[~2013-12-07 22:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 16:05 [PATCH v2] ARM: asm: add readq/writeq methods Matthias Mann
2013-12-07 21:38 ` Peter Maydell
2013-12-07 21:41   ` Måns Rullgård
2013-12-07 22:02     ` Matthias Mann [this message]

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=52A39B08.8090205@arkona-technologies.de \
    --to=m.mann@arkona-technologies.de \
    --cc=linux-arm-kernel@lists.infradead.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