[flashrom] [PATCH 4/5] Generify probe_spi_rdid_generic() and add probe_spi_rdid_edi().

Antonio Ospite ospite at studenti.unina.it
Mon Oct 15 10:56:10 CEST 2012


On Wed,  3 Oct 2012 06:13:04 +0200
Stefan Tauner <stefan.tauner at student.tuwien.ac.at> wrote:

> Previously the "generic" function was working/used for exactly two
> cases, namely for manufacturer IDs with 0 or 1 continuation bytes.
> For this behavior it was overly complicated.
> 
> The new implementation handles up to 3 continuation bytes
> automatically and allows for up to 4 model bytes which is directly
> used to add support for an EDI probing function. The probe_spi_rdid4()
> function is removed because it is no longer needed.
> 
> The new probe_spi_rdid_generic() tries to figure out the maximum
> allowed read size by using the recently added check_trans() function
> to reduce the request size if necessary. While this does not make
> detection to succeed in all theoretical situations, it improves the
> code and will hopefully work in all realworld situations.
> 
> Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
> ---
>  flashchips.c |   24 +++++++--------
>  flashchips.h |    2 +-
>  spi25.c      |   97 ++++++++++++++++++++++++++++++----------------------------
>  3 files changed, 63 insertions(+), 60 deletions(-)
>

A fixup like this is needed for probe_spi_rdid_edi() to be usable:

diff --git a/chipdrivers.h b/chipdrivers.h
index 1ef4959..b754076 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -34,7 +34,7 @@ int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, int

 /* spi25.c */
 int probe_spi_rdid(struct flashctx *flash);
-int probe_spi_rdid4(struct flashctx *flash);
+int probe_spi_rdid_edi(struct flashctx *flash);
 int probe_spi_rems(struct flashctx *flash);
 int probe_spi_res1(struct flashctx *flash);
 int probe_spi_res2(struct flashctx *flash);

-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?




More information about the flashrom mailing list