OemMiscLibD05.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /** @file
  2. *
  3. * Copyright (c) 2016, Hisilicon Limited. All rights reserved.
  4. * Copyright (c) 2016, Linaro Limited. All rights reserved.
  5. *
  6. * This program and the accompanying materials
  7. * are licensed and made available under the terms and conditions of the BSD License
  8. * which accompanies this distribution. The full text of the license may be found at
  9. * http://opensource.org/licenses/bsd-license.php
  10. *
  11. * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  13. *
  14. **/
  15. #include <PlatformArch.h>
  16. #include <Uefi.h>
  17. #include <Library/DebugLib.h>
  18. #include <Library/IoLib.h>
  19. #include <Library/LpcLib.h>
  20. #include <Library/OemAddressMapLib.h>
  21. #include <Library/OemMiscLib.h>
  22. #include <Library/PcdLib.h>
  23. #include <Library/PlatformPciLib.h>
  24. #include <Library/PlatformSysCtrlLib.h>
  25. #include <Library/SerialPortLib.h>
  26. #include <Library/TimerLib.h>
  27. #define OEM_SINGLE_SOCKET 1
  28. #define OEM_DUAL_SOCKET 2
  29. REPORT_PCIEDIDVID2BMC PcieDeviceToReport[PCIEDEVICE_REPORT_MAX] = {
  30. {67,0,0,0},
  31. {225,0,0,3},
  32. {0xFFFF,0xFFFF,0xFFFF,0xFFFF},
  33. {0xFFFF,0xFFFF,0xFFFF,0xFFFF}
  34. };
  35. BOOLEAN OemIsSocketPresent (UINTN Socket)
  36. {
  37. if (PcdGet32(PcdSocketMask) & (1 << Socket)) {
  38. return TRUE;
  39. } else {
  40. return FALSE;
  41. }
  42. }
  43. UINTN OemGetSocketNumber (VOID)
  44. {
  45. if(!OemIsMpBoot()) {
  46. return OEM_SINGLE_SOCKET;
  47. }
  48. return OEM_DUAL_SOCKET;
  49. }
  50. UINTN OemGetDdrChannel (VOID)
  51. {
  52. return 4;
  53. }
  54. UINTN OemGetDimmSlot(UINTN Socket, UINTN Channel)
  55. {
  56. return 2;
  57. }
  58. VOID CoreSelectBoot(VOID)
  59. {
  60. if (!PcdGet64 (PcdTrustedFirmwareEnable)) {
  61. StartupAp ();
  62. }
  63. return;
  64. }
  65. BOOLEAN OemIsMpBoot()
  66. {
  67. return PcdGet32(PcdIsMPBoot);
  68. }
  69. VOID OemLpcInit(VOID)
  70. {
  71. LpcInit();
  72. return;
  73. }
  74. UINT32 OemIsWarmBoot(VOID)
  75. {
  76. return 0;
  77. }
  78. VOID OemBiosSwitch(UINT32 Master)
  79. {
  80. (VOID)Master;
  81. return;
  82. }
  83. BOOLEAN OemIsNeedDisableExpanderBuffer(VOID)
  84. {
  85. return TRUE;
  86. }