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