/* * bsp_start * * This routine does the bulk of the system initialization. */ void bsp_start( void ) { rtems_status_code sc = RTEMS_SUCCESSFUL; ppc_cpu_id_t myCpu; ppc_cpu_revision_t myCpuRevision; /* Get the UART clock initialized first in case we call printk */ InitUARTClock(); Init_FPGA(); EarlyUARTInit(115200); /* * Get CPU identification dynamically. Note that the get_ppc_cpu_type() * function store the result in global variables * so that it can be used later... */ myCpu = get_ppc_cpu_type(); myCpuRevision = get_ppc_cpu_revision(); /* * initialize the device driver parameters */ /* Set globals visible to clock.c */ /* timebase register ticks/microsecond = CPU Clk in MHz */ bsp_clicks_per_usec = 400; bsp_timer_internal_clock = TRUE; bsp_timer_average_overhead = 2; bsp_timer_least_valid = 3; /* * Initialize default raw exception handlers. */ sc = ppc_exc_initialize( PPC_INTERRUPT_DISABLE_MASK_DEFAULT, (uintptr_t) intrStack_start, (uintptr_t) intrStack_size ); if (sc != RTEMS_SUCCESSFUL) { BSP_panic("cannot initialize exceptions"); } /* * Install our own set of exception vectors */ BSP_rtems_irq_mng_init(0); }
int main(void) { BTNDIS_P(); Init_EMIF(); Init_LEDS(); Init_TIMER(); Init_FPGA(); Init_UART(); Init_TWI(100000); mbootBanner(); Init_RTC(); Init_Media(); Init_SHA204(); Init_EMAC(); SYS_UNRESET(); mboot(); while(1); // return 0; }