public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board
@ 2006-11-23 13:42 Yotam Admon
  2006-11-27 22:44 ` Rui Sousa
  0 siblings, 1 reply; 6+ messages in thread
From: Yotam Admon @ 2006-11-23 13:42 UTC (permalink / raw)
  To: u-boot

Hi,
I use U-Boot (1.1.4) and try to work with AM29LV040B (AMD None CFI
Flash) in addition to known CFI flash devices (AMD, Intel, MXIC, SST).

Does anyone have a way to integrate the CFI deriver with none CFI
devices?

Thanks,
Yotam
 

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

* [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board
  2006-11-23 13:42 [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board Yotam Admon
@ 2006-11-27 22:44 ` Rui Sousa
  2006-11-28 11:41   ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Rui Sousa @ 2006-11-27 22:44 UTC (permalink / raw)
  To: u-boot

On Thursday 23 November 2006 14:42, Yotam Admon wrote:
> Hi,
> I use U-Boot (1.1.4) and try to work with AM29LV040B (AMD None CFI
> Flash) in addition to known CFI flash devices (AMD, Intel, MXIC, SST).
>
> Does anyone have a way to integrate the CFI deriver with none CFI
> devices?

Hi Yotam,

What I did in our local U-boot version was(*):

1. Add a cfi_ prefix to flash functions in drivers/cfi_flash.c:
flash_init --> cfi_flash_init
flash_erase --> cfi_flash_erase
write_buff--> cfi_write_buff
...

2. Change flash base address table, in drivers/cfi_flash.c also:
flash_info_t flash_info --> extern flash_info_t flash_info

3. Create in our board specific directory a flash.c file with all the flash 
interface functions and the declaration of flash_info:
flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
flash_init()
flash_erase()
write_buff()
...
4. From my flash_init() I call cfi_flash_init() first. This will change the 
flash_id for all CFI compatible flashes in the flash_info table.

5. For all other flash types I use my own flash driver(s).

6. flash_erase(), for example, then looks like this:
if (info->flash_id == FLASH_MAN_CFI)
                return cfi_flash_erase(info, s_first, s_last);
else
	/ * call my flash driver specific flash_erase */

> Thanks,
> Yotam

I hope the helps you,
Rui

*) I don't see a way for this to be merged into U-boot any time soon since it 
implies changes for all boards using the CFI driver.

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

