ChorusOS 5.0 Board Support Package Developer's Guide

Power-up Program Implementation

This section describes the power-up initialization program, including practical examples.

Example 4-1 is an example of a power-up initialization program for the EST SBC8260 board. The source is provided in source_dir/nucleus/bsp/powerpc/sbc8260/src/boot/trampoline.s.


Example 4-1 Power-up Program

        .text

           .globl  reset

reset:
        /*
         * Put power up initialization code here
         */   
        
        /*
         * Jump to bootconf entry point
         */
        xor        r3, r3, r3
        addis      r5, r0, entryPoint@ha        /*                      */
        addi       r5, r5, entryPoint@l         /*                      */
        lwz        r5, 0(r5)                    /* r5 = entryPoint      */
        mtlr       r5                           /*                      */
        blr                                     /* (*entryPoint)();     */

        .globl  __mkimage__label__REF_start
__mkimage__label__REF_start:
entryPoint:
        .long    0                              /* bootconf entry point */

At image generation the mkimage utility binds the bootconf program entry point to the power-up initialization program, patching the contents of the location labelled __mkimage__label__REF_start with the address of the entry point location labelled by __mkimage__label__start, as described in "bconf_main.c Source File".

This power-up program forces the board-specific (second) argument of the bootconf program to 0, using the argument passing convention described in "bootconf Binary".