global: Migrate CONFIG_STACKBASE to CFG
[platform/kernel/u-boot.git] / include / configs / rockchip-common.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2016 Rockchip Electronics Co., Ltd
4  */
5
6 #ifndef _ROCKCHIP_COMMON_H_
7 #define _ROCKCHIP_COMMON_H_
8 #include <linux/sizes.h>
9
10 /* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */
11
12 #ifndef CONFIG_SPL_BUILD
13
14 /* First try to boot from SD (index 1), then eMMC (index 0) */
15 #if CONFIG_IS_ENABLED(CMD_MMC)
16         #define BOOT_TARGET_MMC(func) \
17                 func(MMC, mmc, 1) \
18                 func(MMC, mmc, 0)
19 #else
20         #define BOOT_TARGET_MMC(func)
21 #endif
22
23 #if CONFIG_IS_ENABLED(CMD_NVME)
24         #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
25 #else
26         #define BOOT_TARGET_NVME(func)
27 #endif
28
29 #if CONFIG_IS_ENABLED(CMD_SCSI)
30         #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
31 #else
32         #define BOOT_TARGET_SCSI(func)
33 #endif
34
35 #if CONFIG_IS_ENABLED(CMD_USB)
36         #define BOOT_TARGET_USB(func) func(USB, usb, 0)
37 #else
38         #define BOOT_TARGET_USB(func)
39 #endif
40
41 #if CONFIG_IS_ENABLED(CMD_PXE)
42         #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
43 #else
44         #define BOOT_TARGET_PXE(func)
45 #endif
46
47 #if CONFIG_IS_ENABLED(CMD_DHCP)
48         #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
49 #else
50         #define BOOT_TARGET_DHCP(func)
51 #endif
52
53 #if CONFIG_IS_ENABLED(CMD_SF)
54         #define BOOT_TARGET_SF(func)    func(SF, sf, 0)
55 #else
56         #define BOOT_TARGET_SF(func)
57 #endif
58
59 #ifdef CONFIG_ROCKCHIP_RK3399
60 #define BOOT_TARGET_DEVICES(func) \
61         BOOT_TARGET_MMC(func) \
62         BOOT_TARGET_NVME(func) \
63         BOOT_TARGET_SCSI(func) \
64         BOOT_TARGET_USB(func) \
65         BOOT_TARGET_PXE(func) \
66         BOOT_TARGET_DHCP(func) \
67         BOOT_TARGET_SF(func)
68 #else
69 #define BOOT_TARGET_DEVICES(func) \
70         BOOT_TARGET_MMC(func) \
71         BOOT_TARGET_USB(func) \
72         BOOT_TARGET_PXE(func) \
73         BOOT_TARGET_DHCP(func)
74 #endif
75
76 #ifdef CONFIG_ARM64
77 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
78 #else
79 #define ROOT_UUID "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3;\0"
80 #endif
81 #define PARTS_DEFAULT \
82         "uuid_disk=${uuid_gpt_disk};" \
83         "name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};" \
84         "name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};" \
85         "name=trust,size=4M,uuid=${uuid_gpt_atf};" \
86         "name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \
87         "name=rootfs,size=-,uuid="ROOT_UUID
88
89 #endif
90
91 #endif /* _ROCKCHIP_COMMON_H_ */