xref: /rk3399_rockchip-uboot/include/configs/mv-common.h (revision 4fb6055211b28c525fb45463ebe5da2757d9abc7)
1 /*
2  * (C) Copyright 2010
3  * Marvell Semiconductor <www.marvell.com>
4  * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 /*
10  * This file contains Marvell Board Specific common defincations.
11  * This file should be included in board config header file.
12  *
13  * It supports common definations for Kirkwood platform
14  * TBD: support for Orion5X platforms
15  */
16 
17 #ifndef _MV_COMMON_H
18 #define _MV_COMMON_H
19 
20 /*
21  * High Level Configuration Options (easy to change)
22  */
23 #define CONFIG_MARVELL		1
24 
25 /*
26  * Custom CONFIG_SYS_TEXT_BASE can be done in <board>.h
27  */
28 #ifndef CONFIG_SYS_TEXT_BASE
29 #define	CONFIG_SYS_TEXT_BASE	0x00600000
30 #endif /* CONFIG_SYS_TEXT_BASE */
31 
32 /* additions for new ARM relocation support */
33 #define CONFIG_SYS_SDRAM_BASE	0x00000000
34 
35 /*
36  * CLKs configurations
37  */
38 
39 /*
40  * NS16550 Configuration
41  */
42 #define CONFIG_SYS_NS16550
43 #define CONFIG_SYS_NS16550_SERIAL
44 #define CONFIG_SYS_NS16550_CLK		CONFIG_SYS_TCLK
45 #if !defined(CONFIG_DM_SERIAL)
46 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
47 #define CONFIG_SYS_NS16550_COM1		MV_UART_CONSOLE_BASE
48 #endif
49 
50 /*
51  * Serial Port configuration
52  * The following definitions let you select what serial you want to use
53  * for your console driver.
54  */
55 
56 #define CONFIG_CONS_INDEX	1	/*Console on UART0 */
57 #define CONFIG_BAUDRATE			115200
58 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, \
59 					  115200,230400, 460800, 921600 }
60 /* auto boot */
61 #define CONFIG_BOOTDELAY	3	/* default enable autoboot */
62 #define CONFIG_PREBOOT
63 
64 #define CONFIG_OF_LIBFDT		/* Device tree support */
65 
66 /*
67  * For booting Linux, the board info and command line data
68  * have to be in the first 8 MB of memory, since this is
69  * the maximum mapped by the Linux kernel during initialization.
70  */
71 #define CONFIG_CMDLINE_TAG	1	/* enable passing of ATAGs  */
72 #define CONFIG_INITRD_TAG	1	/* enable INITRD tag */
73 #define CONFIG_SETUP_MEMORY_TAGS 1	/* enable memory tag */
74 
75 #define	CONFIG_SYS_CBSIZE	1024	/* Console I/O Buff Size */
76 #define	CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE \
77 		+sizeof(CONFIG_SYS_PROMPT) + 16)	/* Print Buff */
78 
79 /*
80  * Size of malloc() pool
81  */
82 #define CONFIG_SYS_MALLOC_LEN	(1024 * 1024 * 4) /* 4MiB for malloc() */
83 
84 /*
85  * Other required minimal configurations
86  */
87 #define CONFIG_SYS_LONGHELP
88 #define CONFIG_AUTO_COMPLETE
89 #define CONFIG_CMDLINE_EDITING
90 #define CONFIG_CONSOLE_INFO_QUIET	/* some code reduction */
91 #define CONFIG_ARCH_CPU_INIT	/* call arch_cpu_init() */
92 #define CONFIG_ARCH_MISC_INIT	/* call arch_misc_init() */
93 #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */
94 #define CONFIG_DISPLAY_CPUINFO	/* Display cpu info */
95 #define CONFIG_SYS_LOAD_ADDR	0x00800000	/* default load adr- 8M */
96 #define CONFIG_SYS_MEMTEST_START 0x00800000	/* 8M */
97 #define CONFIG_SYS_MEMTEST_END	0x00ffffff	/*(_16M -1) */
98 #define CONFIG_SYS_RESET_ADDRESS 0xffff0000	/* Rst Vector Adr */
99 #define CONFIG_SYS_MAXARGS	32	/* max number of command args */
100 
101 /* ====> Include platform Common Definitions */
102 #include <asm/arch/config.h>
103 
104 /*
105  * DRAM Banks configuration, Custom config can be done in <board>.h
106  */
107 #ifndef CONFIG_NR_DRAM_BANKS
108 #define CONFIG_NR_DRAM_BANKS	CONFIG_NR_DRAM_BANKS_MAX
109 #else
110 #if (CONFIG_NR_DRAM_BANKS > CONFIG_NR_DRAM_BANKS_MAX)
111 #error CONFIG_NR_DRAM_BANKS Configurated more than available
112 #endif
113 #endif /* CONFIG_NR_DRAM_BANKS */
114 
115 /* ====> Include driver Common Definitions */
116 /*
117  * Common NAND configuration
118  */
119 #ifdef CONFIG_CMD_NAND
120 #define CONFIG_SYS_MAX_NAND_DEVICE     1
121 #endif
122 
123 /*
124  * Common SPI Flash configuration
125  */
126 #ifdef CONFIG_CMD_SF
127 #define CONFIG_SPI_FLASH_MACRONIX	1
128 #endif
129 
130 /*
131  * Common USB/EHCI configuration
132  */
133 #if defined(CONFIG_CMD_USB) && !defined(CONFIG_DM)
134 #define CONFIG_USB_EHCI		/* Enable EHCI USB support */
135 #define CONFIG_USB_STORAGE
136 #define CONFIG_DOS_PARTITION
137 #define CONFIG_ISO_PARTITION
138 #define CONFIG_SUPPORT_VFAT
139 #endif /* CONFIG_CMD_USB */
140 
141 /*
142  * File system
143  */
144 #ifdef CONFIG_SYS_MVFS
145 #define CONFIG_CMD_EXT2
146 #define CONFIG_CMD_JFFS2
147 #define CONFIG_CMD_FAT
148 #define CONFIG_CMD_UBI
149 #define CONFIG_CMD_UBIFS
150 #define CONFIG_RBTREE
151 #define CONFIG_MTD_DEVICE               /* needed for mtdparts commands */
152 #define CONFIG_MTD_PARTITIONS
153 #define CONFIG_CMD_MTDPARTS
154 #define CONFIG_LZO
155 #endif
156 
157 #endif /* _MV_COMMON_H */
158