|
12 | 12 | #include <drm/drm_managed.h>
|
13 | 13 | #include <uapi/drm/xe_drm.h>
|
14 | 14 |
|
| 15 | +#include <generated/xe_wa_oob.h> |
| 16 | + |
15 | 17 | #include "abi/guc_actions_slpc_abi.h"
|
16 | 18 | #include "instructions/xe_mi_commands.h"
|
17 | 19 | #include "regs/xe_engine_regs.h"
|
|
35 | 37 | #include "xe_sched_job.h"
|
36 | 38 | #include "xe_sriov.h"
|
37 | 39 | #include "xe_sync.h"
|
| 40 | +#include "xe_wa.h" |
38 | 41 |
|
39 | 42 | #define DEFAULT_POLL_FREQUENCY_HZ 200
|
40 | 43 | #define DEFAULT_POLL_PERIOD_NS (NSEC_PER_SEC / DEFAULT_POLL_FREQUENCY_HZ)
|
@@ -812,11 +815,8 @@ static void xe_oa_disable_metric_set(struct xe_oa_stream *stream)
|
812 | 815 | struct xe_mmio *mmio = &stream->gt->mmio;
|
813 | 816 | u32 sqcnt1;
|
814 | 817 |
|
815 |
| - /* |
816 |
| - * Wa_1508761755:xehpsdv, dg2 |
817 |
| - * Enable thread stall DOP gating and EU DOP gating. |
818 |
| - */ |
819 |
| - if (stream->oa->xe->info.platform == XE_DG2) { |
| 818 | + /* Enable thread stall DOP gating and EU DOP gating. */ |
| 819 | + if (XE_WA(stream->gt, 1508761755)) { |
820 | 820 | xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN,
|
821 | 821 | _MASKED_BIT_DISABLE(STALL_DOP_GATING_DISABLE));
|
822 | 822 | xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN2,
|
@@ -1065,11 +1065,10 @@ static int xe_oa_enable_metric_set(struct xe_oa_stream *stream)
|
1065 | 1065 | int ret;
|
1066 | 1066 |
|
1067 | 1067 | /*
|
1068 |
| - * Wa_1508761755:xehpsdv, dg2 |
1069 | 1068 | * EU NOA signals behave incorrectly if EU clock gating is enabled.
|
1070 | 1069 | * Disable thread stall DOP gating and EU DOP gating.
|
1071 | 1070 | */
|
1072 |
| - if (stream->oa->xe->info.platform == XE_DG2) { |
| 1071 | + if (XE_WA(stream->gt, 1508761755)) { |
1073 | 1072 | xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN,
|
1074 | 1073 | _MASKED_BIT_ENABLE(STALL_DOP_GATING_DISABLE));
|
1075 | 1074 | xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN2,
|
@@ -1720,12 +1719,10 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
|
1720 | 1719 | }
|
1721 | 1720 |
|
1722 | 1721 | /*
|
1723 |
| - * Wa_1509372804:pvc |
1724 |
| - * |
1725 | 1722 | * GuC reset of engines causes OA to lose configuration
|
1726 | 1723 | * state. Prevent this by overriding GUCRC mode.
|
1727 | 1724 | */
|
1728 |
| - if (stream->oa->xe->info.platform == XE_PVC) { |
| 1725 | + if (XE_WA(stream->gt, 1509372804)) { |
1729 | 1726 | ret = xe_guc_pc_override_gucrc_mode(>->uc.guc.pc,
|
1730 | 1727 | SLPC_GUCRC_MODE_GUCRC_NO_RC6);
|
1731 | 1728 | if (ret)
|
@@ -1857,23 +1854,14 @@ u32 xe_oa_timestamp_frequency(struct xe_gt *gt)
|
1857 | 1854 | {
|
1858 | 1855 | u32 reg, shift;
|
1859 | 1856 |
|
1860 |
| - /* |
1861 |
| - * Wa_18013179988:dg2 |
1862 |
| - * Wa_14015568240:pvc |
1863 |
| - * Wa_14015846243:mtl |
1864 |
| - */ |
1865 |
| - switch (gt_to_xe(gt)->info.platform) { |
1866 |
| - case XE_DG2: |
1867 |
| - case XE_PVC: |
1868 |
| - case XE_METEORLAKE: |
| 1857 | + if (XE_WA(gt, 18013179988) || XE_WA(gt, 14015568240)) { |
1869 | 1858 | xe_pm_runtime_get(gt_to_xe(gt));
|
1870 | 1859 | reg = xe_mmio_read32(>->mmio, RPM_CONFIG0);
|
1871 | 1860 | xe_pm_runtime_put(gt_to_xe(gt));
|
1872 | 1861 |
|
1873 | 1862 | shift = REG_FIELD_GET(RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK, reg);
|
1874 | 1863 | return gt->info.reference_clock << (3 - shift);
|
1875 |
| - |
1876 |
| - default: |
| 1864 | + } else { |
1877 | 1865 | return gt->info.reference_clock;
|
1878 | 1866 | }
|
1879 | 1867 | }
|
|
0 commit comments