Rev 5078 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5078 | Rev 6104 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | #include |
28 | #include |
29 | #include "radeon_reg.h" |
29 | #include "radeon_reg.h" |
30 | #include "radeon.h" |
30 | #include "radeon.h" |
31 | #include "atom.h" |
31 | #include "atom.h" |
Line 32... | Line -... | ||
32 | - | ||
33 | //#include |
32 | |
34 | #include |
33 | #include |
35 | /* |
34 | /* |
36 | * BIOS. |
35 | * BIOS. |
Line 73... | Line 72... | ||
73 | return true; |
72 | return true; |
74 | } |
73 | } |
Line 75... | Line 74... | ||
75 | 74 | ||
76 | static bool radeon_read_bios(struct radeon_device *rdev) |
75 | static bool radeon_read_bios(struct radeon_device *rdev) |
77 | { |
76 | { |
78 | uint8_t __iomem *bios; |
77 | uint8_t __iomem *bios, val1, val2; |
Line 79... | Line 78... | ||
79 | size_t size; |
78 | size_t size; |
80 | 79 | ||
81 | rdev->bios = NULL; |
80 | rdev->bios = NULL; |
82 | /* XXX: some cards may return 0 for rom size? ddx has a workaround */ |
81 | /* XXX: some cards may return 0 for rom size? ddx has a workaround */ |
Line 181... | Line 180... | ||
181 | } |
180 | } |
Line 182... | Line 181... | ||
182 | 181 | ||
183 | for (i = 0; i < size / ATRM_BIOS_PAGE; i++) { |
182 | for (i = 0; i < size / ATRM_BIOS_PAGE; i++) { |
184 | ret = radeon_atrm_call(atrm_handle, |
183 | ret = radeon_atrm_call(atrm_handle, |
185 | rdev->bios, |
184 | rdev->bios, |
186 | (i * ATRM_BIOS_PAGE), |
185 | (i * ATRM_BIOS_PAGE), |
187 | ATRM_BIOS_PAGE); |
186 | ATRM_BIOS_PAGE); |
188 | if (ret < ATRM_BIOS_PAGE) |
187 | if (ret < ATRM_BIOS_PAGE) |
189 | break; |
188 | break; |
Line 190... | Line 189... | ||
190 | } |
189 | } |
Line 196... | Line 195... | ||
196 | return true; |
195 | return true; |
197 | } |
196 | } |
198 | #else |
197 | #else |
199 | static inline bool radeon_atrm_get_bios(struct radeon_device *rdev) |
198 | static inline bool radeon_atrm_get_bios(struct radeon_device *rdev) |
200 | { |
199 | { |
201 | return false; |
200 | return false; |
202 | } |
201 | } |
203 | #endif |
202 | #endif |
Line 204... | Line 203... | ||
204 | 203 | ||
205 | static bool ni_read_disabled_bios(struct radeon_device *rdev) |
204 | static bool ni_read_disabled_bios(struct radeon_device *rdev) |
Line 218... | Line 217... | ||
218 | rom_cntl = RREG32(R600_ROM_CNTL); |
217 | rom_cntl = RREG32(R600_ROM_CNTL); |
Line 219... | Line 218... | ||
219 | 218 | ||
220 | /* enable the rom */ |
219 | /* enable the rom */ |
221 | WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); |
220 | WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); |
222 | if (!ASIC_IS_NODCE(rdev)) { |
221 | if (!ASIC_IS_NODCE(rdev)) { |
223 | /* Disable VGA mode */ |
222 | /* Disable VGA mode */ |
224 | WREG32(AVIVO_D1VGA_CONTROL, |
223 | WREG32(AVIVO_D1VGA_CONTROL, |
225 | (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | |
224 | (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | |
226 | AVIVO_DVGA_CONTROL_TIMING_SELECT))); |
225 | AVIVO_DVGA_CONTROL_TIMING_SELECT))); |
227 | WREG32(AVIVO_D2VGA_CONTROL, |
226 | WREG32(AVIVO_D2VGA_CONTROL, |
228 | (d2vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | |
227 | (d2vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | |
229 | AVIVO_DVGA_CONTROL_TIMING_SELECT))); |
228 | AVIVO_DVGA_CONTROL_TIMING_SELECT))); |
230 | WREG32(AVIVO_VGA_RENDER_CONTROL, |
229 | WREG32(AVIVO_VGA_RENDER_CONTROL, |
231 | (vga_render_control & ~AVIVO_VGA_VSTATUS_CNTL_MASK)); |
230 | (vga_render_control & ~AVIVO_VGA_VSTATUS_CNTL_MASK)); |
232 | } |
231 | } |
Line 233... | Line 232... | ||
233 | WREG32(R600_ROM_CNTL, rom_cntl | R600_SCK_OVERWRITE); |
232 | WREG32(R600_ROM_CNTL, rom_cntl | R600_SCK_OVERWRITE); |
Line 234... | Line 233... | ||
234 | 233 | ||
235 | r = radeon_read_bios(rdev); |
234 | r = radeon_read_bios(rdev); |
236 | 235 | ||
237 | /* restore regs */ |
236 | /* restore regs */ |
238 | WREG32(R600_BUS_CNTL, bus_cntl); |
237 | WREG32(R600_BUS_CNTL, bus_cntl); |
239 | if (!ASIC_IS_NODCE(rdev)) { |
238 | if (!ASIC_IS_NODCE(rdev)) { |
240 | WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); |
239 | WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); |
241 | WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); |
240 | WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); |
242 | WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); |
241 | WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); |
243 | } |
242 | } |
Line 466... | Line 465... | ||
466 | seprom_cntl1 = RREG32(RADEON_SEPROM_CNTL1); |
465 | seprom_cntl1 = RREG32(RADEON_SEPROM_CNTL1); |
467 | viph_control = RREG32(RADEON_VIPH_CONTROL); |
466 | viph_control = RREG32(RADEON_VIPH_CONTROL); |
468 | if (rdev->flags & RADEON_IS_PCIE) |
467 | if (rdev->flags & RADEON_IS_PCIE) |
469 | bus_cntl = RREG32(RV370_BUS_CNTL); |
468 | bus_cntl = RREG32(RV370_BUS_CNTL); |
470 | else |
469 | else |
471 | bus_cntl = RREG32(RADEON_BUS_CNTL); |
470 | bus_cntl = RREG32(RADEON_BUS_CNTL); |
472 | crtc_gen_cntl = RREG32(RADEON_CRTC_GEN_CNTL); |
471 | crtc_gen_cntl = RREG32(RADEON_CRTC_GEN_CNTL); |
473 | crtc2_gen_cntl = 0; |
472 | crtc2_gen_cntl = 0; |
474 | crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); |
473 | crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); |
475 | fp2_gen_cntl = 0; |
474 | fp2_gen_cntl = 0; |
Line 491... | Line 490... | ||
491 | 490 | ||
492 | /* enable the rom */ |
491 | /* enable the rom */ |
493 | if (rdev->flags & RADEON_IS_PCIE) |
492 | if (rdev->flags & RADEON_IS_PCIE) |
494 | WREG32(RV370_BUS_CNTL, (bus_cntl & ~RV370_BUS_BIOS_DIS_ROM)); |
493 | WREG32(RV370_BUS_CNTL, (bus_cntl & ~RV370_BUS_BIOS_DIS_ROM)); |
495 | else |
494 | else |
Line 496... | Line 495... | ||
496 | WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); |
495 | WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); |
497 | 496 | ||
498 | /* Turn off mem requests and CRTC for both controllers */ |
497 | /* Turn off mem requests and CRTC for both controllers */ |
499 | WREG32(RADEON_CRTC_GEN_CNTL, |
498 | WREG32(RADEON_CRTC_GEN_CNTL, |
Line 521... | Line 520... | ||
521 | WREG32(RADEON_SEPROM_CNTL1, seprom_cntl1); |
520 | WREG32(RADEON_SEPROM_CNTL1, seprom_cntl1); |
522 | WREG32(RADEON_VIPH_CONTROL, viph_control); |
521 | WREG32(RADEON_VIPH_CONTROL, viph_control); |
523 | if (rdev->flags & RADEON_IS_PCIE) |
522 | if (rdev->flags & RADEON_IS_PCIE) |
524 | WREG32(RV370_BUS_CNTL, bus_cntl); |
523 | WREG32(RV370_BUS_CNTL, bus_cntl); |
525 | else |
524 | else |
526 | WREG32(RADEON_BUS_CNTL, bus_cntl); |
525 | WREG32(RADEON_BUS_CNTL, bus_cntl); |
527 | WREG32(RADEON_CRTC_GEN_CNTL, crtc_gen_cntl); |
526 | WREG32(RADEON_CRTC_GEN_CNTL, crtc_gen_cntl); |
528 | if (!(rdev->flags & RADEON_SINGLE_CRTC)) { |
527 | if (!(rdev->flags & RADEON_SINGLE_CRTC)) { |
529 | WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl); |
528 | WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl); |
530 | } |
529 | } |
531 | WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl); |
530 | WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl); |