flashchips: Add a type enum to the chip identification
We used to imply what kind of ID (e.g. RES, REMS, RDID) a chip entry
provides, based on the given probing function. This works well as long
as we call the respective probing function for every single chip entry.
With our ever growing chip database, however, this slows probing signi-
ficantly down. Especially with external programmers with a long command
round-trip.
With the type of identification information stored in the chip entries
explicitly, we'll be able to implement bus-specific probing functions.
These would be called only once and their results would be used to look
a matching chip up in the chip database. Instead of looking for every
possible chip on the buses, we can turn it around and search for the
actually present chips in the database.
Change-Id: Ie658ebf58f21c8994b9b66f7683f9490e8d12267
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/74898
diff --git a/jedec.c b/jedec.c
index 83eb44b..d97736d 100644
--- a/jedec.c
+++ b/jedec.c
@@ -159,7 +159,7 @@
msg_cdbg(", dev_id seems to be normal flash content");
msg_cdbg("\n");
- if (man_id != chip->manufacture_id || dev_id != chip->model_id)
+ if (man_id != chip->id.manufacture || dev_id != chip->id.model)
return 0;
return 1;
@@ -275,7 +275,7 @@
msg_cdbg(", id2 is normal flash content");
msg_cdbg("\n");
- if (largeid1 != chip->manufacture_id || largeid2 != chip->model_id)
+ if (largeid1 != chip->id.manufacture || largeid2 != chip->id.model)
return 0;
return 1;