Chameleon

Chameleon Commit Details

Date:2011-07-19 16:14:20 (12 years 8 months ago)
Author:Sergey Slice
Commit:1179
Parents: 1178
Message:GE correction
Changes:
M/branches/slice/trunkM/revision
M/branches/slice/trunkM/i386/libsaio/gma.c
M/branches/slice/trunkM/i386/libsaio/ntfs.c
M/branches/slice/trunkM/i386/libsaio/nvidia.c
M/branches/slice/trunkM/i386/libsaio/Makefile

File differences

branches/slice/trunkM/i386/libsaio/Makefile
3838
3939
4040
41
41
4242
4343
4444
fake_efi.o ext2fs.o \
hpet.o dram_controllers.o spd.o usb.o pci_setup.o \
device_inject.o nvidia.o ati.o gma.o pci_root.o \
convert.o aml_generator.o console.o
convert.o aml_generator.o console.o exfat.o
LIBS = libsaio.a
LIBS := $(addprefix $(SYMROOT)/, $(LIBS))
branches/slice/trunkM/i386/libsaio/gma.c
1616
1717
1818
19
19
2020
2121
2222
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
4748
4849
4950
......
131132
132133
133134
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
156159
160
161
157162
158163
159164
#endif
#if DEBUG_GMA
#define DBG(x...)printf(x)
#define DBG(x...)verbose(x)
#else
#define DBG(x...)
#endif
uint8_t GMAX3100_vals[22][4] = {
{ 0x01,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x08 },
{ 0x64,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x08 },
{ 0x01,0x00,0x00,0x00 },
{ 0x20,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
{ 0x20,0x03,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x08,0x52,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
{ 0x01,0x00,0x00,0x00 },
{ 0x3B,0x00,0x00,0x00 },
{ 0x00,0x00,0x00,0x00 }
//Slice - correct all values, still not sure
uint8_t GMAX3100_vals[23][4] = {
{ 0x01,0x00,0x00,0x00 },//0 "AAPL,HasPanel"
{ 0x01,0x00,0x00,0x00 },//1 "AAPL,SelfRefreshSupported"
{ 0x01,0x00,0x00,0x00 },//2 "AAPL,aux-power-connected"
{ 0x01,0x00,0x00,0x08 },//3 "AAPL,backlight-control"
{ 0x00,0x00,0x00,0x00 },//4 "AAPL00,blackscreen-preferences"
{ 0x56,0x00,0x00,0x08 },//5 "AAPL01,BacklightIntensity"
{ 0x00,0x00,0x00,0x00 },//6 "AAPL01,blackscreen-preferences"
{ 0x01,0x00,0x00,0x00 },//7 "AAPL01,DataJustify"
{ 0x20,0x00,0x00,0x00 },//8 "AAPL01,Depth"
{ 0x01,0x00,0x00,0x00 },//9 "AAPL01,Dither"
{ 0x20,0x03,0x00,0x00 },//10 "AAPL01,Height"
{ 0x00,0x00,0x00,0x00 },//11 "AAPL01,Interlace"
{ 0x00,0x00,0x00,0x00 },//12 "AAPL01,Inverter"
{ 0x08,0x52,0x00,0x00 },//13 "AAPL01,InverterCurrent"
{ 0x00,0x00,0x00,0x00 },//14 "AAPL01,LinkFormat"
{ 0x00,0x00,0x00,0x00 },//15 "AAPL01,LinkType"
{ 0x01,0x00,0x00,0x00 },//16 "AAPL01,Pipe"
{ 0x01,0x00,0x00,0x00 },//17 "AAPL01,PixelFormat"
{ 0x01,0x00,0x00,0x00 },//18 "AAPL01,Refresh"
{ 0x3B,0x00,0x00,0x00 },//19 "AAPL01,Stretch"
{ 0xc8,0x95,0x00,0x00 },//20 "AAPL01,InverterFrequency"
{ 0x6B,0x10,0x00,0x00 },//21 "subsystem-vendor-id"
{ 0xA2,0x00,0x00,0x00 }//22 "subsystem-id"
};
uint8_t reg_TRUE[]= { 0x01, 0x00, 0x00, 0x00 };
}
else if (model == (char *)"GMAX3100")
{
devprop_add_value(device, "AAPL,HasPanel",GMAX3100_vals[0], 4);
devprop_add_value(device, "AAPL,SelfRefreshSupported",GMAX3100_vals[1], 4);
devprop_add_value(device, "AAPL,aux-power-connected",GMAX3100_vals[2], 4);
devprop_add_value(device, "AAPL,backlight-control",GMAX3100_vals[3], 4);
devprop_add_value(device, "AAPL00,blackscreen-preferences", GMAX3100_vals[4], 4);
devprop_add_value(device, "AAPL01,BacklightIntensity",GMAX3100_vals[5], 4);
devprop_add_value(device, "AAPL01,blackscreen-preferences", GMAX3100_vals[6], 4);
devprop_add_value(device, "AAPL01,DataJustify",GMAX3100_vals[7], 4);
devprop_add_value(device, "AAPL01,Depth",GMAX3100_vals[8], 4);
devprop_add_value(device, "AAPL01,Dither",GMAX3100_vals[9], 4);
devprop_add_value(device, "AAPL01,DualLink",GMAX3100_vals[10], 4);
devprop_add_value(device, "AAPL01,Height",GMAX3100_vals[11], 4);
devprop_add_value(device, "AAPL01,Interlace",GMAX3100_vals[12], 4);
devprop_add_value(device, "AAPL01,Inverter",GMAX3100_vals[13], 4);
devprop_add_value(device, "AAPL01,InverterCurrent",GMAX3100_vals[14], 4);
devprop_add_value(device, "AAPL01,InverterCurrency",GMAX3100_vals[15], 4);
devprop_add_value(device, "AAPL01,LinkFormat",GMAX3100_vals[16], 4);
devprop_add_value(device, "AAPL01,LinkType",GMAX3100_vals[17], 4);
devprop_add_value(device, "AAPL01,Pipe",GMAX3100_vals[18], 4);
devprop_add_value(device, "AAPL01,PixelFormat",GMAX3100_vals[19], 4);
devprop_add_value(device, "AAPL01,Refresh",GMAX3100_vals[20], 4);
devprop_add_value(device, "AAPL01,Stretch",GMAX3100_vals[21], 4);
BuiltIn = gDualLink;
devprop_add_value(device, "AAPL,HasPanel",GMAX3100_vals[0], 4);
devprop_add_value(device, "AAPL,SelfRefreshSupported",GMAX3100_vals[1], 4);
devprop_add_value(device, "AAPL,aux-power-connected",GMAX3100_vals[2], 4);
devprop_add_value(device, "AAPL,backlight-control",GMAX3100_vals[3], 4);
devprop_add_value(device, "AAPL00,blackscreen-preferences",GMAX3100_vals[4], 4);
devprop_add_value(device, "AAPL01,BacklightIntensity",GMAX3100_vals[5], 4);
devprop_add_value(device, "AAPL01,blackscreen-preferences",GMAX3100_vals[6], 4);
devprop_add_value(device, "AAPL01,DataJustify",GMAX3100_vals[7], 4);
devprop_add_value(device, "AAPL01,Depth",GMAX3100_vals[8], 4);
devprop_add_value(device, "AAPL01,Dither",GMAX3100_vals[9], 4);
devprop_add_value(device, "AAPL01,DualLink", &BuiltIn, 1);//GMAX3100_vals[10]
devprop_add_value(device, "AAPL01,Height",GMAX3100_vals[10], 4);
devprop_add_value(device, "AAPL01,Interlace",GMAX3100_vals[11], 4);
devprop_add_value(device, "AAPL01,Inverter",GMAX3100_vals[12], 4);
devprop_add_value(device, "AAPL01,InverterCurrent",GMAX3100_vals[13], 4);
//devprop_add_value(device, "AAPL01,InverterCurrency",GMAX3100_vals[15], 4);
devprop_add_value(device, "AAPL01,LinkFormat",GMAX3100_vals[14], 4);
devprop_add_value(device, "AAPL01,LinkType",GMAX3100_vals[15], 4);
devprop_add_value(device, "AAPL01,Pipe",GMAX3100_vals[16], 4);
devprop_add_value(device, "AAPL01,PixelFormat",GMAX3100_vals[17], 4);
devprop_add_value(device, "AAPL01,Refresh",GMAX3100_vals[18], 4);
devprop_add_value(device, "AAPL01,Stretch",GMAX3100_vals[19], 4);
devprop_add_value(device, "AAPL01,InverterFrequency",GMAX3100_vals[20], 4);
devprop_add_value(device, "class-code",ClassFix, 4);
devprop_add_value(device, "subsystem-vendor-id", GMAX3100_vals[21], 4);
devprop_add_value(device, "subsystem-id", GMAX3100_vals[22], 4);
}
stringdata = malloc(sizeof(uint8_t) * string->length);
branches/slice/trunkM/i386/libsaio/ntfs.c
2626
2727
2828
29
30
31
32
33
2934
3035
3136
......
191196
192197
193198
199
200
201
202
203
194204
195205
196206
......
316326
317327
318328
319
320
329
330
331
332
321333
322334
323335
......
340352
341353
342354
355
356
357
358
343359
344360
#include "libsaio.h"
#include "sl.h"
/*
* dmazar, 14/7/2011 - support for EXFAT volume label reading
*/
#include "exfat.h"
#define BYTE_ORDER_MARK0xFEFF
#include "ntfs_private.h"
*/
if (memcmp((const char *)boot->bf_sysid, "NTFS ", 8) != 0)
{
/*
* Check for EXFAT. Finish by jumping to error to free buf,
* although if it is EXFAT then it's no an error.
*/
EXFATGetDescription(ih, str, strMaxLen);
goto error;
}
boot = (struct bootfile *) buf;
// Check for NTFS signature
if ( memcmp((void*)boot->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) != 0 )
return -1;
if ( memcmp((void*)boot->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) != 0 ) {
// If not NTFS, maybe it is EXFAT
return EXFATGetUUID(ih, uuidStr);
}
// Check for non-null volume serial number
if( !boot->bf_volsn )
if (strncmp((const char *)part_bootfile->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) == 0)
result = true;
// If not NTFS, maybe it is EXFAT
if (!result)
result = EXFATProbe(buffer);
return result;
}
branches/slice/trunkM/i386/libsaio/nvidia.c
6060
6161
6262
63
63
6464
6565
6666
......
8383
8484
8585
86
86
87
88
89
90
8791
8892
8993
......
9195
9296
9397
94
95
98
99
100
101
102
103
96104
105
97106
98107
99108
......
864873
865874
866875
867
876
868877
869878
870879
871880
872
873
874
881
882
875883
876884
877885
......
12391247
12401248
12411249
1250
1251
12421252
12431253
12441254
......
14531463
14541464
14551465
1466
14561467
14571468
14581469
#endif
#if DEBUG_NVIDIA
#define DBG(x...)printf(x)
#define DBG(x...)verbose(x)
#else
#define DBG(x...)
#endif
const char *nvidia_name_1[]={ "@1,name","NVDA,Display-B" };
const char *nvidia_slot_name[]={ "AAPL,slot-name", "Slot-1" };
static uint8_t default_NVCAP[]= {
static uint8_t display_cfg_0[]= {0x03, 0x01, 0x03, 0x00};
static uint8_t display_cfg_1[]= {0xff, 0xff, 0x00, 0x01};
uint8_t default_NVCAP[]= {
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
0x00, 0x00, 0x00, 0x00
#define NVCAP_LEN ( sizeof(default_NVCAP) / sizeof(uint8_t) )
static uint8_t default_dcfg_0[]={0xff, 0xff, 0xff, 0xff};
static uint8_t default_dcfg_1[]={0xff, 0xff, 0xff, 0xff};
static uint8_t default_NVPM[]= {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
#define NVPM_LEN ( sizeof(default_NVPM) / sizeof(uint8_t) )
#define DCFG0_LEN ( sizeof(default_dcfg_0) / sizeof(uint8_t) )
#define DCFG1_LEN ( sizeof(default_dcfg_1) / sizeof(uint8_t) )
static int patch_nvidia_rom(uint8_t *rom)
{
if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) {
printf("False ROM signature: 0x%02x%02x\n", rom[0], rom[1]);
verbose("False ROM signature: 0x%02x%02x\n", rom[0], rom[1]);
return PATCH_ROM_FAILED;
}
uint16_t dcbptr = swap16(read16(rom, 0x36));
if (!dcbptr) {
printf("no dcb table found\n");
if(!dcbptr) {
verbose("no dcb table found\n");
return PATCH_ROM_FAILED;
}
//else
bar[0] = pci_config_read32(nvda_dev->dev.addr, 0x10 );
regs = (uint8_t *) (bar[0] & ~0x0f);
delay(50);
// get card type
nvCardType = (REG32(0) >> 20) & 0x1ff;
devprop_add_nvidia_template(device);
devprop_add_value(device, "NVCAP", default_NVCAP, NVCAP_LEN);
devprop_add_value(device, "NVPM", default_NVPM, NVPM_LEN);
devprop_add_value(device, "VRAM,totalsize", (uint8_t*)&videoRam, 4);
devprop_add_value(device, "model", (uint8_t*)model, strlen(model) + 1);
devprop_add_value(device, "rom-revision", (uint8_t*)biosVersion, strlen(biosVersion) + 1);
branches/slice/trunkM/revision
1
1
1171
1174:1175

Archive Download the corresponding diff file

Revision: 1179