diff options
author | Peter Stuge <peter@stuge.se> | 2009-01-22 22:53:59 +0000 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2009-01-22 22:53:59 +0000 |
commit | 8a681b1d840e701e41892f8375a15baf56107ab5 (patch) | |
tree | 815990f1aba4b7a40201f6fb3cdaa7254989a2a5 | |
parent | df2eb8e97b67452f52723e2e93c0ebcd8e3e61d5 (diff) | |
download | coreboot-8a681b1d840e701e41892f8375a15baf56107ab5.tar.xz |
flashrom: Provide some hints for the user in case /dev/mem mmap fails.
resolves #121
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3889 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r-- | util/flashrom/flashrom.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/util/flashrom/flashrom.c b/util/flashrom/flashrom.c index f613f8a071..7e52fbc8dc 100644 --- a/util/flashrom/flashrom.c +++ b/util/flashrom/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"); + } exit(1); } flash->virtual_memory = bios; |