summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-07-22 10:11:21 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-07-22 10:11:21 +0000
commit50b1095355876f61705aaeb2048e69e7bbf48f2b (patch)
tree716e160b13d78dc7e9437542f2c17c4930fdeb35 /sys/arch/i386
parent32c0cf3c571a2eb4f84a2de066dd18294fc5304f (diff)
BOOTARG_UCODE for AMD
ok deraadt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/boot/conf.c4
-rw-r--r--sys/arch/i386/stand/cdboot/conf.c4
-rw-r--r--sys/arch/i386/stand/libsa/exec_i386.c23
-rw-r--r--sys/arch/i386/stand/pxeboot/conf.c4
4 files changed, 25 insertions, 10 deletions
diff --git a/sys/arch/i386/stand/boot/conf.c b/sys/arch/i386/stand/boot/conf.c
index f76ffad2c53..b6cb3946275 100644
--- a/sys/arch/i386/stand/boot/conf.c
+++ b/sys/arch/i386/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.77 2023/04/25 14:48:16 kn Exp $ */
+/* $OpenBSD: conf.c,v 1.78 2023/07/22 10:11:20 jsg Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -42,7 +42,7 @@
#include <dev/cons.h>
#include "debug.h"
-const char version[] = "3.45";
+const char version[] = "3.65";
int debug = 1;
diff --git a/sys/arch/i386/stand/cdboot/conf.c b/sys/arch/i386/stand/cdboot/conf.c
index e18d8ba325f..5995647650f 100644
--- a/sys/arch/i386/stand/cdboot/conf.c
+++ b/sys/arch/i386/stand/cdboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.44 2023/04/25 14:48:17 kn Exp $ */
+/* $OpenBSD: conf.c,v 1.45 2023/07/22 10:11:20 jsg Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -43,7 +43,7 @@
#include <dev/cons.h>
#include "debug.h"
-const char version[] = "3.45";
+const char version[] = "3.65";
int debug = 1;
void (*sa_cleanup)(void) = NULL;
diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c
index d9e4da9db28..9bf8463edf4 100644
--- a/sys/arch/i386/stand/libsa/exec_i386.c
+++ b/sys/arch/i386/stand/libsa/exec_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_i386.c,v 1.52 2022/07/07 00:56:47 daniel Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.53 2023/07/22 10:11:20 jsg Exp $ */
/*
* Copyright (c) 1997-1998 Michael Shalayeff
@@ -190,7 +190,8 @@ ucode_load(void)
CPUID(0, dummy, vendor[0], vendor[2], vendor[1]);
vendor[3] = 0; /* NULL-terminate */
- if (strcmp((char *)vendor, "GenuineIntel") != 0)
+ if (strcmp((char *)vendor, "GenuineIntel") != 0 &&
+ strcmp((char *)vendor, "AuthenticAMD") != 0)
return;
CPUID(1, signature, dummy, dummy, dummy);
@@ -202,8 +203,22 @@ ucode_load(void)
}
stepping = (signature >> 0) & 0x0f;
- snprintf(path, sizeof(path), "%s:/etc/firmware/intel/%02x-%02x-%02x",
- cmd.bootdev, family, model, stepping);
+ if (strcmp((char *)vendor, "GenuineIntel") == 0) {
+ snprintf(path, sizeof(path),
+ "%s:/etc/firmware/intel/%02x-%02x-%02x",
+ cmd.bootdev, family, model, stepping);
+ } else if (strcmp((char *)vendor, "AuthenticAMD") == 0) {
+ if (family < 0x10)
+ return;
+ else if (family <= 0x14)
+ snprintf(path, sizeof(path),
+ "%s:/etc/firmware/amd/microcode_amd.bin",
+ cmd.bootdev);
+ else
+ snprintf(path, sizeof(path),
+ "%s:/etc/firmware/amd/microcode_amd_fam%02xh.bin",
+ cmd.bootdev, family);
+ }
fd = open(path, O_RDONLY);
if (fd == -1)
diff --git a/sys/arch/i386/stand/pxeboot/conf.c b/sys/arch/i386/stand/pxeboot/conf.c
index f022641757b..4958b7e3441 100644
--- a/sys/arch/i386/stand/pxeboot/conf.c
+++ b/sys/arch/i386/stand/pxeboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.49 2023/04/25 14:48:17 kn Exp $ */
+/* $OpenBSD: conf.c,v 1.50 2023/07/22 10:11:20 jsg Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -45,7 +45,7 @@
#include "pxeboot.h"
#include "pxe_net.h"
-const char version[] = "3.45";
+const char version[] = "3.65";
int debug = 1;
void (*sa_cleanup)(void) = pxe_shutdown;