[coreboot] flashrom: Can't mmap memory

ron minnich rminnich at gmail.com
Fri Feb 6 18:46:00 CET 2009

On Fri, Feb 6, 2009 at 9:29 AM, Myles Watson <mylesgw at gmail.com> wrote:

> Probing for SST SST49LF040, 512 KB: probe_jedec: id1 0xbf, id2 0x5b
> Probing for SST SST49LF040B, 512 KB: probe_jedec: id1 0xbf, id2 0x5b
> Probing for SST SST49LF080A, 1024 KB: probe_jedec: id1 0xbf, id2 0x5b
> Found chip "SST SST49LF080A" (1024 KB) at physical address 0xfff00000.
> Probing for SST SST49LF160C, 2048 KB: Error accessing flash chip,
> 0x200000 bytes at 0xfff00000
> /dev/mem mmap failed: Operation not permitted
> I don't know enough about flashrom to know if it should have stopped,
> or if it should have figured out a better base address for the
> SST49LF160C.

I think it's a bug.

See this code in probe_flash.

		base = flashbase ? flashbase : (0xffffffff - size + 1);
		flash->virtual_memory = bios = physmap("flash chip", base, size);

It seems to me that if we probed the 1M part and flashbase was
0xfff00000, then the next time through, when we have a 2M part, we'll
use a flashbase that is wrong -- 0xfff00000.

I wonder why we even make this test: flashbase ? flashbase :
(0xffffffff - size + 1)

I think it goes back to the lovely sc520 and other chips that had a
non-standard flashbase. But in that case, we ought to have a better
way to set it than this global.


More information about the coreboot mailing list