Chameleon

Chameleon Commit Details

Date:2017-10-03 11:36:03 (1 year 1 month ago)
Author:ErmaC
Commit:2901
Parents: 2900
Message:Merge SMBios FirmwareFeature from Clover project (Credits to MinusZwei)
Changes:
M/branches/ErmaC/Enoch/i386/libsaio/smbios.c
M/branches/ErmaC/Enoch/package/smbios.plist

File differences

branches/ErmaC/Enoch/i386/libsaio/smbios.c
107107
108108
109109
110
111
110112
111113
112114
......
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)
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;
}
branches/ErmaC/Enoch/package/smbios.plist
7575
7676
7777
78
79
80
81
7882
7983
8084
<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: 2901