xref: /openbmc/u-boot/include/configs/imx6_logic.h (revision cd1cc31f)
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_PHY_SMSC
34 
35 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
36 
37 #define CONFIG_EXTRA_ENV_SETTINGS \
38 	"script=boot.scr\0" \
39 	"image=zImage\0" \
40 	"bootm_size=0x10000000\0" \
41 	"fdt_addr_r=0x18000000\0" \
42 	"fdt_addr=0x18000000\0" \
43 	"ramdisk_addr_r=0x13000000\0" \
44 	"ramdiskaddr=0x13000000\0" \
45 	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
46 	"ramdisk_file=rootfs.cpio.uboot\0" \
47 	"boot_fdt=try\0" \
48 	"ip_dyn=yes\0" \
49 	"console=" CONSOLE_DEV "\0" \
50 	"mmcdev=1\0" \
51 	"mmcpart=1\0" \
52 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
53 	"nandroot=ubi0:rootfs rootfstype=ubifs\0" \
54 	"mmcargs=setenv bootargs console=${console},${baudrate}" \
55 	" root=${mmcroot} ${mtdparts}\0" \
56 	"nandargs=setenv bootargs console=${console},${baudrate}" \
57 	" ubi.mtd=fs root=${nandroot} ${mtdparts}\0" \
58 	"ramargs=setenv bootargs console=${console},${baudrate}" \
59 	" root=/dev/ram rw ${mtdparts}\0"                    \
60 	"loadbootscript=" \
61 	"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
62 	"bootscript=echo Running bootscript from mmc ...;" \
63 	" source\0" \
64 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \
65 	" setenv kernelsize ${filesize}\0" \
66 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
67 	"loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \
68 	" ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \
69 	"mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \
70 	" run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \
71 	"mmcramboot=run ramargs; run loadimage;" \
72 	" run loadfdt; run loadramdisk;" \
73 	" bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
74 	"nandboot=echo Booting from nand ...; " \
75 	" run nandargs;" \
76 	" nand read ${loadaddr} kernel ${kernelsize};" \
77 	" nand read ${fdt_addr} dtb;" \
78 	" bootz ${loadaddr} - ${fdt_addr}\0" \
79 	"nandramboot=echo Booting RAMdisk from nand ...; " \
80 	" nand read ${ramdiskaddr} fs ${ramdisksize};" \
81 	" nand read ${loadaddr} kernel ${kernelsize};" \
82 	" nand read ${fdt_addr} dtb;" \
83 	" run ramargs;" \
84 	" bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
85 	"netargs=setenv bootargs console=${console},${baudrate} " \
86 	"root=/dev/nfs" \
87 	" ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
88 	"netboot=echo Booting from net ...; " \
89 	"run netargs; " \
90 	"if test ${ip_dyn} = yes; then " \
91 		"setenv get_cmd dhcp; " \
92 	"else " \
93 		"setenv get_cmd tftp; " \
94 	"fi; " \
95 	"${get_cmd} ${image}; " \
96 	"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
97 		"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
98 			"bootz ${loadaddr} - ${fdt_addr}; " \
99 		"else " \
100 			"if test ${boot_fdt} = try; then " \
101 				"bootz; " \
102 				"else " \
103 				"echo WARN: Cannot load the DT; " \
104 			"fi; " \
105 		"fi; " \
106 	"else " \
107 	       "bootz; " \
108 	"fi;\0" \
109 	"autoboot=mmc dev ${mmcdev};" \
110 	"if mmc rescan; then " \
111 		"if run loadbootscript; then " \
112 			"run bootscript; " \
113 		"else " \
114 		"if run loadimage; then " \
115 			"run mmcboot; " \
116 		"else run netboot; " \
117 		"fi; " \
118 	"fi; " \
119 	"else run netboot; fi"
120 #define CONFIG_BOOTCOMMAND \
121 	"run autoboot"
122 
123 #define CONFIG_ARP_TIMEOUT     200UL
124 
125 #define CONFIG_SYS_MEMTEST_START       0x10000000
126 #define CONFIG_SYS_MEMTEST_END         0x10010000
127 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
128 
129 /* Physical Memory Map */
130 #define CONFIG_NR_DRAM_BANKS           1
131 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
132 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
133 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
134 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
135 
136 #define CONFIG_SYS_INIT_SP_OFFSET \
137 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
138 #define CONFIG_SYS_INIT_SP_ADDR \
139 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
140 
141 /* Environment organization */
142 #define CONFIG_ENV_SIZE                        (8 * 1024)
143 #define CONFIG_ENV_OFFSET             0x400000
144 #define CONFIG_ENV_SECT_SIZE          CONFIG_ENV_SIZE
145 
146 /* NAND stuff */
147 #define CONFIG_SYS_MAX_NAND_DEVICE     1
148 #define CONFIG_SYS_NAND_BASE           0x40000000
149 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
150 #define CONFIG_SYS_NAND_ONFI_DETECTION
151 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
152 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x200000
153 
154 /* MTD device */
155 # define CONFIG_MTD_DEVICE
156 # define CONFIG_MTD_PARTITIONS
157 
158 /* DMA stuff, needed for GPMI/MXS NAND support */
159 #define CONFIG_APBH_DMA
160 #define CONFIG_APBH_DMA_BURST
161 #define CONFIG_APBH_DMA_BURST8
162 
163 /* EEPROM  contains serial no, MAC addr and other Logic PD info */
164 #define CONFIG_I2C_EEPROM
165 
166 #endif                         /* __IMX6LOGIC_CONFIG_H */
167