Slowly but steadily I'm making some progress on this project. First of all I've enhanced RTEMS build machinery to support building Efika BSP from the gen5200 BSP, so now --enable-rtemsbsp=efika is working. After this I started working on tweaking gen5200 to add some basic support for SmartFirmware and to be honest I'm going the most easiest route and hardwiring a lot of important values directly in the code just to have a port in prototype stage up'n'running. Anyway, I was surprised that well _nothing_ was working at all. :-) Next step was obvious: order few MPC5200 related books from nice Freescale support and wait till the pack arrive and start harder study of this PPC implementation. During that time I've made some experiments with as simple as possible assembler based tests and they were working nicely. So few weeks ago I've jumped again to the RTEMS and tried hard to find out what's going wrong and why RTEMS binary is not working at all, while it provides _exactly_ the same instructions at the beginning as my testing debugging example which is working as expected. For your information since Efika lacks JTAG support, I'm using "debug to the memory" method which is described
here in a post by Aymeric Vincent.
And I found the reason. It seems Efika's SFW really refuses to start my RTEMS binary, it seems to be kind of confused by it when it contains following mpc5200 region declaration in its linkcmd file:
MEMORY
{
[...]
mpc5200_regs : org = 0xF0000000, l = 24K
}
SECTIONS
{
[...]
mpc5200_regs :
{
MBAR = .;
mpc5200 = .;
_mpc5200 = .;
. += (0x6000);
} > mpc5200_regs
the purpose of this is to have C struct laid over MPC5200 internal register map. When I remove this and tweak the sources to avoid unresolved symbol errors, I get to the stage where first instructions from the binary are really running well. Perhaps this is just some SFW bug, since the same is running probably well on other MPC5200 boards supported by RTEMS.