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 #ifndef CONFIG_SPL_BUILD 11 12 /* First try to boot from SD (index 0), then eMMC (index 1) */ 13 #if CONFIG_IS_ENABLED(CMD_MMC) 14 #define BOOT_TARGET_MMC(func) \ 15 func(MMC, mmc, 0) \ 16 func(MMC, mmc, 1) 17 #else 18 #define BOOT_TARGET_MMC(func) 19 #endif 20 21 #if CONFIG_IS_ENABLED(CMD_USB) 22 #define BOOT_TARGET_USB(func) func(USB, usb, 0) 23 #else 24 #define BOOT_TARGET_USB(func) 25 #endif 26 27 #if CONFIG_IS_ENABLED(CMD_PXE) 28 #define BOOT_TARGET_PXE(func) func(PXE, pxe, na) 29 #else 30 #define BOOT_TARGET_PXE(func) 31 #endif 32 33 #if CONFIG_IS_ENABLED(CMD_DHCP) 34 #define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na) 35 #else 36 #define BOOT_TARGET_DHCP(func) 37 #endif 38 39 #define BOOT_TARGET_DEVICES(func) \ 40 BOOT_TARGET_MMC(func) \ 41 BOOT_TARGET_USB(func) \ 42 BOOT_TARGET_PXE(func) \ 43 BOOT_TARGET_DHCP(func) 44 45 #ifdef CONFIG_ARM64 46 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0" 47 #else 48 #define ROOT_UUID "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3;\0" 49 #endif 50 #define PARTS_DEFAULT \ 51 "uuid_disk=${uuid_gpt_disk};" \ 52 "name=loader1,start=32K,size=4000K,uuid=${uuid_gpt_loader1};" \ 53 "name=loader2,start=8MB,size=4MB,uuid=${uuid_gpt_loader2};" \ 54 "name=trust,size=4M,uuid=${uuid_gpt_atf};" \ 55 "name=boot,size=112M,bootable,uuid=${uuid_gpt_boot};" \ 56 "name=rootfs,size=-,uuid="ROOT_UUID 57 58 #endif 59 60 #endif /* _ROCKCHIP_COMMON_H_ */ 61