xref: /rk3399_rockchip-uboot/include/configs/rv1126b_common.h (revision 4a251cba6b2a4eac96fc47a81edaf3838e352aee)
1 /* SPDX-License-Identifier:     GPL-2.0+ */
2 /*
3  * (C) Copyright 2025 Rockchip Electronics Co., Ltd
4  *
5  */
6 
7 #ifndef __CONFIG_RV1126B_COMMON_H
8 #define __CONFIG_RV1126B_COMMON_H
9 
10 #define CFG_CPUID_OFFSET                0x22
11 
12 #include "rockchip-common.h"
13 
14 #define CONFIG_SPL_FRAMEWORK
15 #define CONFIG_SPL_TEXT_BASE		0x4fe00000
16 #define CONFIG_SPL_MAX_SIZE		0x00040000
17 #define CONFIG_SPL_BSS_START_ADDR	0x4fee0000
18 #define CONFIG_SPL_BSS_MAX_SIZE		0x20000
19 #define CONFIG_SPL_STACK		0x4fe00000
20 #ifdef CONFIG_SPL_LOAD_FIT_ADDRESS
21 #undef CONFIG_SPL_LOAD_FIT_ADDRESS
22 #endif
23 #define CONFIG_SPL_LOAD_FIT_ADDRESS	0x42000000
24 
25 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
26 #define CONFIG_SYS_CBSIZE		1024
27 
28 #ifdef CONFIG_SUPPORT_USBPLUG
29 #define CONFIG_SYS_TEXT_BASE		0x40000000
30 #else
31 #define CONFIG_SYS_TEXT_BASE		0x40200000
32 #endif
33 
34 #define CONFIG_SYS_INIT_SP_ADDR		0x40600000
35 #define CONFIG_SYS_LOAD_ADDR		0x40700800
36 #define CONFIG_SYS_BOOTM_LEN		(64 << 20)	/* 64M */
37 
38 #define GICD_BASE			0x21201000
39 #define GICC_BASE			0x21202000
40 
41 #define CONFIG_BOUNCE_BUFFER
42 /* For most, U-Boot no need to use 0-1G space. */
43 #define CONFIG_SYS_SDRAM_BASE		0x40000000
44 #define SDRAM_MAX_SIZE			0xc0000000ULL	/* max 3G */
45 #define CONFIG_SYS_NONCACHED_MEMORY	(1 << 20)	/* 1M */
46 
47 /* env used only in U-Boot */
48 #ifndef CONFIG_SPL_BUILD
49 /* usb mass storage */
50 #define CONFIG_USB_FUNCTION_MASS_STORAGE
51 #define CONFIG_ROCKUSB_G_DNL_PID	0x110f
52 
53 #ifdef CONFIG_ARM64
54 #define ENV_MEM_LAYOUT_SETTINGS \
55 	"scriptaddr=0x40600000\0"	\
56 	"pxefile_addr_r=0x40700000\0"	\
57 	"fdt_addr_r=0x48300000\0"	\
58 	"kernel_addr_r=0x40200000\0"	\
59 	"kernel_addr_aarch32_r=0x40208000\0"	\
60 	"kernel_addr_c=0x45480000\0"	\
61 	"ramdisk_addr_r=0x4a200000\0"
62 #endif
63 
64 #include <config_distro_bootcmd.h>
65 
66 #define CONFIG_EXTRA_ENV_SETTINGS \
67 	ENV_MEM_LAYOUT_SETTINGS \
68 	"partitions=" PARTS_RKIMG \
69 	ROCKCHIP_DEVICE_SETTINGS \
70 	RKIMG_DET_BOOTDEV \
71 	BOOTENV
72 
73 #undef RKIMG_BOOTCOMMAND
74 #ifdef CONFIG_FIT_SIGNATURE
75 #define RKIMG_BOOTCOMMAND		\
76 	"boot_fit;"
77 #else
78 #define RKIMG_BOOTCOMMAND		\
79 	"boot_fit;"			\
80 	"boot_android ${devtype} ${devnum};"
81 #endif
82 #endif /* !CONFIG_SPL_BUILD */
83 
84 #if defined(CONFIG_USB_HOST) || defined(CONFIG_SPL_USB_HOST_SUPPORT)
85 /* rockchip ohci host driver */
86 #define CONFIG_USB_OHCI_NEW
87 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	1
88 #endif
89 
90 #define CONFIG_PREBOOT
91 #define CONFIG_LIB_HW_RAND
92 
93 #endif /* __CONFIG_RV1126B_COMMON_H */
94