linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel
@ 2006-02-07  3:33 David Antliff
  2006-02-07 10:52 ` Josh Boyer
  0 siblings, 1 reply; 5+ messages in thread
From: David Antliff @ 2006-02-07  3:33 UTC (permalink / raw)
  To: linuxppc-embedded

Hello,


Just to be clear, this email is related to work that I do for a
commercial enterprise, however I am writing on behalf of myself.


I am working on an MPC852 embedded platform based on the Denx
Linux-2.4.4 port.

We have an existing device with a fixed-flash (AMD-type) conforming to
CFI (Common Flash Interface) version 1.2. Linux-2.4.4 supports this
device when used by the Memory Tech Device Driver (MTD). This device has
a single region ('plane'?) or at least constant geometry across the
device. MTD in 2.4.4 has no problems dividing this up into a bunch of
block devices (partitions for read-only filesystems).

A newer version has a different flash chip - an Intel P30 flash with
multiple regions - it has two types of geometries as it is configured
for 'boot' operation. It also conforms to CFI version 1.4. Unfortunately
the Linux-2.4.4 MTD driver rejects this as unsupported based on CFI
version and hard-coding it in "kinda" works - the partition devices are
readable but the driver complains bitterly about non-alignment with
erase blocks. I suspect the driver is picking up parameters from the
first region (which covers the first set of blocks) and trying to use
this across the device. One thing I don't understand yet - as the first
region uses block sizes that are an integer division of those in the
second region I'm not sure why the boundaries don't align when I am
using the 2nd-region block size to define the partition boundaries.


What I am looking for is some advice please - what do you think is the
best course of action in this situation? 

There will be others but so far I am considering:

1. back-port the CFI code from a newer 2.4 kernel to support CFI v1.4.
 - does anybody know the state of MTD in later versions? What would be a
good version to source from?

2. integrate code found here and try and understand how it works:
http://lists.infradead.org/pipermail/linux-mtd/2001-November/003645.html

3. unfortunately upgrading the entire kernel is not an option at this
stage, unless absolutely necessary.


What would you suggest? Yes, I am happy for a 'quick fix' but if there
isn't one or it's too risky I am willing to invest the time in doing it
right.


Thank you,

David Antliff
Stratex Networks Ltd.
New Zealand

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

* Re: Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel
  2006-02-07  3:33 Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel David Antliff
@ 2006-02-07 10:52 ` Josh Boyer
  2006-02-07 21:04   ` Wolfgang Denk
  2006-02-09 11:04   ` David Woodhouse
  0 siblings, 2 replies; 5+ messages in thread
From: Josh Boyer @ 2006-02-07 10:52 UTC (permalink / raw)
  To: David Antliff; +Cc: linuxppc-embedded

On Tue, 2006-02-07 at 16:33 +1300, David Antliff wrote:
> 
> 
> I am working on an MPC852 embedded platform based on the Denx
> Linux-2.4.4 port.

To note, 2.4.4 is ancient.  And this whole question would be better
asked on the MTD mailing list.

> 
> We have an existing device with a fixed-flash (AMD-type) conforming to
> CFI (Common Flash Interface) version 1.2. Linux-2.4.4 supports this
> device when used by the Memory Tech Device Driver (MTD). This device has
> a single region ('plane'?) or at least constant geometry across the
> device. MTD in 2.4.4 has no problems dividing this up into a bunch of
> block devices (partitions for read-only filesystems).

Yep.

> 
> A newer version has a different flash chip - an Intel P30 flash with
> multiple regions - it has two types of geometries as it is configured
> for 'boot' operation. It also conforms to CFI version 1.4. Unfortunately
> the Linux-2.4.4 MTD driver rejects this as unsupported based on CFI
> version and hard-coding it in "kinda" works - the partition devices are
> readable but the driver complains bitterly about non-alignment with
> erase blocks. I suspect the driver is picking up parameters from the
> first region (which covers the first set of blocks) and trying to use
> this across the device. One thing I don't understand yet - as the first
> region uses block sizes that are an integer division of those in the
> second region I'm not sure why the boundaries don't align when I am
> using the 2nd-region block size to define the partition boundaries.

P30 support was just recently added to the 2.6 kernel.

