pitx-imx8m.h 6.42 KB
Newer Older
1
// SPDX-License-Identifier: GPL-2.0+
Dmitry Petrov's avatar
Dmitry Petrov committed
2
/*
3
4
5
6
7
 * (C) Copyright 2019
 *     Kontron Asia Pacific Design
 * (C) Copyright 2020
 *     Thomas Schaefer, Kontron Europe GmbH
 *     thomas.schaefer@kontron.com
Dmitry Petrov's avatar
Dmitry Petrov committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 */

#ifndef __PITX_IMX8M_H
#define __PITX_IMX8M_H

#include <linux/sizes.h>
#include <asm/arch/imx-regs.h>
#include "imx_env.h"

/******************************************************************************
 * Miscellaneous configurable options
 */
#define CONFIG_MISC_INIT_R

#ifndef CONFIG_SPL_BUILD
#define CONFIG_CMD_KBOARDINFO
/*#define CONFIG_CMD_MMC_RAW_ECSD*/
25
#define CONFIG_DM_PMIC
Dmitry Petrov's avatar
Dmitry Petrov committed
26
27
28
29
#endif

#ifdef CONFIG_USB_TCPC
#undef CONFIG_USB_TCPC
30
31
#endif

Dmitry Petrov's avatar
Dmitry Petrov committed
32
33
34
35
36
37
#define CONFIG_KBOARDINFO_MODULE

#define CONFIG_EMB_EEP_I2C_EEPROM

#define CONFIG_EMB_EEP_I2C_EEPROM_BUS_NUM_EE1	0
#define CONFIG_EMB_EEP_I2C_EEPROM_ADDR_LEN_1	2
38
39
40
#define CONFIG_EMB_EEP_I2C_EEPROM_ADDR_1	0x51
#define CONFIG_EMB_EEP_I2C_EEPROM_OFFSET_1	0x0
#define CONFIG_EMB_EEP_I2C_EEPROM_SIZE		0x1000
Dmitry Petrov's avatar
Dmitry Petrov committed
41

42
#ifdef CONFIG_CMD_KBOARDINFO
Dmitry Petrov's avatar
Dmitry Petrov committed
43
44
45
46
47
48
49
50
51
52
53
54
55
#define CONFIG_HAS_ETH0
#define CONFIG_HAS_ETH1

#define D_ETHADDR                       "02:00:00:01:00:44"
#define D_ETH1ADDR                      "02:00:00:01:00:45"
#endif

/******************************************************************************/

#ifdef CONFIG_SECURE_BOOT
#define CONFIG_CSF_SIZE			0x2000 /* 8K region */
#endif

56
#define CONFIG_SPL_MAX_SIZE		(148 * 1024)
Dmitry Petrov's avatar
Dmitry Petrov committed
57
58
59
60
61
#define CONFIG_SYS_MONITOR_LEN		(512 * 1024)
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x300
#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1

62
63
64
/******************************************************************************
 * SPL
 */
Dmitry Petrov's avatar
Dmitry Petrov committed
65
66
67
#ifdef CONFIG_SPL_BUILD
/*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/
#define CONFIG_SPL_STACK		0x187FF0
68
69
70
71
72
#define CONFIG_SPL_BSS_START_ADDR	0x00180000
#define CONFIG_SPL_BSS_MAX_SIZE		0x2000	/* 8 KB */
#define CONFIG_SYS_SPL_MALLOC_START	0x42200000
#define CONFIG_SYS_SPL_MALLOC_SIZE	0x80000	/* 512 KB */
#define CONFIG_SYS_SPL_PTE_RAM_BASE	0x41580000
73

Dmitry Petrov's avatar
Dmitry Petrov committed
74
75
76
77
#define CONFIG_MALLOC_F_ADDR		0x182000 /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */

#undef CONFIG_DM_MMC
#undef CONFIG_DM_PMIC
78
#undef CONFIG_PMIC_CHILDREN
Dmitry Petrov's avatar
Dmitry Petrov committed
79
#undef CONFIG_DM_PMIC_PFUZE100
80
81
82
#undef CONFIG_CMD_PMIC

#define CONFIG_SYS_FSL_ESDHC_ADDR	0
Dmitry Petrov's avatar
Dmitry Petrov committed
83
84
85
86
87
88
89
90
91
92
93

#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
#define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
#define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */

#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG

#define CONFIG_POWER
#define CONFIG_POWER_I2C
#define CONFIG_POWER_PFUZE100
94
#define CONFIG_POWER_PFUZE100_I2C_ADDR	0x08
Dmitry Petrov's avatar
Dmitry Petrov committed
95
96
#endif

97

Dmitry Petrov's avatar
Dmitry Petrov committed
98
99
100
101
102
103
104
105
#define CONFIG_REMAKE_ELF

#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_BOARD_POSTCLK_INIT
#define CONFIG_BOARD_LATE_INIT

#undef CONFIG_BOOTM_NETBSD

106
107
108
109
/******************************************************************************
 * ENET Config
 * ENET1
 */
Dmitry Petrov's avatar
Dmitry Petrov committed
110
#if defined(CONFIG_CMD_NET)
111
#define CONFIG_ETHPRIME			"FEC"
Dmitry Petrov's avatar
Dmitry Petrov committed
112
113

#define CONFIG_FEC_MXC
114
115
#define CONFIG_FEC_XCV_TYPE		RGMII
#define CONFIG_FEC_MXC_PHYADDR		0
Dmitry Petrov's avatar
Dmitry Petrov committed
116
117
118
119
120
121
122
123
124
#define FEC_QUIRK_ENET_MAC

#define CONFIG_PHY_GIGE
#define IMX_FEC_BASE			0x30BE0000

