|
85 | 85 | #define mmRCC_DEV0_EPF0_STRAP0_ALDE 0x0015
|
86 | 86 | #define mmRCC_DEV0_EPF0_STRAP0_ALDE_BASE_IDX 2
|
87 | 87 |
|
| 88 | +#define mmBIF_DOORBELL_INT_CNTL_ALDE 0x3878 |
| 89 | +#define mmBIF_DOORBELL_INT_CNTL_ALDE_BASE_IDX 2 |
| 90 | +#define BIF_DOORBELL_INT_CNTL_ALDE__DOORBELL_INTERRUPT_DISABLE__SHIFT 0x18 |
| 91 | +#define BIF_DOORBELL_INT_CNTL_ALDE__DOORBELL_INTERRUPT_DISABLE_MASK 0x01000000L |
| 92 | + |
88 | 93 | static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
|
89 | 94 | void *ras_error_status);
|
90 | 95 |
|
@@ -346,14 +351,21 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device
|
346 | 351 | struct ras_err_data err_data = {0, 0, 0, NULL};
|
347 | 352 | struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
|
348 | 353 |
|
349 |
| - bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL); |
| 354 | + if (adev->asic_type == CHIP_ALDEBARAN) |
| 355 | + bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE); |
| 356 | + else |
| 357 | + bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL); |
| 358 | + |
350 | 359 | if (REG_GET_FIELD(bif_doorbell_intr_cntl,
|
351 | 360 | BIF_DOORBELL_INT_CNTL, RAS_CNTLR_INTERRUPT_STATUS)) {
|
352 | 361 | /* driver has to clear the interrupt status when bif ring is disabled */
|
353 | 362 | bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
|
354 | 363 | BIF_DOORBELL_INT_CNTL,
|
355 | 364 | RAS_CNTLR_INTERRUPT_CLEAR, 1);
|
356 |
| - WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl); |
| 365 | + if (adev->asic_type == CHIP_ALDEBARAN) |
| 366 | + WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE, bif_doorbell_intr_cntl); |
| 367 | + else |
| 368 | + WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl); |
357 | 369 |
|
358 | 370 | if (!ras->disable_ras_err_cnt_harvest) {
|
359 | 371 | /*
|
@@ -395,14 +407,22 @@ static void nbio_v7_4_handle_ras_err_event_athub_intr_no_bifring(struct amdgpu_d
|
395 | 407 | {
|
396 | 408 | uint32_t bif_doorbell_intr_cntl;
|
397 | 409 |
|
398 |
| - bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL); |
| 410 | + if (adev->asic_type == CHIP_ALDEBARAN) |
| 411 | + bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE); |
| 412 | + else |
| 413 | + bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL); |
| 414 | + |
399 | 415 | if (REG_GET_FIELD(bif_doorbell_intr_cntl,
|
400 | 416 | BIF_DOORBELL_INT_CNTL, RAS_ATHUB_ERR_EVENT_INTERRUPT_STATUS)) {
|
401 | 417 | /* driver has to clear the interrupt status when bif ring is disabled */
|
402 | 418 | bif_doorbell_intr_cntl = REG_SET_FIELD(bif_doorbell_intr_cntl,
|
403 | 419 | BIF_DOORBELL_INT_CNTL,
|
404 | 420 | RAS_ATHUB_ERR_EVENT_INTERRUPT_CLEAR, 1);
|
405 |
| - WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl); |
| 421 | + |
| 422 | + if (adev->asic_type == CHIP_ALDEBARAN) |
| 423 | + WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL_ALDE, bif_doorbell_intr_cntl); |
| 424 | + else |
| 425 | + WREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL, bif_doorbell_intr_cntl); |
406 | 426 |
|
407 | 427 | amdgpu_ras_global_ras_isr(adev);
|
408 | 428 | }
|
@@ -572,7 +592,11 @@ static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
|
572 | 592 | static void nbio_v7_4_enable_doorbell_interrupt(struct amdgpu_device *adev,
|
573 | 593 | bool enable)
|
574 | 594 | {
|
575 |
| - WREG32_FIELD15(NBIO, 0, BIF_DOORBELL_INT_CNTL, |
| 595 | + if (adev->asic_type == CHIP_ALDEBARAN) |
| 596 | + WREG32_FIELD15(NBIO, 0, BIF_DOORBELL_INT_CNTL_ALDE, |
| 597 | + DOORBELL_INTERRUPT_DISABLE, enable ? 0 : 1); |
| 598 | + else |
| 599 | + WREG32_FIELD15(NBIO, 0, BIF_DOORBELL_INT_CNTL, |
576 | 600 | DOORBELL_INTERRUPT_DISABLE, enable ? 0 : 1);
|
577 | 601 | }
|
578 | 602 |
|
|
0 commit comments