public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Flash Initializing problem, porting u-boot-1.1.3 on mpc850
@ 2008-06-29 12:35 li xuguang
  2008-07-02 18:09 ` Detlev Zundel
  0 siblings, 1 reply; 2+ messages in thread
From: li xuguang @ 2008-06-29 12:35 UTC (permalink / raw)
  To: u-boot

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 

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

* [U-Boot-Users] Flash Initializing problem, porting u-boot-1.1.3 on mpc850
  2008-06-29 12:35 [U-Boot-Users] Flash Initializing problem, porting u-boot-1.1.3 on mpc850 li xuguang
@ 2008-07-02 18:09 ` Detlev Zundel
  0 siblings, 0 replies; 2+ messages in thread
From: Detlev Zundel @ 2008-07-02 18:09 UTC (permalink / raw)
  To: u-boot

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

-- 
An elephant is a mouse with an operating system.
                                        -- Donald Knuth
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

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

end of thread, other threads:[~2008-07-02 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-29 12:35 [U-Boot-Users] Flash Initializing problem, porting u-boot-1.1.3 on mpc850 li xuguang
2008-07-02 18:09 ` Detlev Zundel

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