board.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 "board.h"
  19. #include "uart.h"
  20. #include "ls1b.h"
  21. #ifdef RT_USING_RTGUI
  22. #include <rtgui/rtgui.h>
  23. rt_device_t dc;
  24. extern void rt_hw_dc_init(void);
  25. #endif
  26. extern unsigned char __bss_end;
  27. /**
  28. * @addtogroup Loongson LS1B
  29. */
  30. /*@{*/
  31. /**
  32. * This function will initial sam7s64 board.
  33. */
  34. void rt_hw_board_init(void)
  35. {
  36. /* init hardware interrupt */
  37. rt_hw_exception_init();
  38. /* init hardware interrupt */
  39. rt_hw_interrupt_init();
  40. #ifdef RT_USING_HEAP
  41. rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END);
  42. #endif
  43. #ifdef RT_USING_SERIAL
  44. /* init hardware UART device */
  45. rt_hw_uart_init();
  46. #endif
  47. #ifdef RT_USING_CONSOLE
  48. /* set console device */
  49. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  50. #endif
  51. /* init operating system timer */
  52. rt_hw_timer_init();
  53. #ifdef RT_USING_FPU
  54. /* init hardware fpu */
  55. rt_hw_fpu_init();
  56. #endif
  57. #ifdef RT_USING_RTGUI
  58. rt_device_t dc;
  59. /* init Display Controller */
  60. rt_hw_dc_init();
  61. /* find Display Controller device */
  62. dc = rt_device_find("dc");
  63. /* set Display Controller device as rtgui graphic driver */
  64. rtgui_graphic_set_device(dc);
  65. #endif
  66. #ifdef RT_USING_COMPONENTS_INIT
  67. rt_components_board_init();
  68. #endif
  69. }
  70. /*@}*/