Convert CONFIG_SPL_PAD_TO et al to Kconfig
[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 #define CONFIG_SYS_NS16550_MEM32
11
12 /* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */
13
14 #ifndef CONFIG_SPL_BUILD
15
16 /* First try to boot from SD (index 1), then eMMC (index 0) */
17 #if CONFIG_IS_ENABLED(CMD_MMC)
18         #define BOOT_TARGET_MMC(func) \
19                 func(MMC, mmc, 1) \
20                 func(MMC, mmc, 0)
21 #else
22         #define BOOT_TARGET_MMC(func)
23 #endif
24
25 #if CONFIG_IS_ENABLED(CMD_NVME)
26         #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
27 #else
28         #define BOOT_TARGET_NVME(func)
29 #endif
30
31 #if CONFIG_IS_ENABLED(CMD_SCSI)
32         #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
33 #else
34         #define BOOT_TARGET_SCSI(func)
35 #endif
36
37 #if CONFIG_IS_ENABLED(CMD_USB)
38         #define BOOT_TARGET_USB(func) func(USB, usb, 0)
39 #else
40         #define BOOT_TARGET_USB(func)
41 #endif
42
43 #if CONFIG_IS_ENABLED(CMD_PXE)
44         #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
45 #else
46         #define BOOT_TARGET_PXE(func)
47 #endif
48
49 #if CONFIG_IS_ENABLED(CMD_DHCP)
50         #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
51 #else
52         #define BOOT_TARGET_DHCP(func)
53 #endif
54
55 #if CONFIG_IS_ENABLED(CMD_SF)
56         #define BOOT_TARGET_SF(func)    func(SF, sf, 0)
57 #else
58         #define BOOT_TARGET_SF(func)
59 #endif
60
61 #ifdef CONFIG_ROCKCHIP_RK3399
62 #define BOOT_TARGET_DEVICES(func) \
63         BOOT_TARGET_MMC(func) \
64         BOOT_TARGET_NVME(func) \
65         BOOT_TARGET_SCSI(func) \
66         BOOT_TARGET_USB(func) \
67         BOOT_TARGET_PXE(func) \
68         BOOT_TARGET_DHCP(func) \
69         BOOT_TARGET_SF(func)
70 #else
71 #define BOOT_TARGET_DEVICES(func) \
72         BOOT_TARGET_MMC(func) \
73         BOOT_TARGET_USB(func) \
74         BOOT_TARGET_PXE(func) \
75         BOOT_TARGET_DHCP(func)
76 #endif
77
78 #ifdef CONFIG_ARM64
79 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
80 #else
81 #define ROOT_UUID "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3;\0"
82 #endif
83 #define PARTS_DEFAULT \
84         "uuid_disk=${uuid_gpt_disk};" \
85         "name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};" \
86         "name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};" \
87         "name=trust,size=4M,uuid=${uuid_gpt_atf};" \
88         "name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \
89         "name=rootfs,size=-,uuid="ROOT_UUID
90
91 #endif
92
93 #endif /* _ROCKCHIP_COMMON_H_ */