[U-Boot-Users] Flash Initializing problem, porting u-boot-1.1.3 on mpc850

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

Hi Li,
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.
Why do you want to port such an old version od U-Boot? You will not get much support from this list, as development is only done on the current versions available from the git repositories.
Also when you switch to a current U-Boot, you will see that also the TQM850 board switched over to using the CFI driver that very likely also supports your flash out of the box.
So my suggestion is do not invest time in such an old version, but restart from current top of tree U-Boot.
Cheers Detlev
participants (2)
-
Detlev Zundel
-
li xuguang