1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2016 Rockchip Electronics Co., Ltd
6 #ifndef _ROCKCHIP_COMMON_H_
7 #define _ROCKCHIP_COMMON_H_
8 #include <linux/sizes.h>
10 #define CONFIG_SYS_NS16550_MEM32
12 /* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */
14 #ifndef CONFIG_SPL_BUILD
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) \
22 #define BOOT_TARGET_MMC(func)
25 #if CONFIG_IS_ENABLED(CMD_NVME)
26 #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
28 #define BOOT_TARGET_NVME(func)
31 #if CONFIG_IS_ENABLED(CMD_SCSI)
32 #define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
34 #define BOOT_TARGET_SCSI(func)
37 #if CONFIG_IS_ENABLED(CMD_USB)
38 #define BOOT_TARGET_USB(func) func(USB, usb, 0)
40 #define BOOT_TARGET_USB(func)
43 #if CONFIG_IS_ENABLED(CMD_PXE)
44 #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
46 #define BOOT_TARGET_PXE(func)
49 #if CONFIG_IS_ENABLED(CMD_DHCP)
50 #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
52 #define BOOT_TARGET_DHCP(func)
55 #if CONFIG_IS_ENABLED(CMD_SF)
56 #define BOOT_TARGET_SF(func) func(SF, sf, 0)
58 #define BOOT_TARGET_SF(func)
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) \
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)
79 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
81 #define ROOT_UUID "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3;\0"
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
93 #endif /* _ROCKCHIP_COMMON_H_ */