ProcessorSubClass.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /** @file
  2. *
  3. * Copyright (c) 2015, Hisilicon Limited. All rights reserved.
  4. * Copyright (c) 2015, 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. #ifndef _PROCESSOR_SUBCLASS_DRIVER_H
  16. #define _PROCESSOR_SUBCLASS_DRIVER_H
  17. #include <Uefi.h>
  18. #include <Protocol/Smbios.h>
  19. #include <IndustryStandard/SmBios.h>
  20. #include <Library/HiiLib.h>
  21. #include <Library/DebugLib.h>
  22. #include <Library/MemoryAllocationLib.h>
  23. #include <Library/BaseMemoryLib.h>
  24. #include <Library/UefiBootServicesTableLib.h>
  25. #include <Library/BaseLib.h>
  26. #include <Library/IoLib.h>
  27. #include <Library/UefiLib.h>
  28. #include <Library/PrintLib.h>
  29. #include <Library/PcdLib.h>
  30. #include <PlatformArch.h>
  31. #include <Library/PlatformSysCtrlLib.h>
  32. #include <Library/OemMiscLib.h>
  33. #include <Library/ArmLib.h>
  34. //
  35. // This is the generated header file which includes whatever needs to be exported (strings + IFR)
  36. //
  37. extern UINT8 ProcessorSubClassStrings[];
  38. #define CPU_CACHE_L1_Instruction 0
  39. #define CPU_CACHE_L1_Data 1
  40. #define CPU_CACHE_L2 2
  41. #define CPU_CACHE_L3 3
  42. #define MAX_CACHE_LEVEL 4
  43. #define EXTERNAL_CLOCK 50 //50 MHz
  44. #define CPU_MAX_SPEED 2100 //2.1G
  45. //
  46. // Cache Info
  47. //
  48. typedef struct {
  49. UINT16 InstalledSize; //In KB
  50. CACHE_TYPE_DATA SystemCacheType;
  51. CACHE_ASSOCIATIVITY_DATA Associativity;
  52. } CACHE_INFO;
  53. //
  54. // Cache Configuration
  55. //
  56. typedef union {
  57. struct {
  58. UINT16 Level :3;
  59. UINT16 Socketed :1;
  60. UINT16 Reserved1 :1;
  61. UINT16 Location :2;
  62. UINT16 Enable :1;
  63. UINT16 OperationalMode :2;
  64. UINT16 Reserved2 :6;
  65. } Bits;
  66. UINT16 Data;
  67. }CACHE_CONFIGURATION;
  68. //
  69. // Processor Status
  70. //
  71. typedef union {
  72. struct {
  73. UINT8 CpuStatus :3; // Indicates the status of the processor.
  74. UINT8 Reserved1 :3; // Reserved for future use. Should be set to zero.
  75. UINT8 SocketPopulated :1; // Indicates if the processor socket is populated or not.
  76. UINT8 Reserved2 :1; // Reserved for future use. Should be set to zero.
  77. } Bits;
  78. UINT8 Data;
  79. }PROCESSOR_STATUS_DATA;
  80. //
  81. // Processor Characteristics
  82. //
  83. typedef union {
  84. struct {
  85. UINT16 Reserved :1;
  86. UINT16 Unknown :1;
  87. UINT16 Capable64Bit :1;
  88. UINT16 MultiCore :1;
  89. UINT16 HardwareThread :1;
  90. UINT16 ExecuteProtection :1;
  91. UINT16 EnhancedVirtualization :1;
  92. UINT16 PowerPerformanceControl :1;
  93. UINT16 Reserved2 :8;
  94. } Bits;
  95. UINT16 Data;
  96. } PROCESSOR_CHARACTERISTICS_DATA;
  97. #endif