xref: /rk3399_rockchip-uboot/include/configs/rk3288_common.h (revision d5f538dc02e53c7267fcd4a914104071fca889b5)
1 /*
2  * (C) Copyright 2015 Google, Inc
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #ifndef __CONFIG_RK3288_COMMON_H
8 #define __CONFIG_RK3288_COMMON_H
9 
10 #include <asm/arch/hardware.h>
11 #include "rockchip-common.h"
12 
13 #ifndef CONFIG_SPL_BUILD
14 #undef CONFIG_BOOTCOMMAND
15 #define CONFIG_BOOTCOMMAND RKIMG_BOOTCOMMAND
16 #endif
17 
18 #define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
19 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
20 #define CONFIG_SYS_CBSIZE		1024
21 
22 #define CONFIG_SPL_FRAMEWORK
23 #ifdef CONFIG_SPL_ROCKCHIP_BACK_TO_BROM
24 /* Bootrom will load u-boot binary to 0x0 once return from SPL */
25 #define CONFIG_SYS_TEXT_BASE		0x00000000
26 #else
27 #define CONFIG_SYS_TEXT_BASE		0x00100000
28 #endif
29 #define CONFIG_SYS_INIT_SP_ADDR		0x00100000
30 #define CONFIG_SYS_LOAD_ADDR		0x00800800
31 #define CONFIG_SPL_STACK		0xff718000
32 
33 #define GICD_BASE			0xffc01000
34 #define GICC_BASE			0xffc02000
35 
36 #define CONFIG_ROCKUSB_G_DNL_PID	0x320A
37 
38 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_TPL_BOOTROM_SUPPORT)
39 # define CONFIG_SPL_TEXT_BASE		0x0
40 #else
41 # define CONFIG_SPL_TEXT_BASE		0xff704000
42 #endif
43 
44 /* MMC/SD IP block */
45 #define CONFIG_BOUNCE_BUFFER
46 
47 /* RAW SD card / eMMC locations. */
48 #define CONFIG_SYS_SPI_U_BOOT_OFFS	(128 << 10)
49 
50 /* FAT sd card locations. */
51 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
52 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
53 
54 #define CONFIG_SYS_SDRAM_BASE		0
55 #define SDRAM_BANK_SIZE			(2UL << 30)
56 #define SDRAM_MAX_SIZE			0xfe000000
57 
58 #define CONFIG_SPI_FLASH
59 #define CONFIG_SPI
60 #define CONFIG_SF_DEFAULT_SPEED 20000000
61 
62 #ifndef CONFIG_SPL_BUILD
63 /* usb otg */
64 #define CONFIG_ROCKCHIP_USB2_PHY
65 
66 /* usb mass storage */
67 #define CONFIG_USB_FUNCTION_MASS_STORAGE
68 #define CONFIG_CMD_USB_MASS_STORAGE
69 
70 /* usb host support */
71 #define ENV_MEM_LAYOUT_SETTINGS \
72 	"scriptaddr=0x00000000\0" \
73 	"pxefile_addr_r=0x00100000\0" \
74 	"fdt_addr_r=0x01f00000\0" \
75 	"kernel_addr_r=0x02000000\0" \
76 	"ramdisk_addr_r=0x04000000\0"
77 
78 #include <config_distro_bootcmd.h>
79 
80 /* Linux fails to load the fdt if it's loaded above 256M on a Rock 2 board, so
81  * limit the fdt reallocation to that */
82 #define CONFIG_EXTRA_ENV_SETTINGS \
83 	"fdt_high=0x0fffffff\0" \
84 	"initrd_high=0x0fffffff\0" \
85 	"partitions=" PARTS_DEFAULT \
86 	ENV_MEM_LAYOUT_SETTINGS \
87 	ROCKCHIP_DEVICE_SETTINGS \
88 	RKIMG_DET_BOOTDEV \
89 	BOOTENV
90 #endif
91 
92 #define CONFIG_PREBOOT
93 
94 #endif
95