summaryrefslogtreecommitdiff
path: root/src/soc/amd/stoneyridge/graphics.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-03-27 14:39:29 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-03-28 15:14:35 +0000
commit1d66ad1cbde133a83efd632dcecaaa4253699d85 (patch)
tree535e253d754e70782608b12e700240c8f6b23681 /src/soc/amd/stoneyridge/graphics.c
parent0b03c08223d03515646787b9339c0c5104f020a5 (diff)
soc/amd/stoneyridge: move map_oprom_vendev to graphics.c
Move map_oprom_vendev to graphics.c to match the other AMD SoCs. Also change the comment style to be more in line with the rest of coreboot and drop the unneeded line break in the printk call. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Icc1f3d73fba973413c5a22e2f5ae01bc58bc3e76 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74041 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Diffstat (limited to 'src/soc/amd/stoneyridge/graphics.c')
-rw-r--r--src/soc/amd/stoneyridge/graphics.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/graphics.c b/src/soc/amd/stoneyridge/graphics.c
new file mode 100644
index 0000000000..c0d4328c71
--- /dev/null
+++ b/src/soc/amd/stoneyridge/graphics.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <device/pci_rom.h>
+#include <stdint.h>
+
+/* 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;
+ else
+ new_vendev = vendev;
+
+ if (vendev != new_vendev)
+ printk(BIOS_NOTICE, "Mapping PCI device %8x to %8x\n", vendev, new_vendev);
+
+ return new_vendev;
+}