[U-Boot-Users] Flash Initializing problem, porting u-boot-1.1.3 on mpc850
li xuguang
canxglee at gmail.com
Sun Jun 29 14:35:46 CEST 2008
hi,
I am try to port u-boot-1.1.3 on a board with the processor MPC850. And i
try to change the board of TQM850.
It boots from flash on the board. I have successfully initialized clock,
serial port (connect to RS232). The program can excute in flash
and relocate to ram. But I got trouble on board/tqm8xx/flash.c
"flash_init()". The problem is finially located get_flash_size(),
line 340-342.
The 3 lines aim to get flash device ID.
addr[0x0555] = 0x00AA00AA;
addr[0x02AA] = 0x00550055;
addr[0x0555] = 0x00900090;
I change this code to fit my board:
*(volatile unsigned short *) 0x02800aaa = (unsigned short) 0x00aa;
*(volatile unsigned short *) 0x02800554 = (unsigned short) 0x0055;
*(volatile unsigned short *) 0x02800aaa = (unsigned short) 0x0090;
unsigned short ID;
ID = *(unsigned short *) 0x02800000;
( address connect as follows: mpc a[11..30] ==>>flash a[19..0],
flash a19 ----mpc a11, flasha18 -----mpc a12 ,......
notice LSB of mpc is a[30] not a[31], for flash is word mode.
so the flash address "0x555, 0x2aa" are corresponding the system address
"0xaaa, 0x554" , left shift by 1 bit.)
those 3 lines code have been tested on vxworks' bootrom on this board.
Now , my trouble is : I cannot use "printf" to print number after executing
the 3 line codes, like printf("Device ID is: %x\n",*(unsigned short *)
0x2800000);
But it can print string , likes printf("Read Device ID\n"). it seems just
the second parameter cause the trouble.
Sadly,this kind of "printf" can be used several times , then it stops.
other kinds of function or instruction can be executed a little more, but
stop finilly.
I simply convert address to string ,then print. The result of ID is 0x0001,
which is just the correct number.
If I ignore the 3 line code above, the program runs ok except the
initialization of flash.
I really cann't figure out where the problem is. Could anyone help me ,
or give me some suggest!
Below is the configuration on my board:
oscillator 4MHz
DRAM: 8M
flash: AM29LV160DB (16 bit)
IMMR.ISB = 0x0220
BR0 = 0x02800801
OR0 = 0xffe00936
Cross Compiler: GNU gcc 4.0.2
Result on hyper-terminal:
CPU: XPC850xxZTB at 64 MHz: 2 kB I-Cache 1 kB D-Cache
Board: ### No HW ID - assuming TQM8xxL
DRAM: 8 MB
Now running in RAM - U-Boot at: 007c1000
FLASH:
## Get flash bank 0 size @ 0x02800000
BR0 : 2800801
OR0 : ffe00936
Thanks!
Xuguang Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080629/39ef4267/attachment.htm
More information about the U-Boot
mailing list