config.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Common definitions for LPC32XX board configurations
  3. *
  4. * Copyright (C) 2011 Vladimir Zapolskiy <vz@mleia.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  19. * MA 02110-1301, USA.
  20. */
  21. #ifndef _LPC32XX_CONFIG_H
  22. #define _LPC32XX_CONFIG_H
  23. /* Basic CPU architecture */
  24. #define CONFIG_ARM926EJS
  25. #define CONFIG_ARCH_CPU_INIT
  26. #define CONFIG_NR_DRAM_BANKS_MAX 2
  27. /* 1KHz clock tick */
  28. #define CONFIG_SYS_HZ 1000
  29. /* UART configuration */
  30. #if (CONFIG_SYS_LPC32XX_UART >= 3) && (CONFIG_SYS_LPC32XX_UART <= 6)
  31. #define CONFIG_SYS_NS16550_SERIAL
  32. #define CONFIG_CONS_INDEX (CONFIG_SYS_LPC32XX_UART - 2)
  33. #elif (CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \
  34. (CONFIG_SYS_LPC32XX_UART == 7)
  35. #define CONFIG_LPC32XX_HSUART
  36. #else
  37. #error "define CONFIG_SYS_LPC32XX_UART in the range from 1 to 7"
  38. #endif
  39. #if defined(CONFIG_SYS_NS16550_SERIAL)
  40. #define CONFIG_SYS_NS16550
  41. #define CONFIG_SYS_NS16550_REG_SIZE -4
  42. #define CONFIG_SYS_NS16550_CLK get_serial_clock()
  43. #define CONFIG_SYS_NS16550_COM1 UART3_BASE
  44. #define CONFIG_SYS_NS16550_COM2 UART4_BASE
  45. #define CONFIG_SYS_NS16550_COM3 UART5_BASE
  46. #define CONFIG_SYS_NS16550_COM4 UART6_BASE
  47. #endif
  48. #if defined(CONFIG_LPC32XX_HSUART)
  49. #if CONFIG_SYS_LPC32XX_UART == 1
  50. #define HS_UART_BASE HS_UART1_BASE
  51. #elif CONFIG_SYS_LPC32XX_UART == 2
  52. #define HS_UART_BASE HS_UART2_BASE
  53. #else /* CONFIG_SYS_LPC32XX_UART == 7 */
  54. #define HS_UART_BASE HS_UART7_BASE
  55. #endif
  56. #endif
  57. #define CONFIG_SYS_BAUDRATE_TABLE \
  58. { 9600, 19200, 38400, 57600, 115200, 230400, 460800 }
  59. /* NOR Flash */
  60. #if defined(CONFIG_SYS_FLASH_CFI)
  61. #define CONFIG_FLASH_CFI_DRIVER
  62. #define CONFIG_SYS_FLASH_PROTECTION
  63. #endif
  64. #endif /* _LPC32XX_CONFIG_H */