summaryrefslogtreecommitdiff
path: root/sys/arch/vax/vsa
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-08-26 21:50:17 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-08-26 21:50:17 +0000
commitaca1f8747adc1fd2a8fc28f7337e09efdcffa79b (patch)
tree2fc85ba1aae7c7203f14d93dd4a906f9d3ede4cf /sys/arch/vax/vsa
parent9b3910f7fe60efb8330b04c558711ead0acff761 (diff)
Be sure not to try to match lcg, and to bail out early in cnprobe as well,
if we are running on a KA45 system. These share the KA48 board type but, unlike KA48, can not sport frame buffers. Prevents a bogus lcg device from attaching on KA45, and also repairs console operation if the S3 switch is down (console on serial #0).
Diffstat (limited to 'sys/arch/vax/vsa')
-rw-r--r--sys/arch/vax/vsa/lcg.c72
1 files changed, 37 insertions, 35 deletions
diff --git a/sys/arch/vax/vsa/lcg.c b/sys/arch/vax/vsa/lcg.c
index 529c577b230..b73a59bd9ce 100644
--- a/sys/arch/vax/vsa/lcg.c
+++ b/sys/arch/vax/vsa/lcg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcg.c,v 1.16 2011/04/07 15:30:16 miod Exp $ */
+/* $OpenBSD: lcg.c,v 1.17 2011/08/26 21:50:16 miod Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -176,6 +176,8 @@ lcg_match(struct device *parent, void *vcf, void *aux)
return (0);
break;
case VAX_BTYP_48:
+ if (((vax_siedata >> 8) & 0xff) != VAX_STYP_48)
+ return (0);
/* KA48 can't boot without the frame buffer board */
break;
}
@@ -722,47 +724,47 @@ lcgcnprobe()
switch (vax_boardtype) {
case VAX_BTYP_46:
if ((vax_confdata & 0x40) == 0)
- break; /* no frame buffer */
- /* FALLTHROUGH */
+ return (0); /* no frame buffer */
+ break;
case VAX_BTYP_48:
- if ((vax_confdata & 0x100) != 0)
- break; /* doesn't use graphics console */
-
- tmp = virtual_avail;
- ioaccess(tmp, vax_trunc_page(LCG_CONFIG_ADDR), 1);
- cfg = *(volatile u_int32_t *)
- (tmp + (LCG_CONFIG_ADDR & VAX_PGOFSET));
- iounaccess(tmp, 1);
+ if (((vax_siedata >> 8) & 0xff) != VAX_STYP_48)
+ return (0);
+ break;
+ default:
+ return (0);
+ }
- if (lcg_probe_screen(cfg, NULL, NULL) <= 0)
- break; /* no lcg or unsupported configuration */
+ if ((vax_confdata & 0x100) != 0)
+ return (0); /* doesn't use graphics console */
-#ifdef PARANOIA
- /*
- * Check for video memory.
- * We can not use badaddr() on these models.
- */
- rc = 0;
- ioaccess(tmp, LCG_FB_ADDR, 1);
- ch = (volatile u_int8_t *)tmp;
- *ch = 0x01;
- if ((*ch & 0x01) != 0) {
- *ch = 0x00;
- if ((*ch & 0x01) == 0)
- rc = 1;
- }
- iounaccess(tmp, 1);
- if (rc == 0)
- break;
-#endif
+ tmp = virtual_avail;
+ ioaccess(tmp, vax_trunc_page(LCG_CONFIG_ADDR), 1);
+ cfg = *(volatile u_int32_t *)(tmp + (LCG_CONFIG_ADDR & VAX_PGOFSET));
+ iounaccess(tmp, 1);
- return (1);
+ if (lcg_probe_screen(cfg, NULL, NULL) <= 0)
+ return (0); /* no lcg or unsupported configuration */
- default:
- break;
+#ifdef PARANOIA
+ /*
+ * Check for video memory.
+ * We can not use badaddr() on these models.
+ */
+ rc = 0;
+ ioaccess(tmp, LCG_FB_ADDR, 1);
+ ch = (volatile u_int8_t *)tmp;
+ *ch = 0x01;
+ if ((*ch & 0x01) != 0) {
+ *ch = 0x00;
+ if ((*ch & 0x01) == 0)
+ rc = 1;
}
+ iounaccess(tmp, 1);
+ if (rc == 0)
+ return (0);
+#endif
- return (0);
+ return (1);
}
/*