diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index d4ee6f0..bf305a7 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -3165,37 +3165,58 @@ int evergreen_init(struct radeon_device *rdev) { int r; + printk("hhere1\n"); + /* This don't do much */ r = radeon_gem_init(rdev); if (r) return r; + + printk("hhere2\n"); + /* Read BIOS */ if (!radeon_get_bios(rdev)) { if (ASIC_IS_AVIVO(rdev)) return -EINVAL; } + + printk("hhere3\n"); + /* Must be an ATOMBIOS */ if (!rdev->is_atom_bios) { dev_err(rdev->dev, "Expecting atombios for evergreen GPU\n"); return -EINVAL; } + + printk("hhere4\n"); + r = radeon_atombios_init(rdev); if (r) return r; + + printk("hhere5\n"); + /* reset the asic, the gfx blocks are often in a bad state * after the driver is unloaded or after a resume */ if (radeon_asic_reset(rdev)) dev_warn(rdev->dev, "GPU reset failed !\n"); + + printk("hhere6\n"); + /* Post card if necessary */ if (!radeon_card_posted(rdev)) { if (!rdev->bios) { dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n"); return -EINVAL; } + printk("hhere7\n"); DRM_INFO("GPU not posted. posting now...\n"); atom_asic_init(rdev->mode_info.atom_context); } + + printk("hhere8\n"); + /* Initialize scratch registers */ r600_scratch_init(rdev); /* Initialize surface registers */ diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index 229a20f..ef1e29a 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c @@ -107,6 +107,8 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) int size = 256 * 1024; int i; + printk("here1.1\n"); + if (!radeon_atrm_supported(rdev->pdev)) return false; @@ -116,7 +118,9 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) return false; } + printk("here1.2\n"); for (i = 0; i < size / ATRM_BIOS_PAGE; i++) { + printk("bios_chunk: %03d offset: 0x%x len: 0x%x\n", i, (i * ATRM_BIOS_PAGE), ATRM_BIOS_PAGE); ret = radeon_atrm_get_bios_chunk(rdev->bios, (i * ATRM_BIOS_PAGE), ATRM_BIOS_PAGE); @@ -124,10 +128,15 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) break; } + printk("here1.3\n"); + if (i == 0 || rdev->bios[0] != 0x55 || rdev->bios[1] != 0xaa) { kfree(rdev->bios); return false; } + + printk("here1.4\n"); + return true; } @@ -482,14 +491,22 @@ bool radeon_get_bios(struct radeon_device *rdev) bool r; uint16_t tmp; + printk("here1\n"); + r = radeon_atrm_get_bios(rdev); + printk("here2.1\n"); if (r == false) r = igp_read_bios_from_vram(rdev); + printk("here2.2\n"); if (r == false) r = radeon_read_bios(rdev); + printk("here2.3\n"); if (r == false) { r = radeon_read_disabled_bios(rdev); } + + printk("here2.4\n"); + if (r == false || rdev->bios == NULL) { DRM_ERROR("Unable to locate a BIOS ROM\n"); rdev->bios = NULL; diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index b51e157..a8d7ddd 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -533,6 +533,8 @@ int radeon_atombios_init(struct radeon_device *rdev) struct card_info *atom_card_info = kzalloc(sizeof(struct card_info), GFP_KERNEL); + printk("here3\n"); + if (!atom_card_info) return -ENOMEM; @@ -554,7 +556,14 @@ int radeon_atombios_init(struct radeon_device *rdev) atom_card_info->pll_read = cail_pll_read; atom_card_info->pll_write = cail_pll_write; + printk("here4\n"); + + dump_stack(); + rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios); + + printk("here5\n"); + mutex_init(&rdev->mode_info.atom_context->mutex); radeon_atom_initialize_bios_scratch_regs(rdev->ddev); atom_allocate_fb_scratch(rdev->mode_info.atom_context);