Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mmap and PCI Hardware Addresses

41 views
Skip to first unread message

Randall Hyde

unread,
Oct 23, 2003, 1:05:41 AM10/23/03
to
Hi All,
I need to access a couple of SATA chips from a user-mode
program (yep, running as root). I know for a fact that my
chip resides at address 0xfc300000 (/proc/iomem and /proc/ide/siimage
tells me this). Can I do a mmap like the following to access the registers
on ths chip?

fdDevMem = open( "/dev/mem", O_RDWR );
ptr =
mmap
(
NULL,
4096,
PROT_READ | PROT_WRITE,
MAP_SHARED,
fdDevMem,
0xfc300000
);

When I try this, I get a valid pointer back, but it doesn't seem to
be mapped to my si3112 chip register bank.

I've also used code like the following:
ptr =
mmap
(
0xfc300000,
4096,
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANONYMOUS,
-1,
0
);

Same story.
If I use MAP_FIXED and/or MAP_PRIVATE, the mmap call fails.

What am I doing wrong here?
Thanks,
Randy Hyde

0 new messages