2020-04-16 09:15:26 +02:00
|
|
|
/*
|
|
|
|
* platformdata.h
|
|
|
|
*
|
|
|
|
* Created on: 16 Apr 2020
|
|
|
|
* Author: jief
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLATFORM_PLATFORMDATA_H_
|
|
|
|
#define PLATFORM_PLATFORMDATA_H_
|
|
|
|
|
2020-04-16 09:48:13 +02:00
|
|
|
|
2021-02-07 15:39:03 +01:00
|
|
|
#include "../cpp_foundation/XString.h"
|
2021-04-03 16:42:49 +02:00
|
|
|
#include "../Platform/Settings.h"
|
2020-04-16 09:48:13 +02:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
|
|
|
MacBook11,
|
|
|
|
MacBook21,
|
|
|
|
MacBook31,
|
|
|
|
MacBook41,
|
|
|
|
MacBook51,
|
|
|
|
MacBook52,
|
|
|
|
MacBook61,
|
|
|
|
MacBook71,
|
|
|
|
MacBook81,
|
|
|
|
MacBook91,
|
|
|
|
MacBook101,
|
|
|
|
MacBookPro11,
|
|
|
|
MacBookPro12,
|
|
|
|
MacBookPro21,
|
|
|
|
MacBookPro22,
|
|
|
|
MacBookPro31,
|
|
|
|
MacBookPro41,
|
|
|
|
MacBookPro51,
|
|
|
|
MacBookPro52,
|
|
|
|
MacBookPro53,
|
|
|
|
MacBookPro54,
|
|
|
|
MacBookPro55,
|
|
|
|
MacBookPro61,
|
|
|
|
MacBookPro62,
|
|
|
|
MacBookPro71,
|
|
|
|
MacBookPro81,
|
|
|
|
MacBookPro82,
|
|
|
|
MacBookPro83,
|
|
|
|
MacBookPro91,
|
|
|
|
MacBookPro92,
|
|
|
|
MacBookPro101,
|
|
|
|
MacBookPro102,
|
|
|
|
MacBookPro111,
|
|
|
|
MacBookPro112,
|
|
|
|
MacBookPro113,
|
|
|
|
MacBookPro114,
|
|
|
|
MacBookPro115,
|
|
|
|
MacBookPro121,
|
|
|
|
MacBookPro131,
|
|
|
|
MacBookPro132,
|
|
|
|
MacBookPro133,
|
|
|
|
MacBookPro141,
|
|
|
|
MacBookPro142,
|
|
|
|
MacBookPro143,
|
|
|
|
MacBookPro151,
|
|
|
|
MacBookPro152,
|
|
|
|
MacBookPro153,
|
|
|
|
MacBookPro154,
|
|
|
|
MacBookPro161,
|
2020-05-20 15:23:49 +02:00
|
|
|
MacBookPro162,
|
|
|
|
MacBookPro163,
|
2020-12-19 19:00:37 +01:00
|
|
|
MacBookPro164,
|
2020-04-16 09:48:13 +02:00
|
|
|
MacBookAir11,
|
|
|
|
MacBookAir21,
|
|
|
|
MacBookAir31,
|
|
|
|
MacBookAir32,
|
|
|
|
MacBookAir41,
|
|
|
|
MacBookAir42,
|
|
|
|
MacBookAir51,
|
|
|
|
MacBookAir52,
|
|
|
|
MacBookAir61,
|
|
|
|
MacBookAir62,
|
|
|
|
MacBookAir71,
|
|
|
|
MacBookAir72,
|
|
|
|
MacBookAir81,
|
|
|
|
MacBookAir82,
|
|
|
|
MacBookAir91,
|
|
|
|
MacMini11,
|
|
|
|
MacMini21,
|
|
|
|
MacMini31,
|
|
|
|
MacMini41,
|
|
|
|
MacMini51,
|
|
|
|
MacMini52,
|
|
|
|
MacMini53,
|
|
|
|
MacMini61,
|
|
|
|
MacMini62,
|
|
|
|
MacMini71,
|
|
|
|
MacMini81,
|
|
|
|
iMac41,
|
|
|
|
iMac42,
|
|
|
|
iMac51,
|
|
|
|
iMac52,
|
|
|
|
iMac61,
|
|
|
|
iMac71,
|
|
|
|
iMac81,
|
|
|
|
iMac91,
|
|
|
|
iMac101,
|
|
|
|
iMac111,
|
|
|
|
iMac112,
|
|
|
|
iMac113,
|
|
|
|
iMac121,
|
|
|
|
iMac122,
|
|
|
|
iMac131,
|
|
|
|
iMac132,
|
|
|
|
iMac133,
|
|
|
|
iMac141,
|
|
|
|
iMac142,
|
|
|
|
iMac143,
|
|
|
|
iMac144,
|
|
|
|
iMac151,
|
|
|
|
iMac161,
|
|
|
|
iMac162,
|
|
|
|
iMac171,
|
|
|
|
iMac181,
|
|
|
|
iMac182,
|
|
|
|
iMac183,
|
|
|
|
iMac191,
|
|
|
|
iMac192,
|
2020-12-13 09:51:50 +01:00
|
|
|
iMac201,
|
|
|
|
iMac202,
|
2020-04-16 09:48:13 +02:00
|
|
|
iMacPro11,
|
|
|
|
MacPro11,
|
|
|
|
MacPro21,
|
|
|
|
MacPro31,
|
|
|
|
MacPro41,
|
|
|
|
MacPro51,
|
|
|
|
MacPro61,
|
|
|
|
MacPro71,
|
|
|
|
Xserve11,
|
|
|
|
Xserve21,
|
|
|
|
Xserve31,
|
|
|
|
|
|
|
|
MaxMachineType
|
|
|
|
|
|
|
|
} MACHINE_TYPES;
|
|
|
|
|
|
|
|
|
2020-08-15 15:47:56 +02:00
|
|
|
constexpr LString8 DefaultMemEntry = "N/A";
|
|
|
|
constexpr LString8 DefaultSerial = "CT288GT9VT6";
|
2021-04-03 16:42:49 +02:00
|
|
|
constexpr LString8 AppleBiosVendor = "Apple Inc.";
|
2020-08-15 15:47:56 +02:00
|
|
|
constexpr LString8 AppleManufacturer = "Apple Computer, Inc."; //Old name, before 2007
|
|
|
|
constexpr LString8 AppleBoardSN = "C02140302D5DMT31M";
|
|
|
|
constexpr LString8 AppleBoardLocation = "Part Component";
|
2020-04-16 09:15:26 +02:00
|
|
|
|
|
|
|
|
2021-04-06 15:39:55 +02:00
|
|
|
class PLATFORMDATA
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
const LString8 productName;
|
|
|
|
const LString8 firmwareVersion;
|
|
|
|
const LString8 efiversion;
|
|
|
|
const LString8 boardID;
|
|
|
|
const LString8 productFamily;
|
|
|
|
const LString8 systemVersion;
|
|
|
|
const XString8 serialNumber;
|
|
|
|
const LString8 chassisAsset;
|
|
|
|
UINT8 smcRevision[6];
|
|
|
|
const LString8 smcBranch;
|
|
|
|
const LString8 smcPlatform;
|
|
|
|
UINT32 smcConfig;
|
|
|
|
|
|
|
|
//PLATFORMDATA() : productName(), firmwareVersion(), efiversion(), boardID(), productFamily(), systemVersion(), serialNumber(), chassisAsset(), smcRevision{0,0,0,0,0,0}, smcBranch(), smcPlatform(), smcConfig() { }
|
|
|
|
PLATFORMDATA(const LString8& _productName, const LString8& _firmwareVersion, const LString8& _efiversion, const LString8& _boardID, const LString8& _productFamily,
|
|
|
|
const LString8& _systemVersion, const LString8& _serialNumber, const LString8& _chassisAsset,
|
|
|
|
UINT8 _smcRevision0, UINT8 _smcRevision1, UINT8 _smcRevision2, UINT8 _smcRevision3, UINT8 _smcRevision4, UINT8 _smcRevision5,
|
|
|
|
const LString8& _smcBranch, const LString8& _smcPlatform, UINT32 _smcConfig)
|
|
|
|
: productName(_productName), firmwareVersion(_firmwareVersion), efiversion(_efiversion), boardID(_boardID), productFamily(_productFamily),
|
|
|
|
systemVersion(_systemVersion), serialNumber(_serialNumber), chassisAsset(_chassisAsset), smcRevision{0},
|
|
|
|
smcBranch(_smcBranch), smcPlatform(_smcPlatform), smcConfig(_smcConfig)
|
|
|
|
{
|
|
|
|
smcRevision[0] = _smcRevision0;
|
|
|
|
smcRevision[1] = _smcRevision1;
|
|
|
|
smcRevision[2] = _smcRevision2;
|
|
|
|
smcRevision[3] = _smcRevision3;
|
|
|
|
smcRevision[4] = _smcRevision4;
|
|
|
|
smcRevision[5] = _smcRevision5;
|
|
|
|
}
|
2020-04-16 09:15:26 +02:00
|
|
|
|
2021-04-06 15:39:55 +02:00
|
|
|
// Not sure if default are valid. Delete them. If needed, proper ones can be created
|
|
|
|
PLATFORMDATA(const PLATFORMDATA&) = delete;
|
|
|
|
PLATFORMDATA& operator=(const PLATFORMDATA&) = delete;
|
|
|
|
} ;
|
2020-04-16 09:15:26 +02:00
|
|
|
|
|
|
|
|
2021-04-06 15:39:55 +02:00
|
|
|
extern PLATFORMDATA ApplePlatformData[];
|
|
|
|
|
|
|
|
void SetDMISettingsForModel (SETTINGS_DATA& gSettings, MACHINE_TYPES Model, BOOLEAN Redefine);
|
|
|
|
MACHINE_TYPES GetModelFromString (const XString8& ProductName);
|
|
|
|
void GetDefaultSettings(void);
|
|
|
|
void GetDefaultCpuSettings(SETTINGS_DATA& gSettings);
|
|
|
|
uint8_t GetChassisTypeFromModel(MACHINE_TYPES Model);
|
|
|
|
uint32_t GetFwFeaturesMaskFromModel(MACHINE_TYPES Model);
|
2020-04-16 09:15:26 +02:00
|
|
|
|
|
|
|
#endif /* PLATFORM_PLATFORMDATA_H_ */
|