summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2018-04-25 00:46:29 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2018-04-25 00:46:29 +0000
commit30dff0043d43e012092cc25528eec75f382b4f73 (patch)
tree091f8b1eda95b8120b2bc11efa452d7f40191090 /sys
parent10e973d21eb4073aa99c9e098b56b7fe17e58cfe (diff)
Add a way to reattach efifb(4). This will be used when radeondrm(4)
attaches and claims glass console but after root is mounted if firmware is not found efifb gets reattached to have a useable glass console.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/efifb.c8
-rw-r--r--sys/arch/amd64/amd64/mainbus.c16
-rw-r--r--sys/arch/amd64/include/efifbvar.h3
3 files changed, 24 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/efifb.c b/sys/arch/amd64/amd64/efifb.c
index 8cbb1f501d9..0343f18445b 100644
--- a/sys/arch/amd64/amd64/efifb.c
+++ b/sys/arch/amd64/amd64/efifb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efifb.c,v 1.14 2018/04/20 16:09:36 deraadt Exp $ */
+/* $OpenBSD: efifb.c,v 1.15 2018/04/25 00:46:28 jsg Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -484,6 +484,12 @@ efifb_cndetach(void)
efifb_console.detached = 1;
}
+void
+efifb_cnreattach(void)
+{
+ efifb_console.detached = 0;
+}
+
int
efifb_cb_cnattach(void)
{
diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c
index 67b0021910f..f3083712e1f 100644
--- a/sys/arch/amd64/amd64/mainbus.c
+++ b/sys/arch/amd64/amd64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.42 2018/04/20 16:09:36 deraadt Exp $ */
+/* $OpenBSD: mainbus.c,v 1.43 2018/04/25 00:46:28 jsg Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
@@ -261,6 +261,20 @@ mainbus_attach(struct device *parent, struct device *self, void *aux)
#endif
}
+#if NEFIFB > 0
+void
+mainbus_efifb_reattach(void)
+{
+ union mainbus_attach_args mba;
+ struct device *self = device_mainbus();
+ if (bios_efiinfo != NULL || efifb_cb_found()) {
+ efifb_cnreattach();
+ mba.mba_eaa.eaa_name = "efifb";
+ config_found(self, &mba, mainbus_print);
+ }
+}
+#endif
+
int
mainbus_print(void *aux, const char *pnp)
{
diff --git a/sys/arch/amd64/include/efifbvar.h b/sys/arch/amd64/include/efifbvar.h
index bf0509e646b..558199631b6 100644
--- a/sys/arch/amd64/include/efifbvar.h
+++ b/sys/arch/amd64/include/efifbvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: efifbvar.h,v 1.6 2018/04/20 16:09:36 deraadt Exp $ */
+/* $OpenBSD: efifbvar.h,v 1.7 2018/04/25 00:46:28 jsg Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -28,6 +28,7 @@ struct pci_attach_args;
int efifb_cnattach(void);
int efifb_is_console(struct pci_attach_args *);
void efifb_cndetach(void);
+void efifb_cnreattach(void);
int efifb_cb_found(void);
int efifb_cb_cnattach(void);