CVS commit: src/sys/arch/pmax/ibus

2010-05-15 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 15 20:31:10 UTC 2010

Modified Files:
src/sys/arch/pmax/ibus: pm.c

Log Message:
Set RI_NO_AUTO in ri_flg if init function is invoked from cnattach.
Untested. (3100 support seems somewhat broken, per gxemul output)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/ibus/pm.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/pmax/ibus/pm.c
diff -u src/sys/arch/pmax/ibus/pm.c:1.7 src/sys/arch/pmax/ibus/pm.c:1.8
--- src/sys/arch/pmax/ibus/pm.c:1.7	Mon May 26 10:31:22 2008
+++ src/sys/arch/pmax/ibus/pm.c	Sat May 15 20:31:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm.c,v 1.7 2008/05/26 10:31:22 nisimura Exp $	*/
+/*	$NetBSD: pm.c,v 1.8 2010/05/15 20:31:10 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.7 2008/05/26 10:31:22 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.8 2010/05/15 20:31:10 tsutsui Exp $");
 
 #include 
 #include 
@@ -171,9 +171,10 @@
 	ri = &pm_ri;
 	console = (ri->ri_bits != NULL);
 
-	if (console)
+	if (console) {
 		sc->sc_nscreens = 1;
-	else
+		ri->ri_flg &= ~RI_NO_AUTO;
+	} else
 		pm_common_init();
 
 	printf(": %dx%d, %dbpp\n", ri->ri_width, ri->ri_height, ri->ri_depth);
@@ -243,6 +244,8 @@
 	ri = &pm_ri;
 
 	ri->ri_flg = RI_CENTER;
+	if (ri->ri_bits == NULL)
+		ri->ri_flg |= RI_NO_AUTO;
 	ri->ri_depth = ((kn01csr & KN01_CSR_MONO) != 0 ? 1 : 8);
 	ri->ri_width = 1024;
 	ri->ri_height = 864;



CVS commit: src/sys/arch/pmax/ibus

2011-06-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun  4 01:31:24 UTC 2011

Modified Files:
src/sys/arch/pmax/ibus: pm.c sii.c sii_ds.c siivar.h

Log Message:
Split device_t/softc.  No crash during device attach on GXemul.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/pmax/ibus/pm.c \
src/sys/arch/pmax/ibus/sii.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/ibus/sii_ds.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/pmax/ibus/siivar.h

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/pmax/ibus/pm.c
diff -u src/sys/arch/pmax/ibus/pm.c:1.8 src/sys/arch/pmax/ibus/pm.c:1.9
--- src/sys/arch/pmax/ibus/pm.c:1.8	Sat May 15 20:31:10 2010
+++ src/sys/arch/pmax/ibus/pm.c	Sat Jun  4 01:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm.c,v 1.8 2010/05/15 20:31:10 tsutsui Exp $	*/
+/*	$NetBSD: pm.c,v 1.9 2011/06/04 01:31:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.8 2010/05/15 20:31:10 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.9 2011/06/04 01:31:23 tsutsui Exp $");
 
 #include 
 #include 
@@ -76,7 +76,7 @@
 };
 
 struct pm_softc {
-	struct device		sc_dev;
+	device_t		sc_dev;
 	size_t			sc_cmap_size;
 	size_t			sc_fb_size;
 	int			sc_type;
@@ -89,8 +89,8 @@
 };
 #define	WSDISPLAY_CMAP_DOLUT	0x20
 
-int	pm_match(struct device *, struct cfdata *, void *);
-void	pm_attach(struct device *, struct device *, void *);
+int	pm_match(device_t, cfdata_t, void *);
+void	pm_attach(device_t, device_t, void *);
 int	pm_ioctl(void *, void *, u_long, void *, int, struct lwp *);
 paddr_t	pm_mmap(void *, void *, off_t, int);
 int	pm_alloc_screen(void *, const struct wsscreen_descr *,
@@ -110,7 +110,7 @@
 void	pm_set_curpos(struct pm_softc *, struct wsdisplay_curpos *);
 void	pm_init_cmap(struct pm_softc *);
 
-CFATTACH_DECL(pm, sizeof(struct pm_softc),
+CFATTACH_DECL_NEW(pm, sizeof(struct pm_softc),
pm_match, pm_attach, NULL, NULL);
 
 struct rasops_info pm_ri;
@@ -142,7 +142,7 @@
 u_int	pm_creg;
 
 int
-pm_match(struct device *parent, struct cfdata *match, void *aux)
+pm_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct ibus_attach_args *ia;
 	void *pmaddr;
@@ -160,14 +160,15 @@
 }
 
 void
-pm_attach(struct device *parent, struct device *self, void *aux)
+pm_attach(device_t parent, device_t self, void *aux)
 {
 	struct pm_softc *sc;
 	struct rasops_info *ri;
 	struct wsemuldisplaydev_attach_args waa;
 	int console;
 
-	sc = (struct pm_softc *)self;
+	sc = device_private(self);
+	sc->sc_dev = self;
 	ri = &pm_ri;
 	console = (ri->ri_bits != NULL);
 
Index: src/sys/arch/pmax/ibus/sii.c
diff -u src/sys/arch/pmax/ibus/sii.c:1.8 src/sys/arch/pmax/ibus/sii.c:1.9
--- src/sys/arch/pmax/ibus/sii.c:1.8	Wed Mar 18 10:22:33 2009
+++ src/sys/arch/pmax/ibus/sii.c	Sat Jun  4 01:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sii.c,v 1.8 2009/03/18 10:22:33 cegger Exp $	*/
+/*	$NetBSD: sii.c,v 1.9 2011/06/04 01:31:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sii.c,v 1.8 2009/03/18 10:22:33 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sii.c,v 1.9 2011/06/04 01:31:23 tsutsui Exp $");
 
 #include "sii.h"
 /*
@@ -172,7 +172,7 @@
 	sii_Reset(sc, RESET);
 	printf(": target %d\n", sc->sc_regs->id & SII_IDMSK);
 
-	sc->sc_adapter.adapt_dev = &sc->sc_dev;
+	sc->sc_adapter.adapt_dev = sc->sc_dev;
 	sc->sc_adapter.adapt_nchannels = 1;
 	sc->sc_adapter.adapt_openings = 7; 
 	sc->sc_adapter.adapt_max_periph = 1;
@@ -191,7 +191,7 @@
 	/*
 	 * Now try to attach all the sub-devices
 	 */
