public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Siddharth Choudhuri <siddh_c@yahoo.com>
To: linux-mtd@lists.infradead.org
Subject: [RFC] sysfs support for mtd
Date: Wed, 18 Jul 2007 11:45:54 -0700 (PDT)	[thread overview]
Message-ID: <470958.35224.qm@web30213.mail.mud.yahoo.com> (raw)

Hi,

I have added a sysfs support for mtd. There was an
earlier discussion some time back
(http://lists.infradead.org/pipermail/linux-mtd/2006-December/016952.html)
about adding sysfs support for mtd.

Here's the design:
o Each mtd partition appears as a directory under 
/sys/devices/mtd/ 
o The following fields from struct mtd_info are
exported as files - eccsize, ecctype, erasesize,
numeraseregions, oobsize, size, type, writesize. 

--------------
Eg: 
# ls -l /sys/devices/mtd
drwxr-xr-x    2 root     root            0 Jan  1
00:00 mtd0
drwxr-xr-x    2 root     root            0 Jan  1
00:00 mtd1
drwxr-xr-x    2 root     root            0 Jan  1
00:00 mtd2
drwxr-xr-x    2 root     root            0 Jan  1
00:00 mtd3
# ls -l /sys/devices/mtd/mtd0/
-r--r--r--    1 root     root         4096 Jan  1
00:00 bbt
-r--r--r--    1 root     root         4096 Jan  1
00:00 eccsize
-r--r--r--    1 root     root         4096 Jan  1
00:00 ecctype
-r--r--r--    1 root     root         4096 Jan  1
00:00 erasesize
-r--r--r--    1 root     root         4096 Jan  1
00:00 numeraseregions
-r--r--r--    1 root     root         4096 Jan  1
00:00 oobsize
-r--r--r--    1 root     root         4096 Jan  1
00:00 size
-r--r--r--    1 root     root         4096 Jan  1
00:00 type
-r--r--r--    1 root     root         4096 Jan  1
00:00  writesize
# cat /sys/devices/mtd/mtd0/oobsize 
64
-----------

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 ? 

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
-OR-
/sys/bus/platform/ -> ../../devices/mtd 

o Any other comments/suggestions. 

thanks,
-sid












       
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

             reply	other threads:[~2007-07-18 18:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 18:45 Siddharth Choudhuri [this message]
2007-07-19  7:02 ` [RFC] sysfs support for mtd Artem Bityutskiy
2007-07-20  0:17   ` Siddharth Choudhuri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=470958.35224.qm@web30213.mail.mud.yahoo.com \
    --to=siddh_c@yahoo.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox