1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Configuration for MediaTek MT8512 SoC
4  *
5  * Copyright (C) 2019 MediaTek Inc.
6  * Author: Mingming Lee <mingming.lee@mediatek.com>
7  */
8 
9 #ifndef __MT8512_H
10 #define __MT8512_H
11 
12 #include <linux/sizes.h>
13 
14 #define CONFIG_SYS_NONCACHED_MEMORY		SZ_1M
15 
16 #define CONFIG_CPU_ARMV8
17 
18 #define COUNTER_FREQUENCY			13000000
19 
20 #define CONFIG_SYS_LOAD_ADDR			0x41000000
21 #define CONFIG_LOADADDR				CONFIG_SYS_LOAD_ADDR
22 
23 #define CONFIG_SYS_MALLOC_LEN			SZ_32M
24 #define CONFIG_SYS_BOOTM_LEN			SZ_64M
25 
26 /* Uboot definition */
27 #define CONFIG_SYS_UBOOT_START			CONFIG_SYS_TEXT_BASE
28 #define CONFIG_SYS_INIT_SP_ADDR			(CONFIG_SYS_TEXT_BASE + \
29 						SZ_2M - \
30 						GENERATED_GBL_DATA_SIZE)
31 
32 #define ENV_BOOT_READ_IMAGE \
33 	"boot_rd_img=mmc dev 0" \
34 	";mmc read ${loadaddr} 0x27000 0x8000" \
35 	";iminfo ${loadaddr}\0"
36 
37 /* Console configuration */
38 #define ENV_DEVICE_SETTINGS \
39 	"stdin=serial\0" \
40 	"stdout=serial\0" \
41 	"stderr=serial\0"
42 
43 #define ENV_BOOT_CMD \
44 	"mtk_boot=run boot_rd_img;bootm;\0"
45 
46 #define CONFIG_EXTRA_ENV_SETTINGS \
47 	"fdt_high=0x6c000000\0" \
48 	ENV_DEVICE_SETTINGS \
49 	ENV_BOOT_READ_IMAGE \
50 	ENV_BOOT_CMD \
51 	"bootcmd=run mtk_boot;\0" \
52 
53 #endif
54