public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Non-contiguous flash with flashv2
@ 2008-12-04  6:18 Daniel Helgason
  2008-12-04 10:41 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Helgason @ 2008-12-04  6:18 UTC (permalink / raw)
  To: ecos-discuss

I'm having trouble seeing how flashv2 handles non-contiguous areas of
flash memory. I can see how it handles multiple flash drivers, each of
which can be managing flash in separate memory areas. But it looks like
the flash memory managed by a single flash driver must still be
contiguous.

Here is the problem. I have *two* flash areas that are controlled by
*one* flash-controller device. The flash areas are non-contiguous.

Take 1:

If I define just a single flash driver, then I can use three block_infos
to describe the areas:

  - block_info[0] - program flash
  - block_info[1] - empty space (1 big block covering the whole area)
  - block_info[2] - boot flash

If I do that, then I need to special-case read/erase/program functions
in the driver for the second block_info because that area will take a
bus-error exception if read/written. Also, I don't know the impact to
the other parts of eCos if I'm untruthful about the flash addresses. I
suspect that Redboot, at least, will think it's all valid flash.

Take 2:

If I define two flash drivers that share code, then each driver will
have a single block_info that covers just the valid area:

  Driver 1
  - block_info[0] - program flash
  Driver 2
  - block_info[0] - boot flash

If I do that, I'll run into problems related to the per-driver mutexes
because both drivers share the flash-controller. Also, the flash io code
"bulks up" quite a bit because it has to manage two drivers.

So, which is better, Take 1 or Take 2? Or is there another way?

How about a Take 3 that adds an offset/start field to the block_info
type? Then it would be easy to support non-contiguous flash within a
single driver. I suppose that would make mapping flash addresses to
devices and blocks complicated.

-- 
+---------------------------------------------
| Daniel Helgason <dhelgason@shaw.ca>


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2008-12-10  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-04  6:18 [ECOS] Non-contiguous flash with flashv2 Daniel Helgason
2008-12-04 10:41 ` Andrew Lunn
2008-12-09  0:41   ` Daniel Helgason
2008-12-10  6:10     ` Jonathan Larmour
2008-12-10 10:26     ` Bart Veer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).