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

Archive Download this file

Revision: 840