board.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2006-2018, 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. * 2015-07-06 chinesebear modified for Loongson LS1C
  11. * 2019-12-04 Jiaxun Yang Add board config defines
  12. */
  13. #ifndef __BOARD_H__
  14. #define __BOARD_H__
  15. #include <rtconfig.h>
  16. #ifndef __ASSEMBLY__
  17. void rt_hw_board_init(void);
  18. #endif
  19. /*
  20. * SDRAM config
  21. *
  22. * Take IS42S16400 SDRAM chip as a example
  23. * The specfication is
  24. * Size 8MB
  25. * WIDTH: 16 bits
  26. * COL WIDTH: 8 bits, so we should take the 8 power of 2, it's 256
  27. * ROW WIDTH: 12 bits, so we take the 12 power of 2, it's 4K
  28. *
  29. * Please reference macro SD_PARA0 and SDRAM registers intruduction
  30. * in user's manual to edit the SDRAM config.
  31. */
  32. #if defined(RT_LS1C_BAICAIBOARD)
  33. /* 8MByte IS42S16400 appeared in bacai_board V1.x V2.x */
  34. #define MEM_SIZE (0x800000)
  35. #define SDRAM_WIDTH (WIDTH_16)
  36. #define SDRAM_COL (COL_256)
  37. #define SDRAM_ROW (ROW_4K)
  38. #elif defined(RT_LS1C_OPENLOONGSON)
  39. /* 32MByte appeared in SmartLoong board */
  40. #define MEM_SIZE (0x2000000)
  41. #define SDRAM_WIDTH (WIDTH_16)
  42. #define SDRAM_COL (COL_512)
  43. #define SDRAM_ROW (ROW_8K)
  44. #else
  45. #error Unknown Board
  46. #endif
  47. /* Early Debug config */
  48. #define EARLY_DEBUG /* UART2 serial print debug in early stage */
  49. #define EARLY_DEBUG_BAUD (115200)
  50. /* Clock config */
  51. #define CPU_HZ (252 * 1000000)
  52. #define PLL_MULT (0x54) /* When external clock is 24Mhz PLL=504Mhz */
  53. #define SDRAM_DIV (0) /* SDRAM is CPU divided by 2*/
  54. #define CPU_DIV (2) /* CPU clock is PLL divided by 2 */
  55. #endif