Module Name: src
Committed By: tsutsui
Date: Sat Jun 29 02:41:17 UTC 2019
Modified Files:
src/sys/arch/hp300/hp300: autoconf.c
Log Message:
Handle sti(4) graphics at sgc on HP9000/425t properly. PR port-hp300/54255
Should be pulled up to netbsd-8.
To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/hp300/hp300/autoconf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.105 src/sys/arch/hp300/hp300/autoconf.c:1.106
--- src/sys/arch/hp300/hp300/autoconf.c:1.105 Sun Apr 20 04:12:54 2014
+++ src/sys/arch/hp300/hp300/autoconf.c Sat Jun 29 02:41:17 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.105 2014/04/20 04:12:54 tsutsui Exp $ */
+/* $NetBSD: autoconf.c,v 1.106 2019/06/29 02:41:17 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.105 2014/04/20 04:12:54 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.106 2019/06/29 02:41:17 tsutsui Exp $");
#include "dvbox.h"
#include "gbox.h"
@@ -152,6 +152,7 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
#endif
#if NSTI_SGC > 0
+#include <hp300/dev/sgcreg.h>
#include <hp300/dev/sgcvar.h>
#include <hp300/dev/sti_sgcvar.h>
#endif
@@ -751,6 +752,9 @@ int conscode;
void *conaddr;
static bool cninit_deferred;
+#if NSTI_SGC > 0
+static int consslot = -1;
+#endif
void
hp300_cninit(void)
@@ -838,13 +842,18 @@ hp300_cninit(void)
machineid == HP_433) {
struct bus_space_tag sgc_tag;
bus_space_tag_t sgc_bst;
+ u_int slot;
sgc_bst = &sgc_tag;
memset(sgc_bst, 0, sizeof(struct bus_space_tag));
sgc_bst->bustype = HP300_BUS_SPACE_SGC;
- if (sti_sgc_cnprobe(sgc_bst, sgc_slottopa(0), 0)) {
- cninit_deferred = true;
- goto find_kbd;
+ for (slot = 0; slot < SGC_NSLOTS; slot++) {
+ if (sti_sgc_cnprobe(sgc_bst, sgc_slottopa(slot),
+ slot)) {
+ cninit_deferred = true;
+ consslot = slot;
+ goto find_kbd;
+ }
}
}
#endif
@@ -926,8 +935,7 @@ hp300_cninit_deferred(void)
sgc_bst = &sgc_tag;
memset(sgc_bst, 0, sizeof(struct bus_space_tag));
sgc_bst->bustype = HP300_BUS_SPACE_SGC;
- if (sti_sgc_cnprobe(sgc_bst, sgc_slottopa(0), 0))
- sti_sgc_cnattach(sgc_bst, sgc_slottopa(0), 0);
+ sti_sgc_cnattach(sgc_bst, sgc_slottopa(consslot), consslot);
}
#endif
}