xref: /rk3399_rockchip-uboot/include/configs/sunxi-common.h (revision e24ea55c04a8ee9c273dd879edda23bbde3d807a)
1cba69eeeSIan Campbell /*
2cba69eeeSIan Campbell  * (C) Copyright 2012-2012 Henrik Nordstrom <henrik@henriknordstrom.net>
3cba69eeeSIan Campbell  *
4cba69eeeSIan Campbell  * (C) Copyright 2007-2011
5cba69eeeSIan Campbell  * Allwinner Technology Co., Ltd. <www.allwinnertech.com>
6cba69eeeSIan Campbell  * Tom Cubie <tangliang@allwinnertech.com>
7cba69eeeSIan Campbell  *
8cba69eeeSIan Campbell  * Configuration settings for the Allwinner sunxi series of boards.
9cba69eeeSIan Campbell  *
10cba69eeeSIan Campbell  * SPDX-License-Identifier:	GPL-2.0+
11cba69eeeSIan Campbell  */
12cba69eeeSIan Campbell 
13cba69eeeSIan Campbell #ifndef _SUNXI_COMMON_CONFIG_H
14cba69eeeSIan Campbell #define _SUNXI_COMMON_CONFIG_H
15cba69eeeSIan Campbell 
16cba69eeeSIan Campbell /*
17cba69eeeSIan Campbell  * High Level Configuration Options
18cba69eeeSIan Campbell  */
19cba69eeeSIan Campbell #define CONFIG_SUNXI		/* sunxi family */
20cba69eeeSIan Campbell 
21cba69eeeSIan Campbell #include <asm/arch/cpu.h>	/* get chip and board defs */
22cba69eeeSIan Campbell 
23cba69eeeSIan Campbell #define CONFIG_SYS_TEXT_BASE		0x4a000000
24cba69eeeSIan Campbell 
25cba69eeeSIan Campbell /*
26cba69eeeSIan Campbell  * Display CPU information
27cba69eeeSIan Campbell  */
28cba69eeeSIan Campbell #define CONFIG_DISPLAY_CPUINFO
29cba69eeeSIan Campbell 
30cba69eeeSIan Campbell /* Serial & console */
31cba69eeeSIan Campbell #define CONFIG_SYS_NS16550
32cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_SERIAL
33cba69eeeSIan Campbell /* ns16550 reg in the low bits of cpu reg */
34cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_REG_SIZE	-4
35cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_CLK		24000000
36cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_COM1		SUNXI_UART0_BASE
37cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_COM2		SUNXI_UART1_BASE
38cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_COM3		SUNXI_UART2_BASE
39cba69eeeSIan Campbell #define CONFIG_SYS_NS16550_COM4		SUNXI_UART3_BASE
40cba69eeeSIan Campbell 
41cba69eeeSIan Campbell /* DRAM Base */
42cba69eeeSIan Campbell #define CONFIG_SYS_SDRAM_BASE		0x40000000
43cba69eeeSIan Campbell #define CONFIG_SYS_INIT_RAM_ADDR	0x0
44cba69eeeSIan Campbell #define CONFIG_SYS_INIT_RAM_SIZE	0x8000	/* 32 KiB */
45cba69eeeSIan Campbell 
46cba69eeeSIan Campbell #define CONFIG_SYS_INIT_SP_OFFSET \
47cba69eeeSIan Campbell 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
48cba69eeeSIan Campbell #define CONFIG_SYS_INIT_SP_ADDR \
49cba69eeeSIan Campbell 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
50cba69eeeSIan Campbell 
51cba69eeeSIan Campbell #define CONFIG_NR_DRAM_BANKS		1
52cba69eeeSIan Campbell #define PHYS_SDRAM_0			CONFIG_SYS_SDRAM_BASE
53cba69eeeSIan Campbell #define PHYS_SDRAM_0_SIZE		0x80000000 /* 2 GiB */
54cba69eeeSIan Campbell 
55cba69eeeSIan Campbell #define CONFIG_CMD_MEMORY
56cba69eeeSIan Campbell #define CONFIG_CMD_SETEXPR
57cba69eeeSIan Campbell 
58cba69eeeSIan Campbell #define CONFIG_SETUP_MEMORY_TAGS
59cba69eeeSIan Campbell #define CONFIG_CMDLINE_TAG
60cba69eeeSIan Campbell #define CONFIG_INITRD_TAG
61cba69eeeSIan Campbell 
62*e24ea55cSIan Campbell /* mmc config */
63*e24ea55cSIan Campbell #define CONFIG_MMC
64*e24ea55cSIan Campbell #define CONFIG_GENERIC_MMC
65*e24ea55cSIan Campbell #define CONFIG_CMD_MMC
66*e24ea55cSIan Campbell #define CONFIG_MMC_SUNXI
67*e24ea55cSIan Campbell #define CONFIG_MMC_SUNXI_SLOT		0
68*e24ea55cSIan Campbell #define CONFIG_MMC_SUNXI_USE_DMA
69*e24ea55cSIan Campbell #define CONFIG_ENV_IS_IN_MMC
70*e24ea55cSIan Campbell #define CONFIG_SYS_MMC_ENV_DEV		0	/* first detected MMC controller */
71*e24ea55cSIan Campbell 
72cba69eeeSIan Campbell /* 4MB of malloc() pool */
73cba69eeeSIan Campbell #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (4 << 20))
74cba69eeeSIan Campbell 
75cba69eeeSIan Campbell /*
76cba69eeeSIan Campbell  * Miscellaneous configurable options
77cba69eeeSIan Campbell  */
78cba69eeeSIan Campbell #define CONFIG_CMD_ECHO
79cba69eeeSIan Campbell #define CONFIG_SYS_CBSIZE	256	/* Console I/O Buffer Size */
80cba69eeeSIan Campbell #define CONFIG_SYS_PBSIZE	384	/* Print Buffer Size */
81cba69eeeSIan Campbell #define CONFIG_SYS_MAXARGS	16	/* max number of command args */
82cba69eeeSIan Campbell #define CONFIG_SYS_GENERIC_BOARD
83cba69eeeSIan Campbell 
84cba69eeeSIan Campbell /* Boot Argument Buffer Size */
85cba69eeeSIan Campbell #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
86cba69eeeSIan Campbell 
87cba69eeeSIan Campbell #define CONFIG_SYS_LOAD_ADDR		0x48000000 /* default load address */
88cba69eeeSIan Campbell 
89cba69eeeSIan Campbell /* standalone support */
90cba69eeeSIan Campbell #define CONFIG_STANDALONE_LOAD_ADDR	0x48000000
91cba69eeeSIan Campbell 
92cba69eeeSIan Campbell #define CONFIG_SYS_HZ			1000
93cba69eeeSIan Campbell 
94cba69eeeSIan Campbell /* baudrate */
95cba69eeeSIan Campbell #define CONFIG_BAUDRATE			115200
96cba69eeeSIan Campbell 
97cba69eeeSIan Campbell /* The stack sizes are set up in start.S using the settings below */
98cba69eeeSIan Campbell #define CONFIG_STACKSIZE		(256 << 10)	/* 256 KiB */
99cba69eeeSIan Campbell 
100cba69eeeSIan Campbell /* FLASH and environment organization */
101cba69eeeSIan Campbell 
102cba69eeeSIan Campbell #define CONFIG_SYS_NO_FLASH
103cba69eeeSIan Campbell 
104cba69eeeSIan Campbell #define CONFIG_SYS_MONITOR_LEN		(512 << 10)	/* 512 KiB */
105cba69eeeSIan Campbell #define CONFIG_IDENT_STRING		" Allwinner Technology"
106cba69eeeSIan Campbell 
107*e24ea55cSIan Campbell #define CONFIG_ENV_OFFSET		(544 << 10) /* (8 + 24 + 512) KiB */
108cba69eeeSIan Campbell #define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
109cba69eeeSIan Campbell 
110cba69eeeSIan Campbell #define CONFIG_EXTRA_ENV_SETTINGS \
111cba69eeeSIan Campbell 	"bootm_size=0x10000000\0"
112cba69eeeSIan Campbell 
113cba69eeeSIan Campbell #define CONFIG_SYS_BOOT_GET_CMDLINE
114cba69eeeSIan Campbell 
115cba69eeeSIan Campbell #include <config_cmd_default.h>
116cba69eeeSIan Campbell 
117cba69eeeSIan Campbell #define CONFIG_FAT_WRITE	/* enable write access */
118cba69eeeSIan Campbell 
119cba69eeeSIan Campbell #define CONFIG_SPL_FRAMEWORK
120cba69eeeSIan Campbell #define CONFIG_SPL_LIBCOMMON_SUPPORT
121cba69eeeSIan Campbell #define CONFIG_SPL_SERIAL_SUPPORT
122cba69eeeSIan Campbell #define CONFIG_SPL_LIBGENERIC_SUPPORT
123cba69eeeSIan Campbell 
124cba69eeeSIan Campbell #define CONFIG_SPL
125cba69eeeSIan Campbell #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds"
126cba69eeeSIan Campbell #define CONFIG_SPL_START_S_PATH "arch/arm/cpu/armv7/sunxi"
127cba69eeeSIan Campbell #define CONFIG_SPL_TEXT_BASE		0x2000
128cba69eeeSIan Campbell #define CONFIG_SPL_MAX_SIZE		0x4000		/* 16 KiB */
129cba69eeeSIan Campbell /* end of 32 KiB in sram */
130cba69eeeSIan Campbell #define LOW_LEVEL_SRAM_STACK		0x00008000 /* End of sram */
131cba69eeeSIan Campbell #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
132cba69eeeSIan Campbell #define CONFIG_SYS_SPL_MALLOC_START	0x4ff00000
133cba69eeeSIan Campbell #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00080000	/* 512 KiB */
134cba69eeeSIan Campbell 
135cba69eeeSIan Campbell #undef CONFIG_CMD_FPGA
136cba69eeeSIan Campbell #undef CONFIG_CMD_NET
137cba69eeeSIan Campbell #undef CONFIG_CMD_NFS
138cba69eeeSIan Campbell 
139cba69eeeSIan Campbell #define CONFIG_CONS_INDEX              1       /* UART0 */
140cba69eeeSIan Campbell 
1415835823dSIan Campbell #ifdef CONFIG_SUNXI_GMAC
1425835823dSIan Campbell #define CONFIG_DESIGNWARE_ETH		/* GMAC can use designware driver */
1435835823dSIan Campbell #define CONFIG_DW_AUTONEG
1445835823dSIan Campbell #define CONFIG_PHY_GIGE			/* GMAC can use gigabit PHY	*/
1455835823dSIan Campbell #define CONFIG_PHY_ADDR		1
1465835823dSIan Campbell #define CONFIG_MII			/* MII PHY management		*/
1475835823dSIan Campbell #define CONFIG_PHYLIB
1485835823dSIan Campbell #endif
1495835823dSIan Campbell 
1505835823dSIan Campbell #ifdef CONFIG_CMD_NET
1515835823dSIan Campbell #define CONFIG_CMD_NFS
1525835823dSIan Campbell #define CONFIG_CMD_DNS
1535835823dSIan Campbell #define CONFIG_NETCONSOLE
1545835823dSIan Campbell #define CONFIG_BOOTP_DNS2
1555835823dSIan Campbell #define CONFIG_BOOTP_SEND_HOSTNAME
1565835823dSIan Campbell #endif
1575835823dSIan Campbell 
158cba69eeeSIan Campbell #if !defined CONFIG_ENV_IS_IN_MMC && \
159cba69eeeSIan Campbell     !defined CONFIG_ENV_IS_IN_NAND && \
160cba69eeeSIan Campbell     !defined CONFIG_ENV_IS_IN_FAT && \
161cba69eeeSIan Campbell     !defined CONFIG_ENV_IS_IN_SPI_FLASH
162cba69eeeSIan Campbell #define CONFIG_ENV_IS_NOWHERE
163cba69eeeSIan Campbell #endif
164cba69eeeSIan Campbell 
165cba69eeeSIan Campbell #ifndef CONFIG_SPL_BUILD
166cba69eeeSIan Campbell #include <config_distro_defaults.h>
167cba69eeeSIan Campbell #endif
168cba69eeeSIan Campbell 
169cba69eeeSIan Campbell #endif /* _SUNXI_COMMON_CONFIG_H */
170