[U-Boot] [MCF5445x] board-specific SDRAM setup in assembler - how to do it correctly?
Wolfgang Wegner
wolfgang at leila.ping.de
Thu Jan 21 18:37:35 CET 2010
Hi list,
I am trying to cleanly integrate a new coldfire MCF5445x-based board
into U-Boot. The problem I have is:
- the board is booted from serial flash, meaning that SDRAM setup has
to be done in assembler from a small pre-loader
- the existing code for this already has some #ifdefs for handling
different evaluation boards
- I would like to be able to switch between 2 or 3 board assembly
options requiring different memory setup, possibly by reading
GPIOs used as strap pins.
The existing code is in cpu/mcf5445x/start.S. My idea would be to
make the actual SDRAM init (ll. 190-284) conditional:
#if defined(BOARD_ASM_SDRAM_INIT)
BOARD_ASM_SDRAM_INIT
#else
[ll.190-284]
#endif
BOARD_SDRAM_INIT could be #defined in our board configuration header.
Like this the global code would not be cluttered with #ifdefs, but
some parts of course would be duplicated.
I see no straight-forward way to set the part and board specific
register values in a generic manner if the actual values shall also
be depending on board-specific GPIO pins.
Is there any objection against such an implementation, or any other
example how this could be done in a better way?
Regards,
Wolfgang
More information about the U-Boot
mailing list