Chameleon

Chameleon Commit Details

Date:2012-08-07 15:47:54 (11 years 8 months ago)
Author:ErmaC
Commit:2042
Parents: 2041
Message:sync with trunk nvidia.c update card list. ati. update card list.
Changes:
M/branches/ErmaC/Trunk/i386/libsaio/nvidia.c
M/branches/ErmaC/Trunk/i386/libsaio/ati.c
M/branches/ErmaC/Trunk/i386/libsaio/bootstruct.h
M/branches/ErmaC/Trunk/i386/libsaio/stringTable.c
M/branches/ErmaC/Trunk/i386/libsaio/ati.h
M/branches/ErmaC/Trunk/i386/libsaio/saio_types.h

File differences

branches/ErmaC/Trunk/i386/libsaio/bootstruct.h
11
22
33
4
54
65
76
......
1918
2019
2120
22
2321
2422
2523
......
3028
3129
3230
33
34
31
32
3533
3634
3735
......
5250
5351
5452
55
56
57
58
59
6053
6154
6255
......
10194
10295
10396
104
105
106
107
108
97
98
99
100
101
102
109103
110
104
111105
112106
113107
......
118112
119113
120114
121
122
123
115
116
117
118
124119
125
120
126121
127
122
128123
129
130
124
125
131126
132
127
133128
134129
135
130
136131
137
138
132
133
139134
140
141
142
143
144
145
135
136
137
138
139
140
146141
147142
148143
/*
* Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Portions Copyright (c) 2002-2003 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef __BOOTSTRUCT_H
#include "bios.h"
#include "device_tree.h"
/*!
Kernel boot args global also used by booter for its own data.
/*
* Kernel boot args global also used by booter for its own data.
*/
extern boot_args *bootArgs;
extern boot_args_pre_lion *bootArgsPreLion;
#define CONFIG_SIZE (40 * 4096)
/*
* Max size for config data array, in bytes.
*/
#define IO_CONFIG_DATA_SIZE163840
#define kMemoryMapCountMax 40
/*
/*
* ACPI defined memory range types.
*/
enum {
kMemoryRangeUsable = 1, // RAM usable by the OS.
kMemoryRangeReserved = 2, // Reserved. (Do not use)
kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
enum
{
kMemoryRangeUsable = 1, // RAM usable by the OS.
kMemoryRangeReserved = 2, // Reserved. (Do not use)
kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
/* Undefined types should be treated as kMemoryRangeReserved */
/* Undefined types should be treated as kMemoryRangeReserved */
};
/*!
uses internally. Some fields (e.g. the video information) remain interesting
to the kernel and are thus located in bootArgs although with different field names.
*/
typedef struct PrivateBootInfo {
int convmem; // conventional memory
int extmem; // extended memory
typedef struct PrivateBootInfo
{
int convmem; // conventional memory
int extmem; // extended memory
#if 0
int numBootDrivers; // number of drivers loaded
int numBootDrivers; // number of drivers loaded
#endif
char bootFile[128]; // kernel file name
char bootFile[128]; // kernel file name
unsigned long memoryMapCount;
MemoryRange memoryMap[kMemoryMapCountMax];
unsigned long memoryMapCount;
MemoryRange memoryMap[kMemoryMapCountMax];
PCI_bus_info_t pciInfo;
PCI_bus_info_t pciInfo;
#if 0
driver_config_t driverConfig[NDRIVERS];
driver_config_t driverConfig[NDRIVERS];
#endif
char * configEnd;// pointer to end of config files
char config[CONFIG_SIZE];
char * configEnd;// pointer to end of config files
char config[CONFIG_SIZE];
config_file_t bootConfig;// com.apple.Boot.plist
config_file_t chameleonConfig;// org.chameleon.Boot.plist which can override bootConfig keys
config_file_t themeConfig;// theme.plist
config_file_t smbiosConfig;// smbios.plist
config_file_t helperConfig;// boot helper partition's boot.plist
config_file_t ramdiskConfig;// RAMDisk.plist
config_file_t bootConfig;// com.apple.Boot.plist
config_file_t chameleonConfig;// org.chameleon.Boot.plist which can override bootConfig keys
config_file_t themeConfig;// theme.plist
config_file_t smbiosConfig;// smbios.plist
config_file_t helperConfig;// boot helper partition's boot.plist
config_file_t ramdiskConfig;// RAMDisk.plist
bool memDetect;
} PrivateBootInfo_t;
branches/ErmaC/Trunk/i386/libsaio/nvidia.c
7878
7979
8080
81
82
81
82
8383
8484
8585
......
304304
305305
306306
307
307308
308309
309310
......
643644
644645
645646
647
648
649
646650
647651
648652
......
705709
706710
707711
712
708713
709714
710715
......
944949
945950
946951
952
953
954
955
956
947957
958
948959
949960
961
950962
963
951964
965
966
952967
953968
954969
......
9881003
9891004
9901005
1006
1007
9911008
9921009
9931010
......
10001017
10011018
10021019
1020
10031021
10041022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
10051036
10061037
10071038
......
10451076
10461077
10471078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
10481117
10491118
1119
1120
1121
10501122
10511123
10521124
......
10691141
10701142
10711143
1072
1144
10731145
10741146
10751147
......
11781250
11791251
11801252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
11811284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
11821346
11831347
11841348
......
12531417
12541418
12551419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
12561436
1437
1438
1439
1440
1441
1442
12571443
12581444
12591445
......
12801466
12811467
12821468
1469
1470
12831471
12841472
12851473
......
12991487
13001488
13011489
1490
1491
13021492
13031493
13041494
13051495
13061496
13071497
1498
13081499
13091500
13101501
13111502
1503
13121504
13131505
13141506
......
13221514
13231515
13241516
1517
13251518
13261519
13271520
......
13351528
13361529
13371530
1531
1532
1533
13381534
13391535
1536
13401537
1538
1539
1540
1541
1542
1543
1544
1545
13411546
13421547
1548
13431549
13441550
13451551
1552
1553
1554
1555
1556
13461557
13471558
13481559
13491560
1561
1562
1563
1564
1565
1566
1567
13501568
13511569
13521570
1571
13531572
13541573
1574
1575
1576
13551577
13561578
13571579
......
13651587
13661588
13671589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
13681609
13691610
13701611
......
21632404
21642405
21652406
2407
21662408
21672409
21682410
......
23782620
23792621
23802622
2381
2623
2624
23822625
23832626
23842627
23852628
23862629
23872630
2388
2631
2632
23892633
23902634
23912635
......
24422686
24432687
24442688
2689
24452690
2446
2691
2692
24472693
24482694
24492695
......
24602706
24612707
24622708
2709
24632710
2711
24642712
2713
24652714
2715
24662716
2717
24672718
2468
2719
2720
24692721
24702722
24712723
......
24922744
24932745
24942746
2747
24952748
2749
24962750
24972751
24982752
......
25072761
25082762
25092763
2764
25102765
2766
25112767
25122768
25132769
......
26212877
26222878
26232879
2624
2625
2626
2627
2628
2629
2630
2631
2632
2880
2881
2882
2883
2884
2885
2886
2887
2888
26332889
26342890
26352891
......
26482904
26492905
26502906
2651
2652
2907
26532908
26542909
26552910
......
26632918
26642919
26652920
2921
26662922
2667
2923
26682924
2925
26692926
2927
26702928
2929
26712930
2931
26722932
2933
26732934
2935
26742936
2937
26752938
2939
26762940
2941
26772942
2943
26782944
2945
26792946
2947
26802948
26812949
2682
2683
2950
2951
2952
2953
26842954
26852955
26862956
2687
2688
2957
2958
2959
2960
26892961
26902962
26912963
......
27032975
27042976
27052977
2706
2978
2979
27072980
27082981
27092982
......
27132986
27142987
27152988
2716
2989
2990
27172991
27182992
27192993
......
27353009
27363010
27373011
2738
3012
27393013
27403014
27413015
......
27643038
27653039
27663040
2767
3041
27683042
2769
3043
3044
27703045
27713046
27723047
......
27883063
27893064
27903065
2791
2792
3066
3067
3068
27933069
27943070
27953071
27963072
2797
2798
2799
3073
3074
3075
28003076
2801
2802
2803
3077
3078
3079
28043080
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
28173093
28183094
28193095
28203096
28213097
2822
3098
28233099
28243100
28253101
......
28273103
28283104
28293105
2830
3106
28313107
28323108
28333109
......
28533129
28543130
28553131
2856
2857
2858
2859
3132
3133
3134
3135
28603136
2861
3137
28623138
28633139
2864
2865
2866
2867
2868
3140
3141
3142
3143
3144
28693145
2870
2871
3146
3147
28723148
2873
2874
3149
3150
28753151
2876
2877
2878
2879
2880
2881
2882
3152
3153
3154
3155
3156
3157
3158
28833159
28843160
2885
3161
28863162
28873163
28883164
28893165
28903166
28913167
2892
2893
2894
2895
2896
3168
3169
3170
3171
3172
28973173
28983174
28993175
......
29293205
29303206
29313207
2932
3208
3209
29333210
29343211
29353212
......
29413218
29423219
29433220
2944
3221
3222
29453223
29463224
29473225
......
29653243
29663244
29673245
2968
3246
29693247
29703248
29713249
29723250
29733251
29743252
2975
3253
29763254
29773255
29783256
......
30473325
30483326
30493327
3050
30513328
30523329
30533330
const char *nvidia_slot_name[] ={ "AAPL,slot-name", "Slot-1" };
static uint8_t default_NVCAP[]= {
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0x00, 0x00, 0x00, 0x00
};
{ 0x10DE0391,0x19F1201F,"BFG GeForce 7600 GT" },
{ 0x10DE0391,0x19F120DE,"Galaxy GeForce 7600 GT" },
{ 0x10DE0391,0x3842C615,"EVGA GeForce 7600 GT" },
{ 0x10DE0393,0x00000400,"Apple GeForce 7300GT" },
// 03A0 - 03AF
// 03B0 - 03BF
// 06E0 - 06EF
{ 0x10DE06E4,0x10438322,"Asus EN8400GS" },
{ 0x10DE06E4,0x14583475,"GV-NX84S256HE [GeForce 8400 GS]" },
{ 0x10DE06E4,0x14621160,"MSi GeForce 8400 GS" },
{ 0x10DE06E4,0x14621164,"MSi GeForce 8400 GS" },
{ 0x10DE06E4,0x3842C802,"EVGA GeForce 8400 GS" },
{ 0x10DE06E8,0x10280262,"Dell GeForce 9200M GS" },
{ 0x10DE06E8,0x10280271,"Dell GeForce 9200M GS" },
{ 0x10DE084B,0x1631E03B,"NEC GeForce 9200" },
// 0850 - 085F
// 0860 - 086F
{ 0x10DE086A,0x1458D000,"Gigabyte GeForce 9400" },
// 0870 - 087F
{ 0x10DE0873,0x104319B4,"Asus GeForce G102M" },
// 0DA0 - 0DAF
// 0DB0 - 0DBF
// 0DC0 - 0DCF
{ 0x10DE0DC0,0x10DE082D,"nVidia GeForce GT 440" },
{ 0x10DE0DC0,0x14622310,"MSi GeForce GT 440" },
{ 0x10DE0DC0,0x14622311,"MSi GeForce GT 440" },
{ 0x10DE0DC0,0x14622312,"MSi GeForce GT 440" },
{ 0x10DE0DC0,0x16423A28,"Bitland GeForce GT 440" },
{ 0x10DE0DC0,0x174B1178,"PC Partner GeForce GT 440" },
{ 0x10DE0DC0,0x174B2178,"PC Partner GeForce GT 440" },
{ 0x10DE0DC4,0x10438365,"Asus GeForce GTS 450" },
{ 0x10DE0DC4,0x1043837A,"Asus GeForce GTS 450" },
{ 0x10DE0DCD,0x10280491,"Dell GeForce GT 555M" },
{ 0x10DE0DCD,0x102804B7,"Dell GeForce GT 555M" },
{ 0x10DE0DCD,0x102804B8,"Dell GeForce GT 555M" },
{ 0x10DE0DCD,0x146210A2,"MSi GeForce GT 555M" },
{ 0x10DE0DD1,0x102802A2,"Dell GeForce GTX 460M" },
{ 0x10DE0DD1,0x1028048F,"Dell GeForce GTX 460M" },
{ 0x10DE0DD1,0x17C010EA,"Wistron GeForce GTX 460M" },
{ 0x10DE0DD6,0x10280010,"Dell GeForce GT 550M" },
{ 0x10DE0DD6,0x102804B7,"Dell GeForce GT 550M" },
{ 0x10DE0DD6,0x102804B8,"Dell GeForce GT 550M" },
{ 0x10DE0DD8,0x103C084A,"HP nVidia Quadro 2000" },
{ 0x10DE0DD8,0x10DE084A,"nVidia Quadro 2000" },
// 0DE0 - 0DEF
{ 0x10DE0DE0,0x10DE0828,"nVidia GeForce GT 440" },
{ 0x10DE0DE1,0x1043836D,"Asus GeForce GT 430" },
{ 0x10DE0DE1,0x38421430,"EVGA GeForce GT 430" },
{ 0x10DE0DE2,0x1043835F,"Asus GeForce GT 420" },
{ 0x10DE0DE2,0x14622302,"MSi GeForce GT 420" },
{ 0x10DE0DE2,0x16423A26,"Bitland GeForce GT 420" },
{ 0x10DE0DE2,0x174B1162,"PC Partner GeForce GT 420" },
{ 0x10DE0DE2,0x174B2162,"PC Partner GeForce GT 420" },
{ 0x10DE0DE2,0x1B0A9083,"Pegatron GeForce GT 420" },
{ 0x10DE0DE2,0x1B0A9085,"Pegatron GeForce GT 420" },
{ 0x10DE0DE2,0x1B0A9089,"Pegatron GeForce GT 420" },
{ 0x10DE0DE3,0x1043100D,"Asus GeForce GT 635M" },
{ 0x10DE0DE3,0x10431477,"Asus GeForce GT 635M" },
{ 0x10DE0DE3,0x10431587,"Asus GeForce GT 635M" },
{ 0x10DE0DE9,0x10250487,"Acer GeForce GT 630M" },
{ 0x10DE0DE9,0x10250488,"Acer GeForce GT 630M" },
{ 0x10DE0DE9,0x10250505,"Acer GeForce GT 630M" },
// 0DF0 - 0DFF
{ 0x10DE0DF0,0x1B0A9077,"Pegatron GeForce GT 425M" },
{ 0x10DE0DF0,0x1B0A909A,"Pegatron GeForce GT 425M" },
{ 0x10DE0DF1,0x1025035A,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025036C,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025036D,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250370,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250371,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250374,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250375,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250379,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025037C,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025037D,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025037E,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250382,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025040A,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250413,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250415,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250417,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025041E,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250423,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250424,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250434,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250450,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250464,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250485,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250486,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250487,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250488,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10250499,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x1025049A,"Acer GeForce GT 420M" },
{ 0x10DE0DF1,0x10280468,"Dell GeForce GT 420M" },
{ 0x10DE0DF1,0x1028046E,"Dell GeForce GT 420M" },
{ 0x10DE0DF1,0x144DC08E,"Samsung GeForce GT 420M" },
{ 0x10DE0DF1,0x144DC093,"Samsung GeForce GT 420M" },
{ 0x10DE0DF1,0x144DC096,"Samsung GeForce GT 420M" },
{ 0x10DE0DF1,0x1B0A2036,"Pegatron GeForce GT 420M" },
{ 0x10DE0DF1,0x1B0A207A,"Pegatron GeForce GT 420M" },
{ 0x10DE0DF1,0x1BFD2003,"GeForce GT 420M" }, // SUBVENDOR?
{ 0x10DE0DF2,0x174B5162,"PC Partner GeForce GT 435M" },
{ 0x10DE0DF3,0x144DC08D,"Samsung GeForce GT 420M" },
{ 0x10DE0DF3,0x144DC095,"Samsung GeForce GT 420M" },
{ 0x10DE0DF4,0x1043105C,"Asus GeForce GT 540M" },
{ 0x10DE0DF4,0x104315E2,"Asus GeForce GT 540M" },
{ 0x10DE0DF4,0x104315F2,"Asus GeForce GT 540M" },
{ 0x10DE0DFE,0x10431522,"Asus GF108 ES" },
{ 0x10DE0DFE,0x10431532,"Asus GF108 ES" },
{ 0x10DE0DFE,0x10431552,"Asus GF108 ES" },
{ 0x10DE0DFE,0x1B0A206C,"GF108 ES" },
{ 0x10DE0DFE,0x1B0A206C,"Pegatron GF108 ES" },
// 0E00 - 0E0F
// 0E10 - 0E1F
// 0E20 - 0E2F
{ 0x10DE1042,0x14622595,"MSi GeForce 510" },
{ 0x10DE1042,0x14622596,"MSi GeForce 510" },
{ 0x10DE1050,0x10250487,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250488,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250501,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250503,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250505,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250507,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250509,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250512,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025053A,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025054E,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250550,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025055A,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025055C,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250568,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025056A,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025056B,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025056C,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250570,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250572,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250573,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250574,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250575,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250576,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250578,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250579,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025057A,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025057B,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250580,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250581,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025058B,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025058C,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250593,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025060D,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x1025060F,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10250611,"Acer GeForce GT 520M" },
{ 0x10DE1050,0x10280522,"Dell GeForce GT 520M" },
{ 0x10DE1050,0x103C184D,"HP GeForce GT 520M" },
{ 0x10DE1050,0x103C338A,"HP GeForce GT 520M" },
{ 0x10DE1050,0x103C338B,"HP GeForce GT 520M" },
{ 0x10DE1050,0x103C338C,"HP GeForce GT 520M" },
{ 0x10DE1050,0x10431622,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x10431652,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x10431662,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x10431682,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x104316F2,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x10431722,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x10431732,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x10431742,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x104384CF,"Asus GeForce GT 520M" },
{ 0x10DE1050,0x104D9089,"Sony GeForce GT 520M" },
{ 0x10DE1050,0x104D908A,"Sony GeForce GT 520M" },
{ 0x10DE1050,0x104D908B,"Sony GeForce GT 520M" },
{ 0x10DE1050,0x10CF1635,"Fujitsu GeForce GT 520M" },
{ 0x10DE1050,0x10CF3655,"Fujitsu GeForce GT 520M" },
{ 0x10DE1050,0x1179FC01,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FC31,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FC50,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FC61,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FC71,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FC81,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FC90,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FCC0,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FCD0,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FCE2,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FCF2,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FD16,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FD40,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FD50,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FD52,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FD61,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FD71,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FDD0,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x1179FDD2,"Toshiba GeForce GT 520M" },
{ 0x10DE1050,0x144DC0A0,"Samsung GeForce GT 520M" },
{ 0x10DE1050,0x144DC0B2,"Samsung GeForce GT 520M" },
{ 0x10DE1050,0x144DC0B6,"Samsung GeForce GT 520M" },
{ 0x10DE1050,0x144DC597,"Samsung GeForce GT 520M" },
{ 0x10DE1050,0x14581132,"Gigabyte GeForce GT 520M" },
{ 0x10DE1050,0x1462108C,"MSi GeForce GT 520M" },
{ 0x10DE1050,0x14621094,"MSi GeForce GT 520M" },
{ 0x10DE1050,0x17AA3652,"Lenovo GeForce GT 520M" },
{ 0x10DE1050,0x17AA397D,"Lenovo GeForce GT 520M" },
{ 0x10DE1050,0x17AA397F,"Lenovo GeForce GT 520M" },
{ 0x10DE1050,0x17C010E5,"Wistron GeForce GT 520M" },
{ 0x10DE1050,0x17C010EC,"Wistron GeForce GT 520M" },
{ 0x10DE1050,0x17C010F3,"Wistron GeForce GT 520M" },
{ 0x10DE1050,0x18540865,"LG GeForce GT 520M" },
{ 0x10DE1050,0x18540871,"LG GeForce GT 520M" },
{ 0x10DE1050,0x18541791,"LG GeForce GT 520M" },
{ 0x10DE1050,0x18543001,"LG GeForce GT 520M" },
{ 0x10DE1050,0x19915584,"GeForce GT 520M" },
{ 0x10DE1050,0x1BAB2002,"GeForce GT 520M" },
{ 0x10DE1050,0x1BFD8005,"GeForce GT 520M" },
{ 0x10DE1054,0x10280511,"Dell GeForce 410M" },
{ 0x10DE1054,0x10CF1656,"Fujitsu GeForce 410M" },
// 10B0 - 10BF
// 10C0 - 10CF
{ 0x10DE10C4,0x17AA3605,"Lenovo ION" },
{ 0x10DE10C5,0x1043838D,"Asus GeForce 405" },
{ 0x10DE10C5,0x1043839C,"Asus GeForce 405" },
{ 0x10DE10C5,0x14621834,"MSi GeForce 405" },
{ 0x10DE10C5,0x14621835,"MSi GeForce 405" },
{ 0x10DE10C5,0x14621837,"MSi GeForce 405" },
{ 0x10DE10C5,0x1462183B,"MSi GeForce 405" },
{ 0x10DE10C5,0x14622298,"MSi GeForce 405" },
{ 0x10DE10C5,0x16423899,"Bitland GeForce 405" },
{ 0x10DE10C5,0x16423958,"Bitland GeForce 405" },
{ 0x10DE10C5,0x174B3150,"PC Partner GeForce 405" },
{ 0x10DE10C5,0x1B0A908E,"Pegatron GeForce 405" },
{ 0x10DE10C5,0x1B0A90A9,"Pegatron GeForce 405" },
{ 0x10DE10C5,0x1B0A90AB,"Pegatron GeForce 405" },
{ 0x10DE10C5,0x1B0A90AC,"Pegatron GeForce 405" },
{ 0x10DE10C5,0x1B0A90AF,"Pegatron GeForce 405" },
// 10D0 - 10DF
{ 0x10DE10D8,0x103C0862,"HP NVS 300" },
{ 0x10DE10D8,0x103C0863,"HP NVS 300" },
{ 0x10DE10D8,0x10DE0862,"nVidia NVS 300" },
{ 0x10DE10D8,0x10DE0863,"nVidia NVS 300" },
// 10E0 - 10EF
// 10F0 - 10FF
// 1100 - 110F
{ 0x10DE1140,0x17AA3903,"Lenovo GeForce GT 610M" },
{ 0x10DE1140,0x17AA3983,"Lenovo GeForce GT 610M" },
{ 0x10DE1140,0x17AA500D,"Lenovo GeForce GT 620M" },
{ 0x10DE1140,0x1B0A20DD,"Pegatron GeForce GT 620M" },
{ 0x10DE1140,0x1B0A20FD,"Pegatron GeForce GT 620M" },
// 1150 - 115F
// 1160 - 116F
// 1170 - 117F
{ 0x10DE1180,0x38422680,"EVGA GTX 680" },
{ 0x10DE1180,0x38422682,"EVGA GTX 680 SC" },
{ 0x10DE1185,0x174B2260,"PC Partner GeForce GTX 660" },
{ 0x10DE1188,0x10438406,"Asus GeForce GTX 690" },
{ 0x10DE1188,0x10DE095B,"nVidia GeForce GTX 690" },
{ 0x10DE1188,0x38422690,"EVGA GeForce GTX 690" },
{ 0x10DE1189,0x10438405,"Asus GTX 670 Direct CU II TOP" },
{ 0x10DE1189,0x10DE097A,"nVidia GeForce GTX 670" },
{ 0x10DE1189,0x14583542,"Gigabyte GeForce GTX 670" },
{ 0x10DE1189,0x15691189,"Palit GTX 670 JetStream" },
{ 0x10DE1189,0x174B1260,"PC Partner GeForce GTX 670" },
{ 0x10DE1189,0x19DA1255,"Zotac GTX 670 AMP! Edition" },
{ 0x10DE1189,0x38422672,"EVGA GTX 670" },
{ 0x10DE1189,0x38422678,"EVGA GTX 670" },
// 1190 - 119F
// 11A0 - 11AF
// 11B0 - 11BF
{ 0x10DE1200,0x104383BF,"Asus GeForce GTX 560 Ti" },
{ 0x10DE1200,0x10B00801,"Gainward GeForce GTX 560 Ti" },
{ 0x10DE1200,0x14583515,"Gigabyte GeForce GTX 560 Ti" },
{ 0x10DE1200,0x1458351C,"Gigabyte GeForce GTX 560 Ti" },
{ 0x10DE1200,0x14622601,"MSi GeForce GTX 560 Ti" },
{ 0x10DE1200,0x196E0898,"PNY GeForce GTX 560 Ti" },
{ 0x10DE1200,0x38421567,"EVGA GeForce GTX 560 Ti" },
{ 0x10DE1210,0x10431487,"Asus GeForce GTX 570M" },
{ 0x10DE1210,0x10432104,"Asus GeForce GTX 570M" },
{ 0x10DE1210,0x1179FB12,"Toshiba GeForce GTX 570M" },
{ 0x10DE1210,0x1179FB18,"Toshiba GeForce GTX 570M" },
{ 0x10DE1210,0x1179FB1A,"Toshiba GeForce GTX 570M" },
{ 0x10DE1210,0x146210BD,"MSi GeForce GTX 570M" },
{ 0x10DE1211,0x1028048F,"Dell GeForce GTX 580M" },
{ 0x10DE1211,0x10280490,"Dell GeForce GTX 580M" },
{ 0x10DE1211,0x102804BA,"Dell GeForce GTX 580M" },
{ 0x10DE1211,0x146210A9,"MSi GeForce GTX 580M" },
{ 0x10DE1211,0x15580270,"Clevo GeForce GTX 580M" },
{ 0x10DE1211,0x15580271,"Clevo GeForce GTX 580M" },
{ 0x10DE1211,0x15585102,"Clevo GeForce GTX 580M" },
{ 0x10DE1211,0x15587100,"Clevo GeForce GTX 580M" },
{ 0x10DE1211,0x15587101,"Clevo GeForce GTX 580M" },
{ 0x10DE1211,0x15587200,"Clevo GeForce GTX 580M" },
{ 0x10DE1212,0x1028057B,"Dell GeForce GTX 675M" },
{ 0x10DE1212,0x144DC0D0,"Samsung GeForce GTX 675M" },
{ 0x10DE1212,0x146210CB,"MSi GeForce GTX 675M" },
{ 0x10DE1213,0x102804BA,"Dell GeForce GTX 670M" },
{ 0x10DE1213,0x10432119,"Dell GeForce GTX 670M" },
{ 0x10DE1213,0x10432120,"Dell GeForce GTX 670M" },
{ 0x10DE1213,0x1179FB12,"Toshiba GeForce GTX 670M" },
{ 0x10DE1213,0x1179FB18,"Toshiba GeForce GTX 670M" },
{ 0x10DE1213,0x1179FB1A,"Toshiba GeForce GTX 670M" },
{ 0x10DE1213,0x146210CB,"MSi GeForce GTX 670M" },
{ 0x10DE1241,0x10DE091D,"nVidia GeForce GT 545" },
{ 0x10DE1243,0x10438508,"Asus GeForce GT 545" },
{ 0x10DE1243,0x14622315,"MSi GeForce GT 545" },
{ 0x10DE1243,0x14622316,"MSi GeForce GT 545" },
{ 0x10DE1243,0x16423A28,"Bitland GeForce GT 545" },
{ 0x10DE1243,0x174B5178,"PC Partner GeForce GT 545" },
{ 0x10DE1243,0x174B6178,"PC Partner GeForce GT 545" },
{ 0x10DE1244,0x104383BC,"Asus GeForce GTX 550 Ti" },
{ 0x10DE1244,0x1458351A,"GigaByte GeForce GTX 550 Ti" },
{ 0x10DE1244,0x19DA5194,"Zotac GeForce GTX 550 Ti" },
{ 0x10DE1244,0x1B0A90A2,"Pegatron GeForce GTX 550 Ti" },
{ 0x10DE1244,0x38421556,"EVGA GeForce GTX 550 Ti" },
{ 0x10DE1246,0x10280570,"Dell GeForce GT 550M" },
{ 0x10DE1246,0x10280571,"Dell GeForce GT 550M" },
{ 0x10DE1247,0x10431407,"Asus GeForce GT 555M" },
{ 0x10DE1247,0x10431752,"Asus GeForce GT 635M" },
{ 0x10DE1247,0x10432050,"Asus GeForce GT 555M" },
{ 0x10DE1247,0x14586744,"GigaByte GeForce GT 555M" },
{ 0x10DE1247,0x152D0930,"Quanta GeForce GT 635M" },
{ 0x10DE1248,0x152D0930,"Quanta GeForce GT 635M" },
{ 0x10DE1248,0x17C010E7,"Wistron GeForce GT 555M" },
{ 0x10DE1248,0x17C010E8,"Wistron GeForce GT 555M" },
{ 0x10DE1248,0x17C010EA,"Wistron GeForce GT 555M" },
{ 0x10DE1248,0x18540890,"LG GeForce GT 555M" },
{ 0x10DE1248,0x18540891,"LG GeForce GT 555M" },
{ 0x10DE1248,0x18541795,"LG GeForce GT 555M" },
{ 0x10DE1248,0x18541796,"LG GeForce GT 555M" },
{ 0x10DE124B,0x10438540,"Asus GeForce GT 640" },
{ 0x10DE124B,0x14622319,"MSi GeForce GT 640" },
{ 0x10DE124B,0x174B0640,"PC Partner GeForce GT 640" },
{ 0x10DE124D,0x10280491,"Dell GeForce GT 555M" },
{ 0x10DE124D,0x10280570,"Dell GeForce GT 555M" },
{ 0x10DE124D,0x10280571,"Dell GeForce GT 555M" },
{ 0x10DE124D,0x1462108D,"MSi GeForce GT 555M" },
{ 0x10DE124D,0x146210CC,"MSi GeForce GT 635M" },
{ 0x10DE1251,0x102802A2,"Dell GeForce GTX 560M" },
{ 0x10DE1251,0x102802F8,"Dell GeForce GTX 560M" },
{ 0x10DE1251,0x1028048F,"Dell GeForce GTX 560M" },
{ 0x10DE0DE0,NV_SUB_IDS,"GeForce GT 440" },
{ 0x10DE0DE1,NV_SUB_IDS,"GeForce GT 430" },
{ 0x10DE0DE2,NV_SUB_IDS,"GeForce GT 420" },
{ 0x10DE0DE3,NV_SUB_IDS,"GeForce GT 635M" },
{ 0x10DE0DE4,NV_SUB_IDS,"GeForce GT 520" },
{ 0x10DE0DE5,NV_SUB_IDS,"GeForce GT 530" },
{ 0x10DE0DE8,NV_SUB_IDS,"GeForce GT 620M" },
static int patch_nvidia_rom(uint8_t *rom)
{
if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) {
if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa))
{
printf("False ROM signature: 0x%02x%02x\n", rom[0], rom[1]);
return PATCH_ROM_FAILED;
}
uint16_t dcbptr = READ_LE_SHORT(rom, 0x36);
if (!dcbptr) {
if (!dcbptr)
{
printf("no dcb table found\n");
return PATCH_ROM_FAILED;
}
}
if (numentries >= MAX_NUM_DCB_ENTRIES)
{
numentries = MAX_NUM_DCB_ENTRIES;
}
uint8_t num_outputs = 0, i = 0;
struct dcbentry
/* Should we allow discontinuous DCBs? Certainly DCB I2C tables can be discontinuous */
if ((connection & 0x0000000f) == 0x0000000f) /* end of records */
{
continue;
}
if (connection == 0x00000000) /* seen on an NV11 with DCB v1.5 */
{
continue;
}
if ((connection & 0xf) == 0x6) /* we skip type 6 as it doesnt appear on macbook nvcaps */
{
continue;
}
entries[num_outputs].type = connection & 0xf;
entries[num_outputs].index = num_outputs;
entries[num_outputs++].heads = (uint8_t*)&(dcbtable[(headerlength + recordlength * i) + 1]);
for (i = 0; i < num_outputs; i++)
{
if (entries[i].type == TYPE_GROUPED)
{
continue;
}
channel2 |= ( 0x1 << entries[i].index);
entries[i].type = TYPE_GROUPED;
for (i=0; i<num_outputs; i++)
{
if (entries[i].type == TYPE_GROUPED)
{
continue;
}
// if type is TMDS, the prior output is ANALOG
// we always group ANALOG and TMDS
// if there is a TV output after TMDS, we group it to that channel as well
for (i = 1; i < (sizeof(nvidia_cards) / sizeof(nvidia_cards[0])); i++) // size of nvidia_cards array for-loop
{
if ((nvidia_cards[i].device == device_id) && (nvidia_cards[i].subdev == subsys_id))
{
return nvidia_cards[i].name_model;
break;
}
else if ((nvidia_cards[i].device == device_id) && (nvidia_cards[i].subdev == 0x00000000))
{
return nvidia_cards[i].name_model;
break;
}
{
return nvidia_cards[i].name_model;
break;
}
else if ((nvidia_cards[i].device == device_id) && (nvidia_cards[i].subdev == 0x00000000))
{
return nvidia_cards[i].name_model;
break;
}
}
return nvidia_cards[0].name_model;
}
if (size > bufsize)
{
printf("Filesize of %s is bigger than expected! Truncating to 0x%x Bytes!\n",
filename, bufsize);
printf("Filesize of %s is bigger than expected! Truncating to 0x%x Bytes!\n", filename, bufsize);
size = bufsize;
}
size = read(fd, (char *)buf, size);
char tmp[16];
if (!device)
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_0))
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_0))
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_name_0))
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_1))
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_1))
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_name_1))
{
return 0;
}
if (devices_number == 1)
{
if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_parent))
return 0;
if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_parent))
{
return 0;
}
}
else
{
if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_child))
return 0;
if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_child))
{
return 0;
}
}
// Rek : Dont use sprintf return, it does not WORK !! our custom sprintf() always return 0!
inti;
charbuf[3];
if (hex == NULL || bin == NULL || len <= 0 || strlen(hex) != len * 2) {
if (hex == NULL || bin == NULL || len <= 0 || strlen(hex) != len * 2)
{
printf("[ERROR] bin2hex input error\n");
return -1;
}
for (i = 0; i < len; i++)
{
if (p[0] == '\0' || p[1] == '\0' || !isxdigit(p[0]) || !isxdigit(p[1])) {
if (p[0] == '\0' || p[1] == '\0' || !isxdigit(p[0]) || !isxdigit(p[1]))
{
printf("[ERROR] bin2hex '%s' syntax error\n", hex);
return -2;
}
if (nvcard->videoRam > 0)
{
vram_size = nvcard->videoRam * 1024 * 1024;
return vram_size;
}
}
default:
break;
}
if (!vram_size)
{ // Finally, if vram_size still not set do the calculation with our own method
{
// Finally, if vram_size still not set do the calculation with our own method
if (nvCardType < NV_ARCH_50)
{
vram_size = REG32(NV04_PFB_FIFO_DATA);
return vram_size;
}
static bool checkNvRomSig(uint8_t * aRom){
return aRom != NULL && (aRom[0] == 0x55 && aRom[1] == 0xaa);
static bool checkNvRomSig(uint8_t * aRom)
{
return aRom != NULL && (aRom[0] == 0x55 && aRom[1] == 0xaa);
}
bool setup_nvidia_devprop(pci_dt_t *nvda_dev)
{
struct DevPropDevice*device;
char*devicepath;
option_rom_pci_header_t *rom_pci_header;
struct DevPropDevice*device;
char*devicepath;
option_rom_pci_header_t*rom_pci_header;
volatile uint8_t*regs;
uint8_t*rom;
uint8_t*nvRom;
uint8_tnvCardType;
uint8_t*rom;
uint8_t*nvRom;
uint8_tnvCardType;
unsigned long longvideoRam;
uint32_tnvBiosOveride;
uint32_tbar[7];
uint32_tboot_display;
intnvPatch;
intlen;
charbiosVersion[32];
charnvFilename[32];
charkNVCAP[12];
char*model;
const char*value;
booldoit;
uint32_tnvBiosOveride;
uint32_tbar[7];
uint32_tboot_display;
intnvPatch;
intlen;
charbiosVersion[32];
charnvFilename[32];
charkNVCAP[12];
char*model;
const char*value;
booldoit;
fill_card_list();
devicepath = get_pci_dev_path(nvda_dev);
bar[0] = pci_config_read32(nvda_dev->dev.addr, 0x10 );
regs = (uint8_t *) (bar[0] & ~0x0f);
// get card type
nvCardType = (REG32(0) >> 20) & 0x1ff;
// Amount of VRAM in kilobytes
videoRam = mem_detect(regs, nvCardType, nvda_dev,((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) );
rom = malloc(NVIDIA_ROM_SIZE);
sprintf(nvFilename, "/Extra/%04x_%04x.rom", (uint16_t)nvda_dev->vendor_id,
(uint16_t)nvda_dev->device_id);
// Otherwise read bios from card
nvBiosOveride = 0;
// PROM first
// Enable PROM access
(REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED;
nvRom = (uint8_t*)&regs[NV_PROM_OFFSET];
// PROM first
// Enable PROM access
(REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED;
nvRom = (uint8_t*)&regs[NV_PROM_OFFSET];
// Valid Signature ?
// Valid Signature ?
if (checkNvRomSig(nvRom))
{
bcopy((uint8_t *)nvRom, rom, NVIDIA_ROM_SIZE);
DBG("PROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
else
{
bcopy((uint8_t *)nvRom, rom, NVIDIA_ROM_SIZE);
DBG("PROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
else
{
// disable PROM access
(REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED;
// disable PROM access
(REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED;
//PRAM next
nvRom = (uint8_t*)&regs[NV_PRAMIN_OFFSET];
//PRAM next
nvRom = (uint8_t*)&regs[NV_PRAMIN_OFFSET];
if(checkNvRomSig(nvRom))
{
bcopy((uint32_t *)nvRom, rom, NVIDIA_ROM_SIZE);
DBG("PRAM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
else
{
if(checkNvRomSig(nvRom))
{
bcopy((uint32_t *)nvRom, rom, NVIDIA_ROM_SIZE);
DBG("PRAM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
else
{
// 0xC0000 last
bcopy((char *)0xc0000, rom, NVIDIA_ROM_SIZE);
// Valid Signature ?
if (!checkNvRomSig(rom))
{
printf("ERROR: Unable to locate nVidia Video BIOS\n");
return false;
}
else
{
DBG("ROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
}//end PRAM check
else
{
DBG("ROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]);
}
}//end PRAM check
}//end PROM check
}//end load rom from bios
nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id,
devicepath, devices_number);
if (!string) {
if (!string)
{
string = devprop_create_string();
}
device = devprop_add_device(string, devicepath);
devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t*)&boot_display, 4);
}
if (nvPatch == PATCH_ROM_SUCCESS_HAS_LVDS) {
if (nvPatch == PATCH_ROM_SUCCESS_HAS_LVDS)
{
uint8_t built_in = 0x01;
devprop_add_value(device, "@0,built-in", &built_in, 1);
}
if (crlf_count == 2)
{
if (rom[i-1] == 0x20) i--; // strip last " "
for (version_start = i; version_start > (i-MAX_BIOS_VERSION_LENGTH); version_start--)
{
// find start
if (rom[version_start] == 0x00)
{
version_start++;
// strip "Version "
if (strncmp((const char*)rom+version_start, "Version ", 8) == 0)
{
devprop_add_value(device, "rom-revision", (uint8_t*)biosVersion, strlen(biosVersion) + 1);
devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN);
devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN);
if (getBoolForKey(kVBIOS, &doit, &bootInfo->chameleonConfig) && doit)
{
branches/ErmaC/Trunk/i386/libsaio/ati.c
204204
205205
206206
207
207208
208209
209210
......
434435
435436
436437
438
439
440
441
442
443
444
445
446
437447
448
449
450
451
452
453
454
455
456
457
438458
439459
440460
......
474494
475495
476496
497
477498
499
478500
479501
480502
......
529551
530552
531553
532
554
533555
534556
535557
......
677699
678700
679701
702
680703
681704
682705
683706
684707
685708
709
710
686711
687712
688713
......
770795
771796
772797
773
798
774799
775800
776801
......
780805
781806
782807
783
784
785
786
787
788
789
790
808
809
810
811
812
813
814
815
816
791817
792818
793819
......
13191345
13201346
13211347
1322
1348
13231349
13241350
13251351
{ 0x9480,0xFFA21179, CHIP_FAMILY_RV730,"ATI Radeon HD 5165M", kNull},
{ 0x9490,0x20031787, CHIP_FAMILY_RV730,"ATI Radeon HD 4670", kFlicker},
{ 0x9490,0x25421028, CHIP_FAMILY_RV730,"ATI Radeon HD 4670", kFlicker},
{ 0x9490,0x30501787, CHIP_FAMILY_RV730,"ATI Radeon HD 4710", kNull},
{ 0x9490,0x300017AF, CHIP_FAMILY_RV730,"ATI Radeon HD 4710", kNull},
{ 0x9490,0x4710174B, CHIP_FAMILY_RV730,"ATI Radeon HD 4710", kNull},
{ 0x68A1,0x22411462, CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5850",kNull},
{ 0x68A1,0x39961462, CHIP_FAMILY_CYPRESS,"ATI Mobility Radeon HD 5850",kNull},
{ 0x68A8,0x04421025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x04511025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x048F1028, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6870M", kNull},
{ 0x68A8,0x04901028, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6870M", kNull},
{ 0x68A8,0x04B91028, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6870M", kNull},
{ 0x68A8,0x04BA1028, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6870M", kNull},
{ 0x68A8,0x050A1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x050B1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x050C1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x050E1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x050F1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x05131025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x05141025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x05151025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x05161025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x05251025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x05261025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x056D1025, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0x159B103C, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68A8,0xC0AD144D, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6850M", kUakari},
{ 0x68B8,0x00CF106B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770", kHoolock},
{ 0x68B8,0x0044144D, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6770", kVervet},
{ 0x68BE,0x39821642, CHIP_FAMILY_JUNIPER,"AMD Radeon HD 6750", kNull},
{ 0x68BF,0x220E1458, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750", kVervet},
{ 0x68BF,0x3000148C, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750", kVervet},
{ 0x68BF,0x31401682, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750", kVervet},
{ 0x68BF,0x6750174B, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750", kVervet},
{ 0x68C0,0x1594103C, CHIP_FAMILY_REDWOOD,"AMD Radeon HD 6570M", kNull},
{ 0x68C0,0x392717AA, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5730",kNull},
{ 0x68D8,0xE155174B, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5670", kNull},
{ 0x68D8,0xE166174B, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5670", kUakari},
//{ 0x68D9,0x03CE1043, CHIP_FAMILY_REDWOOD,"ATI Radeon HD ????", kNull},
{ 0x68D9,0x03CE1043, CHIP_FAMILY_REDWOOD,"ASUS EAH5550 series", kNull},
{ 0x68D9,0x22401462, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5570", kNull},
{ 0x68D9,0x3000148C, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 6510", kNull},
{ 0x68D9,0x3000174B, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 6510", kNull},
{ 0x6718,0xE182174B, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970", kGibba},
{ 0x6718,0xE203174B, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970", kGibba},
{ 0x6719,0x03BE1043, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x03D41043, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x0B001002, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x186B174B, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x20101787, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x21FD1458, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x23071787, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x24611462, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x31211682, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0x31221682, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6719,0xE189174B, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950", kGibba},
{ 0x6758,0x6882103C, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670", kBulrushes},
{ 0x6758,0xE181174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670", kBulrushes},
{ 0x6758,0xE1941746, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670", kBulrushes},
{ 0x6758,0xE194174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670", kBulrushes},
{ 0x6758,0xE194174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670", kMangabey},
{ 0x6759,0x20121787, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570", kPithecia},
{ 0x6759,0xE193174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570", kPithecia},
{ 0x675F,0x6510148C, CHIP_FAMILY_TURKS,"AMD Radeon HD 5570", kNull},
{ 0x675F,0x6510174B, CHIP_FAMILY_TURKS,"AMD Radeon HD 5570", kNull},
{ 0x6760,0x00031179, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kNull},
{ 0x6760,0x04C11028, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kNull},
{ 0x6760,0x04CA1028, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kNull},
{ 0x6760,0x04CC1028, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kNull},
{ 0x6760,0x101C1043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kNull},
{ 0x6760,0x165A103C, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kNull},
{ 0x6760,0x167D103C, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kNull},
{ 0x6760,0x1CB21043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kNull},
{ 0x6760,0x00031179, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kIpomoea},
{ 0x6760,0x04C11028, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kIpomoea},
{ 0x6760,0x04CA1028, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kIpomoea},
{ 0x6760,0x04CC1028, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kIpomoea},
{ 0x6760,0x101C1043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450M", kIpomoea},
{ 0x6760,0x165A103C, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kIpomoea},
{ 0x6760,0x167D103C, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kIpomoea},
{ 0x6760,0x1CB21043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kIpomoea},
{ 0x6760,0x20011043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M", kIpomoea},
{ 0x6760,0x85171043, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7470M", kNull},
{ 0x6779,0x00001002, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450", kBulrushes},
//{FLAGTRUE,false,"AAPL,backlight-control",NULL,DWRVAL((uint32_t)0)},
//{FLAGTRUE,false,"AAPL,overwrite_binimage",get_binimage_owr,NULVAL},
{FLAGTRUE,false,"ATY,bin_image",get_binimage_val,NULVAL},
{FLAGTRUE,false,"ATY,Copyright",NULL,STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2011") },
{FLAGTRUE,false,"ATY,Copyright",NULL,STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2012") },
{FLAGTRUE,false,"ATY,Card#",get_romrevision_val,NULVAL},
{FLAGTRUE,false,"ATY,VendorID",NULL,WRDVAL((uint16_t)0x1002)},
{FLAGTRUE,false,"ATY,DeviceID",get_deviceid_val,NULVAL},
branches/ErmaC/Trunk/i386/libsaio/ati.h
5252
5353
5454
55
56
5557
5658
5759
......
189191
190192
191193
192
194
193195
194
195
196
197
198
199
200
201
202
203
204
196
197
198
199
200
201
202
203
204
205
206
205207
206208
207209
......
214216
215217
216218
217
218
219
219
220
221
220222
221223
222224
223
224
225
226
227
225
226
227
228
229
228230
229231
230232
#ifndef _ATI_REG_H_
#define _ATI_REG_H_
#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e
#define DATVAL(x){kPtr, sizeof(x), (uint8_t *)x}
#define STRVAL(x){kStr, sizeof(x), (uint8_t *)x}
#define BYTVAL(x){kCst, 1, (uint8_t *)x}
} radeon_card_info_t;
typedef struct {
struct DevPropDevice*device;
struct DevPropDevice*device;
radeon_card_info_t*info;
pci_dt_t*pci_dev;
uint8_t*fb;
uint8_t*mmio;
uint8_t*io;
uint8_t*rom;
uint32_trom_size;
uint32_tvram_size;
const char*cfg_name;
uint8_tports;
uint32_tflags;
boolposted;
pci_dt_t*pci_dev;
uint8_t*fb;
uint8_t*mmio;
uint8_t*io;
uint8_t*rom;
uint32_trom_size;
uint32_tvram_size;
const char*cfg_name;
uint8_tports;
uint32_tflags;
boolposted;
} card_t;
card_t *card;
//static uint8_t atN = 0;
typedef struct {
type_ttype;
uint32_tsize;
uint8_t*data;
type_ttype;
uint32_tsize;
uint8_t*data;
} value_t;
typedef struct {
uint32_tflags;
boolall_ports;
char*name;
bool(*get_value)(value_t *val);
value_tdefault_val;
uint32_tflags;
boolall_ports;
char*name;
bool(*get_value)(value_t *val);
value_tdefault_val;
} dev_prop_t;
bool get_bootdisplay_val(value_t *val);
branches/ErmaC/Trunk/i386/libsaio/stringTable.c
11
22
33
4
54
65
76
......
1918
2019
2120
22
2321
2422
2523
/*
* Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*
* Copyright 1993 NeXT, Inc. All rights reserved.
*/
branches/ErmaC/Trunk/i386/libsaio/saio_types.h
11
22
33
4
54
65
76
87
9
8
109
1110
1211
......
1918
2019
2120
22
2321
2422
2523
......
6866
6967
7068
69
70
71
72
7173
7274
7375
74
75
76
76
77
78
7779
7880
7981
......
8385
8486
8587
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
105107
106108
107109
108110
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
124126
125127
126128
......
179181
180182
181183
182
184
183185
184186
185187
186188
187189
188190
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
215217
216218
217219
218220
219
220221
221222
222223
/*
* Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* Original Code as defined in and that are subject to the Apple Public
* Source License Version 2.0 (the "License").You may not use this file
* Source License Version 2.0 (the "License"). You may not use this file
* except in compliance with the License. Please obtain a copy of the
* License at http://www.apple.com/publicsource and read it before using
* this file.
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/* Useful types. */
};
typedef struct Tag Tag, *TagPtr;
/*
* Max size fo config data array, in bytes.
*/
#define IO_CONFIG_DATA_SIZE40960 // was 4096 // was 163840
typedef struct
{
charplist[16384];// buffer for plist
TagPtrdictionary; // buffer for xml dictionary
boolcanOverride;// flag to mark a dictionary can be overriden
charplist[IO_CONFIG_DATA_SIZE];// buffer for plist
TagPtrdictionary; // buffer for xml dictionary
boolcanOverride;// flag to mark a dictionary can be overriden
} config_file_t;
/*
{
struct drive_params
{
unsigned short buf_size;
unsigned short info_flags;
unsigned long phys_cyls;
unsigned long phys_heads;
unsigned long phys_spt;
unsigned long long phys_sectors;
unsigned short phys_nbps;
unsigned short dpte_offset;
unsigned short dpte_segment;
unsigned short key;
unsigned char path_len;
unsigned char reserved1;
unsigned short reserved2;
unsigned char bus_type[4];
unsigned char interface_type[8];
unsigned char interface_path[8];
unsigned char dev_path[8];
unsigned char reserved3;
unsigned char checksum;
unsigned short buf_size;
unsigned short info_flags;
unsigned long phys_cyls;
unsigned long phys_heads;
unsigned long phys_spt;
unsigned long long phys_sectors;
unsigned short phys_nbps;
unsigned short dpte_offset;
unsigned short dpte_segment;
unsigned short key;
unsigned char path_len;
unsigned char reserved1;
unsigned short reserved2;
unsigned char bus_type[4];
unsigned char interface_type[8];
unsigned char interface_path[8];
unsigned char dev_path[8];
unsigned char reserved3;
unsigned char checksum;
} params;
struct drive_dpte
{
unsigned short io_port_base;
unsigned short control_port_base;
unsigned char head_flags;
unsigned char vendor_info;
unsigned char irq : 4;
unsigned char irq_unused : 4;
unsigned char block_count;
unsigned char dma_channel : 4;
unsigned char dma_type : 4;
unsigned char pio_type : 4;
unsigned char pio_unused : 4;
unsigned short option_flags;
unsigned short reserved;
unsigned char revision;
unsigned char checksum;
unsigned short io_port_base;
unsigned short control_port_base;
unsigned char head_flags;
unsigned char vendor_info;
unsigned char irq : 4;
unsigned char irq_unused : 4;
unsigned char block_count;
unsigned char dma_channel : 4;
unsigned char dma_type : 4;
unsigned char pio_type : 4;
unsigned char pio_unused : 4;
unsigned short option_flags;
unsigned short reserved;
unsigned char revision;
unsigned char checksum;
} dpte;
} __attribute__((packed));
typedef struct boot_drive_info boot_drive_info_t;
struct dirstuff {
char * dir_path;/* directory path */
long long dir_index;/* directory entry index */
BVRef dir_bvr; /* volume reference */
BVRef dir_bvr;/* volume reference */
};
#define BVSTRLEN 32
struct BootVolume
{
BVRef next; /* list linkage pointer */
int biosdev; /* BIOS device number */
int type; /* device type (floppy, hd, network) */
unsigned int flags; /* attribute flags */
BVGetDescription description; /* BVGetDescription function */
int part_no; /* partition number (1 based) */
unsigned int part_boff; /* partition block offset */
unsigned int part_type; /* partition type */
unsigned int fs_boff; /* 1st block # of next read */
unsigned int fs_byteoff; /* Byte offset for read within block */
FSLoadFile fs_loadfile; /* FSLoadFile function */
FSReadFile fs_readfile; /* FSReadFile function */
FSGetDirEntry fs_getdirentry; /* FSGetDirEntry function */
FSGetFileBlock fs_getfileblock; /* FSGetFileBlock function */
FSGetUUID fs_getuuid; /* FSGetUUID function */
unsigned int bps; /* bytes per sector for this device */
char name[BVSTRLEN]; /* (name of partition) */
char type_name[BVSTRLEN]; /* (type of partition, eg. Apple_HFS) */
BVFree bv_free; /* BVFree function */
uint32_t modTime;
char label[BVSTRLEN]; /* partition volume label */
char altlabel[BVSTRLEN]; /* partition volume label */
bool filtered; /* newFilteredBVChain() will set to TRUE */
bool visible; /* will shown in the device list */
char OSVersion[8];
bool OSisServer; /* 1 = OS X server , 0 = OS X client */
BVRefnext;/* list linkage pointer */
intbiosdev;/* BIOS device number */
inttype;/* device type (floppy, hd, network) */
unsigned intflags;/* attribute flags */
BVGetDescriptiondescription;/* BVGetDescription function */
intpart_no;/* partition number (1 based) */
unsigned intpart_boff;/* partition block offset */
unsigned intpart_type;/* partition type */
unsigned intfs_boff;/* 1st block # of next read */
unsigned intfs_byteoff;/* Byte offset for read within block */
FSLoadFilefs_loadfile;/* FSLoadFile function */
FSReadFilefs_readfile;/* FSReadFile function */
FSGetDirEntryfs_getdirentry;/* FSGetDirEntry function */
FSGetFileBlockfs_getfileblock;/* FSGetFileBlock function */
FSGetUUIDfs_getuuid;/* FSGetUUID function */
unsigned intbps;/* bytes per sector for this device */
charname[BVSTRLEN];/* (name of partition) */
chartype_name[BVSTRLEN];/* (type of partition, eg. Apple_HFS) */
BVFreebv_free;/* BVFree function */
uint32_tmodTime;
charlabel[BVSTRLEN];/* partition volume label */
charaltlabel[BVSTRLEN];/* partition volume label */
boolfiltered;/* newFilteredBVChain() will set to TRUE */
boolvisible;/* will shown in the device list */
charOSVersion[8];
boolOSisServer;/* 1 = OS X server , 0 = OS X client */
};
enum
{
kBVFlagPrimary= 0x01,
kBVFlagNativeBoot= 0x02,
kBVFlagForeignBoot= 0x04,

Archive Download the corresponding diff file

Revision: 2042