<div>hi,</div>
<div>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. </div>
<div> </div>
<div>It boots from flash on the board. I have successfully initialized clock, serial port (connect to RS232). The program can excute in flash</div>
<div>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.</div>
<div>The 3 lines aim to get flash device ID.</div>
<div> </div>
<div>addr[0x0555] = 0x00AA00AA;<br>addr[0x02AA] = 0x00550055;<br>addr[0x0555] = 0x00900090;</div>
<div> </div>
<div>I change this code to fit my board:</div>
<div>*(volatile unsigned short *) 0x02800aaa = (unsigned short) 0x00aa;</div>
<div>*(volatile unsigned short *) 0x02800554 = (unsigned short) 0x0055;</div>
<div>*(volatile unsigned short *) 0x02800aaa = (unsigned short) 0x0090;</div>
<div>unsigned short ID;</div>
<div>ID = *(unsigned short *) 0x02800000;</div>
<div>( address connect as follows: mpc a[11..30] ==>>flash a[19..0],</div>
<div>flash a19 ----mpc a11, flasha18 -----mpc a12 ,......</div>
<div>notice LSB of mpc is a[30] not a[31], for flash is word mode.</div>
<div>so the flash address "0x555, 0x2aa" are corresponding the system address "0xaaa, 0x554" , left shift by 1 bit.)</div>
<div> </div>
<div>those 3 lines code have been tested on vxworks' bootrom on this board.</div>
<div> </div>
<div>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);</div>
<div>But it can print string , likes printf("Read Device ID\n"). it seems just the second parameter cause the trouble.</div>
<div>Sadly,this kind of "printf" can be used several times , then it stops.</div>
<div>other kinds of function or instruction can be executed a little more, but stop finilly.</div>
<div> </div>
<div>I simply convert address to string ,then print. The result of ID is 0x0001, which is just the correct number.</div>
<div> </div>
<div>If I ignore the 3 line code above, the program runs ok except the initialization of flash.</div>
<div>I really cann't figure out where the problem is. Could anyone help me , or give me some suggest!</div>
<div> </div>
<div> </div>
<div> </div>
<div>Below is the configuration on my board:</div>
<div>oscillator 4MHz</div>
<div>DRAM: 8M </div>
<div>flash: AM29LV160DB (16 bit)</div>
<div>IMMR.ISB = 0x0220</div>
<div>BR0 = 0x02800801</div>
<div>OR0 = 0xffe00936</div>
<div>Cross Compiler: GNU gcc 4.0.2</div>
<div> </div>
<div>Result on hyper-terminal:</div>
<div>CPU: XPC850xxZTB at 64 MHz: 2 kB I-Cache 1 kB D-Cache<br>Board: ### No HW ID - assuming TQM8xxL<br>DRAM: 8 MB</div>
<div>Now running in RAM - U-Boot at: 007c1000<br>FLASH: <br>## Get flash bank 0 size @ 0x02800000<br>BR0 : 2800801<br>OR0 : ffe00936</div>
<div> </div>
<div> </div>
<div>
<div>Thanks!</div>
<div> Xuguang Li</div></div>