xref: /rk3399_rockchip-uboot/include/configs/liteboard.h (revision ecad7051b07b11fb17196ce45ed0cbe2f1c3234e)
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_MXC_UART
23*c9e40e65SMarcin Niestroj #define CONFIG_MXC_UART_BASE		UART1_BASE
24*c9e40e65SMarcin Niestroj 
25*c9e40e65SMarcin Niestroj /* MMC Configs */
26*c9e40e65SMarcin Niestroj #ifdef CONFIG_FSL_USDHC
27*c9e40e65SMarcin Niestroj #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC1_BASE_ADDR
28*c9e40e65SMarcin Niestroj #define CONFIG_SUPPORT_EMMC_BOOT
29*c9e40e65SMarcin Niestroj #endif
30*c9e40e65SMarcin Niestroj 
31*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MMC_IMG_LOAD_PART	1
32*c9e40e65SMarcin Niestroj 
33*c9e40e65SMarcin Niestroj #define CONFIG_EXTRA_ENV_SETTINGS \
34*c9e40e65SMarcin Niestroj 	"script=boot.scr\0" \
35*c9e40e65SMarcin Niestroj 	"image=zImage\0" \
36*c9e40e65SMarcin Niestroj 	"console=ttymxc0\0" \
37*c9e40e65SMarcin Niestroj 	"fdt_high=0xffffffff\0" \
38*c9e40e65SMarcin Niestroj 	"initrd_high=0xffffffff\0" \
39*c9e40e65SMarcin Niestroj 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
40*c9e40e65SMarcin Niestroj 	"fdt_addr=0x83000000\0" \
41*c9e40e65SMarcin Niestroj 	"boot_fdt=try\0" \
42*c9e40e65SMarcin Niestroj 	"ip_dyn=yes\0" \
43*c9e40e65SMarcin Niestroj 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
44*c9e40e65SMarcin Niestroj 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
45*c9e40e65SMarcin Niestroj 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
46*c9e40e65SMarcin Niestroj 	"mmcautodetect=yes\0" \
47*c9e40e65SMarcin Niestroj 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
48*c9e40e65SMarcin Niestroj 		"root=${mmcroot}\0" \
49*c9e40e65SMarcin Niestroj 	"loadbootscript=" \
50*c9e40e65SMarcin Niestroj 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
51*c9e40e65SMarcin Niestroj 	"bootscript=echo Running bootscript from mmc ...; " \
52*c9e40e65SMarcin Niestroj 		"source\0" \
53*c9e40e65SMarcin Niestroj 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
54*c9e40e65SMarcin Niestroj 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
55*c9e40e65SMarcin Niestroj 	"mmcboot=echo Booting from mmc ...; " \
56*c9e40e65SMarcin Niestroj 		"run mmcargs; " \
57*c9e40e65SMarcin Niestroj 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
58*c9e40e65SMarcin Niestroj 			"if run loadfdt; then " \
59*c9e40e65SMarcin Niestroj 				"bootz ${loadaddr} - ${fdt_addr}; " \
60*c9e40e65SMarcin Niestroj 			"else " \
61*c9e40e65SMarcin Niestroj 				"if test ${boot_fdt} = try; then " \
62*c9e40e65SMarcin Niestroj 					"bootz; " \
63*c9e40e65SMarcin Niestroj 				"else " \
64*c9e40e65SMarcin Niestroj 					"echo WARN: Cannot load the DT; " \
65*c9e40e65SMarcin Niestroj 				"fi; " \
66*c9e40e65SMarcin Niestroj 			"fi; " \
67*c9e40e65SMarcin Niestroj 		"else " \
68*c9e40e65SMarcin Niestroj 			"bootz; " \
69*c9e40e65SMarcin Niestroj 		"fi;\0" \
70*c9e40e65SMarcin Niestroj 	"netargs=setenv bootargs console=${console},${baudrate} " \
71*c9e40e65SMarcin Niestroj 		"root=/dev/nfs " \
72*c9e40e65SMarcin Niestroj 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
73*c9e40e65SMarcin Niestroj 	"netboot=echo Booting from net ...; " \
74*c9e40e65SMarcin Niestroj 		"run netargs; " \
75*c9e40e65SMarcin Niestroj 		"if test ${ip_dyn} = yes; then " \
76*c9e40e65SMarcin Niestroj 			"setenv get_cmd dhcp; " \
77*c9e40e65SMarcin Niestroj 		"else " \
78*c9e40e65SMarcin Niestroj 			"setenv get_cmd tftp; " \
79*c9e40e65SMarcin Niestroj 		"fi; " \
80*c9e40e65SMarcin Niestroj 		"${get_cmd} ${image}; " \
81*c9e40e65SMarcin Niestroj 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
82*c9e40e65SMarcin Niestroj 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
83*c9e40e65SMarcin Niestroj 				"bootz ${loadaddr} - ${fdt_addr}; " \
84*c9e40e65SMarcin Niestroj 			"else " \
85*c9e40e65SMarcin Niestroj 				"if test ${boot_fdt} = try; then " \
86*c9e40e65SMarcin Niestroj 					"bootz; " \
87*c9e40e65SMarcin Niestroj 				"else " \
88*c9e40e65SMarcin Niestroj 					"echo WARN: Cannot load the DT; " \
89*c9e40e65SMarcin Niestroj 				"fi; " \
90*c9e40e65SMarcin Niestroj 			"fi; " \
91*c9e40e65SMarcin Niestroj 		"else " \
92*c9e40e65SMarcin Niestroj 			"bootz; " \
93*c9e40e65SMarcin Niestroj 		"fi;\0"
94*c9e40e65SMarcin Niestroj 
95*c9e40e65SMarcin Niestroj #define CONFIG_BOOTCOMMAND \
96*c9e40e65SMarcin Niestroj 	   "mmc dev ${mmcdev};" \
97*c9e40e65SMarcin Niestroj 	   "if mmc rescan; then " \
98*c9e40e65SMarcin Niestroj 		   "if run loadbootscript; then " \
99*c9e40e65SMarcin Niestroj 			   "run bootscript; " \
100*c9e40e65SMarcin Niestroj 		   "else " \
101*c9e40e65SMarcin Niestroj 			   "if run loadimage; then " \
102*c9e40e65SMarcin Niestroj 				   "run mmcboot; " \
103*c9e40e65SMarcin Niestroj 			   "else run netboot; " \
104*c9e40e65SMarcin Niestroj 			   "fi; " \
105*c9e40e65SMarcin Niestroj 		   "fi; " \
106*c9e40e65SMarcin Niestroj 	   "else run netboot; fi"
107*c9e40e65SMarcin Niestroj 
108*c9e40e65SMarcin Niestroj /* Miscellaneous configurable options */
109*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MEMTEST_START	0x80000000
110*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + SZ_128M)
111*c9e40e65SMarcin Niestroj 
112*c9e40e65SMarcin Niestroj #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
113*c9e40e65SMarcin Niestroj #define CONFIG_SYS_HZ			1000
114*c9e40e65SMarcin Niestroj 
115*c9e40e65SMarcin Niestroj #define CONFIG_CMDLINE_EDITING
116*c9e40e65SMarcin Niestroj 
117*c9e40e65SMarcin Niestroj /* Physical Memory Map */
118*c9e40e65SMarcin Niestroj #define CONFIG_NR_DRAM_BANKS		1
119*c9e40e65SMarcin Niestroj #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
120*c9e40e65SMarcin Niestroj 
121*c9e40e65SMarcin Niestroj #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
122*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
123*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
124*c9e40e65SMarcin Niestroj 
125*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_SP_OFFSET \
126*c9e40e65SMarcin Niestroj 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
127*c9e40e65SMarcin Niestroj #define CONFIG_SYS_INIT_SP_ADDR \
128*c9e40e65SMarcin Niestroj 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
129*c9e40e65SMarcin Niestroj 
130*c9e40e65SMarcin Niestroj /* FLASH and environment organization */
131*c9e40e65SMarcin Niestroj #define CONFIG_ENV_SIZE			SZ_8K
132*c9e40e65SMarcin Niestroj #define CONFIG_ENV_OFFSET		(8 * SZ_64K)
133*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MMC_ENV_DEV		0
134*c9e40e65SMarcin Niestroj #define CONFIG_SYS_MMC_ENV_PART		0
135*c9e40e65SMarcin Niestroj #define CONFIG_MMCROOT			"/dev/mmcblk0p2"
136*c9e40e65SMarcin Niestroj 
137*c9e40e65SMarcin Niestroj /* USB Configs */
138*c9e40e65SMarcin Niestroj #ifdef CONFIG_CMD_USB
139*c9e40e65SMarcin Niestroj #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
140*c9e40e65SMarcin Niestroj #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
141*c9e40e65SMarcin Niestroj #define CONFIG_MXC_USB_FLAGS   0
142*c9e40e65SMarcin Niestroj #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
143*c9e40e65SMarcin Niestroj #endif
144*c9e40e65SMarcin Niestroj 
145*c9e40e65SMarcin Niestroj #ifdef CONFIG_CMD_NET
146*c9e40e65SMarcin Niestroj #define CONFIG_FEC_MXC
147*c9e40e65SMarcin Niestroj #define CONFIG_MII
148*c9e40e65SMarcin Niestroj #define CONFIG_FEC_ENET_DEV		0
149*c9e40e65SMarcin Niestroj 
150*c9e40e65SMarcin Niestroj #define IMX_FEC_BASE			ENET_BASE_ADDR
151*c9e40e65SMarcin Niestroj #define CONFIG_FEC_MXC_PHYADDR		0x0
152*c9e40e65SMarcin Niestroj #define CONFIG_FEC_XCV_TYPE		RMII
153*c9e40e65SMarcin Niestroj #define CONFIG_ETHPRIME			"FEC"
154*c9e40e65SMarcin Niestroj 
155*c9e40e65SMarcin Niestroj #define CONFIG_PHY_SMSC
156*c9e40e65SMarcin Niestroj #endif
157*c9e40e65SMarcin Niestroj 
158*c9e40e65SMarcin Niestroj #define CONFIG_IMX_THERMAL
159*c9e40e65SMarcin Niestroj 
160*c9e40e65SMarcin Niestroj #endif
161