1 // SPDX-License-Identifier: GPL-2.0+
3 * UPL handoff command functions
5 * Copyright 2024 Google LLC
9 #define LOG_CATEGORY UCLASS_BOOTSTD
14 /* Names of bootmodes */
15 const char *const bootmode_names[UPLBM_COUNT] = {
16 [UPLBM_FULL] = "full",
17 [UPLBM_MINIMAL] = "minimal",
18 [UPLBM_FAST] = "fast",
19 [UPLBM_DIAG] = "diag",
20 [UPLBM_DEFAULT] = "default",
25 [UPLBM_FACTORY] = "factory",
26 [UPLBM_FLASH] = "flash",
27 [UPLBM_RECOVERY] = "recovery",
30 /* Names of memory usages */
31 const char *const usage_names[UPLUS_COUNT] = {
32 [UPLUS_ACPI_RECLAIM] = "acpi-reclaim",
33 [UPLUS_ACPI_NVS] = "acpi-nvs",
34 [UPLUS_BOOT_CODE] = "boot-code",
35 [UPLUS_BOOT_DATA] = "boot-data",
36 [UPLUS_RUNTIME_CODE] = "runtime-code",
37 [UPLUS_RUNTIME_DATA] = "runtime-data",
40 /* Names of access types */
41 const char *const access_types[UPLUS_COUNT] = {
42 [UPLAT_MMIO] = "mmio",
46 /* Names of graphics formats */
47 const char *const graphics_formats[UPLUS_COUNT] = {
48 [UPLGF_ARGB32] = "a8r8g8b8",
49 [UPLGF_ABGR32] = "a8b8g8r8",
50 [UPLGF_ABGR64] = "a16b16g16r16",
53 void upl_init(struct upl *upl)
55 memset(upl, '\0', sizeof(struct upl));
56 alist_init_struct(&upl->image, struct upl_image);
57 alist_init_struct(&upl->mem, struct upl_mem);
58 alist_init_struct(&upl->memmap, struct upl_memmap);
59 alist_init_struct(&upl->memres, struct upl_memres);