Commit cf4270ec authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amdgpu: print full bios version in dmesg.

v2: fix merge error.
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarXiaojie Yuan <Xiaojie.Yuan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c5cb934e
...@@ -1300,8 +1300,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios) ...@@ -1300,8 +1300,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
struct atom_context *ctx = struct atom_context *ctx =
kzalloc(sizeof(struct atom_context), GFP_KERNEL); kzalloc(sizeof(struct atom_context), GFP_KERNEL);
char *str; char *str;
char name[512]; u16 idx;
int i;
if (!ctx) if (!ctx)
return NULL; return NULL;
...@@ -1339,18 +1338,13 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios) ...@@ -1339,18 +1338,13 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
return NULL; return NULL;
} }
str = CSTR(CU16(base + ATOM_ROM_MSG_PTR)); idx = CU16(ATOM_ROM_PART_NUMBER_PTR);
while (*str && ((*str == '\n') || (*str == '\r'))) if (idx == 0)
str++; idx = 0x80;
/* name string isn't always 0 terminated */
for (i = 0; i < 511; i++) { str = CSTR(idx);
name[i] = str[i]; if (*str != '\0')
if (name[i] < '.' || name[i] > 'z') { pr_info("ATOM BIOS: %s\n", str);
name[i] = 0;
break;
}
}
pr_info("ATOM BIOS: %s\n", name);
return ctx; return ctx;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define ATOM_ATI_MAGIC_PTR 0x30 #define ATOM_ATI_MAGIC_PTR 0x30
#define ATOM_ATI_MAGIC " 761295520" #define ATOM_ATI_MAGIC " 761295520"
#define ATOM_ROM_TABLE_PTR 0x48 #define ATOM_ROM_TABLE_PTR 0x48
#define ATOM_ROM_PART_NUMBER_PTR 0x6E
#define ATOM_ROM_MAGIC "ATOM" #define ATOM_ROM_MAGIC "ATOM"
#define ATOM_ROM_MAGIC_PTR 4 #define ATOM_ROM_MAGIC_PTR 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment