Subversion Repositories Kolibri OS

Rev

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

Rev 1404 Rev 1412
Line 479... Line 479...
479
	const char *fw_name = NULL;
479
	const char *fw_name = NULL;
480
	int err;
480
	int err;
Line 481... Line 481...
481
 
481
 
Line 482... Line 482...
482
	DRM_DEBUG("\n");
482
	DRM_DEBUG("\n");
483
 
483
 
484
//   pdev = platform_device_register_simple("radeon_cp", 0, NULL, 0);
484
    pdev = platform_device_register_simple("radeon_cp", 0, NULL, 0);
485
//   err = IS_ERR(pdev);
485
    err = IS_ERR(pdev);
486
//   if (err) {
486
    if (err) {
487
//       printk(KERN_ERR "radeon_cp: Failed to register firmware\n");
487
        printk(KERN_ERR "radeon_cp: Failed to register firmware\n");
488
//       return -EINVAL;
488
        return -EINVAL;
489
//   }
489
    }
490
	if ((rdev->family == CHIP_R100) || (rdev->family == CHIP_RV100) ||
490
	if ((rdev->family == CHIP_R100) || (rdev->family == CHIP_RV100) ||
491
	    (rdev->family == CHIP_RV200) || (rdev->family == CHIP_RS100) ||
491
	    (rdev->family == CHIP_RV200) || (rdev->family == CHIP_RS100) ||
492
	    (rdev->family == CHIP_RS200)) {
492
	    (rdev->family == CHIP_RS200)) {
Line 526... Line 526...
526
		   (rdev->family == CHIP_RV570)) {
526
		   (rdev->family == CHIP_RV570)) {
527
		DRM_INFO("Loading R500 Microcode\n");
527
		DRM_INFO("Loading R500 Microcode\n");
528
		fw_name = FIRMWARE_R520;
528
		fw_name = FIRMWARE_R520;
529
		}
529
		}
Line 530... Line 530...
530
 
530
 
531
//   err = request_firmware(&rdev->me_fw, fw_name, &pdev->dev);
531
   err = request_firmware(&rdev->me_fw, fw_name, &pdev->dev);
532
//   platform_device_unregister(pdev);
532
   platform_device_unregister(pdev);
533
   if (err) {
533
   if (err) {
534
       printk(KERN_ERR "radeon_cp: Failed to load firmware \"%s\"\n",
534
       printk(KERN_ERR "radeon_cp: Failed to load firmware \"%s\"\n",
535
              fw_name);
535
              fw_name);
536
	} else if (rdev->me_fw->size % 8) {
536
	} else if (rdev->me_fw->size % 8) {
Line 2666... Line 2666...
2666
	}
2666
	}
2667
}
2667
}
Line -... Line 2668...
-
 
2668
 
-
 
2669
 
-
 
2670
 
-
 
2671
int r100_ring_test(struct radeon_device *rdev)
-
 
2672
{
-
 
2673
	uint32_t scratch;
-
 
2674
	uint32_t tmp = 0;
-
 
2675
	unsigned i;
-
 
2676
	int r;
-
 
2677
 
-
 
2678
	r = radeon_scratch_get(rdev, &scratch);
-
 
2679
	if (r) {
-
 
2680
		DRM_ERROR("radeon: cp failed to get scratch reg (%d).\n", r);
-
 
2681
		return r;
-
 
2682
	}
-
 
2683
	WREG32(scratch, 0xCAFEDEAD);
-
 
2684
	r = radeon_ring_lock(rdev, 2);
-
 
2685
	if (r) {
-
 
2686
		DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r);
-
 
2687
		radeon_scratch_free(rdev, scratch);
-
 
2688
		return r;
-
 
2689
	}
-
 
2690
	radeon_ring_write(rdev, PACKET0(scratch, 0));
-
 
2691
	radeon_ring_write(rdev, 0xDEADBEEF);
-
 
2692
	radeon_ring_unlock_commit(rdev);
-
 
2693
	for (i = 0; i < rdev->usec_timeout; i++) {
-
 
2694
		tmp = RREG32(scratch);
-
 
2695
		if (tmp == 0xDEADBEEF) {
-
 
2696
			break;
-
 
2697
		}
-
 
2698
		DRM_UDELAY(1);
-
 
2699
	}
-
 
2700
	if (i < rdev->usec_timeout) {
-
 
2701
		DRM_INFO("ring test succeeded in %d usecs\n", i);
-
 
2702
	} else {
-
 
2703
		DRM_ERROR("radeon: ring test failed (sracth(0x%04X)=0x%08X)\n",
-
 
2704
			  scratch, tmp);
-
 
2705
		r = -EINVAL;
-
 
2706
	}
Line 2668... Line 2707...
2668
 
2707
	radeon_scratch_free(rdev, scratch);
2669
 
2708
	return r;
2670
 
2709
}
2671
 
2710
 
Line 2825... Line 2864...
2825
	}
2864
	}
2826
	/* Enable IRQ */
2865
	/* Enable IRQ */
2827
//   r100_irq_set(rdev);
2866
//   r100_irq_set(rdev);
2828
	rdev->config.r100.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL);
2867
	rdev->config.r100.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL);
2829
	/* 1M ring buffer */
2868
	/* 1M ring buffer */
2830
//   r = r100_cp_init(rdev, 1024 * 1024);
2869
   r = r100_cp_init(rdev, 1024 * 1024);
2831
//   if (r) {
2870
   if (r) {
2832
//       dev_err(rdev->dev, "failled initializing CP (%d).\n", r);
2871
       dev_err(rdev->dev, "failled initializing CP (%d).\n", r);
2833
//       return r;
2872
       return r;
2834
//   }
2873
   }
2835
//   r = r100_wb_init(rdev);
2874
//   r = r100_wb_init(rdev);
2836
//   if (r)
2875
//   if (r)
2837
//       dev_err(rdev->dev, "failled initializing WB (%d).\n", r);
2876
//       dev_err(rdev->dev, "failled initializing WB (%d).\n", r);
2838
//   r = r100_ib_init(rdev);
2877
//   r = r100_ib_init(rdev);
2839
//   if (r) {
2878
//   if (r) {