[U-Boot-Users] Intel Flash CFI initialisation failure

Miroslaw Dach miroslaw.dach at psi.ch
Thu Sep 13 10:15:28 CEST 2007


Dear All,

	After some tests I have found out few things which caused the 
problem with my Flash:

1. The erase_region_size variable gets twice bigger number (ie. 131072 
instead of 65536) than it should:

File:        ./drivers/cfi_flash.c
function:     flash_get_size(ulong base, int banknum)

	erase_region_size =
			(tmp & 0xffff) ? ((tmp & 0xffff) * 256) : 128;


When I reduced the erase_region_size by 2 the u-boot initialization 
went to the successful end. Next What I did I have tried to read, write 
and erase memory/sectors. The Read/erase function worked fine but when 
writing to the memory I have got a time out:

---------------- u-boot output --------------------------------
=> flinfo

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 8 MB in 64 Sectors
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x17
  Erase timeout: 16384 ms, write timeout: 2 ms
  Buffer write timeout: 2 ms, buffer size: 32 bytes

=> cp.w 0x400000  FF860000 0x49
Copy to Flash... fwc addr ff860000 cmd 50 0050 16bit x 16 bit
fwc addr ff860000 cmd e8 00e8 16bit x 16 bit
flash_is_busy: 0
fwc addr ff860000 cmd f 000f 16bit x 16 bit
fwc addr ff860000 cmd d0 00d0 16bit x 16 bit
flash_is_busy: 1
long addr is at ff860000 info->portwidth = 2
addr[0] = 0x0
addr[1] = 0x80
addr[2] = 0x0
addr[3] = 0x80
addr[4] = 0x0
addr[5] = 0x80
addr[6] = 0x0
addr[7] = 0x80
Flash buffer write timeout at address ff860000 data 80808080
fwc addr ff860000 cmd ff 00ff 16bit x 16 bit
fwc addr ff860000 cmd ff 00ff 16bit x 16 bit
Timeout writing to Flash

-----------------------------------------------------------------------

I thought that maybe it is set wrongly the processor speed so I have set in 
the include/configs/ml403.h 
#define CONFIG_SYS_CLK_FREQ 100000000

since my PPC405 works with the frequency 100 MHZ
but unfortunately it did not help so I have modified in the:

File:        ./drivers/cfi_flash.c
function:    flash_status_check( ) 

tout *= 10;

The factor 10 was obtained after some experiments.
The time passage when booting u-boot is roughly speaking fine since the
count down from 10 - 0 sec. reflect this what I measure with normal watch 
so the timeout problem refers to something else? 

3. My third observation is that when I refer to the wrong memory location
(ie. md 0x2000000 which is beyond RAM or Flash) than u-boot crashes and I
get:

=> md 0x2000000
02000000:Bus Fault @ 0x01fe84b0, fixup 0x00000000
Machine check in kernel mode.
Caused by (from msr): regs 01fbc620 Data parity signal
NIP: 01FE84B0 XER: 20000000 LR: 01FE8480 REGS: 01fbc620 TRAP: 0200 DAR: 00000004
MSR: 00029000 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00

GPR00: 01FE8480 01FBC710 C01FC950 00000000 00000000 00000010 00000001 00000007 
GPR08: 00000001 40600004 00000000 01FBC4D6 01FBC4D8 30000000 02000F00 017DD000 

Is it somehow possible to restrict in u-boot memory regions which are valid 
for RAM and Flash and reject other regions.

Best Regards

Mirek





More information about the U-Boot mailing list