public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* MTD concat layer
@ 2002-03-08 16:08 Robert Kaiser
  2002-03-08 16:22 ` David Woodhouse
  0 siblings, 1 reply; 34+ messages in thread
From: Robert Kaiser @ 2002-03-08 16:08 UTC (permalink / raw)
  To: 'David Woodhouse '; +Cc: Jonas Holmberg, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

Hi David,

Here is the third cut of my MTD concat layer. The previous version had a bug 
in concat_erase() that I have been able to fix with the help of Jonas. It now 
works nice for him as well as for me.

Can this go into the CVS, please ?

Rob

----------------------------------------------------------------
Robert Kaiser                         email: rkaiser@sysgo.de
SYSGO RTS GmbH
Am Pfaffenstein 14                    phone: (49) 6136 9948-762
D-55270 Klein-Winternheim / Germany   fax:   (49) 6136 9948-10

[-- Attachment #2: patch-mtd-concat.gz --]
[-- Type: application/x-gzip, Size: 5898 bytes --]

[-- Attachment #3: patch-mtd-concat-part.gz --]
[-- Type: application/x-gzip, Size: 2949 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: MTD concat layer
@ 2002-02-14 11:14 Jonas Holmberg
  0 siblings, 0 replies; 34+ messages in thread
From: Jonas Holmberg @ 2002-02-14 11:14 UTC (permalink / raw)
  To: 'Robert Kaiser ', 'David Woodhouse '
  Cc: 'joakim.tjernlund@lumentis.se ',
	'linux-mtd@lists.infradead.org ', 'J?rn Engel '

>> You could hack up a map driver that appears to have the two CFI chips 
>> contiguously, and then the probe code would find them both and make a 
>> single MTD device from them -  but there was a reason why he wasn't
doing 
>> this. Perhaps the 'BIOS' bit is in fact the beginning of the second
chip, 
>> not actually a separate chip at all? I don't remember.
>
>No, the BIOS is in the middle of the chip's addressing space. All this
>_could_ conceivably be solved with a hacked-up map driver, but then
>again,
>one might as well do the partitioning stuff in a hacked-up map driver.
>The
>idea was to have this functionality available in a generic form, so it
>it is accessible as a service from the MTD core layer.

I started to work on a different solution; probe functions that could be called several times with the same map. This would also make it possible to mix CFI and JEDEC chips. And you could mix chips of different geometry. I did , however, caught a nasty cold and haven't been working on it for a week now. If you are interested in this solution I will continue working on it when I get well, otherwise I'll use your solution.

/Jonas

^ permalink raw reply	[flat|nested] 34+ messages in thread
* MTD concat layer
@ 2002-02-12 18:40 Robert Kaiser
  2002-02-13 11:00 ` Joakim Tjernlund
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Robert Kaiser @ 2002-02-12 18:40 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, J?rn Engel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 4813 bytes --]

Hi,

attached is my first version of the MTD "concatenation layer".
This basically allows to build virtual MTD devices by concatenating
existing ones, so it is -in a way- the opposite of partitioning.
I would like to add this to the MTD CVS and so I'm asking people
to have a look at it.

I see two possible uses for this:

1) Having flash filesystem volumes span multiple physical chips
   I have recently seen several people ask for this on the mailing list.

2) Allow re-ordering of blocks in flash chips.
   This is my personal reason for writing this code.  It requires
   some explanation:

   I have this cute DIL/NetPC module that -for technical reasons-
   has it's BIOS right in the middle of the 2MB flash. The mapping
   driver creates partitions reflecting this hardware-imposed map.
   However, this map is very unfortunate in many cases. Specifically,
   it would be nice if one could move the BIOS block out of the way
   and treat the flash portions below and above that BIOS block as
   one contiguous device that can then be partitioned arbitrarily.
   The concat layer allows just that: I can concatenate the physical
   partitions into a single device, specifying the sequence such
   that the BIOS block appears at the end and then re-partition
   that new (virtual) device as to my heart's desire :-)


Q: Why not do this in the mtdpart layer ?

David suggested at some point that this should be done in the
partitioning layer:

dwmw2 said:
> It doesn't need to be an extra layer. Splitting a single device into 
> multiple 'partitions' and building a big 'partition' from multiple devices 
> are just two cases of the same thing - munging the offsets and passing the 
> request off to a 'master' device. 

I tried to hack up the mtdpart.c accordingly, but came to the conclusion
that it is impossible to implement this without causing significant
overhead for parties that use only partitioning or only concatenating,
so it seemed cleaner to do it in a seperate layer. Moreover, the current
partitionining layer is scheduled to be replaced in the near future by
Jörn Engel's code, so I thought it best to stay clear of that layer of
code.

