On 27.01.2008 08:08, Peter Stuge wrote:
On Sun, Jan 27, 2008 at 03:15:58AM +0100, Stefan Reinauer wrote:
#define ID is well tested but I'm not adamant in any way. You're basically asking for less information in source and more at run time. I like more info at run time but I still think it would be nice to have IDs in the code.
Not really less information in the source. Just a single place for that information. flash.h is the only place where the VENDOR_ID defines are defined and the array in flashchips.c is the only place where they are used.
In fact i think it would add information if we replace the VENDOR_ID defines with strings and drop the DEVICE_ID defines completely.
{"W29C011", WINBOND_ID, W_29C011, 128, 128, ...}
should rather read
{"Winbond", "W29C011", 0xda, 0xc1, 128, 128, ...}
I like it.
Please don't change this unless you are willing to add support for all chips mentioned in a #define to flashchips.c. That of course includes testing. Right now flash.h is an ID database which helps greatly if you need to look up an unsupported ID which is already known. Unfortunately no search engine is able to find data sheets based on the ID, so the flash.h database is absolutely essential.
Regards, Carl-Daniel