#define DBG(x...)␊ |
#endif␊ |
␊ |
#define NVIDIA_ROM_SIZE 0x10000␊ |
#define NVIDIA_ROM_SIZE 0x20000␊ |
#define PATCH_ROM_SUCCESS 1␊ |
#define PATCH_ROM_SUCCESS_HAS_LVDS 2␊ |
#define PATCH_ROM_FAILED 0␊ |
|
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 default_dcfg_0[]␉␉=␉{0xff, 0xff, 0xff, 0xff};␊ |
static uint8_t default_dcfg_1[]␉␉=␉{0xff, 0xff, 0xff, 0xff};␊ |
uint8_t connector_type_1[] ␉␉=␉{0x00, 0x08, 0x00, 0x00};␊ |
␊ |
static uint8_t default_NVCAP[]␉␉=␉{␊ |
␉0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00,␊ |
␉0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,␊ |
␉0x00, 0x00, 0x00, 0x00␊ |
};␊ |
␊ |
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 DCFG0_LEN ( sizeof(default_dcfg_0) / sizeof(uint8_t) )␊ |
#define DCFG1_LEN ( sizeof(default_dcfg_1) / sizeof(uint8_t) )␊ |
#define NVCAP_LEN ( sizeof(default_NVCAP) / sizeof(uint8_t) )␊ |
␊ |
static struct nv_chipsets_t NVKnownChipsets[] = {␊ |
|
␉{ 0x10DE06DD, "Quadro 4000" },␊ |
␉{ 0x10DE06DE, "Tesla M2050" },␊ |
␉{ 0x10DE06DE, "Tesla M2070" },␊ |
␉{ 0x10DE06DF, "Tesla M2070-Q" },␊ |
␉{ 0x10DE06E0, "GeForce 9300 GE" },␊ |
␉{ 0x10DE06E1, "GeForce 9300 GS" },␊ |
␉{ 0x10DE06E2, "GeForce 8400" },␊ |
|
␉sprintf(kNVCAP, "NVCAP_%04x", nvda_dev->device_id);␊ |
␉if (getValueForKey(kNVCAP, &value, &len, &bootInfo->bootConfig) && len == NVCAP_LEN * 2) {␊ |
␉␉uint8_t␉new_NVCAP[NVCAP_LEN];␊ |
␊ |
␊ |
␉␉if (hex2bin(value, new_NVCAP, NVCAP_LEN) == 0) {␊ |
␉␉␉verbose("Using user supplied NVCAP for %s :: %s\n", model, devicepath);␊ |
␉␉␉memcpy(default_NVCAP, new_NVCAP, NVCAP_LEN);␊ |
␉␉}␊ |
␉}␊ |
␊ |
#if DEBUG_NVCAP␊ |
#if DEBUG_NVCAP␊ |
printf("NVCAP: %02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x\n",␊ |
␉␉default_NVCAP[0], default_NVCAP[1], default_NVCAP[2], default_NVCAP[3],␊ |
␉␉default_NVCAP[4], default_NVCAP[5], default_NVCAP[6], default_NVCAP[7],␊ |
|
␉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);␊ |
␉devprop_add_value(device, "@1,connector-type", connector_type_1, 4);␊ |
␉devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN);␊ |
␉devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN);␊ |
␉devprop_add_value(device, "NVPM", default_NVPM, 28);␊ |
␉if (getBoolForKey(kVBIOS, &doit, &bootInfo->bootConfig) && doit) {␊ |
␉␉devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512));␊ |
␉}␊ |