
Second problem solved, seems cpu realy behave strangely, I placed ram initialization at the very begining of bootloader and now it works. also there was some incorect timing but it is not likely to cause problem, (becase fixing that did not helped) ram just must be initialized before any other peripherials (dont know why but now it works ok) at first the first thing initilalized was UART.
first problem with bootloader: ... Seems everybody else is executing this code without problems
Indeed. Are you sure your CPU can read the flash contents without problems?
The reson of this one is till unknown, but it does not matter, anyway.
I also found, that some time ago this instruction also was removed on ppcboot so someone had this problem too. http://cvs.tuxbox.org/cgi-bin/viewcvs.cgi/tuxbox/boot/ppcboot/ppc4xx/Attic/s...
#if 1 /* test-only */ addi r4,r0,0x1000 // set ME bit (Machine Exceptions) oris r4,r4,0x0002 // set CE bit (Critical Exceptions) mtmsr r4 // change MSR #else /* problems in rom2ram (see test-only in rom2ram!!!) */ addi r4,r0,0x0000 // dont set (!!!) ME bit (Machine Exceptions) oris r4,r4,0x0002 // set CE bit (Critical Exceptions) mtmsr r4 // change MSR #endif as you see it is same instruction.
It would be interesting to know why this happens.