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