xref: /rk3399_rockchip-uboot/include/configs/rv1103b_common.h (revision e04a8f61d41939fb8619f3d145218fae77469be5)
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			0x80000000
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 /* usb mass storage */
51 #define CONFIG_USB_FUNCTION_MASS_STORAGE
52 #define CONFIG_ROCKUSB_G_DNL_PID	0x110e
53 
54 #define CONFIG_LIB_HW_RAND
55 #define CONFIG_PREBOOT
56 
57 #ifdef CONFIG_ENV_MEM_LAYOUT
58 #define ENV_MEM_LAYOUT_SETTINGS		CONFIG_ENV_MEM_LAYOUT_SETTINGS
59 #else
60 /*
61  *   Image:  0 - 8M
62  *  zImage:  8 - 12M
63  *     fdt: 12 - 13M
64  * ramdisk: 14 ...
65  */
66 #define ENV_MEM_LAYOUT_SETTINGS		\
67 	"scriptaddr=0x00b00000\0"	\
68 	"pxefile_addr_r=0x00c00000\0"	\
69 	"fdt_addr_r=0x00c00000\0"	\
70 	"kernel_addr_c=0x00808000\0"	\
71 	"kernel_addr_r=0x00008000\0"	\
72 	"ramdisk_addr_r=0x000e00000\0"
73 #endif
74 
75 #define CONFIG_EXTRA_ENV_SETTINGS	\
76 	ENV_MEM_LAYOUT_SETTINGS		\
77 	ROCKCHIP_DEVICE_SETTINGS	\
78 	RKIMG_DET_BOOTDEV
79 
80 #undef RKIMG_BOOTCOMMAND
81 #ifdef CONFIG_FIT_SIGNATURE
82 #define RKIMG_BOOTCOMMAND		\
83 	"boot_fit;"
84 #else
85 #define RKIMG_BOOTCOMMAND		\
86 	"boot_fit;"			\
87 	"boot_android ${devtype} ${devnum};"
88 #endif
89 
90 /* Update define for tiny image */
91 #ifdef CONFIG_ROCKCHIP_IMAGE_TINY
92 #undef RKIMG_BOOTCOMMAND
93 #undef RKIMG_DET_BOOTDEV
94 #undef CONFIG_EXTRA_ENV_SETTINGS
95 #undef CONFIG_AUTO_COMPLETE
96 #undef CONFIG_SYS_LONGHELP
97 #undef CONFIG_ZLIB
98 #undef CONFIG_GZIP
99 /* TODO: #define CONFIG_LIB_HW_RAND */
100 
101 #define RKIMG_BOOTCOMMAND		"boot_fit;"
102 #define CONFIG_EXTRA_ENV_SETTINGS	ENV_MEM_LAYOUT_SETTINGS
103 #endif
104 #endif	/* !CONFIG_SPL_BUILD */
105 
106 #endif
107