summaryrefslogtreecommitdiff
path: root/ReferenceCode/Chipset/SystemAgent/MemoryInit/Pei/Source/Api/MrcStartMemoryConfiguration.h
blob: 01aa9d02507e2b5c92e718d0e978f4d00a45a501 (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
/** @file
  Starting point for the core memory reference code.

@copyright
  Copyright (c) 2010 - 2012 Intel Corporation. All rights reserved
  This software and associated documentation (if any) is furnished
  under a license and may only be used or copied in accordance
  with the terms of the license. Except as permitted by such
  license, no part of this software or documentation may be
  reproduced, stored in a retrieval system, or transmitted in any
  form or by any means without the express written consent of
  Intel Corporation.

  This file contains an 'Intel Peripheral Driver' and uniquely
  identified as "Intel Reference Module" and is
  licensed for Intel CPUs and chipsets under the terms of your
  license agreement with Intel or your vendor.  This file may
  be modified by the user, subject to additional terms of the
  license agreement
**/

#ifndef __MRC_StartMemoryConfiguration_h__
#define __MRC_StartMemoryConfiguration_h__

//
// Include files
//
#include "MrcTypes.h"
#include "MrcApi.h"

typedef U16 MrcPostCode;
#define POST_CODE_NO_OVR  ((1 << ((sizeof (MrcPostCode) * 8) - 1)) + ((1 << ((sizeof (MrcPostCode) * 8) - 1)) - 1))

typedef enum {
  MRC_PF_NULL,                ///< All policy flags turned off.
  MRC_PF_COLD     = (1 << 0), ///< Execute MRC function on cold reset.
  MRC_PF_FAST     = (1 << 1), ///< Execute MRC function on cold reset when S3 data is present.
  MRC_PF_WARM     = (1 << 2), ///< Execute MRC function on warm reset.
  MRC_PF_S3       = (1 << 3), ///< Execute MRC function on S3 exit.
  MRC_PF_FULL_MRC = (1 << 4), ///< Execute MRC function when in Full MRC mode.
  MRC_PF_MINI_MRC = (1 << 5), ///< Execute MRC function when in Mini-MRC mode.
  MRC_PF_UNUSED   = (3 << 6), ///< Unused policy flags.
  MRC_PF_ALL      = (0xF)     ///< All policy flags turned off.
} PFSelector;

typedef U8 PolicyFlag;

#pragma pack(push, 1)
typedef struct {
  MrcStatus (*mrc_task) (MrcParameters * const MrcData);  ///< Ptr to function to execute, with parameter list.
  MrcPostCode   post_code_ovr;                            ///< BIOS post code output to the debug port if value <> 0.
  U32           oem_cmd;                                  ///< OEM function to execute prior to MRC function.
  PolicyFlag    policy_flag;                              ///< Call table flags
  MrcIteration  iteration;                                ///< Maximum number of CPU only resets.
#ifdef MRC_DEBUG_PRINT
  char          *String;                                  ///< Output string describing this task (potentially output to debug serial port).
#endif // MRC_DEBUG_PRINT
} CallTableEntry;
#pragma pack(pop)

/**
  Initializes the memory controller and DIMMs.

  @param[in, out] MrcData - Include all MRC global data.

  @retval mrcSuccess if the initalization suceeded, otherwise an error status indicating the failure.
**/
extern
MrcStatus
MrcStartMemoryConfiguration (
  IN OUT MrcParameters *const MrcData
  );

#endif