-	config_found(&sc->sc_dev, &sc->sc_channel, scsiprint);
+	config_found(sc->sc_dev, &sc->sc_channel, scsiprint);
 }
 
 /*
@@ -205,11 +205,13 @@
 {
 	struct scsipi_xfer *xs;
 	struct scsipi_periph *periph;
-	struct siisoftc *sc = (void *)chan->chan_adapter->adapt_dev;
+	struct siisoftc *sc;
 	int target;
 	int s;
 	int count;
 
+	sc = device_private(chan->chan_adapter->adapt_dev);
+
 	switch (req) {
 	case ADAPTER_REQ_RUN_XFER:
 		xs = arg;
@@ -310,7 +312,7 @@
 	 * Set host adapter ID (from PROM sciiidN variable).
 	 */
 	/* XXX device_unit() abuse */
-	regs->id = SII_ID_IO | prom_scsiid(device_unit(&sc->sc_dev));
+	regs->id = SII_ID_IO | prom_scsiid(device_unit(sc->sc_dev));
 	/*
 	 * Enable SII to drive the SCSI bus.
 	 */
@@ -389,9 +391,9 @@
 #ifdef DEBUG
 	if (sii_debug > 1) {
 		printf("sii_StartCmd: %s target %d cmd 0x%x addr %p size %d DMA %d\n",
-			sc->sc_dev.dv_xname,
-			target, scsicmd->cmd[0], scsicmd->buf, scsicmd->buflen,
-			state->dmaDataPhase);
+		device_xname(sc->sc_dev),
+		target, scsicmd->cmd[0], scsicmd->buf, scsicmd->buflen,
+		state->dmaDataPhase);
 	}
 	sii_debug_cmd = scsicmd->cmd[0];
 	if (scsicmd->cmd[0] == READ_10 ||
@@ -612,7 +614,8 @@
 
 		/* check for a BUS RESET */
 		if (cstat & SII_RST) {
-			printf(

CVS commit: src/sys/arch/pmax/ibus

2016-06-20 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Jun 20 20:19:43 UTC 2016

Modified Files:
src/sys/arch/pmax/ibus: sii.c

Log Message:
Fix DEBUG build
While here, if DIAGNOSTIC panic to KASSERTMSG.

ok mlelstv@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/pmax/ibus/sii.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/pmax/ibus/sii.c
diff -u src/sys/arch/pmax/ibus/sii.c:1.11 src/sys/arch/pmax/ibus/sii.c:1.12
--- src/sys/arch/pmax/ibus/sii.c:1.11	Sun Nov 10 20:09:52 2013
+++ src/sys/arch/pmax/ibus/sii.c	Mon Jun 20 20:19:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sii.c,v 1.11 2013/11/10 20:09:52 christos Exp $	*/
+/*	$NetBSD: sii.c,v 1.12 2016/06/20 20:19:43 maya Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sii.c,v 1.11 2013/11/10 20:09:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sii.c,v 1.12 2016/06/20 20:19:43 maya Exp $");
 
 #include "sii.h"
 /*
@@ -1759,11 +1759,8 @@ sii_CmdDone(struct siisoftc *sc, int tar
 {
 	int i;
 
-#ifdef DIAGNOSTIC
-	ScsiCmd *scsicmd = sc->sc_cmd[target];
-	if (target < 0 || !scsicmd)
-		panic("sii_CmdDone");
-#endif
+	ScsiCmd *scsicmd __unused = sc->sc_cmd[target];
+	KASSERTMSG(target >= 0 && scsicmd, "sii_CmdDone");
 	sc->sc_cmd[target] = (ScsiCmd *)0;
 #ifdef DEBUG
 	if (sii_debug > 1) {



CVS commit: src/sys/arch/pmax/ibus

2018-01-05 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Fri Jan  5 13:11:32 UTC 2018

Modified Files:
src/sys/arch/pmax/ibus: pm.c

Log Message:
Check presence of VFB01/VFB02 frame buffer option on DEC(station|system) 3100.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/pmax/ibus/pm.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/pmax/ibus/pm.c
diff -u src/sys/arch/pmax/ibus/pm.c:1.13 src/sys/arch/pmax/ibus/pm.c:1.14
--- src/sys/arch/pmax/ibus/pm.c:1.13	Tue Jun 13 19:13:55 2017
+++ src/sys/arch/pmax/ibus/pm.c	Fri Jan  5 13:11:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm.c,v 1.13 2017/06/13 19:13:55 spz Exp $	*/
+/*	$NetBSD: pm.c,v 1.14 2018/01/05 13:11:32 flxd Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.13 2017/06/13 19:13:55 spz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.14 2018/01/05 13:11:32 flxd Exp $");
 
 #include 
 #include 
@@ -90,6 +90,7 @@ struct pm_softc {
 
 int	pm_match(device_t, cfdata_t, void *);
 void	pm_attach(device_t, device_t, void *);
+int	pm_check_vfb(void);
 int	pm_ioctl(void *, void *, u_long, void *, int, struct lwp *);
 paddr_t	pm_mmap(void *, void *, off_t, int);
 int	pm_alloc_screen(void *, const struct wsscreen_descr *,
@@ -174,6 +175,9 @@ pm_attach(device_t parent, device_t self
 	if (console) {
 		sc->sc_nscreens = 1;
 		ri->ri_flg &= ~RI_NO_AUTO;
+	} else if (!pm_check_vfb()) {
+		printf(": VFB01/VFB02 frame buffer option not found\n");
+		return;
 	} else
 		pm_common_init();
 
@@ -192,6 +196,27 @@ pm_attach(device_t parent, device_t self
 	config_found(self, &waa, wsemuldisplaydevprint);
 }
 
+int
+pm_check_vfb(void)
+{
+	int *mem;
+	const int magic = 0xcafebabe;
+
+	mem = (void *)MIPS_PHYS_TO_KSEG1(KN01_PHYS_FBUF_START);
+
+	*mem = magic;
+	wbflush();
+	if (*mem != magic)
+		return 0;
+
+	*mem = ~magic;
+	wbflush();
+	if (*mem != ~magic)
+		return 0;
+
+	return 1;
+}
+
 void
 pm_init_cmap(struct pm_softc *sc)
 {



CVS commit: src/sys/arch/pmax/ibus

2017-05-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 18 16:37:06 UTC 2017

Modified Files:
src/sys/arch/pmax/ibus: dz_ibus.c

Log Message:
PR/52242: Utkarsh Anand: Minimal fix for fallout from moving to the common
mips bus_space code.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/pmax/ibus/dz_ibus.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/pmax/ibus/dz_ibus.c
diff -u src/sys/arch/pmax/ibus/dz_ibus.c:1.11 src/sys/arch/pmax/ibus/dz_ibus.c:1.12
--- src/sys/arch/pmax/ibus/dz_ibus.c:1.11	Sat Jul  9 13:32:29 2011
+++ src/sys/arch/pmax/ibus/dz_ibus.c	Thu May 18 12:37:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz_ibus.c,v 1.11 2011/07/09 17:32:29 matt Exp $	*/
+/*	$NetBSD: dz_ibus.c,v 1.12 2017/05/18 16:37:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dz_ibus.c,v 1.11 2011/07/09 17:32:29 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dz_ibus.c,v 1.12 2017/05/18 16:37:06 christos Exp $");
 
 #include "dzkbd.h"
 #include "dzms.h"
@@ -168,6 +168,7 @@ dz_ibus_attach(device_t parent, device_t
 	 * XXX - This is evil and ugly, but... due to the nature of how
 	 * bus_space_* works on pmax it will do for the time being.
 	 */
+	sc->sc_iot = normal_memt;
 	sc->sc_ioh = (bus_space_handle_t)MIPS_PHYS_TO_KSEG1(iba->ia_addr);
 
 	sc->sc_dr.dr_csr = 0;