hc
2024-03-22 a0752693d998599af469473b8dc239ef973a012f
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
/** @file
  This file is to load sample board policy.
 
Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
#include "PeiPchPolicyLibrary.h"
#include <Library/ConfigBlockLib.h>
 
/*
  Apply sample board PCH specific default settings
 
  @param[in] SiPreMemPolicy      The pointer to SI PREMEM Policy PPI instance
*/
VOID
EFIAPI
PchLoadSamplePreMemPolicy (
  IN  SI_PREMEM_POLICY_PPI       *SiPreMemPolicy
  )
{
  EFI_STATUS                      Status;
  PCH_TRACE_HUB_PREMEM_CONFIG     *TraceHubPreMemConfig;
  PCH_HSIO_PCIE_PREMEM_CONFIG     *HsioPciePreMemConfig;
  PCH_HSIO_SATA_PREMEM_CONFIG     *HsioSataPreMemConfig;
 
  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gTraceHubPreMemConfigGuid, (VOID *) &TraceHubPreMemConfig);
  ASSERT_EFI_ERROR (Status);
  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gHsioPciePreMemConfigGuid, (VOID *) &HsioPciePreMemConfig);
  ASSERT_EFI_ERROR (Status);
  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gHsioSataPreMemConfigGuid, (VOID *) &HsioSataPreMemConfig);
  ASSERT_EFI_ERROR (Status);
 
  //
  // TRACEHUB
  //
  TraceHubPreMemConfig->MemReg0Size = 0x100000;  // 1MB
  TraceHubPreMemConfig->MemReg1Size = 0x100000;  // 1MB
 
  //
  // HSIO PCIE
  //
  HsioPciePreMemConfig->Lane[0].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[0].HsioRxSetCtle = 6;
  HsioPciePreMemConfig->Lane[1].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[1].HsioRxSetCtle = 6;
  HsioPciePreMemConfig->Lane[2].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[2].HsioRxSetCtle = 6;
  HsioPciePreMemConfig->Lane[3].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[3].HsioRxSetCtle = 6;
  HsioPciePreMemConfig->Lane[5].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[5].HsioRxSetCtle = 8;
  HsioPciePreMemConfig->Lane[7].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[7].HsioRxSetCtle = 8;
  HsioPciePreMemConfig->Lane[8].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[8].HsioRxSetCtle = 8;
  HsioPciePreMemConfig->Lane[9].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[9].HsioRxSetCtle = 8;
  HsioPciePreMemConfig->Lane[10].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[10].HsioRxSetCtle = 8;
  HsioPciePreMemConfig->Lane[11].HsioRxSetCtleEnable = TRUE;
  HsioPciePreMemConfig->Lane[11].HsioRxSetCtle = 8;
  HsioPciePreMemConfig->PciePllSsc = 0xFF;
 
  //
  // HSIO SATA
  //
  HsioSataPreMemConfig->PortLane[0].HsioRxGen3EqBoostMagEnable = TRUE;
  HsioSataPreMemConfig->PortLane[0].HsioRxGen3EqBoostMag = 4;
  HsioSataPreMemConfig->PortLane[0].HsioTxGen1DownscaleAmpEnable = TRUE;
  HsioSataPreMemConfig->PortLane[0].HsioTxGen1DownscaleAmp = 0x2C;
  HsioSataPreMemConfig->PortLane[0].HsioTxGen2DownscaleAmpEnable = 0;
  HsioSataPreMemConfig->PortLane[0].HsioTxGen2DownscaleAmp = 0x38;
 
}