Chameleon

Chameleon Commit Details

Date:2017-10-03 11:40:42 (6 months 23 days ago)
Author:ErmaC
Commit:2902
Parents: 2901
Message:Merge SMBios FirmwareFeature from Clover project (Credits to MinusZwei)
Changes:
M/trunk/package/smbios.plist
M/trunk/i386/libsaio/smbios.c

File differences

trunk/i386/libsaio/smbios.c
107107
108108
109109
110
111
110112
111113
112114
......
130132
131133
132134
133
135
134136
135137
136138
......
198200
199201
200202
203
204
205
201206
202207
208
209
210
211
212
213
214
215
203216
204217
205218
......
380393
381394
382395
396
397
398
399
383400
384401
385402
......
436453
437454
438455
456
457
439458
459
440460
441461
442462
......
545565
546566
547567
568
569
570
571
572
548573
549574
550575
......
902927
903928
904929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
905952
906953
907954
/* =====================================================
Firmware Volume Description (Apple Specific - Type 128)
======================================================= */
#define kSMBFirmwareVolumeFirmwareFeaturesKey "SMfirmwarefeatures" //
#define kSMBFirmwareVolumeFirmwareFeaturesMaskKey "SMfirmwarefeaturesmask" //
/* =========================================
Memory SPD Data (Apple Specific - Type 130)
/* ==========================================
OEM Platform SMC (Apple Specific - Type 134)
============================================ */
//#define kSMBOemSMCKey "SMoemsmc"
//#define kSMBOemSMCKey"SMoemsmc"
/* ==================================================*/
defaultChassis_t defaultChassis;
/* =====================================================
Firmware Volume Description (Apple Specific - Type 128)
===================================================== */
typedef struct
{
uint32_t firmwareFeatures;
uint32_t firmwareFeaturesMask;
} defaultFirmwareVolume_t;
defaultFirmwareVolume_t defaultFirmwareVolume;
typedef struct
{
uint8_ttype;
SMBValueTypevalueType;
uint8_tfieldOffset;
// Firmware Volume Description (Apple Specific - Type 128)
// kSMBTypeFirmwareVolume
{kSMBTypeFirmwareVolume, kSMBDWord, getFieldOffset(SMBFirmwareVolume, FirmwareFeatures),
kSMBFirmwareVolumeFirmwareFeaturesKey, NULL, (char **)&defaultFirmwareVolume.firmwareFeatures},
{kSMBTypeFirmwareVolume, kSMBDWord, getFieldOffset(SMBFirmwareVolume, FirmwareFeaturesMask),
kSMBFirmwareVolumeFirmwareFeaturesMaskKey, NULL, (char **)&defaultFirmwareVolume.firmwareFeaturesMask},
// Memory SPD Data (Apple Specific - Type 130)
// kSMBTypeMemorySPD
//#define kDefaultBoardProcessorType"11" // 0xB
#define kDefaultSystemVersion"1.0"
#define kDefaultBIOSRelease256 // 256 = 0x0100 -> swap bytes: 0x0001 -> Release: 0.1 (see SMBIOS spec. table Type 0)
#define kDefaultFirmwareFeatures0xE907F537; //unknown - use oem SMBIOS value to be default
#define kDefaultFirmwareFeaturesMask0xFFFFFFFF; //unknown - use oem SMBIOS value to be default
//=========== Mac mini ===========
#define kDefaultMacMiniFamily"Napa Mac" // Macmini2,1 family = "Napa Mac" not "Mac mini"
#define kDefaultMacMini"Macmini2,1"
defaultChassis.assetTag = kDefaultAssetTag;
defaultChassis.skuNumber = kDefaultSkuNumber;
// set default firmware features and mask values
// those values will be used whenever no valid key values are found in smbios.plist
defaultFirmwareVolume.firmwareFeatures = kDefaultFirmwareFeatures;
defaultFirmwareVolume.firmwareFeaturesMask = kDefaultFirmwareFeaturesMask;
// if (platformCPUFeature(CPU_FEATURE_MOBILE)) Bungo: doesn't recognise correctly, need fixing
if (PlatformType == 2) // this works but it's a substitute
{
============================================= */
void addSMBFirmwareVolume(SMBStructPtrs *structPtr)
{
SMBFirmwareVolume *p = (SMBFirmwareVolume *)structPtr->new;
// initialise new table
bzero(p, sizeof(SMBFirmwareVolume));
// common rules
p->header.type = kSMBTypeFirmwareVolume;
p->header.length = sizeof(SMBFirmwareVolume);
p->header.handle = 0x8000;
setSMBValue(structPtr, numOfSetters - 4 , (returnType *)(void *)&(p->FirmwareFeatures));
setSMBValue(structPtr, numOfSetters - 3 , (returnType *)(void *)&(p->FirmwareFeaturesMask));
p->RegionCount = 1;
p->RegionType[0] = FW_REGION_MAIN;
p->FlashMap[0].StartAddress = 0xFFE00000;
p->FlashMap[0].EndAddress = 0xFFEFFFFF;
structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBFirmwareVolume) + 2);
tableLength += sizeof(SMBFirmwareVolume) + 2;
structureCount++;
return;
}
trunk/package/smbios.plist
4141
4242
4343
44
45
46
47
44
45
46
47
4848
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
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
7777
78
79
80
81
7882
7983
8084
<key>SMchassisassettag</key>
<string>Pro-Enclosure</string>
<key>SMexternalclock</key>
<string>133</string>
<key>SMmaximalclock</key>
<string>3000</string>
<key>SMexternalclock</key>
<string>133</string>
<key>SMmaximalclock</key>
<string>3000</string>
<key>SMmemtype</key>
<string>24</string>
<key>SMmemspeed</key>
<string>1600</string>
<key>SMmemmanufacturer_1</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_1</key>
<string>0x00001020</string>
<key>SMmempart_1</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_2</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_2</key>
<string>0x00003021</string>
<key>SMmempart_2</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_3</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_3</key>
<string>0x00003021</string>
<key>SMmempart_3</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_4</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_4</key>
<string>0x00003021</string>
<key>SMmempart_4</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemtype</key>
<string>24</string>
<key>SMmemspeed</key>
<string>1600</string>
<key>SMmemmanufacturer_1</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_1</key>
<string>0x00001020</string>
<key>SMmempart_1</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_2</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_2</key>
<string>0x00003021</string>
<key>SMmempart_2</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_3</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_3</key>
<string>0x00003021</string>
<key>SMmempart_3</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMmemmanufacturer_4</key>
<string>0xAD00000000000000</string>
<key>SMmemserial_4</key>
<string>0x00003021</string>
<key>SMmempart_4</key>
<string>0x48594D503131325336344350362D59352020</string>
<key>SMfirmwarefeatures</key>
<string>0xE907F537</string>
<key>SMfirmwarefeaturesmask</key>
<string>0xFFFFFFFF</string>
</dict>
</plist>
<!--

Archive Download the corresponding diff file

Revision: 2902