path: root/flashrom.c
diff options
authorPeter Stuge <>2009-01-22 22:53:59 +0000
committerPeter Stuge <>2009-01-22 22:53:59 +0000
commit72c9668b9535bfe40d3e321faa26cfe5bb9a44b3 (patch)
treef002bdae8d1af4c4f46f6540c73772a34c028a92 /flashrom.c
parent37179b807c416a4e7030a414454a3de484c1114c (diff)
Provide some hints for the user in case /dev/mem mmap fails
Resolves #121 Corresponding to flashrom svn r385 and coreboot v2 svn r3889. Signed-off-by: Peter Stuge <> Acked-by: Carl-Daniel Hailfinger <>
Diffstat (limited to 'flashrom.c')
1 files changed, 7 insertions, 0 deletions
diff --git a/flashrom.c b/flashrom.c
index f613f8a..7e52fbc 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -139,6 +139,13 @@ struct flashchip *probe_flash(struct flashchip *first_flash, int force)
fd_mem, (off_t) base);
if (bios == MAP_FAILED) {
perror("Can't mmap memory using " MEM_DEV);
+ if (EINVAL == errno) {
+ fprintf(stderr, "In Linux this error can be caused by the CONFIG_NONPROMISC_DEVMEM (<2.6.27),\n");
+ fprintf(stderr, "CONFIG_STRICT_DEVMEM (>=2.6.27) and CONFIG_X86_PAT kernel options.\n");
+ fprintf(stderr, "Please check if either is enabled in your kernel before reporting a failure.\n");
+ fprintf(stderr, "You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n");
+ fprintf(stderr, "disabling the other option unfortunately requires a kernel recompile. Sorry!\n");
+ }
flash->virtual_memory = bios;
OpenPOWER on IntegriCloud