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