// SPDX-License-Identifier: MIT /* * Copyright © 2022 Intel Corporation */ #include "xe_step.h" #include <linux/bitfield.h> #include "xe_device.h" #include "xe_platform_types.h" /* * Provide mapping between PCI's revision ID to the individual GMD * (Graphics/Media/Display) stepping values that can be compared numerically. * * Some platforms may have unusual ways of mapping PCI revision ID to GMD * steppings. E.g., in some cases a higher PCI revision may translate to a * lower stepping of the GT and/or display IP. * * Also note that some revisions/steppings may have been set aside as * placeholders but never materialized in real hardware; in those cases there * may be jumps in the revision IDs or stepping values in the tables below. */ /* * Some platforms always have the same stepping value for GT and display; * use a macro to define these to make it easier to identify the platforms * where the two steppings can deviate. */ #define COMMON_STEP(x_) … __diag_push(); __diag_ignore_all("-Woverride-init", "Allow field overrides in table"); /* Same GT stepping between tgl_uy_revids and tgl_revids don't mean the same HW */ static const struct xe_step_info tgl_revids[] = …; static const struct xe_step_info dg1_revids[] = …; static const struct xe_step_info adls_revids[] = …; static const struct xe_step_info adls_rpls_revids[] = …; static const struct xe_step_info adlp_revids[] = …; static const struct xe_step_info adlp_rpl_revids[] = …; static const struct xe_step_info adln_revids[] = …; static const struct xe_step_info dg2_g10_revid_step_tbl[] = …; static const struct xe_step_info dg2_g11_revid_step_tbl[] = …; static const struct xe_step_info dg2_g12_revid_step_tbl[] = …; static const struct xe_step_info pvc_revid_step_tbl[] = …; static const int pvc_basedie_subids[] = …; __diag_pop(); /** * xe_step_pre_gmdid_get - Determine IP steppings from PCI revid * @xe: Xe device * * Convert the PCI revid into proper IP steppings. This should only be * used on platforms that do not have GMD_ID support. */ struct xe_step_info xe_step_pre_gmdid_get(struct xe_device *xe) { … } /** * xe_step_gmdid_get - Determine IP steppings from GMD_ID revid fields * @xe: Xe device * @graphics_gmdid_revid: value of graphics GMD_ID register's revid field * @media_gmdid_revid: value of media GMD_ID register's revid field * * Convert the revid fields of the GMD_ID registers into proper IP steppings. * * GMD_ID revid values are currently expected to have consistent meanings on * all platforms: major steppings (A0, B0, etc.) are 4 apart, with minor * steppings (A1, A2, etc.) taking the values in between. */ struct xe_step_info xe_step_gmdid_get(struct xe_device *xe, u32 graphics_gmdid_revid, u32 media_gmdid_revid) { … } #define STEP_NAME_CASE(name) … const char *xe_step_name(enum xe_step step) { … }