[RFC] sysfs support for mtd
dedekind at infradead.org
Thu Jul 19 03:02:52 EDT 2007
On Wed, 2007-07-18 at 11:45 -0700, Siddharth Choudhuri wrote:
> Here's the design:
> o Each mtd partition appears as a directory under
> o The following fields from struct mtd_info are
> exported as files - eccsize, ecctype, erasesize,
> numeraseregions, oobsize, size, type, writesize.
I doubt OOB-related stuff has to be exposed. We see many new flash
controllers which do not let you access OOB. It is better to avoid OOB
usage altogether, so I would not even exposed that stuff in sysfs.
> I would like to get some suggestions from the group
> before sending out a patch:
> o Currently the fields type, ecctype are integers.
> Should these be converted into appropriate strings as
> per #defines from mtd-abi.h
> Eg: cat /sys/devices/mtd/mtd0/type
> shows 4. Should this show MTD_NANDFLASH instead ?
I think yes, it should be something like "NAND", "OneNAND", "NOR",
> o I am not sure where an additional link from bus to
> mtd should be added in the sysfs hierarchy. Should it
> be /sys/bus/platform/devices -> ../../../devices/mtd
> /sys/bus/platform/ -> ../../devices/mtd
No idea, but I've always thought sysfs core automatically puts these
links. All you have to do is to define your bus object which is
"platform" bus, and the stuff will appear. Although I am not sure.
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd