From 4e32ec19b124a7431d1e3fd9f7e75196b7495a7e Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sat, 30 Aug 2014 23:39:51 +0000 Subject: Refine physical address mapping of flash chips - Create distinct functions for mapping and unmapping for flash chips. - Map only when needed: map before probing and unmap immediately after it. Map again when a single chip was probed successfully before taking any actual actions and clean up afterwards. - Map special function chip registers centrally together with flash space instead of within (some) probing methods after successful probes. - Save the used base addresses of the mappings in struct flashctx as well. - Do not try to (un)map the zero-sized chip definitions that are merely hacks. This also fixes the printing of wrong warnings for these chip definitions introduced in r1765. Corresponding to flashrom svn r1847. Signed-off-by: Stefan Tauner Acked-by: Carl-Daniel Hailfinger --- flash.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'flash.h') diff --git a/flash.h b/flash.h index 301eb7a..a5d3a55 100644 --- a/flash.h +++ b/flash.h @@ -48,9 +48,9 @@ typedef uintptr_t chipaddr; /* Types and macros regarding the maximum flash space size supported by generic code. */ typedef uint32_t chipoff_t; /* Able to store any addressable offset within a supported flash memory. */ typedef uint32_t chipsize_t; /* Able to store the number of bytes of any supported flash memory. */ -#define FL_MAX_CHIPADDR_BITS (24) -#define FL_MAX_CHIPADDR ((chipoff_t)(1ULL<