xref: /openbmc/u-boot/include/configs/imx6_logic.h (revision 0645c23a)
1 /*
2  * Copyright (C) 2017 Logic PD, Inc.
3  *
4  * Configuration settings for the LogicPD i.MX6 SOM.
5  *
6  * SPDX-License-Identifier:    GPL-2.0+
7  */
8 
9 #ifndef __IMX6LOGIC_CONFIG_H
10 #define __IMX6LOGIC_CONFIG_H
11 
12 #define CONFIG_MXC_UART_BASE   UART1_BASE
13 #define CONSOLE_DEV            "ttymxc0"
14 
15 #include <config_distro_defaults.h>
16 #include "mx6_common.h"
17 
18 /* Size of malloc() pool */
19 #define CONFIG_SYS_MALLOC_LEN          (10 * SZ_1M)
20 
21 #define CONFIG_MXC_UART
22 
23 /* MMC Configs */
24 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
25 #define CONFIG_SYS_FSL_USDHC_NUM       2
26 #define CONFIG_MMCROOT         "/dev/mmcblk1p2" /* Dev kit SD card */
27 
28 /* Ethernet Configs */
29 #define CONFIG_MII
30 #define CONFIG_FEC_XCV_TYPE            RMII
31 #define CONFIG_ETHPRIME                "FEC"
32 #define CONFIG_FEC_MXC_PHYADDR         0
33 #define CONFIG_PHYLIB
34 #define CONFIG_PHY_SMSC
35 
36 /* Command definition */
37 #define CONFIG_CMD_BMODE
38 
39 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
40 
41 #define CONFIG_EXTRA_ENV_SETTINGS \
42 	"script=boot.scr\0" \
43 	"image=zImage\0" \
44 	"bootm_size=0x10000000\0" \
45 	"fdt_addr_r=0x18000000\0" \
46 	"fdt_addr=0x18000000\0" \
47 	"ramdisk_addr_r=0x13000000\0" \
48 	"ramdiskaddr=0x13000000\0" \
49 	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
50 	"ramdisk_file=rootfs.cpio.uboot\0" \
51 	"boot_fdt=try\0" \
52 	"ip_dyn=yes\0" \
53 	"console=" CONSOLE_DEV "\0" \
54 	"mmcdev=1\0" \
55 	"mmcpart=1\0" \
56 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
57 	"nandroot=ubi0:rootfs rootfstype=ubifs\0" \
58 	"mmcargs=setenv bootargs console=${console},${baudrate}" \
59 	" root=${mmcroot} ${mtdparts}\0" \
60 	"nandargs=setenv bootargs console=${console},${baudrate}" \
61 	" ubi.mtd=fs root=${nandroot} ${mtdparts}\0" \
62 	"ramargs=setenv bootargs console=${console},${baudrate}" \
63 	" root=/dev/ram rw ${mtdparts}\0"                    \
64 	"loadbootscript=" \
65 	"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
66 	"bootscript=echo Running bootscript from mmc ...;" \
67 	" source\0" \
68 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \
69 	" setenv kernelsize ${filesize}\0" \
70 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
71 	"loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \
72 	" ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \
73 	"mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \
74 	" run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \
75 	"mmcramboot=run ramargs; run loadimage;" \
76 	" run loadfdt; run loadramdisk;" \
77 	" bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
78 	"nandboot=echo Booting from nand ...; " \
79 	" run nandargs;" \
80 	" nand read ${loadaddr} kernel ${kernelsize};" \
81 	" nand read ${fdt_addr} dtb;" \
82 	" bootz ${loadaddr} - ${fdt_addr}\0" \
83 	"nandramboot=echo Booting RAMdisk from nand ...; " \
84 	" nand read ${ramdiskaddr} fs ${ramdisksize};" \
85 	" nand read ${loadaddr} kernel ${kernelsize};" \
86 	" nand read ${fdt_addr} dtb;" \
87 	" run ramargs;" \
88 	" bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
89 	"netargs=setenv bootargs console=${console},${baudrate} " \
90 	"root=/dev/nfs" \
91 	" ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
92 	"netboot=echo Booting from net ...; " \
93 	"run netargs; " \
94 	"if test ${ip_dyn} = yes; then " \
95 		"setenv get_cmd dhcp; " \
96 	"else " \
97 		"setenv get_cmd tftp; " \
98 	"fi; " \
99 	"${get_cmd} ${image}; " \
100 	"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
101 		"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
102 			"bootz ${loadaddr} - ${fdt_addr}; " \
103 		"else " \
104 			"if test ${boot_fdt} = try; then " \
105 				"bootz; " \
106 				"else " \
107 				"echo WARN: Cannot load the DT; " \
108 			"fi; " \
109 		"fi; " \
110 	"else " \
111 	       "bootz; " \
112 	"fi;\0" \
113 	"autoboot=mmc dev ${mmcdev};" \
114 	"if mmc rescan; then " \
115 		"if run loadbootscript; then " \
116 			"run bootscript; " \
117 		"else " \
118 		"if run loadimage; then " \
119 			"run mmcboot; " \
120 		"else run netboot; " \
121 		"fi; " \
122 	"fi; " \
123 	"else run netboot; fi"
124 #define CONFIG_BOOTCOMMAND \
125 	"run autoboot"
126 
127 #define CONFIG_ARP_TIMEOUT     200UL
128 
129 #define CONFIG_SYS_MEMTEST_START       0x10000000
130 #define CONFIG_SYS_MEMTEST_END         0x10010000
131 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
132 
133 /* Physical Memory Map */
134 #define CONFIG_NR_DRAM_BANKS           1
135 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
136 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
137 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
138 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
139 
140 #define CONFIG_SYS_INIT_SP_OFFSET \
141 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
142 #define CONFIG_SYS_INIT_SP_ADDR \
143 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
144 
145 /* Environment organization */
146 #define CONFIG_ENV_SIZE                        (8 * 1024)
147 #define CONFIG_ENV_IS_IN_NAND
148 #define CONFIG_ENV_OFFSET             0x400000
149 #define CONFIG_ENV_SECT_SIZE          CONFIG_ENV_SIZE
150 
151 /* NAND stuff */
152 #define CONFIG_CMD_NAND_TRIMFFS
153 #define CONFIG_SYS_MAX_NAND_DEVICE     1
154 #define CONFIG_SYS_NAND_BASE           0x40000000
155 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
156 #define CONFIG_SYS_NAND_ONFI_DETECTION
157 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
158 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x200000
159 
160 /* MTD device */
161 # define CONFIG_MTD_DEVICE
162 # define CONFIG_CMD_MTDPARTS
163 # define CONFIG_MTD_PARTITIONS
164 # define MTDIDS_DEFAULT		"nand0=gpmi-nand"
165 # define MTDPARTS_DEFAULT	"mtdparts=gpmi-nand:4m(uboot)," \
166 					"1m(env),16m(kernel),1m(dtb),-(fs)"
167 
168 /* DMA stuff, needed for GPMI/MXS NAND support */
169 #define CONFIG_APBH_DMA
170 #define CONFIG_APBH_DMA_BURST
171 #define CONFIG_APBH_DMA_BURST8
172 
173 /* EEPROM  contains serial no, MAC addr and other Logic PD info */
174 #define CONFIG_I2C_EEPROM
175 
176 #endif                         /* __IMX6LOGIC_CONFIG_H */
177