r100.c (4ce9198ecf73739104b274c7c6377ef3659b3ca5) r100.c (4c712e6c7ef19e7e8e1f38b27bb65290def39b40)
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

--- 3795 unchanged lines hidden (view full) ---

3804 radeon_irq_kms_fini(rdev);
3805 radeon_fence_driver_fini(rdev);
3806 radeon_bo_fini(rdev);
3807 radeon_atombios_fini(rdev);
3808 kfree(rdev->bios);
3809 rdev->bios = NULL;
3810}
3811
1/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

--- 3795 unchanged lines hidden (view full) ---

3804 radeon_irq_kms_fini(rdev);
3805 radeon_fence_driver_fini(rdev);
3806 radeon_bo_fini(rdev);
3807 radeon_atombios_fini(rdev);
3808 kfree(rdev->bios);
3809 rdev->bios = NULL;
3810}
3811
3812/*
3813 * Due to how kexec works, it can leave the hw fully initialised when it
3814 * boots the new kernel. However doing our init sequence with the CP and
3815 * WB stuff setup causes GPU hangs on the RN50 at least. So at startup
3816 * do some quick sanity checks and restore sane values to avoid this
3817 * problem.
3818 */
3819void r100_restore_sanity(struct radeon_device *rdev)
3820{
3821 u32 tmp;
3822
3823 tmp = RREG32(RADEON_CP_CSQ_CNTL);
3824 if (tmp) {
3825 WREG32(RADEON_CP_CSQ_CNTL, 0);
3826 }
3827 tmp = RREG32(RADEON_CP_RB_CNTL);
3828 if (tmp) {
3829 WREG32(RADEON_CP_RB_CNTL, 0);
3830 }
3831 tmp = RREG32(RADEON_SCRATCH_UMSK);
3832 if (tmp) {
3833 WREG32(RADEON_SCRATCH_UMSK, 0);
3834 }
3835}
3836
3812int r100_init(struct radeon_device *rdev)
3813{
3814 int r;
3815
3816 /* Register debugfs file specific to this group of asics */
3817 r100_debugfs(rdev);
3818 /* Disable VGA */
3819 r100_vga_render_disable(rdev);
3820 /* Initialize scratch registers */
3821 radeon_scratch_init(rdev);
3822 /* Initialize surface registers */
3823 radeon_surface_init(rdev);
3837int r100_init(struct radeon_device *rdev)
3838{
3839 int r;
3840
3841 /* Register debugfs file specific to this group of asics */
3842 r100_debugfs(rdev);
3843 /* Disable VGA */
3844 r100_vga_render_disable(rdev);
3845 /* Initialize scratch registers */
3846 radeon_scratch_init(rdev);
3847 /* Initialize surface registers */
3848 radeon_surface_init(rdev);
3849 /* sanity check some register to avoid hangs like after kexec */
3850 r100_restore_sanity(rdev);
3824 /* TODO: disable VGA need to use VGA request */
3825 /* BIOS*/
3826 if (!radeon_get_bios(rdev)) {
3827 if (ASIC_IS_AVIVO(rdev))
3828 return -EINVAL;
3829 }
3830 if (rdev->is_atom_bios) {
3831 dev_err(rdev->dev, "Expecting combios for RS400/RS480 GPU\n");

--- 61 unchanged lines hidden ---
3851 /* TODO: disable VGA need to use VGA request */
3852 /* BIOS*/
3853 if (!radeon_get_bios(rdev)) {
3854 if (ASIC_IS_AVIVO(rdev))
3855 return -EINVAL;
3856 }
3857 if (rdev->is_atom_bios) {
3858 dev_err(rdev->dev, "Expecting combios for RS400/RS480 GPU\n");

--- 61 unchanged lines hidden ---