board.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006-2012, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2010-06-25 Bernard first version
  13. * 2011-08-08 lgnq modified for Loongson LS1B
  14. * 2019-12-04 Jiaxun Yang Adapt new MIPS generic code
  15. */
  16. #include <rtthread.h>
  17. #include <rthw.h>
  18. #include <mips_fpu.h>
  19. #include "board.h"
  20. #include "uart.h"
  21. #include "ls1b.h"
  22. #ifdef RT_USING_RTGUI
  23. #include <rtgui/rtgui.h>
  24. rt_device_t dc;
  25. extern void rt_hw_dc_init(void);
  26. #endif
  27. extern unsigned char __bss_end;
  28. /**
  29. * @addtogroup Loongson LS1B
  30. */
  31. /*@{*/
  32. /**
  33. * This function will initial sam7s64 board.
  34. */
  35. void rt_hw_board_init(void)
  36. {
  37. /* init hardware interrupt */
  38. rt_hw_exception_init();
  39. /* init hardware interrupt */
  40. rt_hw_interrupt_init();
  41. #ifdef RT_USING_HEAP
  42. rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END);
  43. #endif
  44. #ifdef RT_USING_SERIAL
  45. /* init hardware UART device */
  46. rt_hw_uart_init();
  47. #endif
  48. #ifdef RT_USING_CONSOLE
  49. /* set console device */
  50. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  51. #endif
  52. /* init operating system timer */
  53. rt_hw_timer_init();
  54. #ifdef RT_USING_FPU
  55. /* init hardware fpu */
  56. rt_hw_fpu_init();
  57. #endif
  58. #ifdef RT_USING_RTGUI
  59. rt_device_t dc;
  60. /* init Display Controller */
  61. rt_hw_dc_init();
  62. /* find Display Controller device */
  63. dc = rt_device_find("dc");
  64. /* set Display Controller device as rtgui graphic driver */
  65. rtgui_graphic_set_device(dc);
  66. #endif
  67. #ifdef RT_USING_COMPONENTS_INIT
  68. rt_components_board_init();
  69. #endif
  70. }
  71. /*@}*/