blob: fbbcdb25ccaa59fe7179f8afca1dc9dbee962bd5 [file] [log] [blame]
Chia-Wei Wang956b2de2024-09-10 17:39:18 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) ASPEED Technology Inc.
4 */
5
6#ifndef __ASM_AST2700_FMC_HDR_H__
7#define __ASM_AST2700_FMC_HDR_H__
8
9#include <linux/types.h>
10
11#define HDR_MAGIC 0x48545341 /* ASTH */
12#define HDR_PB_MAX 30
13
14enum prebuilt_type {
15 PBT_END_MARK = 0x0,
16
17 PBT_DDR4_PMU_TRAIN_IMEM,
18 PBT_DDR4_PMU_TRAIN_DMEM,
19 PBT_DDR4_2D_PMU_TRAIN_IMEM,
20 PBT_DDR4_2D_PMU_TRAIN_DMEM,
21 PBT_DDR5_PMU_TRAIN_IMEM,
22 PBT_DDR5_PMU_TRAIN_DMEM,
23 PBT_DP_FW,
24 PBT_UEFI_X64_AST2700,
25
26 PBT_NUM
27};
28
29struct fmc_hdr_preamble {
30 uint32_t magic;
31 uint32_t version;
32};
33
34struct fmc_hdr_body {
35 uint32_t fmc_size;
36 union {
37 struct {
38 uint32_t type;
39 uint32_t size;
40 } pbs[0];
41 uint32_t raz[29];
42 };
43};
44
45struct fmc_hdr {
46 struct fmc_hdr_preamble preamble;
47 struct fmc_hdr_body body;
48} __packed;
49
50int fmc_hdr_get_prebuilt(uint32_t type, uint32_t *ofst, uint32_t *size);
51
52#endif