Chameleon Applications

Chameleon Applications Commit Details

Date:2011-07-17 01:44:26 (9 years 4 months ago)
Author:ErmaC
Commit:325
Parents: 324
Message:Update to C2RC5 r.1164. Some change into makefile and buildpkg script thanks to meklort for the tips.
Changes:
M/branches/iFabio/Chameleon/i386/boot2/boot.h
M/branches/iFabio/Chameleon/i386/libsaio/ati.c
M/branches/iFabio/Chameleon/package/buildpkg
M/branches/iFabio/Chameleon/Makefile
M/branches/iFabio/Chameleon/i386/libsaio/acpi_patcher.c
M/branches/iFabio/Chameleon/i386/libsaio/nvidia.c

File differences

branches/iFabio/Chameleon/i386/libsaio/acpi_patcher.c
211211
212212
213213
214
215
214
215
216216
217217
218218
......
249249
250250
251251
252
253
254
252
253
254
255255
256256
257257
......
267267
268268
269269
270
270
271
272
271273
272274
273
274
275
275276
276277
277
278
278
279
279280
280
281
281
282282
283
284
283
285284
285
286
287
286288
287289
288290
289291
290292
291
292
293
294
293295
294
295
296
297
298
299
296
297
300298
299
300
301
301302
302303
303304
304305
305306
306
307
307
308
308309
309
310
311
312
313
314
315
316
317
318
319
320
310
311
312
313
314
315
316
317
318
319
320
321
322
321323
322324
323
325
326
327
324328
325329
326
327
328
330
331
332
329333
330
331
334
335
336
332337
333338
334339
335340
336
337
338
341
342
343
339344
340
341
345
346
342347
343348
344349
345350
346
347
348
351
352
353
349354
350
351
352
353
354
355
356
357
358
359
360
355
356
357
358
359
360
361
362
363
361364
362365
363366
char resource_template_register_fixedhw[] =
{
0x11, 0x14, 0x0A, 0x11, 0x82, 0x0C, 0x00, 0x7F,
0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x79, 0x00
0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x79, 0x00
};
char resource_template_register_systemio[] =
bool c4_enabled = false;
bool cst_using_sustemio = false;
getBoolForKey(kEnableC2States, &c2_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC3States, &c3_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC4States, &c4_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC2State, &c2_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC3State, &c3_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kEnableC4State, &c4_enabled, &bootInfo->chameleonConfig);
getBoolForKey(kCSTUsingSystemIO, &cst_using_sustemio, &bootInfo->chameleonConfig);
c2_enabled = c2_enabled | (fadt->C2_Latency < 100);
aml_add_byte(pack, cstates_count);
struct aml_chunk* tmpl = aml_add_package(pack);
if (cst_using_sustemio) {
if (cst_using_sustemio)
{
// C1
resource_template_register_fixedhw[8] = 0x00;
resource_template_register_fixedhw[9] = 0x00;
resource_template_register_fixedhw[10] = 0x00;
resource_template_register_fixedhw[11] = 0x00; // C1
resource_template_register_fixedhw[18] = 0x00;
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x01); // C1
aml_add_byte(tmpl, 0x20); // Latency
aml_add_word(tmpl, 0x03e8); // Power
aml_add_word(tmpl, 0x0001); // Latency
aml_add_dword(tmpl, 0x000003e8); // Power
uint8_t p_blk_lo = acpi_cpu_p_blk + 4;
uint8_t p_blk_hi = (acpi_cpu_p_blk + 4) >> 8;
uint8_t p_blk_lo, p_blk_hi;
// C2
if (c2_enabled)
if (c2_enabled) // C2
{
p_blk_lo = acpi_cpu_p_blk + 4;
p_blk_hi = (acpi_cpu_p_blk + 4) >> 8;
tmpl = aml_add_package(pack);
resource_template_register_systemio[11] = p_blk_lo; // C2
resource_template_register_systemio[12] = p_blk_hi; // C2
aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio));
aml_add_byte(tmpl, 0x02); // C2
aml_add_byte(tmpl, 0x60); // Latency
aml_add_word(tmpl, 0x01f4); // Power
aml_add_word(tmpl, 0x0040); // Latency
aml_add_dword(tmpl, 0x000001f4); // Power
}
p_blk_lo = acpi_cpu_p_blk + 5;
p_blk_hi = (acpi_cpu_p_blk + 5) >> 8;
// C4
if (c4_enabled)
if (c4_enabled) // C4
{
p_blk_lo = acpi_cpu_p_blk + 5;
p_blk_hi = (acpi_cpu_p_blk + 5) >> 8;
tmpl = aml_add_package(pack);
resource_template_register_systemio[11] = p_blk_lo; // C4
resource_template_register_systemio[12] = p_blk_hi; // C4
aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio));
aml_add_byte(tmpl, 0x04); // C4
aml_add_word(tmpl, 0x0A); // Latency
aml_add_byte(tmpl, 0xC8); // Power
aml_add_word(tmpl, 0x0080); // Latency
aml_add_dword(tmpl, 0x000000C8); // Power
}
else
// C3
if (c3_enabled)
{
tmpl = aml_add_package(pack);
resource_template_register_systemio[11] = p_blk_lo; // C3
resource_template_register_systemio[12] = p_blk_hi; // C3
aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio));
aml_add_byte(tmpl, 0x03); // C3
aml_add_word(tmpl, 0x80); // Latency
aml_add_word(tmpl, 0x015e); // Power
}
else if (c3_enabled) // C3
{
p_blk_lo = acpi_cpu_p_blk + 5;
p_blk_hi = (acpi_cpu_p_blk + 5) >> 8;
tmpl = aml_add_package(pack);
resource_template_register_systemio[11] = p_blk_lo; // C3
resource_template_register_systemio[12] = p_blk_hi; // C3
aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio));
aml_add_byte(tmpl, 0x03); // C3
aml_add_word(tmpl, 0x0060); // Latency
aml_add_dword(tmpl, 0x0000015e); // Power
}
}
else {
else
{
// C1
resource_template_register_fixedhw[11] = 0x00; // C1
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x01); // C1
aml_add_byte(tmpl, 0x01); // Latency
aml_add_word(tmpl, 0x03e8); // Power
aml_add_byte(tmpl, 0x01); // C1
aml_add_word(tmpl, 0x0001); // Latency
aml_add_dword(tmpl, 0x000003e8); // Power
// C2
if (c2_enabled)
resource_template_register_fixedhw[18] = 0x03;
if (c2_enabled) // C2
{
tmpl = aml_add_package(pack);
resource_template_register_fixedhw[11] = 0x10; // C2
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x02); // C2
aml_add_byte(tmpl, fadt->C2_Latency);
aml_add_word(tmpl, 0x01f4); // Power
aml_add_byte(tmpl, 0x02); // C2
aml_add_word(tmpl, 0x0040); // Latency
aml_add_dword(tmpl, 0x000001f4); // Power
}
// C4
if (c4_enabled)
if (c4_enabled) // C4
{
tmpl = aml_add_package(pack);
resource_template_register_fixedhw[11] = 0x30; // C4
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x04); // C4
aml_add_word(tmpl, 0x11); // TODO: right latency for C4
aml_add_byte(tmpl, 0xfa); // Power
aml_add_byte(tmpl, 0x04); // C4
aml_add_word(tmpl, 0x0080); // Latency
aml_add_dword(tmpl, 0x000000C8); // Power
}
else
// C3
if (c3_enabled)
{
tmpl = aml_add_package(pack);
resource_template_register_fixedhw[11] = 0x20; // C3
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x03); // C3
aml_add_word(tmpl, fadt->C3_Latency);
aml_add_word(tmpl, 0x015e); // Power
}
else if (c3_enabled)
{
tmpl = aml_add_package(pack);
resource_template_register_fixedhw[11] = 0x20; // C3
aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw));
aml_add_byte(tmpl, 0x03); // C3
aml_add_word(tmpl, 0x0060); // Latency
aml_add_dword(tmpl, 0x0000015e); // Power
}
}
branches/iFabio/Chameleon/i386/libsaio/nvidia.c
621621
622622
623623
624
624625
625626
626627
......
628629
629630
630631
632
631633
632634
633635
......
660662
661663
662664
665
663666
664667
665668
......
673676
674677
675678
679
676680
677681
678682
679683
680684
681685
686
682687
683688
684689
......
10811086
10821087
10831088
1089
10841090
10851091
10861092
{
if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) {
printf("False ROM signature: 0x%02x%02x\n", rom[0], rom[1]);
pause();
return PATCH_ROM_FAILED;
}
if (!dcbptr) {
printf("no dcb table found\n");
pause();
return PATCH_ROM_FAILED;
}
//else
if (sig != 0x4edcbdcb)
{
printf("Bad display config block signature (0x%8x)\n", sig); //Azi: issue #48
pause();
return PATCH_ROM_FAILED;
}
}
if (strcmp(sig, "DEV_REC"))
{
printf("Bad Display Configuration Block signature (%s)\n", sig);
pause();
return PATCH_ROM_FAILED;
}
}
else
{
printf("ERROR: dcbtable_version is 0x%X\n", dcbtable_version);
pause();
return PATCH_ROM_FAILED;
}
if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) {
printf("ERROR: nVidia ROM Patching Failed!\n");
pause();
//return false;
}
branches/iFabio/Chameleon/i386/libsaio/ati.c
11481148
11491149
11501150
1151
1151
1152
11521153
11531154
11541155
if (!card->info->device_id || !card->info->cfg_name)
{
printf("Unsupported card!\n");
printf("Unsupported card!\nUse AtiConfig key to specify a framebuffer for your card.\nIf still unsupported, report dev id, subsys id and vendor.");
pause();
return false;
}
branches/iFabio/Chameleon/i386/boot2/boot.h
8181
8282
8383
84
85
86
84
85
86
8787
8888
8989
#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
#define kCSTUsingSystemIO"CSTUsingSystemIO"/* acpi_patcher.c */
#define kEnableC2States"EnableC2State"/* acpi_patcher.c */
#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
#define kEnableC2State"EnableC2State"/* acpi_patcher.c */
#define kEnableC3State"EnableC3State"/* acpi_patcher.c */
#define kEnableC4State"EnableC4State"/* acpi_patcher.c */
#define kWake"Wake"/* boot.c */
#define kForceWake"ForceWake"/* boot.c */
branches/iFabio/Chameleon/package/buildpkg
250250
251251
252252
253
254
253
254
255
256
257
255258
256259
257260
do
theme=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' )
mkdir -p "${1}/${theme}/Root/"
ditto --noextattr --noqtn "${themes[$i]}" "${1}/${themes[$i]##*/}/Root/${theme}"
find "${1}/${themes[$i]##*/}" -name '.DS_Store' -or -name '.svn' -exec rm -R {} \+
rsync -r --exclude=.svn "${themes[$i]}" "${1}/${themes[$i]##*/}/Root/${theme}"
# #### Comment out thx meklort
# ditto --noextattr --noqtn "${themes[$i]}" "${1}/${themes[$i]##*/}/Root/${theme}"
# ####
find "${1}/${themes[$i]##*/}" -name '.DS_Store' -or -name '.svn' -exec rm -R {} \+
find "${1}/${themes[$i]##*/}" -type f -exec chmod 644 {} \+
echo "[BUILD] ${themes[$i]##*/} "
buildpackage "${1}/${theme}" "/Extra/Themes" "" "start_selected=\"false\"" >/dev/null 2>&1
branches/iFabio/Chameleon/Makefile
9696
9797
9898
99
100
99
100
101101
102102
103103
104104
105
106
105
106
107107
108108
109109
@echo "#define I386BOOT_CHAMELEONREVISION \"`svnversion -n | tr -d [:alpha:]`\"" >> $@
pkg: all
@if [ -e "$(SYMROOT)" ]; then \
sudo `pwd`/package/buildpkg `pwd`/sym/package; \
@if [ -e "$(SYMROOT)" ]; then \
"${SRCROOT}/package/buildpkg" "${SYMROOT}/package"; \
fi;
dmg: all
@if [ -e "$(SYMROOT)" ]; then \
sudo `pwd`/package/slimpkg `pwd`/sym/package; \
sudo `pwd`/package/builddmg `pwd`/sym/package; \
"${SRCROOT}/package/slimpkg" "${SYMROOT}/package"; \
"${SRCROOT}/package/builddmg" "${SYMROOT}/package"; \
fi;
.PHONY: $(SYMROOT)/i386/vers.h

Archive Download the corresponding diff file

Revision: 325