Exposing NAND chip information
Florian Fainelli
ffainelli at freebox.fr
Tue Apr 17 05:39:28 EDT 2012
Hi Tom,
Le 04/17/12 01:51, Tom Isaacson a écrit :
>> I have the exact same requirement and cooked up a patch to do this for NAND:
>> http://patchwork.ozlabs.org/patch/94407/
>
> Ah, your patch shows you've added the sysfs files in mtdcore.c, which means they'll show up in:
> /sys/class/mtd/..
Yes, when I first asked what was the best place to add those attributes,
I initially wanted to create something like /sys/class/mtd/nand0 or such
and put attributes there, but Artem preferred having them in
/sys/class/mtd/mtd<N>/
> The code I've done adds them in mxc_nd2.c (the device I have) so they appear in:
> /sys/devices/platform/mxc_nandv2_flash.0/..
> Obviously this only works for one type of flash right now, but I was thinking of extending all the separate uses of DEVICE_ATTR and manage_sysfs_files() to call back to a generic sysfs function in nand_base.c so these new parameters appear for all NAND devices.
> I can't find anything online that gives a guide to where files should be added to sysfs - is there such a thing, or do people just make it up as they go along?
>
>> however, to be complete it would also need to expose such informations for SPI
>> and NOR flashes, which I have not done yet.
>
> I don't have access to those devices so I can't test any code I might attempt.
I do, it's just that I have been lazy on working again on this.
--
Florian
More information about the linux-mtd
mailing list