#include "flasher.h" #include "dm644x.h" #include "uart.h" #include "util.h" #include "nor.h" uint32_t ret_code; void boot() { asm( " MRS r0, cpsr" ); asm( " BIC r0, r0, #0x1F" ); /* CLEAR MODES */ asm( " ORR r0, r0, #0x13" ); /* SET SUPERVISOR mode */ asm( " ORR r0, r0, #0xC0" ); /* Disable FIQ and IRQ */ asm( " MSR cpsr, r0" ); /* Set the IVT to low memory, leave MMU & caches disabled */ asm( " MRC p15, 0, r1, c1, c0, 0" ); asm( " BIC r0,r0,#0x00002000" ); asm( " MCR p15, 0, r1, c1, c0, 0" ); /* Stack setup (__topstack symbol defined in linker script) */ extern uint32_t __topstack; register uint32_t *stackpointer asm ( "sp" ); stackpointer = &(__topstack); /* Call to main code */ main(); } int32_t main( void ) { PSCInit(); /* Platform Initialization */ DM644xInit(); waitloop( 100000000 ); /* Set RAM pointer to beginning of RAM space */ set_current_mem_loc( 0 ); UART_Boot(); waitloop( 1000000 ); if( ret_code == 1 ) UARTSendData( (uint8_t *)"SUCCESS", TRUE ); else UARTSendData( (uint8_t *)"FAILURE", TRUE ); waitloop( 1000000 ); return( E_PASS ); }