Export microcode version of sDMA
Change-Id: I86fa5da5e72af13a2e76e6e3be4667a7220923d5 Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This commit is contained in:
@@ -150,10 +150,10 @@ typedef struct _HsaSystemProperties
|
|||||||
HSAuint32 PlatformRev; // HSA platform revision, reflects Platform Table Revision ID
|
HSAuint32 PlatformRev; // HSA platform revision, reflects Platform Table Revision ID
|
||||||
} HsaSystemProperties;
|
} HsaSystemProperties;
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
HSAuint32 Value;
|
HSAuint32 Value;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned int uCode : 10; // ucode packet processor version
|
unsigned int uCode : 10; // ucode packet processor version
|
||||||
unsigned int Major : 6; // GFXIP Major engine version
|
unsigned int Major : 6; // GFXIP Major engine version
|
||||||
@@ -162,6 +162,17 @@ typedef union
|
|||||||
}ui32;
|
}ui32;
|
||||||
} HSA_ENGINE_ID;
|
} HSA_ENGINE_ID;
|
||||||
|
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
HSAuint32 Value;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
unsigned int uCodeSDMA: 10; // ucode version SDMA engine
|
||||||
|
unsigned int uCodeRes : 10; // ucode version (reserved)
|
||||||
|
unsigned int Reserved : 12; // Reserved, must be 0
|
||||||
|
};
|
||||||
|
} HSA_ENGINE_VERSION;
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
HSAuint32 Value;
|
HSAuint32 Value;
|
||||||
@@ -251,7 +262,8 @@ typedef struct _HsaNodeProperties
|
|||||||
HSAuint16 MarketingName[HSA_PUBLIC_NAME_SIZE]; // Public name of the "device" on the node (board or APU name).
|
HSAuint16 MarketingName[HSA_PUBLIC_NAME_SIZE]; // Public name of the "device" on the node (board or APU name).
|
||||||
// Unicode string
|
// Unicode string
|
||||||
HSAuint8 AMDName[HSA_PUBLIC_NAME_SIZE]; //CAL Name of the "device", ASCII
|
HSAuint8 AMDName[HSA_PUBLIC_NAME_SIZE]; //CAL Name of the "device", ASCII
|
||||||
HSAuint8 Reserved[64];
|
HSA_ENGINE_VERSION uCodeEngineVersions;
|
||||||
|
HSAuint8 Reserved[60];
|
||||||
} HsaNodeProperties;
|
} HsaNodeProperties;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-8
@@ -740,7 +740,6 @@ HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
|
|||||||
char path[256];
|
char path[256];
|
||||||
unsigned long long prop_val;
|
unsigned long long prop_val;
|
||||||
uint32_t i, prog, major, minor, step;
|
uint32_t i, prog, major, minor, step;
|
||||||
uint16_t fw_version = 0;
|
|
||||||
int read_size;
|
int read_size;
|
||||||
const struct hsa_gfxip_table *hsa_gfxip;
|
const struct hsa_gfxip_table *hsa_gfxip;
|
||||||
char namebuf[HSA_PUBLIC_NAME_SIZE];
|
char namebuf[HSA_PUBLIC_NAME_SIZE];
|
||||||
@@ -815,7 +814,7 @@ HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
|
|||||||
else if (strcmp(prop_name, "max_slots_scratch_cu") == 0)
|
else if (strcmp(prop_name, "max_slots_scratch_cu") == 0)
|
||||||
props->MaxSlotsScratchCU = (uint32_t)prop_val;
|
props->MaxSlotsScratchCU = (uint32_t)prop_val;
|
||||||
else if (strcmp(prop_name, "fw_version") == 0)
|
else if (strcmp(prop_name, "fw_version") == 0)
|
||||||
fw_version = (uint16_t)prop_val;
|
props->EngineId.Value = (uint32_t)prop_val & 0x3ff;
|
||||||
else if (strcmp(prop_name, "vendor_id") == 0)
|
else if (strcmp(prop_name, "vendor_id") == 0)
|
||||||
props->VendorId = (uint32_t)prop_val;
|
props->VendorId = (uint32_t)prop_val;
|
||||||
else if (strcmp(prop_name, "device_id") == 0)
|
else if (strcmp(prop_name, "device_id") == 0)
|
||||||
@@ -830,14 +829,10 @@ HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
|
|||||||
props->LocalMemSize = prop_val;
|
props->LocalMemSize = prop_val;
|
||||||
else if (strcmp(prop_name, "drm_render_minor") == 0)
|
else if (strcmp(prop_name, "drm_render_minor") == 0)
|
||||||
props->DrmRenderMinor = (int32_t)prop_val;
|
props->DrmRenderMinor = (int32_t)prop_val;
|
||||||
|
else if (strcmp(prop_name, "sdma_fw_version") == 0)
|
||||||
|
props->uCodeEngineVersions.Value = (uint32_t)prop_val & 0x3ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
props->EngineId.ui32.uCode = fw_version & 0x3ff;
|
|
||||||
props->EngineId.ui32.Major = 0;
|
|
||||||
props->EngineId.ui32.Minor = 0;
|
|
||||||
props->EngineId.ui32.Stepping = 0;
|
|
||||||
|
|
||||||
hsa_gfxip = find_hsa_gfxip_device(props->DeviceId);
|
hsa_gfxip = find_hsa_gfxip_device(props->DeviceId);
|
||||||
if (hsa_gfxip) {
|
if (hsa_gfxip) {
|
||||||
envvar = getenv("HSA_OVERRIDE_GFX_VERSION");
|
envvar = getenv("HSA_OVERRIDE_GFX_VERSION");
|
||||||
|
|||||||
Reference in New Issue
Block a user