Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/i386/libsaio/platform.h

1/*
2 * platform.h
3 * AsereBLN: reworked and extended
4 *
5 */
6
7#ifndef __LIBSAIO_PLATFORM_H
8#define __LIBSAIO_PLATFORM_H
9
10
11//Azi: this was already acting as a mini libsaio.h :P see bootstruct.h.
12//#include "libsaio.h"
13#include "libsa.h"
14#include "saio_types.h"
15#include "saio_internal.h" //Updt - delete these and test!!!
16
17
18extern bool platformCPUFeature(uint32_t);
19extern void scan_platform(void);
20//Azi: function is on mem.c which is gone on Kabyl's... ???
21extern void dumpPhysAddr(const char * title, void * a, int len);
22
23/* CPUID index into cpuid_raw */
24#define CPUID_00
25#define CPUID_11
26#define CPUID_22
27#define CPUID_33
28#define CPUID_44
29#define CPUID_805
30#define CPUID_816
31#define CPUID_MAX7
32
33#define CPU_MODEL_YONAH0x0E// Sossaman, Yonah
34#define CPU_MODEL_MEROM0x0F// Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom
35#define CPU_MODEL_PENRYN0x17// Wolfdale, Yorkfield, Harpertown, Penryn
36#define CPU_MODEL_NEHALEM0x1A// Bloomfield. Nehalem-EP, Nehalem-WS, Gainestown
37#define CPU_MODEL_ATOM0x1C// Atom
38#define CPU_MODEL_FIELDS0x1E// Lynnfield, Clarksfield, Jasper Forest
39#define CPU_MODEL_DALES0x1F// Havendale, Auburndale
40#define CPU_MODEL_DALES_32NM0x25// Clarkdale, Arrandale
41#define CPU_MODEL_SANDY0x2A// Sandy Bridge
42#define CPU_MODEL_WESTMERE0x2C// Gulftown, Westmere-EP, Westmere-WS
43#define CPU_MODEL_SANDY_XEON0x2D// Sandy Bridge Xeon
44#define CPU_MODEL_NEHALEM_EX0x2E// Beckton
45#define CPU_MODEL_WESTMERE_EX0x2F
46
47/* CPU Features */
48#define CPU_FEATURE_MMX0x00000001// MMX Instruction Set
49#define CPU_FEATURE_SSE0x00000002// SSE Instruction Set
50#define CPU_FEATURE_SSE20x00000004// SSE2 Instruction Set
51#define CPU_FEATURE_SSE30x00000008// SSE3 Instruction Set
52#define CPU_FEATURE_SSE410x00000010// SSE41 Instruction Set
53#define CPU_FEATURE_SSE420x00000020// SSE42 Instruction Set
54#define CPU_FEATURE_EM64T0x00000040// 64Bit Support
55#define CPU_FEATURE_HTT0x00000080// HyperThreading
56#define CPU_FEATURE_MOBILE0x00000100// Mobile CPU
57#define CPU_FEATURE_MSR0x00000200// MSR Support
58
59/* SMBIOS Memory Types */
60#define SMB_MEM_TYPE_UNDEFINED0
61#define SMB_MEM_TYPE_OTHER1
62#define SMB_MEM_TYPE_UNKNOWN2
63#define SMB_MEM_TYPE_DRAM3
64#define SMB_MEM_TYPE_EDRAM4
65#define SMB_MEM_TYPE_VRAM5
66#define SMB_MEM_TYPE_SRAM6
67#define SMB_MEM_TYPE_RAM7
68#define SMB_MEM_TYPE_ROM8
69#define SMB_MEM_TYPE_FLASH9
70#define SMB_MEM_TYPE_EEPROM10
71#define SMB_MEM_TYPE_FEPROM11
72#define SMB_MEM_TYPE_EPROM12
73#define SMB_MEM_TYPE_CDRAM13
74#define SMB_MEM_TYPE_3DRAM14
75#define SMB_MEM_TYPE_SDRAM15
76#define SMB_MEM_TYPE_SGRAM16
77#define SMB_MEM_TYPE_RDRAM17
78#define SMB_MEM_TYPE_DDR18
79#define SMB_MEM_TYPE_DDR219
80#define SMB_MEM_TYPE_FBDIMM20
81#define SMB_MEM_TYPE_DDR324// Supported in 10.5.6+ AppleSMBIOS
82
83/* Memory Configuration Types */
84#define SMB_MEM_CHANNEL_UNKNOWN0
85#define SMB_MEM_CHANNEL_SINGLE1
86#define SMB_MEM_CHANNEL_DUAL2
87#define SMB_MEM_CHANNEL_TRIPLE3
88
89/* Maximum number of ram slots */
90#define MAX_RAM_SLOTS8 //Azi: 8 or 12 ??
91#define RAM_SLOT_ENUMERATOR{0, 2, 4, 1, 3, 5, 6, 8, 10, 7, 9, 11}
92
93/* Maximum number of SPD bytes */
94#define MAX_SPD_SIZE256
95
96/* Size of SMBIOS UUID in bytes */
97#define UUID_LEN16
98
99typedef struct _RamSlotInfo_t
100{
101 uint32_tModuleSize;// Size of Module in MB
102 uint32_tFrequency;// in Mhz
103 const char*Vendor;
104 const char*PartNo;
105 const char*SerialNo;
106 char*spd;// SPD Dump
107 boolInUse;
108 uint8_tType;
109 uint8_tBankConnections;// table type 6, see (3.3.7)
110 uint8_tBankConnCnt;
111} RamSlotInfo_t;
112
113typedef struct _PlatformInfo_t
114{
115struct CPU
116{
117uint32_tFeatures;// CPU Features like MMX, SSE2, VT, MobileCPU
118uint32_tVendor;// Vendor
119uint32_tSignature;// Signature
120uint32_tStepping;// Stepping
121uint32_tModel;// Model
122uint32_tExtModel;// Extended Model
123uint32_tFamily;// Family
124uint32_tExtFamily;// Extended Family
125uint32_tNoCores;// No Cores per Package
126uint32_tNoThreads;// Threads per Package
127uint8_tMaxCoef;// Max Multiplier
128uint8_tMaxDiv;
129uint8_tCurrCoef;// Current Multiplier
130uint8_tCurrDiv;
131uint64_tTSCFrequency;// TSC Frequency Hz
132uint64_tFSBFrequency;// FSB Frequency Hz
133uint64_tCPUFrequency;// CPU Frequency Hz
134uint32_tMaxRatio;// Max Bus Ratio
135uint32_tMinRatio;// Min Bus Ratio
136charBrandString[48];// 48 Byte Branding String
137uint32_tCPUID[CPUID_MAX][4];// CPUID 0..4, 80..81 Raw Values
138} CPU;
139
140struct RAM
141{
142uint64_tFrequency;// Ram Frequency
143uint32_tDivider;// Memory divider
144uint8_tCAS;// CAS 1/2/2.5/3/4/5/6/7
145uint8_tTRC;
146uint8_tTRP;
147uint8_tRAS;
148uint8_tChannels;// Channel Configuration Single,Dual or Triple
149uint8_tNoSlots;// Maximum no of slots available
150uint8_tType;// Standard SMBIOS v2.5 Memory Type
151RamSlotInfo_tDIMM[MAX_RAM_SLOTS];// Information about each slot
152} RAM;
153
154struct DMI
155{
156intMaxMemorySlots;// number of memory slots populated by SMBIOS
157intCntMemorySlots;// number of memory slots counted
158intMemoryModules;// number of memory modules installed
159intDIMM[MAX_RAM_SLOTS];// Information and SPD mapping for each slot
160} DMI;
161uint8_tType;// System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FACP: PM_Profile)
162uint8_t*UUID;
163} PlatformInfo_t;
164
165extern PlatformInfo_t Platform;
166
167#endif /* !__LIBSAIO_PLATFORM_H */
168

Archive Download this file

Revision: 1031