On Tuesday, October 05, 2010 10:56:39 Reinhard Meyer wrote:
> +     /*
> +      * count the number of continuation bytes, but
> +      * leave at least 3 bytes to the end of the buffer untouched
> +      */
> +     for (shift = 0, idp = idbuf;
> +             shift < (sizeof(idbuf) - 3) && *idp == 0x7f;
> +                     shift++, idp++)
> +             ;
> +
> +     /* search the table for matches in shift and id */
> +     for (i = 0; i < ARRAY_SIZE(flashes); i++) {
> +             if (flashes[i].shift == shift && flashes[i].idcode == *idp) {
> +                     /* we have a match, call probe */
> +                     flash = flashes[i].probe(spi, idp);
> +                     if (flash)
> +                             break;
> +             }
>       }

thinking about this some more, i see two problems.  (1) we've been providing 4 
bytes to probe funcs (like the spansion), so 3 is too small.  (2) all of the 
probe devices today expect to get the whole idcode buffer.  so if we're going 
to change this API, we need to fix all the probe funcs too.  but that is a lot 
of changes to roll into one commit, so let's first focus on converting to a 
table without changing any probe semantics.

see the follow up patch that addresses these issues and some other stuff.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to