Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Subject: Can't read from mmaped PCI memory space
Date: Sun, 28 Nov 2010 22:20:49 +0100	[thread overview]
Message-ID: <4CF2C7B1.5030007@grandegger.com> (raw)

Hello,

I'm trying to read from mmapped PCI memory space on an alchemy board,
but I can't get it to work. Here's the lspci output of the PCI card:

  bash-3.00# lspci -v
  00:00.0 Class 0200: 168c:001b (rev 01)
	Subsystem: 168c:2063
	Flags: bus master, medium devsel, latency 168, IRQ 9
	Memory at 0000000040000000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [44] Power Management version 2

I used mmap on "/dev/mem" and "/sys/bus/pci/.../resource0", but I do not
read the expected values using "*(volatile u32 *)mmap_addr" from that
region. The value also changes from read to read. Reading from kernel
space just work fine. Am I doing something illegal? Any idea why it does
not work?

TIA,

Wolfgang.

             reply	other threads:[~2010-11-28 21:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28 21:20 Wolfgang Grandegger [this message]
2010-11-29 10:24 ` Can't read from mmaped PCI memory space tiejun.chen
2010-11-29 13:23   ` Wolfgang Grandegger
2010-11-29 13:41     ` Wolfgang Grandegger
2010-12-13 20:48       ` Wolfgang Grandegger

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=4CF2C7B1.5030007@grandegger.com \
    --to=wg@grandegger.com \
    --cc=linux-mips@linux-mips.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