The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Bruce Leonard <brucle@earthlink.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 0/2][MTD] Support for > 2GiB MTD devices
Date: Thu, 21 Aug 2008 19:00:44 -0700 (GMT-07:00)	[thread overview]
Message-ID: <10836950.1219370444356.JavaMail.root@elwamui-cypress.atl.sa.earthlink.net> (raw)

All,

Over the course of the last several months, I've been working on adding support to
the kernel for MTD devices that exceed 2GiB in size.  In my particular case I
have a need for 8GiB of NAND flash that appears as a single device.  I'm now
ready to submit my (first ever!) patch (please be kind :)  ).

Design Details:
The problem - The size field of struct mtd_info is only 32-bits, which limits
	the size of mtd devices to 2GiB (0x80000000).
The solution - The size of a device can be calculated buy multiplying the number
	of erase blocks by the erase block size.  I added a new field to struct
	mtd_info to hold the number of erase blocks and an inline function to
	determine the device size by returning mtd_info->size if it's non-zero
	or returning (mtd_info->num_eraseblocks * mtd_info->erasesize).

A couple of comments.  First and foremost, these patches don't completely change
the MTD layer.  Due to my in-experience outside of what I was focused on
(NAND/UBI/UBIFS/MTDCHAR) I felt it was best if I restricted my changes to what I
knew.  If the community feels I need to take these changes into the rest of the
MTD layer please advise.  Secondly, there were changes that I needed to make in
mtd-utils, but I again only focused on the UBI sub-set.  mtd-utils no longer builds
because of the changes (though the UBI tools still build).  But I really do NOT
feel qualified to make changes to the rest of mtd-utils as they're tools I don't
use and don't understand and I don't want to accidentaly break something I don't
understand.  The changes in mtd-utils are the same changes as in
.../include/linux/mtd/mtd.h and .../include/mtd/mtd-abi.h.  If anyone has a
suggestion as to how I should handle mtd-utils I would appreciate it.

Thanks again to everyone who's answered my endless stupid questions.

Bruce


             reply	other threads:[~2008-08-22  2:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22  2:00 Bruce Leonard [this message]
2008-08-22  8:35 ` [PATCH 0/2][MTD] Support for > 2GiB MTD devices Frans Meulenbroeks

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=10836950.1219370444356.JavaMail.root@elwamui-cypress.atl.sa.earthlink.net \
    --to=brucle@earthlink.net \
    --cc=linux-kernel@vger.kernel.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