* bank switching
@ 2007-10-29 16:14 M8 (Servaes Joordens)
2007-10-30 12:57 ` David Woodhouse
0 siblings, 1 reply; 3+ messages in thread
From: M8 (Servaes Joordens) @ 2007-10-29 16:14 UTC (permalink / raw)
To: linux-mtd
hello linux mtd-guys,
I use the blackfin embedded uClinux environment. I want to change a
flash chip-driver to support all four memory banks which are available.
Right now, I have a driver which supports 1 memory bank of 2MB. I want
to be able to use the other three memory banks also 2-4Mb, 4-6MB and 6-8MB.
Memory bank selection is done by using general io pf4 and pf5. For
instance: when pf4 is enabled and pf5 is disabled I am writing in the
region 2-4MB.
What would be the correct way to change the chip driver? Do you have a
template or tutorial on bank switching?
The driver I want to change is: cfi_cmdset_0001.c
I hope someone can help me.
regards,
Servaes Joordens
--
Servaes Joordens
-------------------------------------------
M8
Tappersweg 29
2031ET Haarlem
The Netherlands
Tel: +31 23 5311122
Mob: +31 6 51183379
Fax: +31 23 5322388
VAT-ID: nl-813029090B01
kvk: 34131430 Haarlem
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: bank switching
2007-10-29 16:14 bank switching M8 (Servaes Joordens)
@ 2007-10-30 12:57 ` David Woodhouse
2007-11-02 9:30 ` M8 (Servaes Joordens)
0 siblings, 1 reply; 3+ messages in thread
From: David Woodhouse @ 2007-10-30 12:57 UTC (permalink / raw)
To: M8 (Servaes Joordens); +Cc: linux-mtd
On Mon, 2007-10-29 at 17:14 +0100, M8 (Servaes Joordens) wrote:
> I use the blackfin embedded uClinux environment. I want to change a
> flash chip-driver to support all four memory banks which are available.
> Right now, I have a driver which supports 1 memory bank of 2MB. I want
> to be able to use the other three memory banks also 2-4Mb, 4-6MB and 6-8MB.
>
> Memory bank selection is done by using general io pf4 and pf5. For
> instance: when pf4 is enabled and pf5 is disabled I am writing in the
> region 2-4MB.
>
> What would be the correct way to change the chip driver? Do you have a
> template or tutorial on bank switching?
>
> The driver I want to change is: cfi_cmdset_0001.c
No, that's the "chip driver". What you need to provide is a "map driver"
which enables physical access (read/write cycles) to the flash device in
question.
See the MTD_COMPLEX_MAPPINGS config option, which turns simple things
like 'read word' and 'write word' into out-of-line function calls in
your map driver. And see the map drivers which do this already, like
maps/sbc_gxx.c
--
dwmw2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: bank switching
2007-10-30 12:57 ` David Woodhouse
@ 2007-11-02 9:30 ` M8 (Servaes Joordens)
0 siblings, 0 replies; 3+ messages in thread
From: M8 (Servaes Joordens) @ 2007-11-02 9:30 UTC (permalink / raw)
To: David Woodhouse, mtd-forum
David Woodhouse wrote:
> On Mon, 2007-10-29 at 17:14 +0100, M8 (Servaes Joordens) wrote:
>
>> I use the blackfin embedded uClinux environment. I want to change a
>> flash chip-driver to support all four memory banks which are available.
>> Right now, I have a driver which supports 1 memory bank of 2MB. I want
>> to be able to use the other three memory banks also 2-4Mb, 4-6MB and 6-8MB.
>>
>> Memory bank selection is done by using general io pf4 and pf5. For
>> instance: when pf4 is enabled and pf5 is disabled I am writing in the
>> region 2-4MB.
>>
>> What would be the correct way to change the chip driver? Do you have a
>> template or tutorial on bank switching?
>>
>> The driver I want to change is: cfi_cmdset_0001.c
>>
>
> No, that's the "chip driver". What you need to provide is a "map driver"
> which enables physical access (read/write cycles) to the flash device in
> question.
>
> See the MTD_COMPLEX_MAPPINGS config option, which turns simple things
> like 'read word' and 'write word' into out-of-line function calls in
> your map driver. And see the map drivers which do this already, like
> maps/sbc_gxx.c
>
>
Now I enabled the MTD_COMPLEX_MAPPINGS. I changed the code in
map_funcs.c for the bank switching, but I get a problem with my ext2
partition in RAM. The RAM memory has another memory mapping (of course).
In what file should I make the changes?
I use the following files:
- mtd/cmdlinepart.c
- mtd/chips/cfi_probe.c
- mtd/chips/cfi_cmdset_0001.c
- mtd/maps/uclinux.c (for the root fs in RAM)
- mtd/maps/physmap.c (for the flash_memory)
- mtd/maps/map_funcs.c
My idea is:
- I change the call to simple_map_init(xxx) in physmap.c to
my_simple_map_init(xxx)
- I add the bank-switching routines in physmap.c and link them via
my_simple_map_init(xxx)
Is this the correct way to do it?
--
Servaes Joordens
-------------------------------------------
M8
Tappersweg 29
2031ET Haarlem
The Netherlands
Tel: +31 23 5311122
Mob: +31 6 51183379
Fax: +31 23 5322388
VAT-ID: nl-813029090B01
kvk: 34131430 Haarlem
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-02 9:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 16:14 bank switching M8 (Servaes Joordens)
2007-10-30 12:57 ` David Woodhouse
2007-11-02 9:30 ` M8 (Servaes Joordens)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox