blob: d76514e4cb7f809002daf4429d89f6b2a687119b [file] [log] [blame]
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +00001/*
2 * Common definitions for LPC32XX board configurations
3 *
Vladimir Zapolskiydb6a14f2015-02-12 00:24:20 +02004 * Copyright (C) 2011-2015 Vladimir Zapolskiy <vz@mleia.com>
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +00005 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +00007 */
8
9#ifndef _LPC32XX_CONFIG_H
10#define _LPC32XX_CONFIG_H
11
Vladimir Zapolskiydb6a14f2015-02-12 00:24:20 +020012
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +000013/* Basic CPU architecture */
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +000014#define CONFIG_ARCH_CPU_INIT
15
16#define CONFIG_NR_DRAM_BANKS_MAX 2
17
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +000018/* UART configuration */
19#if (CONFIG_SYS_LPC32XX_UART >= 3) && (CONFIG_SYS_LPC32XX_UART <= 6)
20#define CONFIG_SYS_NS16550_SERIAL
21#define CONFIG_CONS_INDEX (CONFIG_SYS_LPC32XX_UART - 2)
22#elif (CONFIG_SYS_LPC32XX_UART == 1) || (CONFIG_SYS_LPC32XX_UART == 2) || \
23 (CONFIG_SYS_LPC32XX_UART == 7)
24#define CONFIG_LPC32XX_HSUART
25#else
26#error "define CONFIG_SYS_LPC32XX_UART in the range from 1 to 7"
27#endif
28
29#if defined(CONFIG_SYS_NS16550_SERIAL)
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +000030
31#define CONFIG_SYS_NS16550_REG_SIZE -4
32#define CONFIG_SYS_NS16550_CLK get_serial_clock()
33
34#define CONFIG_SYS_NS16550_COM1 UART3_BASE
35#define CONFIG_SYS_NS16550_COM2 UART4_BASE
36#define CONFIG_SYS_NS16550_COM3 UART5_BASE
37#define CONFIG_SYS_NS16550_COM4 UART6_BASE
38#endif
39
40#if defined(CONFIG_LPC32XX_HSUART)
41#if CONFIG_SYS_LPC32XX_UART == 1
42#define HS_UART_BASE HS_UART1_BASE
43#elif CONFIG_SYS_LPC32XX_UART == 2
44#define HS_UART_BASE HS_UART2_BASE
45#else /* CONFIG_SYS_LPC32XX_UART == 7 */
46#define HS_UART_BASE HS_UART7_BASE
47#endif
48#endif
49
50#define CONFIG_SYS_BAUDRATE_TABLE \
51 { 9600, 19200, 38400, 57600, 115200, 230400, 460800 }
52
Albert ARIBAUD \(3ADEV\)391e1632015-03-31 11:40:43 +020053/* Ethernet */
54#define LPC32XX_ETH_BASE ETHERNET_BASE
55
Vladimir Zapolskiya6e30ef2015-08-11 19:57:09 +030056/* NAND */
57#if defined(CONFIG_NAND_LPC32XX_SLC)
58#define NAND_LARGE_BLOCK_PAGE_SIZE 0x800
59#define NAND_SMALL_BLOCK_PAGE_SIZE 0x200
60
61#if !defined(CONFIG_SYS_NAND_PAGE_SIZE)
62#define CONFIG_SYS_NAND_PAGE_SIZE NAND_LARGE_BLOCK_PAGE_SIZE
63#endif
64
65#if (CONFIG_SYS_NAND_PAGE_SIZE == NAND_LARGE_BLOCK_PAGE_SIZE)
66#define CONFIG_SYS_NAND_OOBSIZE 64
67#define CONFIG_SYS_NAND_ECCPOS { 40, 41, 42, 43, 44, 45, 46, 47, \
68 48, 49, 50, 51, 52, 53, 54, 55, \
69 56, 57, 58, 59, 60, 61, 62, 63, }
70#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
71#elif (CONFIG_SYS_NAND_PAGE_SIZE == NAND_SMALL_BLOCK_PAGE_SIZE)
72#define CONFIG_SYS_NAND_OOBSIZE 16
73#define CONFIG_SYS_NAND_ECCPOS { 10, 11, 12, 13, 14, 15, }
74#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
75#else
76#error "CONFIG_SYS_NAND_PAGE_SIZE set to an invalid value"
77#endif
78
79#define CONFIG_SYS_NAND_ECCSIZE 0x100
80#define CONFIG_SYS_NAND_ECCBYTES 3
81#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
82 CONFIG_SYS_NAND_PAGE_SIZE)
83#endif /* CONFIG_NAND_LPC32XX_SLC */
84
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +000085/* NOR Flash */
86#if defined(CONFIG_SYS_FLASH_CFI)
87#define CONFIG_FLASH_CFI_DRIVER
88#define CONFIG_SYS_FLASH_PROTECTION
89#endif
90
Vladimir Zapolskiy69ec0752015-08-12 20:32:08 +030091/* USB OHCI */
92#if defined(CONFIG_USB_OHCI_LPC32XX)
93#define CONFIG_USB_OHCI_NEW
94#define CONFIG_SYS_USB_OHCI_CPU_INIT
95#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1
96#define CONFIG_SYS_USB_OHCI_REGS_BASE USB_BASE
97#define CONFIG_SYS_USB_OHCI_SLOT_NAME "lpc32xx-ohci"
98#endif
99
Vladimir Zapolskiy6b20ef82012-04-19 04:33:08 +0000100#endif /* _LPC32XX_CONFIG_H */