> 
> 
> What I am looking for is some advice please - what do you think is the
> best course of action in this situation? 
> 
> There will be others but so far I am considering:
> 
> 1. back-port the CFI code from a newer 2.4 kernel to support CFI v1.4.
>  - does anybody know the state of MTD in later versions? What would be a
> good version to source from?

There is no support for CFI 1.4 in any 2.4 kernel.  You'd have to
backport from 2.6

> 
> 2. integrate code found here and try and understand how it works:
> http://lists.infradead.org/pipermail/linux-mtd/2001-November/003645.html

That won't solve all of your problems.

> 
> 
> What would you suggest? Yes, I am happy for a 'quick fix' but if there
> isn't one or it's too risky I am willing to invest the time in doing it
> right.

'quick fix' is to pull the changes from cfi_cmdset_0001.c in MTD CVS
back into your kernel.  But I'm not sure how quick that will be given
that your kernel is very very old.

josh

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

* Re: Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel
  2006-02-07 10:52 ` Josh Boyer
@ 2006-02-07 21:04   ` Wolfgang Denk
  2006-02-07 22:46     ` David Antliff
  2006-02-09 11:04   ` David Woodhouse
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2006-02-07 21:04 UTC (permalink / raw)
  To: Josh Boyer; +Cc: David Antliff, linuxppc-embedded

In message <1139309578.32218.7.camel@yoda.jdub.homelinux.org> you wrote:
>
> > What would you suggest? Yes, I am happy for a 'quick fix' but if there
> > isn't one or it's too risky I am willing to invest the time in doing it
> > right.
> 
> 'quick fix' is to pull the changes from cfi_cmdset_0001.c in MTD CVS
> back into your kernel.  But I'm not sure how quick that will be given
> that your kernel is very very old.

It's not quick at all, and the  ancient  2.4.4  MTD  code  has  other
problems  at  all.  Swithing to a newer kernel version is very likely
less trouble.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If you believe that feeling bad or worrying long enough will change a
past or future event, then you are residing on another planet with  a
different reality system.

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

* Re: Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel
  2006-02-07 21:04   ` Wolfgang Denk
@ 2006-02-07 22:46     ` David Antliff
  0 siblings, 0 replies; 5+ messages in thread
From: David Antliff @ 2006-02-07 22:46 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-embedded

On Tue, 2006-02-07 at 22:04 +0100, Wolfgang Denk wrote:
> In message <1139309578.32218.7.camel@yoda.jdub.homelinux.org> you wrote:
> >
> > > What would you suggest? Yes, I am happy for a 'quick fix' but if there
> > > isn't one or it's too risky I am willing to invest the time in doing it
> > > right.
> > 
> > 'quick fix' is to pull the changes from cfi_cmdset_0001.c in MTD CVS
> > back into your kernel.  But I'm not sure how quick that will be given
> > that your kernel is very very old.
> 
> It's not quick at all, and the  ancient  2.4.4  MTD  code  has  other
> problems  at  all.  Swithing to a newer kernel version is very likely
> less trouble.

Josh & Wolfgang, I appreciate your replies - thank you. 

FYI, we have decided to investigate writing a simple block device driver
for this device to get our development back on track with an eventual
goal of upgrading the kernel when time and resources permit. 

MTD is not crucial to our project, it just made a previous task easier
and this current one harder! :)

Thanks again,

David Antliff

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

* Re: Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel
  2006-02-07 10:52 ` Josh Boyer
  2006-02-07 21:04   ` Wolfgang Denk
@ 2006-02-09 11:04   ` David Woodhouse
  1 sibling, 0 replies; 5+ messages in thread
From: David Woodhouse @ 2006-02-09 11:04 UTC (permalink / raw)
  To: Josh Boyer; +Cc: David Antliff, linuxppc-embedded

On Tue, 2006-02-07 at 05:52 -0500, Josh Boyer wrote:
> To note, 2.4.4 is ancient.  And this whole question would be better
> asked on the MTD mailing list.

No, really it wouldn't. Don't bother asking about 2.4 on the MTD list.

-- 
dwmw2

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

end of thread, other threads:[~2006-02-09 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07  3:33 Common Flash Interface v1.4 and MTD support in Linux-2.4.4 kernel David Antliff
2006-02-07 10:52 ` Josh Boyer
2006-02-07 21:04   ` Wolfgang Denk
2006-02-07 22:46     ` David Antliff
2006-02-09 11:04   ` David Woodhouse

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 NNTP newsgroup(s).