xref: /rk3399_rockchip-uboot/include/configs/rv1103b_common.h (revision 6cef3c7b7cc45a9c882fc64e5496a416c99313b8)
1 /*
2  * (C) Copyright 2024 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #ifndef __CONFIG_RV1103B_COMMON_H
8 #define __CONFIG_RV1103B_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_SYS_NS16550_MEM32
16 
17 #ifdef CONFIG_SUPPORT_USBPLUG
18 #define CONFIG_SYS_TEXT_BASE		0x00000000
19 #else
20 #define CONFIG_SYS_TEXT_BASE		0x00200000
21 #endif
22 #define CONFIG_SYS_INIT_SP_ADDR		0x00400000
23 #define CONFIG_SYS_LOAD_ADDR		0x00008000
24 #define CONFIG_SYS_BOOTM_LEN		(64 << 20)
25 #define CONFIG_SYS_SDRAM_BASE		0
26 #define SDRAM_MAX_SIZE			0x20000000
27 #define CONFIG_SYS_NONCACHED_MEMORY    (1 << 20)       /* 1 MiB */
28 
29 /* SPL */
30 #define CONFIG_SPL_FRAMEWORK
31 #define CONFIG_SPL_TEXT_BASE		0x00000000
32 #define CONFIG_SPL_MAX_SIZE		0x40000
33 #define CONFIG_SPL_BSS_START_ADDR	0x001fe000
34 #define CONFIG_SPL_BSS_MAX_SIZE		0x20000
35 #define CONFIG_SPL_STACK		0x001fe000
36 
37 /* secure otp */
38 #define OTP_UBOOT_ROLLBACK_OFFSET	0x350
39 #define OTP_UBOOT_ROLLBACK_WORDS	2	/* 64 bits, 2 words */
40 #define OTP_ALL_ONES_NUM_BITS		32
41 #define OTP_SECURE_BOOT_ENABLE_ADDR	0x20
42 #define OTP_SECURE_BOOT_ENABLE_SIZE	1
43 #define OTP_RSA_HASH_ADDR		0x180
44 #define OTP_RSA_HASH_SIZE		32
45 
46 /* MMC/SD IP block */
47 #define CONFIG_BOUNCE_BUFFER
48 
49 #ifndef CONFIG_SPL_BUILD
50 #ifdef CONFIG_OPTEE_CLIENT
51 #define CONFIG_PRAM			2048
52 #endif
53 /* usb mass storage */
54 #define CONFIG_USB_FUNCTION_MASS_STORAGE
55 #define CONFIG_ROCKUSB_G_DNL_PID	0x110e
56 
57 #define CONFIG_LIB_HW_RAND
58 #define CONFIG_PREBOOT
59 
60 #ifdef CONFIG_ENV_MEM_LAYOUT
61 #define ENV_MEM_LAYOUT_SETTINGS		CONFIG_ENV_MEM_LAYOUT_SETTINGS
62 #else
63 /*
64  *   Image:  0 - 8M
65  *  zImage:  8 - 12M
66  *     fdt: 12 - 13M
67  * ramdisk: 14 ...
68  */
69 #define ENV_MEM_LAYOUT_SETTINGS		\
70 	"scriptaddr=0x00b00000\0"	\
71 	"pxefile_addr_r=0x00c00000\0"	\
72 	"fdt_addr_r=0x00c00000\0"	\
73 	"kernel_addr_c=0x00808000\0"	\
74 	"kernel_addr_r=0x00008000\0"	\
75 	"ramdisk_addr_r=0x000e00000\0"
76 #endif
77 
78 #define CONFIG_EXTRA_ENV_SETTINGS	\
79 	ENV_MEM_LAYOUT_SETTINGS		\
80 	ROCKCHIP_DEVICE_SETTINGS	\
81 	RKIMG_DET_BOOTDEV
82 
83 #undef RKIMG_BOOTCOMMAND
84 #ifdef CONFIG_FIT_SIGNATURE
85 #define RKIMG_BOOTCOMMAND		\
86 	"boot_fit;"
87 #else
88 #define RKIMG_BOOTCOMMAND		\
89 	"boot_fit;"			\
90 	"boot_android ${devtype} ${devnum};"
91 #endif
92 
93 /* Update define for tiny image */
94 #ifdef CONFIG_ROCKCHIP_IMAGE_TINY
95 #undef RKIMG_BOOTCOMMAND
96 #undef RKIMG_DET_BOOTDEV
97 #undef CONFIG_EXTRA_ENV_SETTINGS
98 #undef CONFIG_AUTO_COMPLETE
99 #undef CONFIG_SYS_LONGHELP
100 #undef CONFIG_ZLIB
101 #undef CONFIG_GZIP
102 /* TODO: #define CONFIG_LIB_HW_RAND */
103 
104 #define RKIMG_BOOTCOMMAND		"boot_fit;"
105 #define CONFIG_EXTRA_ENV_SETTINGS	ENV_MEM_LAYOUT_SETTINGS
106 #endif
107 #endif	/* !CONFIG_SPL_BUILD */
108 
109 #endif
110