xref: /rk3399_rockchip-uboot/include/configs/rk3188_common.h (revision c964ade6392e69a0bd1a7a038a59639eb0a542d2)
1 /*
2  * (C) Copyright 2015 Google, Inc
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #ifndef __CONFIG_RK3188_COMMON_H
8 #define __CONFIG_RK3188_COMMON_H
9 
10 #define CONFIG_SYS_CACHELINE_SIZE	64
11 
12 #include <asm/arch/hardware.h>
13 #include "rockchip-common.h"
14 
15 #define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
16 #define CONFIG_SYS_MALLOC_LEN		(32 << 20)
17 #define CONFIG_SYS_CBSIZE		1024
18 
19 #define CONFIG_SYS_TIMER_COUNTS_DOWN
20 /* RK3188 do not have a ARMv7 ARCH timer */
21 #undef CONFIG_SYS_ARCH_TIMER
22 
23 #ifdef CONFIG_SPL_ROCKCHIP_BACK_TO_BROM
24 /* Bootrom will load u-boot binary to 0x60000000 once return from SPL */
25 #define CONFIG_SYS_TEXT_BASE		0x60000000
26 #else
27 #define CONFIG_SYS_TEXT_BASE		0x60200000
28 #endif
29 #define CONFIG_SYS_INIT_SP_ADDR		0x60400000
30 #define CONFIG_SYS_LOAD_ADDR		0x60800800
31 
32 #define CONFIG_ROCKCHIP_MAX_INIT_SIZE	(0x8000 - 0x800)
33 #define CONFIG_ROCKCHIP_CHIP_TAG	"RK31"
34 #define CONFIG_ROCKUSB_G_DNL_PID	0x310B
35 
36 #define CONFIG_SPL_TEXT_BASE		0x10080800
37 /* spl size 32kb sram - 2kb bootrom */
38 #define CONFIG_SPL_MAX_SIZE		(0x8000 - 0x800)
39 #define CONFIG_SPL_FRAMEWORK		1
40 #define CONFIG_ROCKCHIP_SERIAL		1
41 
42 #define CONFIG_SPL_STACK		0x10087fff
43 
44 /* MMC/SD IP block */
45 #define CONFIG_BOUNCE_BUFFER
46 
47 #define CONFIG_SYS_SDRAM_BASE		0x60000000
48 #define SDRAM_BANK_SIZE			(2UL << 30)
49 #define SDRAM_MAX_SIZE			0x80000000
50 
51 #define CONFIG_SPI
52 #define CONFIG_SF_DEFAULT_SPEED 20000000
53 
54 #ifndef CONFIG_SPL_BUILD
55 
56 /* usb mass storage */
57 #define CONFIG_USB_FUNCTION_MASS_STORAGE
58 
59 /* usb otg */
60 #define CONFIG_ROCKCHIP_USB2_PHY
61 
62 /* usb host support */
63 #define ENV_MEM_LAYOUT_SETTINGS \
64 	"scriptaddr=0x60000000\0" \
65 	"pxefile_addr_r=0x60100000\0" \
66 	"fdt_addr_r=0x68300000\0" \
67 	"kernel_addr_r=0x62000000\0" \
68 	"ramdisk_addr_r=0x6a200000\0"
69 
70 #include <config_distro_bootcmd.h>
71 
72 /* Linux fails to load the fdt if it's loaded above 256M on a Rock board,
73  * so limit the fdt reallocation to that */
74 #define CONFIG_EXTRA_ENV_SETTINGS \
75 	"fdt_high=0x6fffffff\0" \
76 	"initrd_high=0x6fffffff\0" \
77 	"partitions=" PARTS_DEFAULT \
78 	ENV_MEM_LAYOUT_SETTINGS \
79 	ROCKCHIP_DEVICE_SETTINGS \
80 	BOOTENV
81 
82 #endif /* CONFIG_SPL_BUILD */
83 
84 #define CONFIG_PREBOOT
85 
86 #endif
87