* [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board
  2006-11-27 22:44 ` Rui Sousa
@ 2006-11-28 11:41   ` Stefan Roese
  2006-11-28 13:32     ` Rui Sousa
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stefan Roese @ 2006-11-28 11:41 UTC (permalink / raw)
  To: u-boot

Hi Rui,

On Monday 27 November 2006 23:44, Rui Sousa wrote:
> What I did in our local U-boot version was(*):
>
> 1. Add a cfi_ prefix to flash functions in drivers/cfi_flash.c:
> flash_init --> cfi_flash_init
> flash_erase --> cfi_flash_erase
> write_buff--> cfi_write_buff
> ...
>
> 2. Change flash base address table, in drivers/cfi_flash.c also:
> flash_info_t flash_info --> extern flash_info_t flash_info
>
> 3. Create in our board specific directory a flash.c file with all the flash
> interface functions and the declaration of flash_info:
> flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
> flash_init()
> flash_erase()
> write_buff()

Hmmm. When I understood Tolunay correctly (Tolunay, please correct me if I am 
wrong here), he _does_ want to use most of the CFI drivers functions like 
erasing and programming for those non CFI compatible FLASH's too. Most of 
those devices are kind of AMD compatible, so this should be possible with not 
too many changes.

If we don't use this code, then merging those devices into this driver doesn't 
make much sense to me anymore.

Best regards,
Stefan

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

* [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board
  2006-11-28 11:41   ` Stefan Roese
@ 2006-11-28 13:32     ` Rui Sousa
  2006-11-28 15:39     ` Andrew Dyer
  2006-11-28 17:06     ` Tolunay Orkun
  2 siblings, 0 replies; 6+ messages in thread
From: Rui Sousa @ 2006-11-28 13:32 UTC (permalink / raw)
  To: u-boot

On Tuesday 28 November 2006 12:41, Stefan Roese wrote:
> Hi Rui,

Hi,

> On Monday 27 November 2006 23:44, Rui Sousa wrote:
> > What I did in our local U-boot version was(*):
> >
...
> > flash_erase()
> > write_buff()
>
> Hmmm. When I understood Tolunay correctly (Tolunay, please correct me if I
> am wrong here), he _does_ want to use most of the CFI drivers functions
> like erasing and programming for those non CFI compatible FLASH's too.

Ah. Ok. I thought the main problem was the fact that when you enable the CFI 
flash driver you can no longer use your own flash drivers (because the 
function names conflict).

> Most 
> of those devices are kind of AMD compatible, so this should be possible
> with not too many changes.
>
> If we don't use this code, then merging those devices into this driver
> doesn't make much sense to me anymore.
>
> Best regards,
> Stefan

Rui

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

* [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board
  2006-11-28 11:41   ` Stefan Roese
  2006-11-28 13:32     ` Rui Sousa
@ 2006-11-28 15:39     ` Andrew Dyer
  2006-11-28 17:06     ` Tolunay Orkun
  2 siblings, 0 replies; 6+ messages in thread
From: Andrew Dyer @ 2006-11-28 15:39 UTC (permalink / raw)
  To: u-boot

On 11/28/06, Stefan Roese <sr@denx.de> wrote:
> Hmmm. When I understood Tolunay correctly (Tolunay, please correct me if I am
> wrong here), he _does_ want to use most of the CFI drivers functions like
> erasing and programming for those non CFI compatible FLASH's too. Most of
> those devices are kind of AMD compatible, so this should be possible with not
> too many changes.

It seems to me that for older non-CFI AMD devices, it shouldn't be too
hard to use the cfi driver, intercept execution in flash_detect_cfi()
or flash_get_size(), fill in the flash_info_t structure appropriately
for the device, and continue on with most of the code being none the
wiser about what happened.

-- 
Hardware, n.:
        The parts of a computer system that can be kicked.

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

* [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board
  2006-11-28 11:41   ` Stefan Roese
  2006-11-28 13:32     ` Rui Sousa
  2006-11-28 15:39     ` Andrew Dyer
@ 2006-11-28 17:06     ` Tolunay Orkun
  2 siblings, 0 replies; 6+ messages in thread
From: Tolunay Orkun @ 2006-11-28 17:06 UTC (permalink / raw)
  To: u-boot

Stefan Roese wrote:
> Hi Rui,
>
> On Monday 27 November 2006 23:44, Rui Sousa wrote:
>   
>> What I did in our local U-boot version was(*):
>>
>> 1. Add a cfi_ prefix to flash functions in drivers/cfi_flash.c:
>> flash_init --> cfi_flash_init
>> flash_erase --> cfi_flash_erase
>> write_buff--> cfi_write_buff
>> ...
>>
>> 2. Change flash base address table, in drivers/cfi_flash.c also:
>> flash_info_t flash_info --> extern flash_info_t flash_info
>>
>> 3. Create in our board specific directory a flash.c file with all the flash
>> interface functions and the declaration of flash_info:
>> flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
>> flash_init()
>> flash_erase()
>> write_buff()
>>     
>
> Hmmm. When I understood Tolunay correctly (Tolunay, please correct me if I am 
> wrong here), he _does_ want to use most of the CFI drivers functions like 
> erasing and programming for those non CFI compatible FLASH's too. Most of 
> those devices are kind of AMD compatible, so this should be possible with not 
> too many changes.
>   
Yes, that is the plan. I did not have time to work on it yet but I will 
send a patch this week.

Best regards,
Tolunay

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

end of thread, other threads:[~2006-11-28 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-23 13:42 [U-Boot-Users] Can U-boot support CFI and None CFI devices on the same board Yotam Admon
2006-11-27 22:44 ` Rui Sousa
2006-11-28 11:41   ` Stefan Roese
2006-11-28 13:32     ` Rui Sousa
2006-11-28 15:39     ` Andrew Dyer
2006-11-28 17:06     ` Tolunay Orkun

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