summaryrefslogtreecommitdiff
path: root/Platform/AMD/AgesaModulePkg/Include/AmdRdeDirectory.h
blob: d357ed398e4a1235db84d41e8c03e6ac58f418a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/** @file
  AMD RDE (Recovery Directory) definitions.

  Copyright (C) 2026 Advanced Micro Devices, Inc. All rights reserved.<BR>

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef _AMD_RDE_DIRECTORY_H
#define _AMD_RDE_DIRECTORY_H

#include <Uefi.h>

/**
  Get AMD SoC RDE BIOS Driectory Image

  @param[in]      ImageType        Image type.
  @param[in]      InMediaOffset    The offset to the image in the media. The offset is related to the
                                   begining address of meida, such as the SPI ROM.
  @param[in out]  Imagesize        Pointer to the image size.
                                   When zero, the size of the image is returned.
                                   Otherwise, the image is read and returned to users
                                   the user's buffer if ImagePointer is not NULL.
  @param[out]     Buffer           Buffer pointer that points to memory buffer allocated by caller
                                   to store the image.

  @retval  EFI_SUCCESS  Initial library successfully.
  @retval  Other        Return error status.

**/
EFI_STATUS
EFIAPI
AmdRdeDirectoryGetImage (
  IN      UINT16  ImageType,
  IN      UINT64  *InMediaOffset OPTIONAL,
  IN OUT  UINT32  *Imagesize,
  OUT     VOID    *Buffer
  );

/**
  Get AMD SoC RDE Response table

  @param[in out] RdeResponseSize   RDE Response table size
                                   When zero, the size of the table is returned.
                                   Otherwise, the table is read and returned to users buffer if
                                   RdeResponseTable is not NULL.

  @param[out]    RdeResponseTable  Pointer to store the response table.
  @param[out]    InMediaOffset     The offset to the image in the media. The offset is related to the
                                   begining address of meida, such as the SPI ROM.

  @retval  EFI_SUCCESS            RDE response table is sucessfully returned to the caller's buffer.
  @retval  EFI_BUFFER_TOO_SMALL   RDE response table is returned to caller. Callers has to allocate a
                                  sufficient memory buffer to receive the table.
  @retval  Other                  Return error status.

**/
EFI_STATUS
EFIAPI
AmdRdeDirectoryGetResponseTable (
  IN OUT  UINT32  *RdeResponseSize,
  OUT     VOID    *RdeResponseTable,
  OUT     UINT64  *InMediaOffset
  );

/**
  Set AMD SoC RDE Response table

  @param[in]   InMediaOffset     The offset to the image in the media. The offset is related to the
                                 begining address of meida, such as the SPI ROM.
  @param[in]   RdeResponseTable  Pointer to the response table.
  @param[in]   RdeResponseSize   RDE Response table size

  @retval  EFI_SUCCESS            RDE response table is sucessfully write to SPI.
  @retval  Other                  Return error status.

**/
EFI_STATUS
EFIAPI
AmdRdeDirectorySetResponseTable (
  IN  UINT64  InMediaOffset,
  IN  VOID    *RdeResponseTable,
  IN  UINT32  RdeResponseSize
  );

#endif // _AMD_RDE_DIRECTORY_H