board.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2010-06-25 Bernard first version
  9. * 2011-08-08 lgnq modified for Loongson LS1B
  10. * 2019-12-04 Jiaxun Yang Adapt new MIPS generic code
  11. */
  12. #include <rtthread.h>
  13. #include <rthw.h>
  14. #include <mips_fpu.h>
  15. #include "board.h"
  16. #include "drv_uart.h"
  17. #include "ls1b.h"
  18. #ifdef RT_USING_RTGUI
  19. #include <rtgui/rtgui.h>
  20. rt_device_t dc;
  21. extern void rt_hw_dc_init(void);
  22. #endif
  23. extern unsigned char __bss_end;
  24. /**
  25. * @addtogroup Loongson LS1B
  26. */
  27. /*@{*/
  28. /**
  29. * This function will initial sam7s64 board.
  30. */
  31. void rt_hw_board_init(void)
  32. {
  33. /* init hardware interrupt */
  34. rt_hw_exception_init();
  35. /* init hardware interrupt */
  36. rt_hw_interrupt_init();
  37. #ifdef RT_USING_HEAP
  38. rt_system_heap_init((void*)&__bss_end, (void*)RT_HW_HEAP_END);
  39. #endif
  40. #ifdef RT_USING_SERIAL
  41. /* init hardware UART device */
  42. rt_hw_uart_init();
  43. #endif
  44. #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
  45. /* set console device */
  46. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  47. #endif
  48. /* init operating system timer */
  49. rt_hw_timer_init();
  50. #ifdef RT_USING_FPU
  51. /* init hardware fpu */
  52. rt_hw_fpu_init();
  53. #endif
  54. #ifdef RT_USING_RTGUI
  55. rt_device_t dc;
  56. /* init Display Controller */
  57. rt_hw_dc_init();
  58. /* find Display Controller device */
  59. dc = rt_device_find("dc");
  60. /* set Display Controller device as rtgui graphic driver */
  61. rtgui_graphic_set_device(dc);
  62. #endif
  63. #ifdef RT_USING_COMPONENTS_INIT
  64. rt_components_board_init();
  65. #endif
  66. rt_kprintf("current sr: 0x%08x\n", read_c0_status());
  67. }
  68. /*@}*/