soc/intel: Remove blank lines before '}' and after '{'
[coreboot2.git] / src / lib / bmp_logo.c
blob288877780a44c50d9bc50a35b73b4bd11012876d
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <bootsplash.h>
5 #include <cbfs.h>
6 #include <cbmem.h>
7 #include <stdint.h>
8 #include <vendorcode/google/chromeos/chromeos.h>
10 static const struct cbmem_entry *logo_entry;
12 #if !CONFIG(HAVE_CUSTOM_BMP_LOGO)
13 const char *bmp_logo_filename(void)
15 return "logo.bmp";
17 #endif
19 void bmp_load_logo(uint32_t *logo_ptr, uint32_t *logo_size)
21 void *logo_buffer;
23 /* CBMEM is locked for S3 resume path. */
24 if (acpi_is_wakeup_s3())
25 return;
27 logo_entry = cbmem_entry_add(CBMEM_ID_FSP_LOGO, 1 * MiB);
28 if (!logo_entry)
29 return;
31 logo_buffer = cbmem_entry_start(logo_entry);
32 if (!logo_buffer)
33 return;
35 *logo_size = cbfs_load(bmp_logo_filename(), logo_buffer, 1 * MiB);
36 if (*logo_size)
37 *logo_ptr = (uintptr_t)logo_buffer;
40 void bmp_release_logo(void)
42 if (logo_entry)
43 cbmem_entry_remove(logo_entry);
44 logo_entry = NULL;