There are two patches attached to this mail:

1) patch-mtd-concat

This contains the actual concat layer. It also modifies the sc520cdp.c
mapping driver to demonstrate how use it by concatenating
the sc520cdp's two flash banks into one MTD device.

The concat code is in drivers/mtd/mtdconcat.c
This code defines two extenal functions:

-mtd_concat_create() to build a virtual MTD device by concatenating
 existing MTD devices.

-mtd_concat_destroy() to destroy an MTD object obtained from
 mtd_concat_create()

There is a header file (incluce/linux/mtd/concat.h) defining the
prototypes of these functions.

2) patch-mtd-concat-part

This patch modifies the DIL/NetPC mapping driver to re-order flash
blocks as described above. It also modifies the partitioning layer
(which is why I've made this a seperate patch): The current partitioning
layer has the habit of always registering the partitions as MTD devices
and not giving the caller access to the device objects it creates. I've
changed this (in a backward compatible way) because I do not want the
intermediate layers (i.e. the physical partitioning) to appear
as MTD devices. (I believe JÖrn's new partitioning code deals with this
too, though probably in a different way.)

Shortcomings I'm aware of so far (suggestions welcome):

* Currently, all sub-devices are expected to be of the same type.
  It might be reasonable to allow concatenating certain combinations
  of different types, where the super device would be assigned a
  "least common denominator" type (i.e. if combining ROMs with flashes,
  would yield a ROM, etc.).

* I'm not sure how to assign flags to the concatenated device. Right now,
  all but the writeablility flag have to be the same.

* Currently, all sub-devices are expected to have the same OOB and
  ECC info. I must admit that I don't have enough clue about these
  things to tell wether it might make sense to concatenate devices
  with differring OOB and/or ECC info. So by default, I'm not allowing it.

* The readv()/writev() functions are not implemented. The reason is that
  so far I could not conceive of a way to do this that would not result
  in terribly messy code. Also, it is my impression that these functions
  are not very important anyway (I might be wrong, here..).


Thanks for any suggestions

Rob

----------------------------------------------------------------
Robert Kaiser                          email: rkaiser@sysgo.de
SYSGO RTS GmbH
Am Pfaffenstein 14
D-55270 Klein-Winternheim / Germany    fax:   (49) 6136 9948-10

[-- Attachment #2: Type: APPLICATION/x-gunzip, Size: 4752 bytes --]

[-- Attachment #3: Type: APPLICATION/x-gunzip, Size: 3034 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2002-03-08 16:11 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-08 16:08 MTD concat layer Robert Kaiser
2002-03-08 16:22 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2002-02-14 11:14 Jonas Holmberg
2002-02-12 18:40 Robert Kaiser
2002-02-13 11:00 ` Joakim Tjernlund
2002-02-13 11:04   ` David Woodhouse
2002-02-13 11:34     ` Robert Kaiser
2002-02-13 11:37     ` Robert Schwebel
2002-02-13 13:33       ` Daniel Engström
2002-02-13 14:01         ` Eric W. Biederman
2002-02-15 15:58 ` David Woodhouse
2002-02-15 17:43   ` Robert Kaiser
2002-02-15 18:02     ` David Woodhouse
2002-02-15 18:40       ` Jörn Engel
2002-02-16 10:33         ` Robert Kaiser
2002-02-16 10:43       ` Robert Kaiser
2002-02-16 10:43         ` David Woodhouse
2002-02-16 11:03           ` Robert Kaiser
2002-02-16 11:08             ` David Woodhouse
2002-02-16 14:56             ` Brian J. Fox
2002-02-17 10:36               ` Robert Kaiser
2002-02-17 19:05                 ` Brian J. Fox
2002-02-18  8:48                   ` Robert Kaiser
2002-02-18  9:05                     ` David Woodhouse
2002-02-18 15:53                       ` Brian J. Fox
2002-02-18 17:01                         ` Robert Kaiser
2002-02-18 17:02                           ` David Woodhouse
2002-02-18 15:46                     ` Brian J. Fox
2002-02-20 14:28 ` Jonas Holmberg
2002-02-20 15:35   ` Robert Kaiser
2002-02-21 14:51     ` Jonas Holmberg
2002-02-26 11:32       ` Robert Kaiser
2002-03-06 13:37         ` Jonas Holmberg
2002-03-06 16:02           ` Robert Kaiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox