On Tue, 20 Oct 2009, Brett Graham wrote:
> --minimal python example--
> open("/dev/mem", O_RDWR|O_SYNC|O_LARGEFILE) = 3
> fstat64(3, {st_mode=S_IFCHR|0640, st_rdev=makedev(1, 1), ...}) = 0
> dup(3) = 4
> mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x48088) = 0x40020000
> --- SIGBUS (Bus error) @ 0 (0) ---
> +++ killed by SIGBUS +++
> Process 1633 detached
Your script:
>> m = mmap.mmap(f, mmap.PAGESIZE, mmap.MAP_SHARED, mmap.PROT_WRITE |
>> mmap.PROT_READ, offset=addr & ~MAP_MASK)
>> m.seek(addr & MAP_MASK)
So the mmap() is working fine, based on the output above...
>> c = m.read_byte()
... but the above line is going to fail. GPTIMER registers need 16-
or 32-bit accesses[1].
- Paul
1. OMAP34xx TRM 16.3.2:
"CAUTION
The GP timer registers are limited to 32-bit and 16-bit data accesses;
8-bit access is not allowed and can corrupt the register content."
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html