Subversion Repositories Kolibri OS

Rev

Rev 1268 | Rev 1963 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1268 Rev 1430
Line 91... Line 91...
91
	memcpy(rdev->bios, bios, size);
91
	memcpy(rdev->bios, bios, size);
92
//    pci_unmap_rom(rdev->pdev, bios);
92
//    pci_unmap_rom(rdev->pdev, bios);
93
	return true;
93
	return true;
94
}
94
}
Line -... Line 95...
-
 
95
 
-
 
96
/* ATRM is used to get the BIOS on the discrete cards in
-
 
97
 * dual-gpu systems.
-
 
98
 */
-
 
99
static bool radeon_atrm_get_bios(struct radeon_device *rdev)
-
 
100
{
-
 
101
	int ret;
-
 
102
	int size = 64 * 1024;
-
 
103
	int i;
-
 
104
 
-
 
105
	if (!radeon_atrm_supported(rdev->pdev))
-
 
106
		return false;
-
 
107
 
-
 
108
	rdev->bios = kmalloc(size, GFP_KERNEL);
-
 
109
	if (!rdev->bios) {
-
 
110
		DRM_ERROR("Unable to allocate bios\n");
-
 
111
		return false;
-
 
112
	}
-
 
113
 
-
 
114
	for (i = 0; i < size / ATRM_BIOS_PAGE; i++) {
-
 
115
		ret = radeon_atrm_get_bios_chunk(rdev->bios,
-
 
116
						 (i * ATRM_BIOS_PAGE),
-
 
117
						 ATRM_BIOS_PAGE);
-
 
118
		if (ret <= 0)
-
 
119
			break;
-
 
120
	}
-
 
121
 
-
 
122
	if (i == 0 || rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) {
-
 
123
		kfree(rdev->bios);
-
 
124
		return false;
-
 
125
	}
-
 
126
	return true;
95
 
127
}
96
static bool r700_read_disabled_bios(struct radeon_device *rdev)
128
static bool r700_read_disabled_bios(struct radeon_device *rdev)
97
{
129
{
98
	uint32_t viph_control;
130
	uint32_t viph_control;
99
	uint32_t bus_cntl;
131
	uint32_t bus_cntl;
Line 386... Line 418...
386
		return avivo_read_disabled_bios(rdev);
418
		return avivo_read_disabled_bios(rdev);
387
	else
419
	else
388
		return legacy_read_disabled_bios(rdev);
420
		return legacy_read_disabled_bios(rdev);
389
}
421
}
Line -... Line 422...
-
 
422
 
390
 
423
 
391
bool radeon_get_bios(struct radeon_device *rdev)
424
bool radeon_get_bios(struct radeon_device *rdev)
392
{
425
{
393
	bool r;
426
	bool r;
Line 394... Line 427...
394
	uint16_t tmp;
427
	uint16_t tmp;
-
 
428
 
395
 
429
	r = radeon_atrm_get_bios(rdev);
396
	if (rdev->flags & RADEON_IS_IGP) {
430
	if (r == false)
397
		r = igp_read_bios_from_vram(rdev);
431
		r = igp_read_bios_from_vram(rdev);
398
		if (r == false)
-
 
399
			r = radeon_read_bios(rdev);
-
 
400
	} else
432
		if (r == false)
401
	r = radeon_read_bios(rdev);
433
			r = radeon_read_bios(rdev);
402
	if (r == false) {
434
	if (r == false) {
403
		r = radeon_read_disabled_bios(rdev);
435
		r = radeon_read_disabled_bios(rdev);
404
	}
436
	}
405
	if (r == false || rdev->bios == NULL) {
437
	if (r == false || rdev->bios == NULL) {
406
		DRM_ERROR("Unable to locate a BIOS ROM\n");
438
		DRM_ERROR("Unable to locate a BIOS ROM\n");
407
		rdev->bios = NULL;
439
		rdev->bios = NULL;
408
		return false;
440
		return false;
-
 
441
	}
-
 
442
	if (rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) {
-
 
443
		printk("BIOS signature incorrect %x %x\n", rdev->bios[0], rdev->bios[1]);
-
 
444
		goto free_bios;
-
 
445
	}
-
 
446
 
-
 
447
	tmp = RBIOS16(0x18);
409
	}
448
	if (RBIOS8(tmp + 0x14) != 0x0) {
410
	if (rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) {
449
		DRM_INFO("Not an x86 BIOS ROM, not using.\n");
Line 411... Line 450...
411
		goto free_bios;
450
		goto free_bios;
412
	}
451
	}