#define CONFIG_PHYLIB
#define CONFIG_PHY_TI
#endif

125
126
127
128
129
130
131
132
/******************************************************************************
 * Environment Settings
 */
#define CONFIG_ENV_OVERWRITE
#define CONFIG_SYS_MMC_ENV_DEV		1		/* USDHC2 */

/******************************************************************************
 * Default Environment Variables
Dmitry Petrov's avatar
Dmitry Petrov committed
133
 */
134

135
136
137
138
139
140
141
142
143
144
145
#ifndef CONFIG_SPL_BUILD
#define BOOT_TARGET_DEVICES(func) \
	func(MMC, mmc, 0) \
	func(MMC, mmc, 1) \
	func(USB, usb, 0) \
	func(DHCP, dhcp, 0)
#include <config_distro_bootcmd.h>
#else
#define BOOTENV
#endif

146
147
148
149
150
#define CONFIG_EXTRA_ENV_SETTINGS						\
	"autoload=no\0" 							\
	"image=Image\0" 							\
	"splashpos=m,m\0" 							\
	"console=ttymxc2,115200 earlycon=ec_imx6q,0x30880000\0" 		\
151
	"fdt_addr_r=0x43000000\0"						\
152
	"fdt_high=0xffffffffffffffff\0"						\
153
	"boot_fdt=try\0"							\
154
	"fdtfile=pitx-imx8m_hdmi.dtb\0"						\
155
156
	"initrd_addr=0x43800000\0"						\
	"initrd_high=0xffffffffffffffff\0" 					\
157
	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"			\
158
	"scriptaddr=0x40400000\0"						\
159
	"boot_scripts=boot.scr.uimg boot.scr update_pitx/update.scr\0"		\
160
	"video_off=yes\0"							\
161
	BOOTENV
162
163
164



Dmitry Petrov's avatar
Dmitry Petrov committed
165
166
167
/* Link Definitions */
#define CONFIG_LOADADDR			0x40480000

168
#define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
Dmitry Petrov's avatar
Dmitry Petrov committed
169

170
171
#define CONFIG_SYS_INIT_RAM_ADDR	0x40000000
#define CONFIG_SYS_INIT_RAM_SIZE	0x80000
Dmitry Petrov's avatar
Dmitry Petrov committed
172
173
174
175
176
177
178
179
#define CONFIG_SYS_INIT_SP_OFFSET \
        (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)

/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN		((CONFIG_ENV_SIZE + (2*1024) + (16*1024)) * 1024)

180
#define PHYS_SDRAM			0x40000000
181
#define PHYS_SDRAM_SIZE			0xC0000000 /* 3GB DDR in DRAM1 region */
182

183
#define PHYS_SDRAM_2			0x100000000UL
Dmitry Petrov's avatar
Dmitry Petrov committed
184

185
186
187
#define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM
#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + \
					(PHYS_SDRAM_SIZE >> 1))
Dmitry Petrov's avatar
Dmitry Petrov committed
188
189
190
191
192
193
194

#define CONFIG_BAUDRATE			115200

#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE		UART3_BASE_ADDR

/* Monitor Command Prompt */
195
196
197
#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
#define CONFIG_SYS_CBSIZE		2048
#define CONFIG_SYS_MAXARGS		64
198
#define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
Dmitry Petrov's avatar
Dmitry Petrov committed
199
200
201
202
203
204
205
206
207
208
209
#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
					sizeof(CONFIG_SYS_PROMPT) + 16)

#define CONFIG_IMX_BOOTAUX

#define CONFIG_SYS_FSL_USDHC_NUM	2

#define CONFIG_SUPPORT_EMMC_BOOT	/* eMMC specific */
#define CONFIG_SYS_MMC_IMG_LOAD_PART	1

#ifdef CONFIG_FSL_QSPI
210
#define FSL_QSPI_FLASH_SIZE             (SZ_16M)
Dmitry Petrov's avatar
Dmitry Petrov committed
211
212
213
#endif


214
215
216
217
/******************************************************************************
 * I2C Configs
 */
#define CONFIG_SYS_I2C_SPEED		100000
Dmitry Petrov's avatar
Dmitry Petrov committed
218

219
220
221
/******************************************************************************
 * USB configs
 */
Dmitry Petrov's avatar
Dmitry Petrov committed
222
#define CONFIG_SERIAL_TAG
223
#define CONFIG_FASTBOOT_USB_DEV		0
Dmitry Petrov's avatar
Dmitry Petrov committed
224
225


226
#define CONFIG_USB_MAX_CONTROLLER_COUNT	2
Dmitry Petrov's avatar
Dmitry Petrov committed
227
228

#define CONFIG_USBD_HS
229
#define CONFIG_USB_GADGET_VBUS_DRAW	2
Dmitry Petrov's avatar
Dmitry Petrov committed
230
231
232

#define CONFIG_OF_SYSTEM_SETUP

233
/******************************************************************************
234
 * Video
235
 */
236
#ifdef CONFIG_DM_VIDEO
Dmitry Petrov's avatar
Dmitry Petrov committed
237
#define CONFIG_VIDEO_LOGO
238
239
240
241
#define CONFIG_BMP_16BPP
#define CONFIG_BMP_24BPP
#define CONFIG_BMP_32BPP
#define CONFIG_VIDEO_BMP_RLE8
Dmitry Petrov's avatar
Dmitry Petrov committed
242
243
244
245
246
247
248
249
250
#define CONFIG_VIDEO_BMP_LOGO
#endif

#if defined(CONFIG_ANDROID_SUPPORT)
#include "imx8mq_evk_android.h"
#elif defined (CONFIG_ANDROID_THINGS_SUPPORT)
#include "imx8mq_evk_androidthings.h"
#endif
#endif