Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:47

0001 /*
0002  *  This is where the real hardware setup is done. A minimal stack
0003  *  has been provided by the start.S code. No normal C or RTEMS
0004  *  functions can be called from here.
0005  */
0006 
0007 #include <bsp.h>
0008 #include <bsp/bootcard.h>
0009 
0010 extern void _wr_vbr(uint32_t);
0011 extern void init_main(void);
0012 
0013 /*
0014  * From linkcmds
0015  */
0016 
0017 extern uint8_t _INTERRUPT_VECTOR[];
0018 
0019 extern uint8_t _clear_start[];
0020 extern uint8_t _clear_end[];
0021 
0022 extern uint8_t _data_src_start[];
0023 extern uint8_t _data_dest_start[];
0024 extern uint8_t _data_dest_end[];
0025 
0026 void Init5329(void)
0027 {
0028   register uint32_t i;
0029   register uint8_t *dbp, *sbp;
0030   register uint32_t *dp, *sp;
0031 
0032   /*
0033    * Initialize the hardware
0034    */
0035   init_main();
0036 
0037   /*
0038    * Copy the vector table to RAM
0039    */
0040   if (&_VBR != (void *) _INTERRUPT_VECTOR) {
0041     sp = (uint32_t *) _INTERRUPT_VECTOR;
0042     dp = (uint32_t *) &_VBR;
0043     for (i = 0; i < 256; i++) {
0044       *dp++ = *sp++;
0045     }
0046   }
0047 
0048   _wr_vbr((uint32_t) &_VBR);
0049 
0050   /*
0051    * Move initialized data from ROM to RAM.
0052    */
0053   if (_data_src_start != _data_dest_start) {
0054     dbp = (uint8_t *) _data_dest_start;
0055     sbp = (uint8_t *) _data_src_start;
0056     i = _data_dest_end - _data_dest_start;
0057     while (i--)
0058       *dbp++ = *sbp++;
0059   }
0060 
0061   /*
0062    * Zero uninitialized data
0063    */
0064 
0065   if (_clear_start != _clear_end) {
0066     sbp = _clear_start;
0067     dbp = _clear_end;
0068     i = dbp - sbp;
0069     while (i--)
0070       *sbp++ = 0;
0071   }
0072 
0073   /*
0074    * We have to call some kind of RTEMS function here!
0075    */
0076 
0077   boot_card(0);
0078   for (;;) ;
0079 }