xref: /rk3399_rockchip-uboot/include/configs/rk3576_common.h (revision f11557654b890b08c3f8f18d042f36a4ac17447f)
1 /* SPDX-License-Identifier:     GPL-2.0+ */
2 /*
3  * (C) Copyright 2023 Rockchip Electronics Co., Ltd
4  *
5  */
6 
7 #ifndef __CONFIG_RK3576_COMMON_H
8 #define __CONFIG_RK3576_COMMON_H
9 
10 #include "rockchip-common.h"
11 
12 #define CONFIG_SPL_FRAMEWORK
13 #define CONFIG_SPL_TEXT_BASE		0x40000000
14 #define CONFIG_SPL_MAX_SIZE		0x00040000
15 #define CONFIG_SPL_BSS_START_ADDR	0x43fe0000
16 #define CONFIG_SPL_BSS_MAX_SIZE		0x00010000
17 #define CONFIG_SPL_STACK		0x43fe0000
18 #ifdef CONFIG_SPL_LOAD_FIT_ADDRESS
19 #undef CONFIG_SPL_LOAD_FIT_ADDRESS
20 #endif
21 #define CONFIG_SPL_LOAD_FIT_ADDRESS	0x42000000
22 
23 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
24 #define CONFIG_SYS_CBSIZE		1024
25 
26 #ifdef CONFIG_SUPPORT_USBPLUG
27 #define CONFIG_SYS_TEXT_BASE		0x00000000
28 #else
29 #define CONFIG_SYS_TEXT_BASE		0x40200000
30 #endif
31 
32 #define CONFIG_SYS_INIT_SP_ADDR		0x40400000
33 #define CONFIG_SYS_LOAD_ADDR		0x40708000
34 #define CONFIG_SYS_BOOTM_LEN		(64 << 20)	/* 64M */
35 #define COUNTER_FREQUENCY		24000000
36 
37 #define CONFIG_BOUNCE_BUFFER
38 #define CONFIG_SYS_SDRAM_BASE		0x40000000
39 #define SDRAM_MAX_SIZE			(0x100000000 - CONFIG_SYS_SDRAM_BASE)	/* max 4G */
40 #define CONFIG_SYS_NONCACHED_MEMORY	(1 << 20)	/* 1M */
41 #define CONFIG_SYS_MMC_ENV_DEV	0
42 
43 /* env used only in U-Boot */
44 #ifndef CONFIG_SPL_BUILD
45 /* usb mass storage */
46 #define CONFIG_USB_FUNCTION_MASS_STORAGE
47 #define CONFIG_ROCKUSB_G_DNL_PID	0x350e
48 
49 /*
50  * decompressed kernel:  7M ~ 80M
51  * compressed kernel:    80M ~ 120M
52  * compressed ramdisk:   120M ~ 160M
53  * kernel fdt:           160M ~ 162M
54  * uncompressed ramdisk: 162M ~ max
55  */
56 #define ENV_MEM_LAYOUT_SETTINGS \
57 	"scriptaddr=0x40500000\0" \
58 	"pxefile_addr_r=0x40600000\0" \
59 	"fdt_addr_r=0x4a000000\0" \
60 	"kernel_addr_r=0x40700000\0" \
61 	"kernel_addr_c=0x45000000\0" \
62 	"ramdisk_addr_r=0x4a200000\0" \
63 	"ramdisk_addr_c=0x47800000\0"
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 #endif /* !CONFIG_SPL_BUILD */
73 
74 /* rockchip ohci host driver */
75 #define CONFIG_USB_OHCI_NEW
76 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	1
77 
78 #define CONFIG_PREBOOT
79 #define CONFIG_LIB_HW_RAND
80 
81 #endif /* __CONFIG_RK3576_COMMON_H */
82