xref: /rk3399_rockchip-uboot/include/configs/rv1106_common.h (revision e12b5efd268e1005d4dd24711b7aeefc0edf34bb)
1 /*
2  * (C) Copyright 2022 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #ifndef __CONFIG_RV1106_COMMON_H
8 #define __CONFIG_RV1106_COMMON_H
9 
10 #include "rockchip-common.h"
11 
12 #define COUNTER_FREQUENCY		24000000
13 #define CONFIG_SYS_MALLOC_LEN		(16 << 20)
14 #define CONFIG_SYS_CBSIZE		1024
15 #define CONFIG_SKIP_LOWLEVEL_INIT
16 #define CONFIG_SYS_NS16550_MEM32
17 
18 #define CONFIG_SYS_TEXT_BASE		0x00200000
19 #define CONFIG_SYS_INIT_SP_ADDR		0x00400000
20 #define CONFIG_SYS_LOAD_ADDR		0x00e00800
21 #define CONFIG_SYS_BOOTM_LEN		(64 << 20)
22 #define GICD_BASE			0xff1f1000
23 #define GICC_BASE			0xff1f2000
24 #define CONFIG_SYS_SDRAM_BASE		0
25 #define SDRAM_MAX_SIZE			0xfd000000
26 #define CONFIG_SYS_NONCACHED_MEMORY    (1 << 20)       /* 1 MiB */
27 
28 /* SPL */
29 #define CONFIG_SPL_FRAMEWORK
30 #define CONFIG_SPL_TEXT_BASE		0x00000000
31 #define CONFIG_SPL_MAX_SIZE		0x30000
32 #define CONFIG_SPL_BSS_START_ADDR	0x00600000
33 #define CONFIG_SPL_BSS_MAX_SIZE		0x20000
34 #define CONFIG_SPL_STACK		0x00600000
35 
36 /* secure otp */
37 #define OTP_UBOOT_ROLLBACK_OFFSET	0xe0
38 #define OTP_UBOOT_ROLLBACK_WORDS	2	/* 64 bits, 2 words */
39 #define OTP_ALL_ONES_NUM_BITS		32
40 #define OTP_SECURE_BOOT_ENABLE_ADDR	0x80
41 #define OTP_SECURE_BOOT_ENABLE_SIZE	2
42 #define OTP_RSA_HASH_ADDR		0x90
43 #define OTP_RSA_HASH_SIZE		32
44 
45 /* MMC/SD IP block */
46 #define CONFIG_BOUNCE_BUFFER
47 
48 #ifndef CONFIG_SPL_BUILD
49 /* usb mass storage */
50 #define CONFIG_USB_FUNCTION_MASS_STORAGE
51 #define CONFIG_ROCKUSB_G_DNL_PID	0x110c
52 
53 #define CONFIG_LIB_HW_RAND
54 #define CONFIG_PREBOOT
55 
56 /*
57  *   Image:  0 - 8M
58  *  zImage:  8 - 12M
59  *     fdt: 12 - 13M
60  * ramdisk: 14 ...
61  */
62 #define ENV_MEM_LAYOUT_SETTINGS		\
63 	"scriptaddr=0x00b00000\0"	\
64 	"pxefile_addr_r=0x00c00000\0"	\
65 	"fdt_addr_r=0x00c00000\0"	\
66 	"kernel_addr_c=0x00808000\0"	\
67 	"kernel_addr_r=0x00008000\0"	\
68 	"ramdisk_addr_r=0x000e00000\0"
69 
70 #define CONFIG_EXTRA_ENV_SETTINGS	\
71 	ENV_MEM_LAYOUT_SETTINGS		\
72 	ROCKCHIP_DEVICE_SETTINGS	\
73 	RKIMG_DET_BOOTDEV
74 
75 #undef RKIMG_BOOTCOMMAND
76 #ifdef CONFIG_FIT_SIGNATURE
77 #define RKIMG_BOOTCOMMAND		\
78 	"boot_fit;"
79 #else
80 #define RKIMG_BOOTCOMMAND		\
81 	"boot_fit;"			\
82 	"boot_android ${devtype} ${devnum};"
83 #endif
84 
85 /* Update define for tiny image */
86 #ifdef CONFIG_ROCKCHIP_IMAGE_TINY
87 #undef RKIMG_BOOTCOMMAND
88 #undef RKIMG_DET_BOOTDEV
89 #undef CONFIG_EXTRA_ENV_SETTINGS
90 #undef CONFIG_AUTO_COMPLETE
91 #undef CONFIG_SYS_LONGHELP
92 #undef CONFIG_ZLIB
93 #undef CONFIG_GZIP
94 /* TODO: #define CONFIG_LIB_HW_RAND */
95 
96 #define RKIMG_BOOTCOMMAND		"boot_fit;"
97 #define CONFIG_EXTRA_ENV_SETTINGS	ENV_MEM_LAYOUT_SETTINGS
98 #endif
99 #endif	/* !CONFIG_SPL_BUILD */
100 
101 #endif
102