xref: /rk3399_rockchip-uboot/include/configs/at91-sama5_common.h (revision 1f20fc53b382ece8da7440f354b219deb7ed19df)
1b2d387bcSWu, Josh /*
2b2d387bcSWu, Josh  * Common part of configuration settings for the AT91 SAMA5 board.
3b2d387bcSWu, Josh  *
4b2d387bcSWu, Josh  * Copyright (C) 2015 Atmel Corporation
5b2d387bcSWu, Josh  *		      Josh Wu <josh.wu@atmel.com>
6b2d387bcSWu, Josh  *
7b2d387bcSWu, Josh  * SPDX-License-Identifier:	GPL-2.0+
8b2d387bcSWu, Josh  */
9b2d387bcSWu, Josh 
10b2d387bcSWu, Josh #ifndef __AT91_SAMA5_COMMON_H
11b2d387bcSWu, Josh #define __AT91_SAMA5_COMMON_H
12b2d387bcSWu, Josh 
13b2d387bcSWu, Josh #include <asm/hardware.h>
14b2d387bcSWu, Josh 
15b2d387bcSWu, Josh #define CONFIG_SYS_TEXT_BASE		0x26f00000
16b2d387bcSWu, Josh 
17b2d387bcSWu, Josh /* ARM asynchronous clock */
18b2d387bcSWu, Josh #define CONFIG_SYS_AT91_SLOW_CLOCK      32768
19b2d387bcSWu, Josh #define CONFIG_SYS_AT91_MAIN_CLOCK      12000000 /* from 12 MHz crystal */
20b2d387bcSWu, Josh 
21b2d387bcSWu, Josh #define CONFIG_ARCH_CPU_INIT
22b2d387bcSWu, Josh 
23b2d387bcSWu, Josh #ifndef CONFIG_SPL_BUILD
24b2d387bcSWu, Josh #define CONFIG_SKIP_LOWLEVEL_INIT
25b2d387bcSWu, Josh #endif
26b2d387bcSWu, Josh 
27372ca03fSWu, Josh #define CONFIG_ENV_VARS_UBOOT_CONFIG
28b2d387bcSWu, Josh 
29b2d387bcSWu, Josh /* general purpose I/O */
30fc977b94SWenyou Yang #ifndef CONFIG_DM_GPIO
31b2d387bcSWu, Josh #define CONFIG_AT91_GPIO
32fc977b94SWenyou Yang #endif
33b2d387bcSWu, Josh 
34b2d387bcSWu, Josh 
35b2d387bcSWu, Josh /*
36b2d387bcSWu, Josh  * BOOTP options
37b2d387bcSWu, Josh  */
38b2d387bcSWu, Josh #define CONFIG_BOOTP_BOOTFILESIZE
39b2d387bcSWu, Josh #define CONFIG_BOOTP_BOOTPATH
40b2d387bcSWu, Josh #define CONFIG_BOOTP_GATEWAY
41b2d387bcSWu, Josh #define CONFIG_BOOTP_HOSTNAME
42b2d387bcSWu, Josh 
43b2d387bcSWu, Josh /*
44b2d387bcSWu, Josh  * Command line configuration.
45b2d387bcSWu, Josh  */
46b2d387bcSWu, Josh 
47b2d387bcSWu, Josh #ifdef CONFIG_SYS_USE_MMC
48ac1eefebSJosh Wu 
49ac1eefebSJosh Wu #ifdef CONFIG_ENV_IS_IN_MMC
50ac1eefebSJosh Wu /* Use raw reserved sectors to save environment */
51ac1eefebSJosh Wu #define CONFIG_ENV_OFFSET		0x2000
52ac1eefebSJosh Wu #define CONFIG_ENV_SIZE			0x1000
53ac1eefebSJosh Wu #define CONFIG_SYS_MMC_ENV_DEV		0
54ac1eefebSJosh Wu #else
55372ca03fSWu, Josh /* u-boot env in sd/mmc card */
56372ca03fSWu, Josh #define CONFIG_ENV_SIZE		0x4000
57ac1eefebSJosh Wu #endif
58372ca03fSWu, Josh 
5989a3658aSWu, Josh #define CONFIG_BOOTCOMMAND	"if test ! -n ${dtb_name}; then "	\
6089a3658aSWu, Josh 				    "setenv dtb_name at91-${board_name}.dtb; " \
6189a3658aSWu, Josh 				"fi; "					\
6289a3658aSWu, Josh 				"fatload mmc 0:1 0x21000000 ${dtb_name}; " \
63372ca03fSWu, Josh 				"fatload mmc 0:1 0x22000000 zImage; "	\
64372ca03fSWu, Josh 				"bootz 0x22000000 - 0x21000000"
65*5abc1a45SSam Protsenko 
66b2d387bcSWu, Josh #else
67dc018fefSWu, Josh 
68dc018fefSWu, Josh #ifdef CONFIG_SYS_USE_NANDFLASH
69dc018fefSWu, Josh /* u-boot env in nand flash */
70dc018fefSWu, Josh #define CONFIG_ENV_OFFSET		0xc0000
71dc018fefSWu, Josh #define CONFIG_ENV_OFFSET_REDUND	0x100000
72dc018fefSWu, Josh #define CONFIG_ENV_SIZE			0x20000
73dc018fefSWu, Josh #define CONFIG_BOOTCOMMAND		"nand read 0x21000000 0x180000 0x80000;"	\
74dc018fefSWu, Josh 					"nand read 0x22000000 0x200000 0x600000;"	\
75dc018fefSWu, Josh 					"bootz 0x22000000 - 0x21000000"
767a53b954SWu, Josh #elif CONFIG_SYS_USE_SERIALFLASH
777a53b954SWu, Josh /* u-boot env in serial flash, by default is bus 0 and cs 0 */
78a6104737SJosh Wu #define CONFIG_ENV_OFFSET		0x6000
79a6104737SJosh Wu #define CONFIG_ENV_SIZE			0x2000
807a53b954SWu, Josh #define CONFIG_ENV_SECT_SIZE		0x1000
817a53b954SWu, Josh #define CONFIG_BOOTCOMMAND		"sf probe 0; "				\
827a53b954SWu, Josh 					"sf read 0x21000000 0x60000 0xc000; "	\
837a53b954SWu, Josh 					"sf read 0x22000000 0x6c000 0x394000; "	\
847a53b954SWu, Josh 					"bootz 0x22000000 - 0x21000000"
85dc018fefSWu, Josh #endif
86dc018fefSWu, Josh 
87b2d387bcSWu, Josh #endif
88b2d387bcSWu, Josh 
89b2d387bcSWu, Josh #define CONFIG_SYS_LONGHELP
90b2d387bcSWu, Josh #define CONFIG_CMDLINE_EDITING
91b2d387bcSWu, Josh #define CONFIG_AUTO_COMPLETE
92b2d387bcSWu, Josh 
93b2d387bcSWu, Josh /* Size of malloc() pool */
94b2d387bcSWu, Josh #define CONFIG_SYS_MALLOC_LEN		(4 * 1024 * 1024)
95b2d387bcSWu, Josh 
96b2d387bcSWu, Josh #endif
97