1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

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 <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
Stefan Tauner
2014-08-30 23:39:51 +00:00
parent 583ea32911
commit 4e32ec19b1
5 changed files with 98 additions and 41 deletions

View File

@ -166,9 +166,6 @@ int probe_jedec_29gl(struct flashctx *flash)
if (man_id != chip->manufacture_id || dev_id != chip->model_id)
return 0;
if (chip->feature_bits & FEATURE_REGISTERMAP)
map_flash_registers(flash);
return 1;
}
@ -287,9 +284,6 @@ static int probe_jedec_common(struct flashctx *flash, unsigned int mask)
if (largeid1 != chip->manufacture_id || largeid2 != chip->model_id)
return 0;
if (chip->feature_bits & FEATURE_REGISTERMAP)
map_flash_registers(flash);
return 1;
}