xref: /rk3399_rockchip-uboot/include/configs/liteboard.h (revision c9e40e65e1dcf19f518fa3811bb6de2bf407360f)
1*c9e40e65SMarcin Niestroj /*
2*c9e40e65SMarcin Niestroj  * Copyright (C) 2015 Freescale Semiconductor, Inc.
3*c9e40e65SMarcin Niestroj  * Copyright (C) 2016 Grinn
4*c9e40e65SMarcin Niestroj  *
5*c9e40e65SMarcin Niestroj  * Configuration settings for the Grinn liteBoard (i.MX6UL).
6*c9e40e65SMarcin Niestroj  *
7*c9e40e65SMarcin Niestroj  * SPDX-License-Identifier:	GPL-2.0+
8*c9e40e65SMarcin Niestroj  */
9*c9e40e65SMarcin Niestroj #ifndef __LITEBOARD_CONFIG_H
10*c9e40e65SMarcin Niestroj #define __LITEBOARD_CONFIG_H
11*c9e40e65SMarcin Niestroj 
12*c9e40e65SMarcin Niestroj #include <asm/arch/imx-regs.h>
13*c9e40e65SMarcin Niestroj #include <linux/sizes.h>
14*c9e40e65SMarcin Niestroj #include "mx6_common.h"
15*c9e40e65SMarcin Niestroj 
16*c9e40e65SMarcin Niestroj /* SPL options */
17*c9e40e65SMarcin Niestroj #include "imx6_spl.h"
18*c9e40e65SMarcin Niestroj 
19*c9e40e65SMarcin Niestroj /* Size of malloc() pool */
20*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MALLOC_LEN		(16 * SZ_1M)
21*c9e40e65SMarcin Niestroj 
22*c9e40e65SMarcin Niestroj #define CONFIG_BOARD_EARLY_INIT_F
23*c9e40e65SMarcin Niestroj #define CONFIG_BOARD_LATE_INIT
24*c9e40e65SMarcin Niestroj 
25*c9e40e65SMarcin Niestroj #define CONFIG_MXC_UART
26*c9e40e65SMarcin Niestroj #define CONFIG_MXC_UART_BASE		UART1_BASE
27*c9e40e65SMarcin Niestroj 
28*c9e40e65SMarcin Niestroj /* MMC Configs */
29*c9e40e65SMarcin Niestroj #ifdef CONFIG_FSL_USDHC
30*c9e40e65SMarcin Niestroj #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC1_BASE_ADDR
31*c9e40e65SMarcin Niestroj #define CONFIG_SUPPORT_EMMC_BOOT
32*c9e40e65SMarcin Niestroj #endif
33*c9e40e65SMarcin Niestroj 
34*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MMC_IMG_LOAD_PART	1
35*c9e40e65SMarcin Niestroj 
36*c9e40e65SMarcin Niestroj #define CONFIG_EXTRA_ENV_SETTINGS \
37*c9e40e65SMarcin Niestroj 	"script=boot.scr\0" \
38*c9e40e65SMarcin Niestroj 	"image=zImage\0" \
39*c9e40e65SMarcin Niestroj 	"console=ttymxc0\0" \
40*c9e40e65SMarcin Niestroj 	"fdt_high=0xffffffff\0" \
41*c9e40e65SMarcin Niestroj 	"initrd_high=0xffffffff\0" \
42*c9e40e65SMarcin Niestroj 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
43*c9e40e65SMarcin Niestroj 	"fdt_addr=0x83000000\0" \
44*c9e40e65SMarcin Niestroj 	"boot_fdt=try\0" \
45*c9e40e65SMarcin Niestroj 	"ip_dyn=yes\0" \
46*c9e40e65SMarcin Niestroj 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
47*c9e40e65SMarcin Niestroj 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
48*c9e40e65SMarcin Niestroj 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
49*c9e40e65SMarcin Niestroj 	"mmcautodetect=yes\0" \
50*c9e40e65SMarcin Niestroj 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
51*c9e40e65SMarcin Niestroj 		"root=${mmcroot}\0" \
52*c9e40e65SMarcin Niestroj 	"loadbootscript=" \
53*c9e40e65SMarcin Niestroj 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
54*c9e40e65SMarcin Niestroj 	"bootscript=echo Running bootscript from mmc ...; " \
55*c9e40e65SMarcin Niestroj 		"source\0" \
56*c9e40e65SMarcin Niestroj 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
57*c9e40e65SMarcin Niestroj 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
58*c9e40e65SMarcin Niestroj 	"mmcboot=echo Booting from mmc ...; " \
59*c9e40e65SMarcin Niestroj 		"run mmcargs; " \
60*c9e40e65SMarcin Niestroj 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
61*c9e40e65SMarcin Niestroj 			"if run loadfdt; then " \
62*c9e40e65SMarcin Niestroj 				"bootz ${loadaddr} - ${fdt_addr}; " \
63*c9e40e65SMarcin Niestroj 			"else " \
64*c9e40e65SMarcin Niestroj 				"if test ${boot_fdt} = try; then " \
65*c9e40e65SMarcin Niestroj 					"bootz; " \
66*c9e40e65SMarcin Niestroj 				"else " \
67*c9e40e65SMarcin Niestroj 					"echo WARN: Cannot load the DT; " \
68*c9e40e65SMarcin Niestroj 				"fi; " \
69*c9e40e65SMarcin Niestroj 			"fi; " \
70*c9e40e65SMarcin Niestroj 		"else " \
71*c9e40e65SMarcin Niestroj 			"bootz; " \
72*c9e40e65SMarcin Niestroj 		"fi;\0" \
73*c9e40e65SMarcin Niestroj 	"netargs=setenv bootargs console=${console},${baudrate} " \
74*c9e40e65SMarcin Niestroj 		"root=/dev/nfs " \
75*c9e40e65SMarcin Niestroj 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
76*c9e40e65SMarcin Niestroj 	"netboot=echo Booting from net ...; " \
77*c9e40e65SMarcin Niestroj 		"run netargs; " \
78*c9e40e65SMarcin Niestroj 		"if test ${ip_dyn} = yes; then " \
79*c9e40e65SMarcin Niestroj 			"setenv get_cmd dhcp; " \
80*c9e40e65SMarcin Niestroj 		"else " \
81*c9e40e65SMarcin Niestroj 			"setenv get_cmd tftp; " \
82*c9e40e65SMarcin Niestroj 		"fi; " \
83*c9e40e65SMarcin Niestroj 		"${get_cmd} ${image}; " \
84*c9e40e65SMarcin Niestroj 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
85*c9e40e65SMarcin Niestroj 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
86*c9e40e65SMarcin Niestroj 				"bootz ${loadaddr} - ${fdt_addr}; " \
87*c9e40e65SMarcin Niestroj 			"else " \
88*c9e40e65SMarcin Niestroj 				"if test ${boot_fdt} = try; then " \
89*c9e40e65SMarcin Niestroj 					"bootz; " \
90*c9e40e65SMarcin Niestroj 				"else " \
91*c9e40e65SMarcin Niestroj 					"echo WARN: Cannot load the DT; " \
92*c9e40e65SMarcin Niestroj 				"fi; " \
93*c9e40e65SMarcin Niestroj 			"fi; " \
94*c9e40e65SMarcin Niestroj 		"else " \
95*c9e40e65SMarcin Niestroj 			"bootz; " \
96*c9e40e65SMarcin Niestroj 		"fi;\0"
97*c9e40e65SMarcin Niestroj 
98*c9e40e65SMarcin Niestroj #define CONFIG_BOOTCOMMAND \
99*c9e40e65SMarcin Niestroj 	   "mmc dev ${mmcdev};" \
100*c9e40e65SMarcin Niestroj 	   "if mmc rescan; then " \
101*c9e40e65SMarcin Niestroj 		   "if run loadbootscript; then " \
102*c9e40e65SMarcin Niestroj 			   "run bootscript; " \
103*c9e40e65SMarcin Niestroj 		   "else " \
104*c9e40e65SMarcin Niestroj 			   "if run loadimage; then " \
105*c9e40e65SMarcin Niestroj 				   "run mmcboot; " \
106*c9e40e65SMarcin Niestroj 			   "else run netboot; " \
107*c9e40e65SMarcin Niestroj 			   "fi; " \
108*c9e40e65SMarcin Niestroj 		   "fi; " \
109*c9e40e65SMarcin Niestroj 	   "else run netboot; fi"
110*c9e40e65SMarcin Niestroj 
111*c9e40e65SMarcin Niestroj /* Miscellaneous configurable options */
112*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MEMTEST_START	0x80000000
113*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + SZ_128M)
114*c9e40e65SMarcin Niestroj 
115*c9e40e65SMarcin Niestroj #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
116*c9e40e65SMarcin Niestroj #define CONFIG_SYS_HZ			1000
117*c9e40e65SMarcin Niestroj 
118*c9e40e65SMarcin Niestroj #define CONFIG_CMDLINE_EDITING
119*c9e40e65SMarcin Niestroj #define CONFIG_STACKSIZE		SZ_128K
120*c9e40e65SMarcin Niestroj 
121*c9e40e65SMarcin Niestroj /* Physical Memory Map */
122*c9e40e65SMarcin Niestroj #define CONFIG_NR_DRAM_BANKS		1
123*c9e40e65SMarcin Niestroj #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
124*c9e40e65SMarcin Niestroj 
125*c9e40e65SMarcin Niestroj #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
126*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
127*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
128*c9e40e65SMarcin Niestroj 
129*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_SP_OFFSET \
130*c9e40e65SMarcin Niestroj 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
131*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_SP_ADDR \
132*c9e40e65SMarcin Niestroj 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
133*c9e40e65SMarcin Niestroj 
134*c9e40e65SMarcin Niestroj /* FLASH and environment organization */
135*c9e40e65SMarcin Niestroj #define CONFIG_ENV_SIZE			SZ_8K
136*c9e40e65SMarcin Niestroj #define CONFIG_ENV_IS_IN_MMC
137*c9e40e65SMarcin Niestroj #define CONFIG_ENV_OFFSET		(8 * SZ_64K)
138*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MMC_ENV_DEV		0
139*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MMC_ENV_PART		0
140*c9e40e65SMarcin Niestroj #define CONFIG_MMCROOT			"/dev/mmcblk0p2"
141*c9e40e65SMarcin Niestroj 
142*c9e40e65SMarcin Niestroj #define CONFIG_CMD_BMODE
143*c9e40e65SMarcin Niestroj 
144*c9e40e65SMarcin Niestroj /* USB Configs */
145*c9e40e65SMarcin Niestroj #ifdef CONFIG_CMD_USB
146*c9e40e65SMarcin Niestroj #define CONFIG_USB_EHCI
147*c9e40e65SMarcin Niestroj #define CONFIG_USB_EHCI_MX6
148*c9e40e65SMarcin Niestroj #define CONFIG_USB_STORAGE
149*c9e40e65SMarcin Niestroj #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
150*c9e40e65SMarcin Niestroj #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
151*c9e40e65SMarcin Niestroj #define CONFIG_MXC_USB_FLAGS   0
152*c9e40e65SMarcin Niestroj #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
153*c9e40e65SMarcin Niestroj #endif
154*c9e40e65SMarcin Niestroj 
155*c9e40e65SMarcin Niestroj #ifdef CONFIG_CMD_NET
156*c9e40e65SMarcin Niestroj #define CONFIG_FEC_MXC
157*c9e40e65SMarcin Niestroj #define CONFIG_MII
158*c9e40e65SMarcin Niestroj #define CONFIG_FEC_ENET_DEV		0
159*c9e40e65SMarcin Niestroj 
160*c9e40e65SMarcin Niestroj #define IMX_FEC_BASE			ENET_BASE_ADDR
161*c9e40e65SMarcin Niestroj #define CONFIG_FEC_MXC_PHYADDR		0x0
162*c9e40e65SMarcin Niestroj #define CONFIG_FEC_XCV_TYPE		RMII
163*c9e40e65SMarcin Niestroj #define CONFIG_ETHPRIME			"FEC"
164*c9e40e65SMarcin Niestroj 
165*c9e40e65SMarcin Niestroj #define CONFIG_PHYLIB
166*c9e40e65SMarcin Niestroj #define CONFIG_PHY_SMSC
167*c9e40e65SMarcin Niestroj #endif
168*c9e40e65SMarcin Niestroj 
169*c9e40e65SMarcin Niestroj #define CONFIG_IMX_THERMAL
170*c9e40e65SMarcin Niestroj 
171*c9e40e65SMarcin Niestroj #endif
172