config.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Common definitions for LPC32XX board configurations
  3. *
  4. * Copyright (C) 2011-2015 Vladimir Zapolskiy <vz@mleia.com>
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef _LPC32XX_CONFIG_H
  9. #define _LPC32XX_CONFIG_H
  10. #define CONFIG_SYS_GENERIC_BOARD
  11. /* Basic CPU architecture */
  12. #define CONFIG_ARCH_CPU_INIT
  13. #define CONFIG_NR_DRAM_BANKS_MAX 2
  14. /* UART configuration */
  15. #if (CONFIG_SYS_LPC32XX_UART >= 3) && (CONFIG_SYS_LPC32XX_UART <= 6)
  16. #define CONFIG_SYS_NS16550_SERIAL
  17. #define CONFIG_CONS_INDEX (CONFIG_SYS_LPC32XX_UART - 2)
  18. #elif (CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \
  19. (CONFIG_SYS_LPC32XX_UART == 7)
  20. #define CONFIG_LPC32XX_HSUART
  21. #else
  22. #error "define CONFIG_SYS_LPC32XX_UART in the range from 1 to 7"
  23. #endif
  24. #if defined(CONFIG_SYS_NS16550_SERIAL)
  25. #define CONFIG_SYS_NS16550
  26. #define CONFIG_SYS_NS16550_REG_SIZE -4
  27. #define CONFIG_SYS_NS16550_CLK get_serial_clock()
  28. #define CONFIG_SYS_NS16550_COM1 UART3_BASE
  29. #define CONFIG_SYS_NS16550_COM2 UART4_BASE
  30. #define CONFIG_SYS_NS16550_COM3 UART5_BASE
  31. #define CONFIG_SYS_NS16550_COM4 UART6_BASE
  32. #endif
  33. #if defined(CONFIG_LPC32XX_HSUART)
  34. #if CONFIG_SYS_LPC32XX_UART == 1
  35. #define HS_UART_BASE HS_UART1_BASE
  36. #elif CONFIG_SYS_LPC32XX_UART == 2
  37. #define HS_UART_BASE HS_UART2_BASE
  38. #else /* CONFIG_SYS_LPC32XX_UART == 7 */
  39. #define HS_UART_BASE HS_UART7_BASE
  40. #endif
  41. #endif
  42. #define CONFIG_SYS_BAUDRATE_TABLE \
  43. { 9600, 19200, 38400, 57600, 115200, 230400, 460800 }
  44. /* Ethernet */
  45. #define LPC32XX_ETH_BASE ETHERNET_BASE
  46. /* NOR Flash */
  47. #if defined(CONFIG_SYS_FLASH_CFI)
  48. #define CONFIG_FLASH_CFI_DRIVER
  49. #define CONFIG_SYS_FLASH_PROTECTION
  50. #endif
  51. #endif /* _LPC32XX_CONFIG_H */