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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/** @file
 
  Copyright (C) 2020, Phytium Technology Co Ltd. All rights reserved.<BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
 
**/
 
#ifndef SYSTEM_SERVICE_INTERFACE_H_
#define SYSTEM_SERVICE_INTERFACE_H_
 
/* SMC function IDs for OEM Service queries */
#define PHYTIUM_OEM_SVC_PSSI_VERSION   0x8200ff03
#define PHYTIUM_OEM_SVC_PBF_VERSION    0x82000001
#define PHYTIUM_OEM_SVC_CPU_VERSION    0xc2000002
#define PHYTIUM_OEM_SVC_CPU_MAPS       0xc2000003
#define PHYTIUM_OEM_SVC_CPU_CONF       0xc2000004
#define PHYTIUM_OEM_SVC_MEM_REGIONS    0xc2000005
#define PHYTIUM_OEM_SVC_MCU_DIMMS      0xc2000006
#define PHYTIUM_OEM_SVC_PCI_CONTROLLER 0xc2000007
#define PHYTIUM_OEM_SVC_HOST_BRIDGE    0xc2000008
#define PHYTIUM_OEM_SVC_GET_FLASH_CMD  0xC200000C
 
#define PHYTIUM_IOBASE_MASK           0xfffffff
#define PHYTIUM_MEMIO32_MASK          0xffffffff
#define PHYTIUM_MEMIO64_MASK          0xffffffffff
 
#pragma pack(1)
 
typedef struct {
  UINT64     CpuMapCount;
  UINT64     CpuMap[1];
} PHYTIUM_CPU_MAP_INFO;
 
 
typedef struct {
  UINT64     CpuFreq;             // Hz
  UINT64     CpuL3CacheSize;      // Byte
  UINT64     CpuL3CacheLineSize;  // Byte
} PHYTIUM_CPU_CORE_INFO;
 
typedef struct {
  UINT64    CupVersion;                 //cpu version
  PHYTIUM_CPU_CORE_INFO CpuCoreInfo;    //cpu core info
  PHYTIUM_CPU_MAP_INFO  CpuMapInfo;     //cpu map info
} PHYTIUM_CPU_INFO;
 
typedef struct {
  UINT64     MemSize;    // MB
  UINT64     MemDramId;
  UINT64     MemModuleId;
  UINT64     MemSerial;
  UINT64     MemSlotNumber;
  UINT64     MemFeatures;
} PHYTIUM_MCU_DIMM;
 
#define MCU_DIMM_MAXCOUNT 2
 
typedef struct {
  UINT64             MemFreq;    // MHz
  UINT64             MemDimmCount;
  PHYTIUM_MCU_DIMM   McuDimm[1];
} PHYTIUM_MCU_DIMMS;
 
typedef struct {
  UINT64     MemStart;
  UINT64     MemSize;
  UINT64     MemNodeId;
} PHYTIUM_MEMORY_BLOCK;
 
typedef struct {
  UINT64               MemBlockCount;
  PHYTIUM_MEMORY_BLOCK MemBlock[1];
} PHYTIUM_MEMORY_INFO;
 
typedef struct {
  UINT8    PciLane;
  UINT8    PciSpeed;
  UINT8    Reserved[6];
} PHYTIUM_PCI_BLOCK;
 
typedef struct {
  UINT64               PciCount;
  PHYTIUM_PCI_BLOCK    PciBlock[1];
} PHYTIUM_PCI_CONTROLLER;
 
typedef struct {
  UINT8    BusStart;
  UINT8    BusEnd;
  UINT8    Reserved[6];
  UINT64   PciConfigBase;
  UINT64   IoBase;
  UINT64   IoSize;
  UINT64   Mem32Base;
  UINT64   Mem32Size;
  UINT64   Mem64Base;
  UINT64   Mem64Size;
  UINT16   IntA;
  UINT16   IntB;
  UINT16   IntC;
  UINT16   IntD;
} PHYTIUM_PCI_HOST_BLOCK;
 
typedef struct {
  UINT64                  PciHostCount;
  PHYTIUM_PCI_HOST_BLOCK  PciHostBlock[1];
} PHYTIUM_PCI_HOST_BRIDGE;
 
#pragma pack ()
 
 
#endif // SYSTEM_SERVICE_INTERFACE_H_