blob: f9aeaa80696fcf52e0659237999249f5fb3d9f62 [file] [log] [blame]
Edward O'Callaghancdabc882014-11-11 12:22:04 +11001#ifndef __LIB_CBFS_CORE
2#define __LIB_CBFS_CORE
3
4#include <cbfs.h>
5#include <string.h>
6
7#ifdef LIBPAYLOAD
8# include <libpayload-config.h>
9# ifdef CONFIG_LZMA
10# include <lzma.h>
11# define CBFS_CORE_WITH_LZMA
12# endif
13# define CBFS_MINI_BUILD
14#elif defined(__SMM__)
15# define CBFS_MINI_BUILD
Patrick Georgi56b83092015-04-02 19:44:19 +020016#elif defined(__BOOTBLOCK__)
Edward O'Callaghancdabc882014-11-11 12:22:04 +110017 /* No LZMA in boot block. */
Aaron Durbinae1fcc32015-05-01 16:48:54 -050018#elif defined(__VERSTAGE__)
19 /* No LZMA in verstage. */
Edward O'Callaghancdabc882014-11-11 12:22:04 +110020#elif defined(__PRE_RAM__) && !CONFIG_COMPRESS_RAMSTAGE
21 /* No LZMA in romstage if ramstage is not compressed. */
22#else
23# define CBFS_CORE_WITH_LZMA
24# include <lib.h>
25#endif
26
27#include <cbfs.h>
28#include <string.h>
29#include <cbmem.h>
30
31#ifdef LIBPAYLOAD
32# include <stdio.h>
33# define DEBUG(x...)
34# define LOG(x...) printf(x)
35# define ERROR(x...) printf(x)
36#else
37# include <console/console.h>
38# define ERROR(x...) printk(BIOS_ERR, "CBFS: " x)
39# define LOG(x...) printk(BIOS_INFO, "CBFS: " x)
40# if CONFIG_DEBUG_CBFS
41# define DEBUG(x...) printk(BIOS_SPEW, "CBFS: " x)
42# else
43# define DEBUG(x...)
44# endif
45#endif
46
Edward O'Callaghancdabc882014-11-11 12:22:04 +110047#endif /* __LIB_CBFS_CORE */