Chameleon

Chameleon Commit Details

Date:2010-01-17 14:27:51 (9 years 9 months ago)
Author:JrCs
Commit:19
Parents: 18
Message:New SystemType option to force system-type and PM_Profile
Changes:
M/branches/JrCs/i386/libsaio/acpi.h
M/branches/JrCs/i386/libsaio/dsdt_patcher.c
M/branches/JrCs/i386/libsaio/platform.c
M/branches/JrCs/i386/libsaio/fake_efi.c
M/branches/JrCs/i386/libsaio/platform.h
M/branches/JrCs/i386/boot2/boot.h

File differences

branches/JrCs/i386/libsaio/dsdt_patcher.c
153153
154154
155155
156
157
158
159
160
161
156162
157163
158164
memcpy(fadt_mod, fadt, fadt->Length);
}
// Set PM_Profile from System-type
if (fadt_mod->PM_Profile != Platform.Type) {
verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type);
fadt_mod->PM_Profile = Platform.Type;
}
// Patch FADT to fix restart
if (fix_restart)
{
branches/JrCs/i386/libsaio/acpi.h
7171
7272
7373
74
75
7476
75
77
7678
7779
7880
uint32_t CreatorRevision;
uint32_t FIRMWARE_CTRL;
uint32_t DSDT;
uint8_t Model;
uint8_t PM_Profile;
/*We absolutely don't care about theese fields*/
uint8_t notimp1[68];
uint8_t notimp1[66];
//Reset Fix
uint32_t Flags;
branches/JrCs/i386/libsaio/platform.c
44
55
66
7
78
89
910
......
3435
3536
3637
38
39
40
3741
3842
3943
4044
4145
46
47
48
49
50
51
52
53
54
4255
*/
#include "libsaio.h"
#include "boot.h"
#include "bootstruct.h"
#include "pci.h"
#include "platform.h"
void scan_platform(void)
{
const char*value;
int len;
memset(&Platform, 0, sizeof(Platform));
build_pci_dt();
scan_cpu(&Platform);
scan_memory(&Platform);
scan_spd(&Platform);
Platform.Type = 1; /* Desktop */
if (getValueForKey(kSystemType, &value, &len, &bootInfo->bootConfig) && value != NULL) {
Platform.Type = (unsigned char) strtoul(value, NULL, 10);
if (Platform.Type > 6) {
verbose("Error: system-type must be between 0 to 6. Defaulting to 1 !\n");
Platform.Type = 1;
}
}
}
branches/JrCs/i386/libsaio/platform.h
9898
9999
100100
101
101102
102103
103104
104
105105
106
107
108
106109
107110
108111
uint32_tBrandString[16];// 48 Byte Branding String
uint32_tCPUID[CPUID_MAX][4];// CPUID 0..4, 80..81 Raw Values
} CPU;
struct RAM {
RamSlotInfo_tDIMM[MAX_RAM_SLOTS];// Information about each slot
uint64_tFrequency;// Ram Frequency
//uint8_tType;// Standard SMBIOS v2.5 Memory Type
} RAM;
uint8_t Type; // System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FADT: PM_Profile)
} PlatformInfo_t;
extern PlatformInfo_t Platform;
branches/JrCs/i386/libsaio/fake_efi.c
278278
279279
280280
281
282
283
284
285
286
281287
282288
283289
......
330336
331337
332338
339
340
341
342
333343
334344
335345
static char CPU_Frequency_prop[] = "CPUFrequency";
/*==========================================================================
* SystemType
*/
static char SystemType_prop[] = "system-type";
/*==========================================================================
* SMBIOS
*/
stop("Couldn't get root node");
}
/* Export system-type */
verbose("Using system-type=0x%02x\n", Platform.Type);
DT__AddProperty(node, SystemType_prop, sizeof(Platform.Type), &Platform.Type);
/* We could also just do DT__FindNode("/efi/platform", true)
* But I think eventually we want to fill stuff in the efi node
* too so we might as well create it so we have a pointer for it too.
branches/JrCs/i386/boot2/boot.h
5959
6060
6161
62
6263
6364
6465
#define kBootBannerKey "Boot Banner"
#define kWaitForKeypressKey "Wait"
#define kRestartFix "RestartFix" /* dsdt_patcher.c */
#define kSystemType "SystemType" /* fake_efi.c */
/*
* Flags to the booter or kernel

Archive Download the corresponding diff file

Revision: 19