OpenBIC
OpenSource Bridge-IC
sbmr.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SBMR_H
18#define SBMR_H
19
20#include "plat_def.h"
21#ifdef ENABLE_SBMR
22
23#include <stdint.h>
24#include "ipmb.h"
25typedef struct __attribute__((packed)) {
26 union {
27 struct {
28 uint8_t type;
29 uint16_t rsvd;
30 uint8_t severity;
31 } __attribute__((packed));
32 uint32_t status_code;
33 };
34 union {
35 struct {
36 uint16_t operation;
37 uint8_t sub_class;
38 uint8_t class;
39 } __attribute__((packed));
40 uint32_t efi_status_code;
41 };
42 uint8_t inst;
43} sbmr_boot_progress_code_t;
44
45#define SBMR_POSTCODE_SIZE sizeof(sbmr_boot_progress_code_t)
46
47#ifndef SMBR_UEFI_BOOT_START_POST_CODE
48#define SMBR_UEFI_BOOT_START_POST_CODE 0xc1010005
49#endif
50
51extern bool sbmr_frb3_flag_clr;
52
53#ifdef ENABLE_NVIDIA
54extern sbmr_boot_progress_code_t nv_sbmr_postcode[];
55#endif
56
57struct sbmr_cmd_send_boot_progress_code_req {
58 uint8_t group_ext_def_body;
59 sbmr_boot_progress_code_t code;
60} __attribute__((packed));
61
62struct sbmr_cmd_send_boot_progress_code_resp {
63 uint8_t completion_code;
64 uint8_t group_ext_def_body;
65} __attribute__((packed));
66
67struct sbmr_cmd_get_boot_progress_code_req {
68 uint8_t group_ext_def_body;
69} __attribute__((packed));
70
71struct sbmr_cmd_get_boot_progress_code_resp {
72 uint8_t completion_code;
73 uint8_t group_ext_def_body;
74 sbmr_boot_progress_code_t code;
75} __attribute__((packed));
76
77uint16_t copy_sbmr_read_buffer(uint16_t start, uint16_t length, uint8_t *buffer,
78 uint16_t buffer_len);
79void sbmr_postcode_insert(sbmr_boot_progress_code_t boot_progress_code);
80void reset_sbmr_postcode_buffer();
81bool sbmr_get_9byte_postcode_ok();
82void sbmr_reset_9byte_postcode_ok();
83bool sbmr_get_uefi_status();
84bool smbr_cmd_handler(ipmi_msg *msg);
85
86#endif /* ENABLE_SBMR */
87
88#endif /* SBMR_H */
ipmi_msg buffer
Definition: ipmb.h:0
uint8_t completion_code
Definition: ipmb.h:13
typedef __attribute__
Definition: mctp_ctrl.h:109
uint32_t length
Definition: pldm_firmware_update.h:1
Definition: pldm_smbios.h:61
uint8_t type
Definition: pldm_smbios.h:62
Definition: ipmb.h:165
uint8_t rsvd
Definition: plat_pldm.h:4