blob: 3f9c1855b407e510d1b63fbf7b54724e6766f53c [file] [log] [blame]
Furquan Shaikh796aeeb2021-09-16 22:02:01 -07001/* 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"
Furquan Shaikh555f0402021-10-08 15:18:33 -070010#include "cse_helpers.h"
Furquan Shaikh796aeeb2021-09-16 22:02:01 -070011
12#define FPT_MARKER "$FPT"
13#define FPT_ENTRY_VERSION 0x10
14
Furquan Shaikh796aeeb2021-09-16 22:02:01 -070015enum fpt_hdr_version {
16 FPT_HDR_VERSION_20 = 0x20,
17 FPT_HDR_VERSION_21 = 0x21,
18};
19
20typedef void *fpt_hdr_ptr;
21
22struct 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
31extern const struct fpt_hdr_ops fpt_hdr_20_ops;
32extern const struct fpt_hdr_ops fpt_hdr_21_ops;
33
Furquan Shaikh796aeeb2021-09-16 22:02:01 -070034#endif /* __CBFSTOOL_CSE_FPT_H__ */