public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "José Fonseca" <j_r_fonseca@yahoo.co.uk>
To: linux-kernel@vger.kernel.org
Subject: How to write portable MMIO code?
Date: Tue, 30 Apr 2002 15:22:12 +0100	[thread overview]
Message-ID: <20020430142212.GR18163@localhost> (raw)

Dear kernel developers,

I'm currently trying to get the Mach64 DRI driver to run on PowerPC. It's 
mostly working but there are some strange behaviors (DMA works, MMIO not 
really unless you make long waits when submiting, etc.). This is most 
likely related with the MMIO programming macros in the kernel module.

My question is: How to code MMIO to be portable across all platforms, 
i.e., taking in consideration the endian format and memory caches?

I've search thorougly the answer to this question but found 
incomplete/contraditory answers:

  - should one use readl/writel or dereference the address directly?
  - is the use of readl/writel macros suficient to account for endian 
correctness or it's also needed to use the cpu_to_le32/le32_to_cpu macros?
  - should one in general (i.e., assuming the worst case) do wmb() on 
writes, and mb() on reads?

Although I appreciate answers concerning future developments on this 
matter, I need an answer to the current stable kernel release.


Regards,

José Fonseca


PS: Please CC me as I'm not subscribed.

             reply	other threads:[~2002-04-30 15:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-30 14:22 José Fonseca [this message]
2002-04-30 16:19 ` How to write portable MMIO code? Kai Germaschewski
2002-04-30 19:01   ` José Fonseca
2002-04-30 19:41     ` Kai Germaschewski
2002-04-30 20:01       ` Jesse Barnes
2002-04-30 19:56   ` arjan

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=20020430142212.GR18163@localhost \
    --to=j_r_fonseca@yahoo.co.uk \
    --cc=linux-kernel@vger.kernel.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