From e30532d0f406e58caac338164b6048abbaa487f5 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 27 Mar 2023 14:52:36 +0200 Subject: [PATCH] soc/amd/stoneyridge/graphics: introduce defines for constants Signed-off-by: Felix Held Change-Id: I2021a106e0d3a603b1a05296411700ffea32fc8c Reviewed-on: https://review.coreboot.org/c/coreboot/+/74042 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/amd/stoneyridge/graphics.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/soc/amd/stoneyridge/graphics.c b/src/soc/amd/stoneyridge/graphics.c index c0d4328c71..1b83c45f66 100644 --- a/src/soc/amd/stoneyridge/graphics.c +++ b/src/soc/amd/stoneyridge/graphics.c @@ -4,15 +4,22 @@ #include #include +#define ST_GPU_FIRST_VID_DID 0x100298e0 +#define ST_GPU_LAST_VID_DID 0x100298ef +#define ST_VBIOS_VID_DID 0x100298e0 +#define CZ_GPU_FIRST_VID_DID 0x10029870 +#define CZ_GPU_LAST_VID_DID 0x1002987f +#define CZ_VBIOS_VID_DID 0x10029870 + /* Change the vendor / device IDs to match the generic VBIOS header. */ u32 map_oprom_vendev(u32 vendev) { u32 new_vendev; - if ((vendev >= 0x100298e0) && (vendev <= 0x100298ef)) - new_vendev = 0x100298e0; - else if ((vendev >= 0x10029870) && (vendev <= 0x1002987f)) - new_vendev = 0x10029870; + if ((vendev >= ST_GPU_FIRST_VID_DID) && (vendev <= ST_GPU_LAST_VID_DID)) + new_vendev = ST_VBIOS_VID_DID; + else if ((vendev >= CZ_GPU_FIRST_VID_DID) && (vendev <= CZ_GPU_LAST_VID_DID)) + new_vendev = CZ_VBIOS_VID_DID; else new_vendev = vendev;