config.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. /* NAND */
  47. #if defined(CONFIG_NAND_LPC32XX_SLC)
  48. #define NAND_LARGE_BLOCK_PAGE_SIZE 0x800
  49. #define NAND_SMALL_BLOCK_PAGE_SIZE 0x200
  50. #if !defined(CONFIG_SYS_NAND_PAGE_SIZE)
  51. #define CONFIG_SYS_NAND_PAGE_SIZE NAND_LARGE_BLOCK_PAGE_SIZE
  52. #endif
  53. #if (CONFIG_SYS_NAND_PAGE_SIZE == NAND_LARGE_BLOCK_PAGE_SIZE)
  54. #define CONFIG_SYS_NAND_OOBSIZE 64
  55. #define CONFIG_SYS_NAND_ECCPOS { 40, 41, 42, 43, 44, 45, 46, 47, \
  56. 48, 49, 50, 51, 52, 53, 54, 55, \
  57. 56, 57, 58, 59, 60, 61, 62, 63, }
  58. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  59. #elif (CONFIG_SYS_NAND_PAGE_SIZE == NAND_SMALL_BLOCK_PAGE_SIZE)
  60. #define CONFIG_SYS_NAND_OOBSIZE 16
  61. #define CONFIG_SYS_NAND_ECCPOS { 10, 11, 12, 13, 14, 15, }
  62. #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
  63. #else
  64. #error "CONFIG_SYS_NAND_PAGE_SIZE set to an invalid value"
  65. #endif
  66. #define CONFIG_SYS_NAND_ECCSIZE 0x100
  67. #define CONFIG_SYS_NAND_ECCBYTES 3
  68. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  69. CONFIG_SYS_NAND_PAGE_SIZE)
  70. #endif /* CONFIG_NAND_LPC32XX_SLC */
  71. /* NOR Flash */
  72. #if defined(CONFIG_SYS_FLASH_CFI)
  73. #define CONFIG_FLASH_CFI_DRIVER
  74. #define CONFIG_SYS_FLASH_PROTECTION
  75. #endif
  76. /* USB OHCI */
  77. #if defined(CONFIG_USB_OHCI_LPC32XX)
  78. #define CONFIG_USB_OHCI_NEW
  79. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  80. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
  81. #define CONFIG_SYS_USB_OHCI_REGS_BASE USB_BASE
  82. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "lpc32xx-ohci"
  83. #endif
  84. #endif /* _LPC32XX_CONFIG_H */