Exposing NAND chip information

Tom Isaacson Tom.Isaacson at navico.com
Sun Apr 22 19:40:41 EDT 2012


> If you have a need to have them in mtd_info - probably you can add
> those. Just add/document a way to detect that the chip does not have
> this data. E.g., all zeroes or -1. I mean, NORs might not have the IDs.
I think zeroes would make more sense.

>> Also, when I add the files to the /sys tree is there any naming
>> convention I should follow? I was going to copy the way the eMMC
>> device does it:
>>   manfid - Manufacturer ID
>>   devid - Chip ID
>>   manf_name - Manufacturer name
>>   dev_name - Chip name

>Should we put all ID's to the same file instead? Or at lease
>manfid/manf_name and devid/dev_name pairs to waste less RAM because each
>sysfs file cunsumes several KiBs of RAM AFAIR (struct inode alone is
>several KiB). Also if you add sysfs files - do not forget to document
>them id Documentation/ABI and CC Greg KH.

The documentation for sysfs (http://lxr.linux.no/linux+v3.3.2/Documentation/filesystems/sysfs.txt) says:
"Attributes should be ASCII text files, preferably with only one value per file. It is noted that it may not be efficient to contain only one value per file, so it is socially acceptable to express an array of values of the same type."
So if we want to combine we should do it the first way - both IDs in one file, both strings in another:
  id - Manufacturer and Chip ID (tab separated)
  name - Manufacturer and Chip name (tab separated)

Tom





More information about the linux-mtd mailing list