config.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. /* Basic CPU architecture */
  11. #define CONFIG_ARCH_CPU_INIT
  12. #define CONFIG_NR_DRAM_BANKS_MAX 2
  13. /* UART configuration */
  14. #if (CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \
  15. (CONFIG_SYS_LPC32XX_UART == 7)
  16. #if !defined(CONFIG_LPC32XX_HSUART)
  17. #define CONFIG_LPC32XX_HSUART
  18. #endif
  19. #endif
  20. #if !defined(CONFIG_SYS_NS16550_CLK)
  21. #define CONFIG_SYS_NS16550_CLK 13000000
  22. #endif
  23. #define CONFIG_SYS_BAUDRATE_TABLE \
  24. { 9600, 19200, 38400, 57600, 115200, 230400, 460800 }
  25. /* Ethernet */
  26. #define LPC32XX_ETH_BASE ETHERNET_BASE
  27. /* NAND */
  28. #if defined(CONFIG_NAND_LPC32XX_SLC)
  29. #define NAND_LARGE_BLOCK_PAGE_SIZE 0x800
  30. #define NAND_SMALL_BLOCK_PAGE_SIZE 0x200
  31. #if !defined(CONFIG_SYS_NAND_PAGE_SIZE)
  32. #define CONFIG_SYS_NAND_PAGE_SIZE NAND_LARGE_BLOCK_PAGE_SIZE
  33. #endif
  34. #if (CONFIG_SYS_NAND_PAGE_SIZE == NAND_LARGE_BLOCK_PAGE_SIZE)
  35. #define CONFIG_SYS_NAND_OOBSIZE 64
  36. #define CONFIG_SYS_NAND_ECCPOS { 40, 41, 42, 43, 44, 45, 46, 47, \
  37. 48, 49, 50, 51, 52, 53, 54, 55, \
  38. 56, 57, 58, 59, 60, 61, 62, 63, }
  39. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  40. #elif (CONFIG_SYS_NAND_PAGE_SIZE == NAND_SMALL_BLOCK_PAGE_SIZE)
  41. #define CONFIG_SYS_NAND_OOBSIZE 16
  42. #define CONFIG_SYS_NAND_ECCPOS { 10, 11, 12, 13, 14, 15, }
  43. #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
  44. #else
  45. #error "CONFIG_SYS_NAND_PAGE_SIZE set to an invalid value"
  46. #endif
  47. #define CONFIG_SYS_NAND_ECCSIZE 0x100
  48. #define CONFIG_SYS_NAND_ECCBYTES 3
  49. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  50. CONFIG_SYS_NAND_PAGE_SIZE)
  51. #endif /* CONFIG_NAND_LPC32XX_SLC */
  52. /* NOR Flash */
  53. #if defined(CONFIG_SYS_FLASH_CFI)
  54. #define CONFIG_FLASH_CFI_DRIVER
  55. #define CONFIG_SYS_FLASH_PROTECTION
  56. #endif
  57. /* USB OHCI */
  58. #if defined(CONFIG_USB_OHCI_LPC32XX)
  59. #define CONFIG_USB_OHCI_NEW
  60. #define CONFIG_SYS_USB_OHCI_CPU_INIT
  61. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
  62. #define CONFIG_SYS_USB_OHCI_REGS_BASE USB_BASE
  63. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "lpc32xx-ohci"
  64. #endif
  65. #endif /* _LPC32XX_CONFIG_H */