util/intelmetool: Add additional helpful error messages

Add more verbose error message for common problems on modern
operating systems, like Secure Boot and CONFIG_STRICT_DEVMEM.

Change-Id: Ie3361910d48271bcc2cd3b4b74937fbc5df0a176
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25401
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
This commit is contained in:
Patrick Rudolph 2018-02-02 15:07:09 +01:00 committed by Philipp Deppenwiese
parent 405d2eabe0
commit ad4ddfcfdb
2 changed files with 6 additions and 3 deletions

View File

@ -491,7 +491,8 @@ int main(int argc, char *argv[])
#ifndef __DARWIN__ #ifndef __DARWIN__
fd_mem = open("/dev/mem", O_RDWR); fd_mem = open("/dev/mem", O_RDWR);
if (fd_mem < 0) { if (fd_mem < 0) {
perror("Can not open /dev/mem"); perror("Can not open /dev/mem. Do you have disabled "
"Secure Boot ?");
exit(1); exit(1);
} }

View File

@ -68,7 +68,8 @@ int write_rcba32(uint32_t addr, uint32_t val)
rcba = map_physical((off_t)rcba_phys, size); rcba = map_physical((off_t)rcba_phys, size);
if (rcba == NULL) { if (rcba == NULL) {
printf("Could not map RCBA\n"); printf("Could not map RCBA\n"
"Do you have cmdline argument 'iomem=relaxed' set ?\n");
return 1; return 1;
} }
*(uint32_t *)(rcba + addr) = val; *(uint32_t *)(rcba + addr) = val;
@ -93,7 +94,8 @@ int read_rcba32(uint32_t addr, uint32_t *val)
rcba = map_physical((off_t)rcba_phys, size); rcba = map_physical((off_t)rcba_phys, size);
if (rcba == NULL) { if (rcba == NULL) {
printf("Could not map RCBA\n"); printf("Could not map RCBA\n"
"Do you have cmdline argument 'iomem=relaxed' set ?\n");
return 1; return 1;
} }