CFI MTD on 5282

View: New views
4 Messages — Rating Filter:   Alert me  

CFI MTD on 5282

by Allon Stern :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've got a custom M5282. We have a memory-mapped MTD.

Several fun problems here...

#1: How do I add this device to the baseline 5282 config? It'd be  
handy to use CFI, as it is a CFI compliant part
This is my big problem at the moment. I can find examples that seem  
to deal with SPI, and the guidance I'm getting from a co-worker who  
added this part to an ARM platform is being of minimal help.....I can  
find references which are pretty aged. I'm trying to do this on a 2.6  
kernel (using the latest baseline. Thanks, Greg!)


#2: this device is a 64MB part. Fun, since we don't have quite the  
number of address lines we need. The hardware designer ran CS2 and  
CS3 to
the high order address lines. (A24/A25)

I've decided to configure CS2 and CS3 as GPIOs and drive it as a  
banked MTD. Is this possible?
The chip appears as two stacked chips with a common chip select, and  
the A25 selects the die.
I can bank them on the high order address line; I MIGHT be able to  
get a revision which ANDs the CS0 going to the chip with CS2 going to  
A24 on the flash, which would let me set up two chip selects to get a  
contiguous memory space for it;
Anyone know if CFI will get all munged up if the top and bottom  
halves of the memory are reversed? That is, if the base address  
points to the top half of the chip, and the middle address points to  
the bottom?

And without that revision, is it possible to do a banked MTD with the  
bank selecting two halves of a single strataflash part? (I'd have  
four banks, each one half of a die, and two dies)

(it's a Numonyx P30 strataflash, FWIW)


-
allon


---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.


Re: CFI MTD on 5282

by Allon Stern :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Aug 18, 2008, at 1:54 PM, Allon Stern wrote:
>
> #1: How do I add this device to the baseline 5282 config? It'd be  
> handy to use CFI, as it is a CFI compliant part

And of course I find the answer right after sending an email. The  
other question still stands.

And whose bright idea was it to put platform specific MTD maps out in  
a non-platform-specific area? How annoying.

*sigh* linux.
-
allon


---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.


Re: CFI MTD on 5282

by Greg Ungerer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Allon,

Allon Stern wrote:

> I've got a custom M5282. We have a memory-mapped MTD.
>
> Several fun problems here...
>
> #1: How do I add this device to the baseline 5282 config? It'd be handy
> to use CFI, as it is a CFI compliant part
> This is my big problem at the moment. I can find examples that seem to
> deal with SPI, and the guidance I'm getting from a co-worker who added
> this part to an ARM platform is being of minimal help.....I can find
> references which are pretty aged. I'm trying to do this on a 2.6 kernel
> (using the latest baseline. Thanks, Greg!)
>
>
> #2: this device is a 64MB part. Fun, since we don't have quite the
> number of address lines we need. The hardware designer ran CS2 and CS3 to
> the high order address lines. (A24/A25)
>
> I've decided to configure CS2 and CS3 as GPIOs and drive it as a banked
> MTD. Is this possible?
> The chip appears as two stacked chips with a common chip select, and the
> A25 selects the die.
> I can bank them on the high order address line; I MIGHT be able to get a
> revision which ANDs the CS0 going to the chip with CS2 going to A24 on
> the flash, which would let me set up two chip selects to get a
> contiguous memory space for it;
> Anyone know if CFI will get all munged up if the top and bottom halves
> of the memory are reversed? That is, if the base address points to the
> top half of the chip, and the middle address points to the bottom?
>
> And without that revision, is it possible to do a banked MTD with the
> bank selecting two halves of a single strataflash part? (I'd have four
> banks, each one half of a die, and two dies)
>
> (it's a Numonyx P30 strataflash, FWIW)

You can do pretty much any weird translation you like in your own
MTD map driver. You just need to write access functions (the
read/write/... functions in struct map_info) that do appropriate
GPIO twidling and address translation on the supplied linear address,
and return appropriate data. Once they work you can do a cfi_probe
and it should work. (The bank switching is hidden in the accessor
functions).

Or am I mis-understanding what you want to do?

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg@...
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.


Re: CFI MTD on 5282

by Allon Stern :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Aug 19, 2008, at 1:56 AM, Greg Ungerer wrote:

>
> You can do pretty much any weird translation you like in your own
> MTD map driver. You just need to write access functions (the
> read/write/... functions in struct map_info) that do appropriate
> GPIO twidling and address translation on the supplied linear address,
> and return appropriate data. Once they work you can do a cfi_probe
> and it should work. (The bank switching is hidden in the accessor
> functions).
>
> Or am I mis-understanding what you want to do?
>
> Regards
> Greg

No, no misunderstanding. I'm learning more as I go. This sounds great.
Thanks!

-
allon


---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.