1 /*
2  * (C) Copyright 2015
3  * Kamil Lulko, <rev13@wp.pl>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10 
11 #define CONFIG_STM32F4
12 #define CONFIG_STM32F4DISCOVERY
13 
14 #define CONFIG_OF_LIBFDT
15 
16 #define CONFIG_BOARD_EARLY_INIT_F
17 #define CONFIG_MISC_INIT_R
18 
19 #define CONFIG_SYS_FLASH_BASE		0x08000000
20 
21 #define CONFIG_SYS_INIT_SP_ADDR		0x10010000
22 #define CONFIG_SYS_TEXT_BASE		0x08000000
23 
24 #define CONFIG_SYS_ICACHE_OFF
25 #define CONFIG_SYS_DCACHE_OFF
26 
27 /*
28  * Configuration of the external SDRAM memory
29  */
30 #define CONFIG_NR_DRAM_BANKS		1
31 #define CONFIG_SYS_RAM_SIZE		(8 << 20)
32 #define CONFIG_SYS_RAM_CS		1
33 #define CONFIG_SYS_RAM_FREQ_DIV		2
34 #define CONFIG_SYS_RAM_BASE		0xD0000000
35 #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_RAM_BASE
36 #define CONFIG_SYS_LOAD_ADDR		0xD0400000
37 #define CONFIG_LOADADDR			0xD0400000
38 
39 #define CONFIG_SYS_MAX_FLASH_SECT	12
40 #define CONFIG_SYS_MAX_FLASH_BANKS	2
41 
42 #define CONFIG_ENV_IS_IN_FLASH
43 #define CONFIG_ENV_OFFSET		(256 << 10)
44 #define CONFIG_ENV_SECT_SIZE		(128 << 10)
45 #define CONFIG_ENV_SIZE			(8 << 10)
46 
47 #define CONFIG_BOARD_SPECIFIC_LED
48 #define CONFIG_RED_LED			110
49 #define CONFIG_GREEN_LED		109
50 
51 #define CONFIG_STM32_GPIO
52 #define CONFIG_STM32_SERIAL
53 /*
54  * Configuration of the USART
55  * 1:   TX:PA9  RX:PA10
56  * 2:   TX:PD5  RX:PD6
57  * 3:   TX:PC10 RX:PC11
58  * 6:   TX:PG14 RX:PG9
59  */
60 #define CONFIG_STM32_USART		1
61 
62 #define CONFIG_STM32_HSE_HZ		8000000
63 
64 #define CONFIG_SYS_CLK_FREQ		180000000 /* 180 MHz */
65 
66 #define CONFIG_SYS_HZ_CLOCK		1000000	/* Timer is clocked at 1MHz */
67 
68 #define CONFIG_CMDLINE_TAG
69 #define CONFIG_SETUP_MEMORY_TAGS
70 #define CONFIG_INITRD_TAG
71 #define CONFIG_REVISION_TAG
72 
73 #define CONFIG_SYS_CBSIZE		1024
74 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE \
75 					+ sizeof(CONFIG_SYS_PROMPT) + 16)
76 
77 #define CONFIG_SYS_MAXARGS		16
78 
79 #define CONFIG_SYS_MALLOC_LEN		(2 << 20)
80 
81 #define CONFIG_STACKSIZE		(64 << 10)
82 
83 #define CONFIG_BAUDRATE			115200
84 #define CONFIG_BOOTARGS							\
85 	"console=ttyS0,115200 earlyprintk consoleblank=0 ignore_loglevel"
86 #define CONFIG_BOOTCOMMAND						\
87 	"run bootcmd_romfs"
88 
89 #define CONFIG_EXTRA_ENV_SETTINGS \
90 	"bootargs_romfs=uclinux.physaddr=0x08180000 root=/dev/mtdblock0\0" \
91 	"bootcmd_romfs=setenv bootargs ${bootargs} ${bootargs_romfs};" \
92 	"bootm 0x08044000 - 0x08042000\0"
93 
94 #define CONFIG_BOOTDELAY		3
95 #define CONFIG_AUTOBOOT
96 
97 /*
98  * Command line configuration.
99  */
100 #define CONFIG_SYS_LONGHELP
101 #define CONFIG_SYS_HUSH_PARSER
102 #define CONFIG_AUTO_COMPLETE
103 #define CONFIG_CMDLINE_EDITING
104 
105 #define CONFIG_CMD_MEM
106 #define CONFIG_CMD_TIMER
107 
108 #endif /* __CONFIG_H */
109