xref: /aosp_15_r20/external/coreboot/util/cbfstool/cse_fpt.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __CBFSTOOL_CSE_FPT_H__
4 #define __CBFSTOOL_CSE_FPT_H__
5 
6 #include <commonlib/endian.h>
7 #include <commonlib/region.h>
8 
9 #include "common.h"
10 #include "cse_helpers.h"
11 
12 #define FPT_MARKER			"$FPT"
13 #define FPT_ENTRY_VERSION		0x10
14 
15 enum fpt_hdr_version {
16 	FPT_HDR_VERSION_20 = 0x20,
17 	FPT_HDR_VERSION_21 = 0x21,
18 };
19 
20 typedef void *fpt_hdr_ptr;
21 
22 struct fpt_hdr_ops {
23 	bool (*match_version)(struct buffer *buff);
24 
25 	fpt_hdr_ptr (*read)(struct buffer *buff);
26 	void (*print)(const fpt_hdr_ptr ptr);
27 
28 	size_t (*get_entry_count)(const fpt_hdr_ptr ptr);
29 };
30 
31 extern const struct fpt_hdr_ops fpt_hdr_20_ops;
32 extern const struct fpt_hdr_ops fpt_hdr_21_ops;
33 
34 #endif /* __CBFSTOOL_CSE_FPT_H__ */
35