Edward O'Callaghan has uploaded this change for review.

View Change

flashrom.c: Warn when mapping >=16M flash chips from high mem

Change-Id: Ibf59c243fb9c6e0db68f17ee87fc1bb354a3f886
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M flashrom.c
1 file changed, 4 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/34/63534/1
diff --git a/flashrom.c b/flashrom.c
index ac61259..ccdf7f2 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -694,6 +694,10 @@
if (flash->chip->total_size == 0)
return 0;

+ /* FIXME: The internal master hooks 'map_flash_region = physmap'. */
+ if (flash->chip->total_size > 16 * 1024)
+ msg_cwarn("Warning: maping %d kB sized flash chip. This could cause issue on x86.\n", flash->chip->total_size * 1024);
+
const chipsize_t size = flash->chip->total_size * 1024;
uintptr_t base = flashbase ? flashbase : (0xffffffff - size + 1);
void *addr = programmer_map_flash_region(flash->chip->name, base, size);

To view, visit change 63534. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibf59c243fb9c6e0db68f17ee87fc1bb354a3f886
Gerrit-Change-Number: 63534
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange