xref: /rk3399_rockchip-uboot/include/configs/rv1126b_common.h (revision 4e72b3266b78595b835d5326b538aedd3bd0e034)
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		0x43f00000
16 #define CONFIG_SPL_MAX_SIZE		0x00040000
17 #define CONFIG_SPL_BSS_START_ADDR	0x43fe0000
18 #define CONFIG_SPL_BSS_MAX_SIZE		0x20000
19 #define CONFIG_SPL_STACK		0x43f00000
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=0x40400000\0"	\
59 	"kernel_addr_c=0x45480000\0"	\
60 	"ramdisk_addr_r=0x4a200000\0"
61 #else
62 #define ENV_MEM_LAYOUT_SETTINGS \
63 	"scriptaddr=0x40600000\0"	\
64 	"pxefile_addr_r=0x40700000\0"	\
65 	"fdt_addr_r=0x48300000\0"	\
66 	"kernel_addr_r=0x40208000\0"	\
67 	"kernel_addr_c=0x41200000\0"	\
68 	"ramdisk_addr_r=0x41800000\0"
69 #endif
70 
71 #include <config_distro_bootcmd.h>
72 
73 #define CONFIG_EXTRA_ENV_SETTINGS \
74 	ENV_MEM_LAYOUT_SETTINGS \
75 	"partitions=" PARTS_RKIMG \
76 	ROCKCHIP_DEVICE_SETTINGS \
77 	RKIMG_DET_BOOTDEV \
78 	BOOTENV
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 #endif /* !CONFIG_SPL_BUILD */
90 
91 /* rockchip ohci host driver */
92 #define CONFIG_USB_OHCI_NEW
93 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	1
94 
95 #define CONFIG_PREBOOT
96 #define CONFIG_LIB_HW_RAND
97 
98 #endif /* __CONFIG_RV1126B_COMMON_H */
99