CVS commit: src/sys/arch/hp700/dev

2014-01-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 07:44:16 UTC 2014

Modified Files:
src/sys/arch/hp700/dev: lasi.c

Log Message:
Fix lasi at mainbus attachment, e.g. on a HP715/100.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hp700/dev/lasi.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/hp700/dev/lasi.c
diff -u src/sys/arch/hp700/dev/lasi.c:1.24 src/sys/arch/hp700/dev/lasi.c:1.25
--- src/sys/arch/hp700/dev/lasi.c:1.24	Sat Oct 19 13:49:11 2013
+++ src/sys/arch/hp700/dev/lasi.c	Fri Jan 17 07:44:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: lasi.c,v 1.24 2013/10/19 13:49:11 skrll Exp $	*/
+/*	$NetBSD: lasi.c,v 1.25 2014/01/17 07:44:16 skrll Exp $	*/
 
 /*	$OpenBSD: lasi.c,v 1.4 2001/06/09 03:57:19 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.24 2013/10/19 13:49:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.25 2014/01/17 07:44:16 skrll Exp $");
 
 #undef LASIDEBUG
 
@@ -200,6 +200,15 @@ lasiattach(device_t parent, device_t sel
 
 	/* Attach the GSC bus. */
 	ga.ga_ca = *ca;	/* clone from us */
+	if (strcmp(device_xname(parent), "mainbus0") == 0) {
+		ga.ga_dp.dp_bc[0] = ga.ga_dp.dp_bc[1];
+		ga.ga_dp.dp_bc[1] = ga.ga_dp.dp_bc[2];
+		ga.ga_dp.dp_bc[2] = ga.ga_dp.dp_bc[3];
+		ga.ga_dp.dp_bc[3] = ga.ga_dp.dp_bc[4];
+		ga.ga_dp.dp_bc[4] = ga.ga_dp.dp_bc[5];
+		ga.ga_dp.dp_bc[5] = ga.ga_dp.dp_mod;
+		ga.ga_dp.dp_mod = 0;
+	}
 
 	ga.ga_name = "gsc";
 	ga.ga_ir = &sc->sc_ir;



CVS commit: src/sys/arch/hp700/dev

2014-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 10 16:36:54 UTC 2014

Modified Files:
src/sys/arch/hp700/dev: Makefile

Log Message:
include bsd.own.mk


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/Makefile

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/hp700/dev/Makefile
diff -u src/sys/arch/hp700/dev/Makefile:1.2 src/sys/arch/hp700/dev/Makefile:1.3
--- src/sys/arch/hp700/dev/Makefile:1.2	Sun Oct 19 18:05:21 2008
+++ src/sys/arch/hp700/dev/Makefile	Fri Jan 10 11:36:54 2014
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.2 2008/10/19 22:05:21 apb Exp $
+#	$NetBSD: Makefile,v 1.3 2014/01/10 16:36:54 christos Exp $
 
 #	$OpenBSD: Makefile,v 1.3 1999/04/20 20:19:37 mickey Exp $
 
-.include 
+.include 
 
 cpudevs.h cpudevs_data.h: cpudevs devlist2h.awk
 	/bin/rm -f cpudevs.h cpudevs_data.h



CVS commit: src/sys/arch/hp700/dev

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:49:11 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: asp.c dino.c elroy.c lasi.c wax.c

Log Message:
Appease gcc 4.8.

XXX should really use bus_space(9)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hp700/dev/asp.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/hp700/dev/dino.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp700/dev/elroy.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp700/dev/lasi.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/wax.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/hp700/dev/asp.c
diff -u src/sys/arch/hp700/dev/asp.c:1.22 src/sys/arch/hp700/dev/asp.c:1.23
--- src/sys/arch/hp700/dev/asp.c:1.22	Wed Oct 10 15:46:33 2012
+++ src/sys/arch/hp700/dev/asp.c	Sat Oct 19 13:49:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asp.c,v 1.22 2012/10/10 15:46:33 skrll Exp $	*/
+/*	$NetBSD: asp.c,v 1.23 2013/10/19 13:49:11 skrll Exp $	*/
 
 /*	$OpenBSD: asp.c,v 1.5 2000/02/09 05:04:22 mickey Exp $	*/
 
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: asp.c,v 1.22 2012/10/10 15:46:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asp.c,v 1.23 2013/10/19 13:49:11 skrll Exp $");
 
 #include 
 #include 
@@ -189,7 +189,6 @@ aspattach(device_t parent, device_t self
 	struct gsc_attach_args ga;
 	struct cpu_info *ci = &cpus[0];
 	bus_space_handle_t ioh;
-	uint32_t irr;
 	int s;
 
 	sc->sc_dev = self;
@@ -245,7 +244,7 @@ aspattach(device_t parent, device_t self
 	viper_setintrwnd(1 << ca->ca_irq);
 
 	sc->sc_trs->asp_imr = ~0;
-	irr = sc->sc_trs->asp_irr;
+	(void)sc->sc_trs->asp_irr;
 	sc->sc_trs->asp_imr = 0;
 
 	/* Establish the interrupt register. */

Index: src/sys/arch/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.36 src/sys/arch/hp700/dev/dino.c:1.37
--- src/sys/arch/hp700/dev/dino.c:1.36	Wed May 23 16:11:37 2012
+++ src/sys/arch/hp700/dev/dino.c	Sat Oct 19 13:49:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.36 2012/05/23 16:11:37 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.37 2013/10/19 13:49:11 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.36 2012/05/23 16:11:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.37 2013/10/19 13:49:11 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -356,7 +356,6 @@ dino_conf_write(void *v, pcitag_t tag, i
 {
 	struct dino_softc *sc = v;
 	volatile struct dino_regs *r = sc->sc_regs;
-	pcireg_t data1;
 	uint32_t pamr;
 
 	/* fix arbitration errata by disabling all pci devs on config read */
@@ -368,7 +367,7 @@ dino_conf_write(void *v, pcitag_t tag, i
 
 	/* fix coalescing config and io writes by interleaving w/ a read */
 	r->pci_addr = tag | PCI_ID_REG;
-	data1 = r->pci_conf_data;
+	(void)r->pci_conf_data;
 
 	/* restore arbitration */
 	r->pamr = pamr;
@@ -1605,7 +1604,6 @@ dinoattach(device_t parent, device_t sel
 	volatile struct dino_regs *r;
 	struct cpu_info *ci = &cpus[0];
 	const char *p = NULL;
-	u_int data;
 	int s, ver;
 
 	sc->sc_dv = self;
@@ -1650,7 +1648,7 @@ dinoattach(device_t parent, device_t sel
 	s = splhigh();
 	r->icr = 0;
 	r->imr = ~0;
-	data = r->irr0;
+	(void)r->irr0;
 	r->imr = 0;
 	r->iar0 = ci->ci_hpa | (31 - ca->ca_irq);
 	splx(s);

Index: src/sys/arch/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.13 src/sys/arch/hp700/dev/elroy.c:1.14
--- src/sys/arch/hp700/dev/elroy.c:1.13	Wed Oct 10 15:46:34 2012
+++ src/sys/arch/hp700/dev/elroy.c	Sat Oct 19 13:49:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.13 2012/10/10 15:46:34 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.14 2013/10/19 13:49:11 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -254,7 +254,7 @@ elroy_conf_read(void *v, pcitag_t tag, i
 	struct elroy_softc *sc = v;
 	volatile struct elroy_regs *r = sc->sc_regs;
 	uint32_t arb_mask, err_cfg, control;
-	pcireg_t data, data1;
+	pcireg_t data;
 
 /* printf("elroy_conf_read(%p, 0x%08x, 0x%x)", v, tag, reg); */
 	arb_mask = elroy_read32(&r->arb_mask);
@@ -268,7 +268,7 @@ elroy_conf_read(void *v, pcitag_t tag, i
 	~htole32(ELROY_CONTROL_HF));
 
 	elroy_write32(&r->pci_conf_addr, htole32(tag | reg));
-	data1 = elroy_read32(&r->pci_conf_addr);
+	(void)elroy_read32(&r->pci_conf_addr);
 	data = elroy_read32(&r->pci_conf_data);
 
 	elroy_write32(&r->control, control |
@@ -289,7 +289,6 @@ elroy_conf_write(void *v, pcitag_t tag, 
 	struct elroy_softc *sc = v;
 	volatile struct elroy_regs *r = sc->sc_regs;
 	uint32_t arb_mask, err_cfg, control;
-	pcireg_t data1;
 
 /* printf("elroy_conf_write(%p, 0x%08x, 0x%x, 0x%x)\n", v, tag, reg, data); */
 	arb_mask = elroy_read32(&r->arb_mask);
@@ -304,13 +303,13 @@ elroy_conf_write(void *v, pcitag_t tag, 
 
 	/* fix coalescing config writes errata by interleaving w/ a read */
 	elroy_write32(&r->pci_conf_addr, htole32(tag

CVS commit: src/sys/arch/hp700/dev

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:29:10 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
__unused


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.41 src/sys/arch/hp700/dev/pdc.c:1.42
--- src/sys/arch/hp700/dev/pdc.c:1.41	Sun Feb  5 21:46:37 2012
+++ src/sys/arch/hp700/dev/pdc.c	Sat Oct 19 13:29:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.41 2012/02/05 21:46:37 skrll Exp $	*/
+/*	$NetBSD: pdc.c,v 1.42 2013/10/19 13:29:10 skrll Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.41 2012/02/05 21:46:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.42 2013/10/19 13:29:10 skrll Exp $");
 
 #include 
 #include 
@@ -460,7 +460,7 @@ pdccninit(struct consdev *cn)
 int
 pdccnlookc(dev_t dev, int *cp)
 {
-	int s, err, l, pagezero_cookie;
+	int s, err __unused, l, pagezero_cookie;
 
 	s = splhigh();
 	pagezero_cookie = hp700_pagezero_map();



CVS commit: src/sys/arch/hp700/dev

2013-10-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 19 13:28:37 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: sti_sgc.c

Log Message:
Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/sti_sgc.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/hp700/dev/sti_sgc.c
diff -u src/sys/arch/hp700/dev/sti_sgc.c:1.21 src/sys/arch/hp700/dev/sti_sgc.c:1.22
--- src/sys/arch/hp700/dev/sti_sgc.c:1.21	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/dev/sti_sgc.c	Sat Oct 19 13:28:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sti_sgc.c,v 1.21 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: sti_sgc.c,v 1.22 2013/10/19 13:28:36 skrll Exp $	*/
 
 /*	$OpenBSD: sti_sgc.c,v 1.38 2009/02/06 22:51:04 miod Exp $	*/
 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.21 2011/07/01 18:33:09 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.22 2013/10/19 13:28:36 skrll Exp $");
 
 #include "opt_cputype.h"
 
@@ -143,7 +143,7 @@ sti_sgc_probe(device_t parent, cfdata_t 
 	struct confargs *ca = aux;
 	bus_space_handle_t romh;
 	paddr_t rom;
-	uint32_t id, romend;
+	uint32_t id;
 	u_char devtype;
 	int rv = 0, romunmapped = 0;
 
@@ -197,7 +197,6 @@ sti_sgc_probe(device_t parent, cfdata_t 
 	default:
 		DPRINTF(("%s: unknown type (%x)\n", __func__, devtype));
 		rv = 0;
-		romend = 0;
 	}
 
 	if (rv &&



CVS commit: src/sys/arch/hp700/dev

2013-02-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb 21 15:16:02 UTC 2013

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Fixup the cpu_{match,attach} functions to not allow more that HPPA_MAXCPUs
to be used.

Fixes problem booting on a dual-cpu j6700 with GENERIC (which doesn't
define MULTIPROCESSOR) reported by KIYOHARA Takashi on port-hp700.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.29 src/sys/arch/hp700/dev/cpu.c:1.30
--- src/sys/arch/hp700/dev/cpu.c:1.29	Wed Oct 10 15:46:34 2012
+++ src/sys/arch/hp700/dev/cpu.c	Thu Feb 21 15:16:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.29 2012/10/10 15:46:34 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.30 2013/02/21 15:16:02 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.29 2012/10/10 15:46:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.30 2013/02/21 15:16:02 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -74,9 +74,6 @@ cpumatch(device_t parent, cfdata_t cf, v
 	ca->ca_type.iodc_sv_model != HPPA_NPROC_HPPA)
 		return 0;
 
-	if (cf->cf_unit >= MAXCPUS)
-		return 0;
-
 	return 1;
 }
 
@@ -105,10 +102,6 @@ cpuattach(device_t parent, device_t self
 
 	sc->sc_dev = self;
 
-	ci = &cpus[cpuno];
-	ci->ci_cpuid = cpuno;
-	ci->ci_hpa = ca->ca_hpa;
-
 	/* Print the CPU chip name, nickname, and rev. */
 	aprint_normal(": %s", hppa_cpu_info->hci_chip_name);
 	if (hppa_cpu_info->hci_chip_nickname != NULL)
@@ -162,6 +155,15 @@ cpuattach(device_t parent, device_t self
 	hppa_mod_info(HPPA_TYPE_FPU, (fpu_version >> 16) & 0x1f),
 	(fpu_version >> 11) & 0x1f);
 
+	if (cpuno >= HPPA_MAXCPUS) {
+		aprint_normal_dev(self, "not started\n");
+		return;
+	}
+
+	ci = &cpus[cpuno];
+	ci->ci_cpuid = cpuno;
+	ci->ci_hpa = ca->ca_hpa;
+
 	hp700_intr_initialise(ci);
 
 	ir = &ci->ci_ir;



CVS commit: src/sys/arch/hp700/dev

2012-10-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 10 16:51:10 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: ssio.c

Log Message:
Remove the (never used) struct device from ssio_softc.

>From chuq.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp700/dev/ssio.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/hp700/dev/ssio.c
diff -u src/sys/arch/hp700/dev/ssio.c:1.3 src/sys/arch/hp700/dev/ssio.c:1.4
--- src/sys/arch/hp700/dev/ssio.c:1.3	Sat Apr 14 06:04:34 2012
+++ src/sys/arch/hp700/dev/ssio.c	Wed Oct 10 16:51:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssio.c,v 1.3 2012/04/14 06:04:34 skrll Exp $	*/
+/*	$NetBSD: ssio.c,v 1.4 2012/10/10 16:51:10 skrll Exp $	*/
 
 /*	$OpenBSD: ssio.c,v 1.7 2009/03/08 22:19:04 miod Exp $	*/
 
@@ -106,8 +106,6 @@ struct ssio_iv {
 struct ssio_iv ssio_intr_table[SSIO_NINTS];
 
 struct ssio_softc {
-	struct device sc_dev;
-
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ic1h;
 	bus_space_handle_t sc_ic2h;



CVS commit: src/sys/arch/hp700/dev

2012-05-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 23 21:11:34 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Enable IPIs for MULTIPROCESSOR kernels


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.27 src/sys/arch/hp700/dev/cpu.c:1.28
--- src/sys/arch/hp700/dev/cpu.c:1.27	Wed May 23 16:11:37 2012
+++ src/sys/arch/hp700/dev/cpu.c	Wed May 23 21:11:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.27 2012/05/23 16:11:37 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.28 2012/05/23 21:11:34 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.27 2012/05/23 16:11:37 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.28 2012/05/23 21:11:34 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -172,6 +172,10 @@ cpuattach(device_t parent, device_t self
 
 	sc->sc_ihclk = hp700_intr_establish(IPL_CLOCK, clock_intr,
 	NULL /*clockframe*/, &ci->ci_ir, 31);
+#ifdef MULTIPROCESSOR
+	sc->sc_ihipi = hp700_intr_establish(IPL_HIGH, hppa_ipi_intr,
+	NULL /*clockframe*/, &ci->ci_ir, 30);
+#endif
 
 	/*
 	 * Reserve some bits for chips that don't like to be moved
@@ -191,6 +195,7 @@ cpuattach(device_t parent, device_t self
 	}
 	m = TAILQ_FIRST(&mlist);
 	ci->ci_stack = VM_PAGE_TO_PHYS(m);
+	ci->ci_softc = sc;
 
 	if (ci->ci_hpa == hppa_mcpuhpa) {
 		ci->ci_flags |= CPUF_PRIMARY|CPUF_RUNNING;
@@ -205,6 +210,7 @@ cpuattach(device_t parent, device_t self
 		}
 	}
 	hppa_ncpu++;
+	hppa_ipi_init(ci);
 #endif
 	KASSERT(ci->ci_cpl == -1);
 }



CVS commit: src/sys/arch/hp700/dev

2012-05-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 23 10:37:02 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: asp.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp700/dev/asp.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/hp700/dev/asp.c
diff -u src/sys/arch/hp700/dev/asp.c:1.19 src/sys/arch/hp700/dev/asp.c:1.20
--- src/sys/arch/hp700/dev/asp.c:1.19	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/dev/asp.c	Wed May 23 10:37:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: asp.c,v 1.19 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: asp.c,v 1.20 2012/05/23 10:37:01 skrll Exp $	*/
 
 /*	$OpenBSD: asp.c,v 1.5 2000/02/09 05:04:22 mickey Exp $	*/
 
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: asp.c,v 1.19 2011/07/01 18:33:09 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asp.c,v 1.20 2012/05/23 10:37:01 skrll Exp $");
 
 #include 
 #include 
@@ -201,7 +201,7 @@ aspattach(device_t parent, device_t self
 	 * Map the ASP interrupt registers.
 	 */
 	if (bus_space_map(ca->ca_iot, ca->ca_hpa + ASP_REG_INT,
-			  sizeof(struct asp_trs), 0, &ioh)) {
+	sizeof(struct asp_trs), 0, &ioh)) {
 		aprint_error(": can't map interrupt registers.\n");
 		return;
 	}



CVS commit: src/sys/arch/hp700/dev

2012-05-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 23 10:31:59 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: dino.c wax.c

Log Message:
s/IRQ/interrupt/ in autoconf message.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/hp700/dev/dino.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp700/dev/wax.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.34 src/sys/arch/hp700/dev/dino.c:1.35
--- src/sys/arch/hp700/dev/dino.c:1.34	Tue Apr  3 12:07:26 2012
+++ src/sys/arch/hp700/dev/dino.c	Wed May 23 10:31:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.34 2012/04/03 12:07:26 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.35 2012/05/23 10:31:59 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.34 2012/04/03 12:07:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.35 2012/05/23 10:31:59 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -1618,7 +1618,7 @@ dinoattach(device_t parent, device_t sel
 	sc->sc_dmat = ca->ca_dmatag;
 
 	if (ca->ca_irq == HP700CF_IRQ_UNDEF) {
-		aprint_error_dev(self, ": can't allocate IRQ");
+		aprint_error_dev(self, ": can't allocate interrupt");
 		return;
 	}
 

Index: src/sys/arch/hp700/dev/wax.c
diff -u src/sys/arch/hp700/dev/wax.c:1.18 src/sys/arch/hp700/dev/wax.c:1.19
--- src/sys/arch/hp700/dev/wax.c:1.18	Tue Apr  3 12:07:26 2012
+++ src/sys/arch/hp700/dev/wax.c	Wed May 23 10:31:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wax.c,v 1.18 2012/04/03 12:07:26 skrll Exp $	*/
+/*	$NetBSD: wax.c,v 1.19 2012/05/23 10:31:59 skrll Exp $	*/
 
 /*	$OpenBSD: wax.c,v 1.1 1998/11/23 03:04:10 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.18 2012/04/03 12:07:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.19 2012/05/23 10:31:59 skrll Exp $");
 
 #include 
 #include 
@@ -120,7 +120,7 @@ waxattach(device_t parent, device_t self
 	int s, in;
 
 	if (ca->ca_irq == HP700CF_IRQ_UNDEF) {
-		aprint_error(": can't allocate IRQ\n");
+		aprint_error(": can't allocate interrupt\n");
 		return;
 	}
 



CVS commit: src/sys/arch/hp700/dev

2012-05-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 23 09:49:56 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Add a KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.25 src/sys/arch/hp700/dev/cpu.c:1.26
--- src/sys/arch/hp700/dev/cpu.c:1.25	Wed May 23 07:06:02 2012
+++ src/sys/arch/hp700/dev/cpu.c	Wed May 23 09:49:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.25 2012/05/23 07:06:02 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.26 2012/05/23 09:49:56 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.25 2012/05/23 07:06:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.26 2012/05/23 09:49:56 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -151,6 +151,7 @@ cpuattach(device_t parent, device_t self
 	/*
 	 * Describe the floating-point support.
 	 */
+	KASSERT(fpu_present);
 	aprint_normal("%s: %s floating point, rev %d\n", self->dv_xname,
 	hppa_mod_info(HPPA_TYPE_FPU, (fpu_version >> 16) & 0x1f),
 	(fpu_version >> 11) & 0x1f);



CVS commit: src/sys/arch/hp700/dev

2012-05-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 23 07:06:02 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Count the cpus as they attach so that CPU_INFO_FOREACH works before
hatching the secondary cpus.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.24 src/sys/arch/hp700/dev/cpu.c:1.25
--- src/sys/arch/hp700/dev/cpu.c:1.24	Mon May 21 21:15:39 2012
+++ src/sys/arch/hp700/dev/cpu.c	Wed May 23 07:06:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.24 2012/05/21 21:15:39 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.25 2012/05/23 07:06:02 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.24 2012/05/21 21:15:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.25 2012/05/23 07:06:02 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -179,7 +179,6 @@ cpuattach(device_t parent, device_t self
 
 	if (ci->ci_hpa == hppa_mcpuhpa) {
 		ci->ci_flags |= CPUF_PRIMARY|CPUF_RUNNING;
-		hppa_ncpu++;
 	} else {
 		int err;
 
@@ -190,6 +189,7 @@ cpuattach(device_t parent, device_t self
 			return;
 		}
 	}
+	hppa_ncpu++;
 
 #endif
 
@@ -266,9 +266,6 @@ cpu_hatch(void)
 	struct cpu_info *ci = curcpu();
 
 	ci->ci_flags |= CPUF_RUNNING;
-#if 0
-	hppa_ncpu++;
-#endif
 
 	/* Wait for additional CPUs to spinup. */
 	while (!start_secondary_cpu)



CVS commit: src/sys/arch/hp700/dev

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 21:15:39 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Unwrap a line.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.23 src/sys/arch/hp700/dev/cpu.c:1.24
--- src/sys/arch/hp700/dev/cpu.c:1.23	Fri Apr  6 12:21:58 2012
+++ src/sys/arch/hp700/dev/cpu.c	Mon May 21 21:15:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.23 2012/04/06 12:21:58 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.24 2012/05/21 21:15:39 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.23 2012/04/06 12:21:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.24 2012/05/21 21:15:39 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -168,8 +168,7 @@ cpuattach(device_t parent, device_t self
 
 	/* Allocate stack for spin up and FPU emulation. */
 	TAILQ_INIT(&mlist);
-	error = uvm_pglistalloc(PAGE_SIZE, 0, -1L, PAGE_SIZE, 0, &mlist, 1,
-	0);
+	error = uvm_pglistalloc(PAGE_SIZE, 0, -1L, PAGE_SIZE, 0, &mlist, 1, 0);
 
 	if (error) {
 		aprint_error(": unable to allocate CPU stack!\n");



CVS commit: src/sys/arch/hp700/dev

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 20:58:39 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.14 src/sys/arch/hp700/dev/apic.c:1.15
--- src/sys/arch/hp700/dev/apic.c:1.14	Sat Apr 14 10:43:19 2012
+++ src/sys/arch/hp700/dev/apic.c	Mon May 21 20:58:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: apic.c,v 1.14 2012/04/14 10:43:19 skrll Exp $	*/
+/*	$NetBSD: apic.c,v 1.15 2012/05/21 20:58:39 skrll Exp $	*/
 
 /*	$OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $	*/
 
@@ -141,7 +141,8 @@ apic_intr_map(const struct pci_attach_ar
 	if (sc->sc_irq[line] == 0)
 		sc->sc_irq[line] = hp700_intr_allocate_bit(&ir_cpu);
 	*ihp = (line << APIC_INT_LINE_SHIFT) | sc->sc_irq[line];
-	return (APIC_INT_IRQ(*ihp) == 0);
+
+	return APIC_INT_IRQ(*ihp) == 0;
 }
 
 const char *
@@ -152,7 +153,7 @@ apic_intr_string(void *v, pci_intr_handl
 	snprintf(buf, sizeof(buf), "line %ld irq %ld",
 	APIC_INT_LINE(ih), APIC_INT_IRQ(ih));
 
-	return (buf);
+	return buf;
 }
 
 void *
@@ -172,7 +173,7 @@ apic_intr_establish(void *v, pci_intr_ha
 
 	/* no mapping or bogus */
 	if (irq <= 0 || irq > 31)
-		return (NULL);
+		return NULL;
 
 	aiv = malloc(sizeof(struct apic_iv), M_DEVBUF, M_NOWAIT);
 	if (aiv == NULL)
@@ -234,7 +235,7 @@ apic_intr_establish(void *v, pci_intr_ha
 
 	apic_intr_list[irq] = aiv;
 
-	return (arg);
+	return arg;
 }
 
 void
@@ -262,7 +263,7 @@ apic_intr(void *v)
 	/* Signal EOI. */
 	elroy_write32(&r->apic_eoi, htole32((31 - irq) & APIC_ENT0_VEC));
 
-	return (claimed);
+	return claimed;
 }
 
 void



CVS commit: src/sys/arch/hp700/dev

2012-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 14 10:43:19 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
Sync with the following OpenBSD changes, but do the shared interrupt
reporting differently.  Each cpu and device interrupt gets its own
counter.

revision 1.14
Fix counting of interrupts for devices that attach to elroy(4).  Shared
interrupts would be counted double, once for the interrupting device and
once for the device at the head of the chain.  The handlers would run properly
though.  Avoid this by giving each device its own interrupt counter instead
of using the counter provided by the generic interrupt handling code for the
head of the chain.

revision 1.13
Stop calling shared interrupt handlers as soon as one of them return 1
(positive interrupt was for me), like we do on other architectures.
This is done here, at the elroy(4) driver level, since this is where shared
PCI interrupts are handled.  We could do something similar for dino(4) but
this optimization is probably not very relevant there.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.13 src/sys/arch/hp700/dev/apic.c:1.14
--- src/sys/arch/hp700/dev/apic.c:1.13	Tue Apr  3 12:07:26 2012
+++ src/sys/arch/hp700/dev/apic.c	Sat Apr 14 10:43:19 2012
@@ -1,6 +1,6 @@
-/*	$NetBSD: apic.c,v 1.13 2012/04/03 12:07:26 skrll Exp $	*/
+/*	$NetBSD: apic.c,v 1.14 2012/04/14 10:43:19 skrll Exp $	*/
 
-/*	$OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $	*/
+/*	$OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $	*/
 
 /*
  * Copyright (c) 2005 Michael Shalayeff
@@ -178,53 +178,61 @@ apic_intr_establish(void *v, pci_intr_ha
 	if (aiv == NULL)
 		return NULL;
 
+	cnt = malloc(sizeof(struct evcnt), M_DEVBUF, M_NOWAIT);
+	if (cnt == NULL) {
+		free(aiv, M_DEVBUF);
+		return NULL;
+	}
+
 	aiv->sc = sc;
 	aiv->ih = ih;
 	aiv->handler = handler;
 	aiv->arg = arg;
 	aiv->next = NULL;
-	aiv->cnt = NULL;
-	if (apic_intr_list[irq]) {
-		cnt = malloc(sizeof(struct evcnt), M_DEVBUF, M_NOWAIT);
-		if (cnt == NULL) {
+	aiv->cnt = cnt;
+
+	biv = apic_intr_list[irq];
+	if (biv == NULL) {
+		iv = hp700_intr_establish(pri, apic_intr, aiv, &ir_cpu, irq);
+		if (iv == NULL) {
 			free(aiv, M_DEVBUF);
+			free(cnt, M_DEVBUF);
+
 			return NULL;
 		}
+	}
+
+	snprintf(aiv->aiv_name, sizeof(aiv->aiv_name), "line %d irq %d",
+	line, irq);
 
-		snprintf(aiv->aiv_name, sizeof(aiv->aiv_name), "line %d irq %d",
-		line, irq);
+	evcnt_attach_dynamic(cnt, EVCNT_TYPE_INTR, NULL,
+	device_xname(sc->sc_dv), aiv->aiv_name);
 
-		evcnt_attach_dynamic(cnt, EVCNT_TYPE_INTR, NULL,
-		device_xname(sc->sc_dv), aiv->aiv_name);
-		biv = apic_intr_list[irq];
+	if (biv) {
 		while (biv->next)
 			biv = biv->next;
 		biv->next = aiv;
-		aiv->cnt = cnt;
 		return arg;
 	}
 
-	iv = hp700_intr_establish(pri, apic_intr, aiv, &ir_cpu, irq);
-	if (iv) {
-		ent0 = (31 - irq) & APIC_ENT0_VEC;
-		ent0 |= apic_get_int_ent0(sc, line);
+	ent0 = (31 - irq) & APIC_ENT0_VEC;
+	ent0 |= apic_get_int_ent0(sc, line);
 #if 0
-		if (cold) {
-			sc->sc_imr |= (1 << irq);
-			ent0 |= APIC_ENT0_MASK;
-		}
+	if (cold) {
+		sc->sc_imr |= (1 << irq);
+		ent0 |= APIC_ENT0_MASK;
+	}
 #endif
-		apic_write(sc->sc_regs, APIC_ENT0(line), APIC_ENT0_MASK);
-		apic_write(sc->sc_regs, APIC_ENT1(line),
-		((hpa & 0x0ff0) >> 4) | ((hpa & 0x000ff000) << 12));
-		apic_write(sc->sc_regs, APIC_ENT0(line), ent0);
-
-		/* Signal EOI. */
-		elroy_write32(&r->apic_eoi,
-		htole32((31 - irq) & APIC_ENT0_VEC));
+	apic_write(sc->sc_regs, APIC_ENT0(line), APIC_ENT0_MASK);
+	apic_write(sc->sc_regs, APIC_ENT1(line),
+	((hpa & 0x0ff0) >> 4) | ((hpa & 0x000ff000) << 12));
+	apic_write(sc->sc_regs, APIC_ENT0(line), ent0);
 
-		apic_intr_list[irq] = aiv;
-	}
+	/* Signal EOI. */
+	elroy_write32(&r->apic_eoi,
+	htole32((31 - irq) & APIC_ENT0_VEC));
+
+	apic_intr_list[irq] = aiv;
 
 	return (arg);
 }
@@ -244,11 +252,11 @@ apic_intr(void *v)
 	int claimed = 0;
 
 	while (iv) {
-		if (iv->handler(iv->arg)) {
-			if (iv->cnt)
-iv->cnt->ev_count++;
-			claimed = 1;
-		}
+		claimed = iv->handler(iv->arg);
+		if (claimed && iv->cnt)
+			iv->cnt->ev_count++;
+		if (claimed)
+			break;
 		iv = iv->next;
 	}
 	/* Signal EOI. */



CVS commit: src/sys/arch/hp700/dev

2012-04-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 14 06:04:35 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: ssio.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/ssio.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/hp700/dev/ssio.c
diff -u src/sys/arch/hp700/dev/ssio.c:1.2 src/sys/arch/hp700/dev/ssio.c:1.3
--- src/sys/arch/hp700/dev/ssio.c:1.2	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/dev/ssio.c	Sat Apr 14 06:04:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssio.c,v 1.2 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: ssio.c,v 1.3 2012/04/14 06:04:34 skrll Exp $	*/
 
 /*	$OpenBSD: ssio.c,v 1.7 2009/03/08 22:19:04 miod Exp $	*/
 
@@ -160,8 +160,8 @@ ssio_match(device_t parent, cfdata_t mat
 	if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_NS)
 		return 0;
 
-if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NS_PC87560)
-return 1;
+	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NS_PC87560)
+		return 1;
 
 	return 0;
 }
@@ -204,10 +204,10 @@ ssio_attach(device_t parent, device_t se
 	sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_TTY, ssio_intr,
 	sc);
 	if (sc->sc_ih == NULL) {
-aprint_error_dev(self, "could not establish interrupt");
-if (intrstr != NULL)
-aprint_error(" at %s", intrstr);
-aprint_error("\n");
+		aprint_error_dev(self, "could not establish interrupt");
+		if (intrstr != NULL)
+			aprint_error(" at %s", intrstr);
+		aprint_error("\n");
 		goto unmap_ic2;
 	}
 	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
@@ -324,7 +324,7 @@ ssio_intr(void *v)
 	irq = bus_space_read_1(sc->sc_iot, sc->sc_ic1h, 0);
 	irq &= 0x07;
 
-	if (irq  == 7) {
+	if (irq == 7) {
 		bus_space_write_1(sc->sc_iot, sc->sc_ic1h, 0, 0x0b);
 		isr = bus_space_read_1(sc->sc_iot, sc->sc_ic1h, 0);
 		if ((isr & 0x80) == 0)



CVS commit: src/sys/arch/hp700/dev

2012-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Apr  3 11:44:32 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Make MULTIPROCESSOR compile.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.20 src/sys/arch/hp700/dev/cpu.c:1.21
--- src/sys/arch/hp700/dev/cpu.c:1.20	Sun Feb 26 08:44:12 2012
+++ src/sys/arch/hp700/dev/cpu.c	Tue Apr  3 11:44:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.20 2012/02/26 08:44:12 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.21 2012/04/03 11:44:32 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,13 +29,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.20 2012/02/26 08:44:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.21 2012/04/03 11:44:32 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 



CVS commit: src/sys/arch/hp700/dev

2012-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb 26 07:51:57 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpudevs.h cpudevs_data.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp700/dev/cpudevs.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp700/dev/cpudevs_data.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/hp700/dev/cpudevs.h
diff -u src/sys/arch/hp700/dev/cpudevs.h:1.6 src/sys/arch/hp700/dev/cpudevs.h:1.7
--- src/sys/arch/hp700/dev/cpudevs.h:1.6	Sat Feb  4 17:05:38 2012
+++ src/sys/arch/hp700/dev/cpudevs.h	Sun Feb 26 07:51:56 2012
@@ -1,9 +1,9 @@
-/*	$NetBSD: cpudevs.h,v 1.6 2012/02/04 17:05:38 skrll Exp $	*/
+/*	$NetBSD: cpudevs.h,v 1.7 2012/02/26 07:51:56 skrll Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
  * generated from:
- *	NetBSD: cpudevs,v 1.5 2009/04/30 07:01:26 skrll Exp 
+ *	NetBSD: cpudevs,v 1.6 2012/02/26 07:50:37 skrll Exp 
  */
 
 #define	HPPA_TYPE_NPROC	0x00
@@ -230,6 +230,7 @@
 #define	HPPA_CPU_PCXL2	0x0f
 #define	HPPA_CPU_PCXUP	0x10
 #define	HPPA_CPU_PCXW	0x11
+#define	HPPA_CPU_PCXWP	0x12
 #define	HPPA_CPU_PCXW2	0x13
 #define	HPPA_FPU_SOFTEMU	0x01
 #define	HPPA_FPU_INDIGO	0x02

Index: src/sys/arch/hp700/dev/cpudevs_data.h
diff -u src/sys/arch/hp700/dev/cpudevs_data.h:1.7 src/sys/arch/hp700/dev/cpudevs_data.h:1.8
--- src/sys/arch/hp700/dev/cpudevs_data.h:1.7	Sun Feb  5 08:31:53 2012
+++ src/sys/arch/hp700/dev/cpudevs_data.h	Sun Feb 26 07:51:56 2012
@@ -1,9 +1,9 @@
-/*	$NetBSD: cpudevs_data.h,v 1.7 2012/02/05 08:31:53 skrll Exp $	*/
+/*	$NetBSD: cpudevs_data.h,v 1.8 2012/02/26 07:51:56 skrll Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
  * generated from:
- *	NetBSD: cpudevs,v 1.5 2009/04/30 07:01:26 skrll Exp 
+ *	NetBSD: cpudevs,v 1.6 2012/02/26 07:50:37 skrll Exp 
  */
 
 {HPPA_TYPE_BOARD,	HPPA_BOARD_HP840,	"840/930 (Indigo)" },
@@ -210,6 +210,7 @@
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXL2,	"PCXL2 (Velociraptor)" },
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXUP,	"PCXU+ (Vulcan)" },
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXW,	"PCXW (Vulcan)" },
+{HPPA_TYPE_CPU,	HPPA_CPU_PCXWP,	"PCXW+ (Landshark)" },
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXW2,	"PCXW2 (Piranha)" },
 {HPPA_TYPE_FPU,	HPPA_FPU_SOFTEMU,	"Software Emulation" },
 {HPPA_TYPE_FPU,	HPPA_FPU_INDIGO,	"Indigo" },



CVS commit: src/sys/arch/hp700/dev

2012-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb 26 07:50:38 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpudevs

Log Message:
Take an educiated guess at the CPU id for PCXW+ (Landshark)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/dev/cpudevs

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/hp700/dev/cpudevs
diff -u src/sys/arch/hp700/dev/cpudevs:1.5 src/sys/arch/hp700/dev/cpudevs:1.6
--- src/sys/arch/hp700/dev/cpudevs:1.5	Thu Apr 30 07:01:26 2009
+++ src/sys/arch/hp700/dev/cpudevs	Sun Feb 26 07:50:37 2012
@@ -1,4 +1,4 @@
-$NetBSD: cpudevs,v 1.5 2009/04/30 07:01:26 skrll Exp $
+$NetBSD: cpudevs,v 1.6 2012/02/26 07:50:37 skrll Exp $
 
 $OpenBSD: cpudevs,v 1.44 2007/05/18 15:57:35 kettenis Exp $
 
@@ -322,7 +322,7 @@ cpu	PCXU	0x0e	PCXU (Onyx)
 cpu	PCXL2	0x0f	PCXL2 (Velociraptor)
 cpu	PCXUP	0x10	PCXU+ (Vulcan)
 cpu	PCXW	0x11	PCXW (Vulcan)
-#cpu	PCXWP	0x??	PCXW+ (Landshark)
+cpu	PCXWP	0x12	PCXW+ (Landshark)
 cpu	PCXW2	0x13	PCXW2 (Piranha)
 #cpu	PCXM	0x??	Mako
 #cpu	PCXM2	0x??	Shortfin



CVS commit: src/sys/arch/hp700/dev

2012-02-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb  5 21:46:37 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
Delay some things to attach time - pdc_init is too early.

Minor tidyup while I'm here.

OK riz@


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.40 src/sys/arch/hp700/dev/pdc.c:1.41
--- src/sys/arch/hp700/dev/pdc.c:1.40	Sat Oct  1 15:51:17 2011
+++ src/sys/arch/hp700/dev/pdc.c	Sun Feb  5 21:46:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.40 2011/10/01 15:51:17 chs Exp $	*/
+/*	$NetBSD: pdc.c,v 1.41 2012/02/05 21:46:37 skrll Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.40 2011/10/01 15:51:17 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.41 2012/02/05 21:46:37 skrll Exp $");
 
 #include 
 #include 
@@ -63,8 +63,8 @@ enum pdc_type pdc_type;
 
 static struct pdc_result pdcret1 PDC_ALIGNMENT;
 static struct pdc_result pdcret2 PDC_ALIGNMENT;
+static char pdc_consbuf[IODC_MINIOSIZ] PDC_ALIGNMENT;
 
-char pdc_consbuf[IODC_MINIOSIZ] PDC_ALIGNMENT;
 iodcio_t pdc_cniodc, pdc_kbdiodc;
 pz_device_t *pz_kbd, *pz_cons;
 
@@ -105,10 +105,6 @@ static int pdcsettod(todr_chip_handle_t,
 void
 pdc_init(void)
 {
-	static struct todr_chip_handle todr = {
-		.todr_settime = pdcsettod,
-		.todr_gettime = pdcgettod,
-	};
 	static int kbd_iodc[IODC_MAXSIZE/sizeof(int)];
 	static int cn_iodc[IODC_MAXSIZE/sizeof(int)];
 	int err;
@@ -116,12 +112,11 @@ pdc_init(void)
 
 	pagezero_cookie = hp700_pagezero_map();
 
-	/*
-	 * locore has updated pdc with (pdcio_t)PAGE0->mem_pdc
-	 */
 	pz_kbd = &PAGE0->mem_kbd;
 	pz_cons = &PAGE0->mem_cons;
 
+	pdc = (pdcio_t)PAGE0->mem_pdc;
+
 	/* XXX should we reset the console/kbd here?
 	   well, /boot did that for us anyway */
 	if ((err = pdc_call((iodcio_t)pdc, 0, PDC_IODC, PDC_IODC_READ,
@@ -133,19 +128,13 @@ pdc_init(void)
 #endif
 	}
 
+	hp700_pagezero_unmap(pagezero_cookie);
+
 	pdc_cniodc = (iodcio_t)cn_iodc;
 	pdc_kbdiodc = (iodcio_t)kbd_iodc;
 
 	/* XXX make pdc current console */
 	cn_tab = &constab[0];
-
-	cn_init_magic(&pdc_cnm_state);
-	cn_set_magic("+");
-
-	hp700_pagezero_unmap(pagezero_cookie);
-
-	/* attach the TOD clock */
-	todr_attach(&todr);
 }
 
 void
@@ -235,13 +224,22 @@ pdcmatch(device_t parent, cfdata_t cf, v
 void
 pdcattach(device_t parent, device_t self, void *aux)
 {
+	static struct todr_chip_handle todr = {
+		.todr_settime = pdcsettod,
+		.todr_gettime = pdcgettod,
+	};
 	struct pdc_softc *sc = device_private(self);
 
 	sc->sc_dv = self;
 	pdc_attached = 1;
 
-	if (!pdc)
-		pdc_init();
+	KASSERT(pdc != NULL);
+
+	cn_init_magic(&pdc_cnm_state);
+	cn_set_magic("+");
+
+	/* attach the TOD clock */
+	todr_attach(&todr);
 
 	aprint_normal("\n");
 



CVS commit: src/sys/arch/hp700/dev

2012-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb  4 17:05:38 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpudevs.h cpudevs_data.h

Log Message:
Regen from previous.

OK riz@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/dev/cpudevs.h \
src/sys/arch/hp700/dev/cpudevs_data.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/hp700/dev/cpudevs.h
diff -u src/sys/arch/hp700/dev/cpudevs.h:1.5 src/sys/arch/hp700/dev/cpudevs.h:1.6
--- src/sys/arch/hp700/dev/cpudevs.h:1.5	Thu Apr 30 07:01:26 2009
+++ src/sys/arch/hp700/dev/cpudevs.h	Sat Feb  4 17:05:38 2012
@@ -1,9 +1,9 @@
-/*	$NetBSD: cpudevs.h,v 1.5 2009/04/30 07:01:26 skrll Exp $	*/
+/*	$NetBSD: cpudevs.h,v 1.6 2012/02/04 17:05:38 skrll Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
  * generated from:
- *	NetBSD: cpudevs,v 1.4 2005/12/11 12:17:24 christos Exp 
+ *	NetBSD: cpudevs,v 1.5 2009/04/30 07:01:26 skrll Exp 
  */
 
 #define	HPPA_TYPE_NPROC	0x00
@@ -223,6 +223,7 @@
 #define	HPPA_BUS_ROPES	15
 #define	HPPA_BUS_MERCED	16
 #define	HPPA_CPU_SOFTEMU	0x01
+#define	HPPA_CPU_PCXT	0x09
 #define	HPPA_CPU_PCXT2	0x0b
 #define	HPPA_CPU_PCXL	0x0d
 #define	HPPA_CPU_PCXU	0x0e
Index: src/sys/arch/hp700/dev/cpudevs_data.h
diff -u src/sys/arch/hp700/dev/cpudevs_data.h:1.5 src/sys/arch/hp700/dev/cpudevs_data.h:1.6
--- src/sys/arch/hp700/dev/cpudevs_data.h:1.5	Thu Apr 30 07:01:26 2009
+++ src/sys/arch/hp700/dev/cpudevs_data.h	Sat Feb  4 17:05:38 2012
@@ -1,9 +1,9 @@
-/*	$NetBSD: cpudevs_data.h,v 1.5 2009/04/30 07:01:26 skrll Exp $	*/
+/*	$NetBSD: cpudevs_data.h,v 1.6 2012/02/04 17:05:38 skrll Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
  * generated from:
- *	NetBSD: cpudevs,v 1.4 2005/12/11 12:17:24 christos Exp 
+ *	NetBSD: cpudevs,v 1.5 2009/04/30 07:01:26 skrll Exp 
  */
 
 {HPPA_TYPE_BOARD,	HPPA_BOARD_HP840,	"840/930 (Indigo)" },
@@ -203,6 +203,7 @@
 {HPPA_TYPE_BUS,	HPPA_BUS_ROPES,	"Ropes" },
 {HPPA_TYPE_BUS,	HPPA_BUS_MERCED,	"Merced" },
 {HPPA_TYPE_CPU,	HPPA_CPU_SOFTEMU,	"Software Emulation" },
+{HPPA_TYPE_CPU,	HPPA_CPU_PCXT,	"PCXT (Thunderbird)" },
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXT2,	"PCXT' (Thunderbird')" },
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXL,	"PCXL (Hummingbird)" },
 {HPPA_TYPE_CPU,	HPPA_CPU_PCXU,	"PCXU (Onyx)" },



CVS commit: src/sys/arch/hp700/dev

2012-01-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 27 21:05:39 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Adapt to extent(9) changes.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.18 src/sys/arch/hp700/dev/uturn.c:1.19
--- src/sys/arch/hp700/dev/uturn.c:1.18	Thu Jan 12 23:10:27 2012
+++ src/sys/arch/hp700/dev/uturn.c	Fri Jan 27 21:05:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.18 2012/01/12 23:10:27 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.19 2012/01/27 21:05:38 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -357,7 +357,7 @@ uturnattach(device_t parent, device_t se
 	snprintf(sc->sc_mapname, sizeof(sc->sc_mapname), "%s_map",
 	device_xname(sc->sc_dv));
 	sc->sc_map = extent_create(sc->sc_mapname, 0, (1 << iova_bits),
-	M_DEVBUF, 0, 0, EX_NOWAIT);
+	0, 0, EX_NOWAIT);
 
 	sc->sc_dmatag = uturn_dmat;
 	sc->sc_dmatag._cookie = sc;



CVS commit: src/sys/arch/hp700/dev

2012-01-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 12 23:10:28 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Copyright correction


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.17 src/sys/arch/hp700/dev/uturn.c:1.18
--- src/sys/arch/hp700/dev/uturn.c:1.17	Thu Jan 12 23:06:45 2012
+++ src/sys/arch/hp700/dev/uturn.c	Thu Jan 12 23:10:27 2012
@@ -1,9 +1,9 @@
-/*	$NetBSD: uturn.c,v 1.17 2012/01/12 23:06:45 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.18 2012/01/12 23:10:27 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
 /*-
- * Copyright (c) 2012, 2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation



CVS commit: src/sys/arch/hp700/dev

2012-01-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 12 23:06:45 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Support virtual mode as PCX-U/U+ (and probably other) CPU based machines
required it. Only PCX-W seemed to work with real mode.

Gratuitous copying of code from astro. Deadlines!


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.16 src/sys/arch/hp700/dev/uturn.c:1.17
--- src/sys/arch/hp700/dev/uturn.c:1.16	Fri Jul  1 18:33:09 2011
+++ src/sys/arch/hp700/dev/uturn.c	Thu Jan 12 23:06:45 2012
@@ -1,7 +1,52 @@
-/*	$NetBSD: uturn.c,v 1.16 2011/07/01 18:33:09 dyoung Exp $	*/
+/*	$NetBSD: uturn.c,v 1.17 2012/01/12 23:06:45 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
+/*-
+ * Copyright (c) 2012, 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2007 Mark Kettenis
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
 /*
  * Copyright (c) 2004 Michael Shalayeff
  * All rights reserved.
@@ -28,7 +73,13 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* TODO IOA programming */
+/*
+ * References:
+ * 1. Hardware Cache Coherent Input/Output. Hewlett-Packard Journal, February
+ *1996.
+ * 2. PA-RISC 1.1 Architecture and Instruction Set Reference Manual,
+ *Hewlett-Packard, February 1994, Third Edition
+ */
 
 #include 
 #include 
@@ -37,6 +88,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -46,6 +98,7 @@
 
 #include 
 
+#define UTURNDEBUG
 #ifdef UTURNDEBUG
 
 #define	DPRINTF(s)	do {	\
@@ -101,15 +154,61 @@ struct uturn_regs {
 	uint32_t	io_io_high;		/* Offset 15 */
 };
 
+
+/* Uturn supports 256 TLB entries */
+#define	UTURN_CHAINID_SHIFT	8
+#define	UTURN_CHAINID_MASK	0xff
+#define	UTURN_TLB_ENTRIES	(1 << UTURN_CHAINID_SHIFT)
+
+#define	UTURN_IOVP_SIZE		PAGE_SIZE
+#define	UTURN_IOVP_SHIFT	PAGE_SHIFT
+#define	UTURN_IOVP_MASK		PAGE_MASK
+
+#define	UTURN_IOVA(iovp, off)	((iovp) | (off))
+#define	UTURN_IOVP(iova)	((iova) & UTURN_IOVP_MASK)
+#define	UTURN_IOVA_INDEX(iova)	((iova) >> UTURN_IOVP_SHIFT)
+
 struct uturn_softc {
 	device_t sc_dv;
 
 	bus_dma_tag_t sc_dmat;
 	struct uturn_regs volatile *sc_regs;
+	uint64_t *sc_pdir;
+	uint32_t sc_chainid_shift;
+
+	char sc_mapname[20];
+	struct extent *sc_map;
 
 	struct hppa_bus_dma_tag sc_dmatag;
 };
 
+/*
+ * per-map IOVA page table
+ */
+struct uturn_page_entry {
+	SPLAY_ENTRY(uturn_page_entry) upe_node;
+	paddr_t	upe_pa;
+	vaddr_t	upe_va;
+	bus_addr_t upe_iova;
+};
+
+struct uturn_page_map {
+	SPLAY_HEAD(uturn_page_tree, uturn_page_entry) upm_tree;
+	int upm_maxpage;	/* Size of allocate

CVS commit: src/sys/arch/hp700/dev

2011-10-01 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sat Oct  1 15:51:36 UTC 2011

Modified Files:
src/sys/arch/hp700/dev: elroyreg.h

Log Message:
elroy regs don't need to be packed, makes this work with gcc 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/elroyreg.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/hp700/dev/elroyreg.h
diff -u src/sys/arch/hp700/dev/elroyreg.h:1.2 src/sys/arch/hp700/dev/elroyreg.h:1.3
--- src/sys/arch/hp700/dev/elroyreg.h:1.2	Thu Apr 30 07:01:26 2009
+++ src/sys/arch/hp700/dev/elroyreg.h	Sat Oct  1 15:51:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroyreg.h,v 1.2 2009/04/30 07:01:26 skrll Exp $	*/
+/*	$NetBSD: elroyreg.h,v 1.3 2011/10/01 15:51:36 chs Exp $	*/
 
 /*	$OpenBSD: elroyreg.h,v 1.1 2007/05/21 22:43:38 kettenis Exp $	*/
 
@@ -126,7 +126,7 @@ struct elroy_regs {
 	uint32_t	pad850;
 	uint64_t	res14[123];	/* 0x858 */
 	/*0x1000 */
-} __packed;
+};
 
 /* APIC registers */
 #define	APIC_VERSION	0x01



CVS commit: src/sys/arch/hp700/dev

2011-10-01 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sat Oct  1 15:51:17 UTC 2011

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
PDC_CHASSIS_INFO needs a third parameter, the size of the LCD structure.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.39 src/sys/arch/hp700/dev/pdc.c:1.40
--- src/sys/arch/hp700/dev/pdc.c:1.39	Sun Apr 24 16:26:55 2011
+++ src/sys/arch/hp700/dev/pdc.c	Sat Oct  1 15:51:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.39 2011/04/24 16:26:55 rmind Exp $	*/
+/*	$NetBSD: pdc.c,v 1.40 2011/10/01 15:51:17 chs Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.39 2011/04/24 16:26:55 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.40 2011/10/01 15:51:17 chs Exp $");
 
 #include 
 #include 
@@ -569,7 +569,7 @@ pdcproc_chassis_info(struct pdc_chassis_
 	int err;
 
 	err = pdc_call((iodcio_t)pdc, 0, PDC_CHASSIS, PDC_CHASSIS_INFO,
-	&pdcret1, &pdcret2);
+	&pdcret1, &pdcret2 , sizeof(*pcl));
 	if (err < 0)
 		return err;
 



CVS commit: src/sys/arch/hp700/dev

2011-03-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 19 06:48:10 UTC 2011

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.29 src/sys/arch/hp700/dev/dino.c:1.30
--- src/sys/arch/hp700/dev/dino.c:1.29	Tue Feb  1 18:33:24 2011
+++ src/sys/arch/hp700/dev/dino.c	Sat Mar 19 06:48:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.29 2011/02/01 18:33:24 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.30 2011/03/19 06:48:09 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.29 2011/02/01 18:33:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.30 2011/03/19 06:48:09 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -1668,7 +1668,6 @@
 	sc->sc_ih = hp700_intr_establish(IPL_NONE, NULL, &sc->sc_ir,
 	&ir_cpu, ca->ca_irq);
 
-
 	/* TODO establish the bus error interrupt */
 
 	ver = ca->ca_type.iodc_revision;



CVS commit: src/sys/arch/hp700/dev

2011-01-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 27 13:57:39 UTC 2011

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.9 src/sys/arch/hp700/dev/apic.c:1.10
--- src/sys/arch/hp700/dev/apic.c:1.9	Tue Jan  4 10:42:33 2011
+++ src/sys/arch/hp700/dev/apic.c	Thu Jan 27 13:57:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: apic.c,v 1.9 2011/01/04 10:42:33 skrll Exp $	*/
+/*	$NetBSD: apic.c,v 1.10 2011/01/27 13:57:39 skrll Exp $	*/
 
 /*	$OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -266,7 +266,7 @@
 	err = pdcproc_pci_inttblsz(&nentries);
 	if (err)
 		return;
-	
+
 	size = nentries * sizeof(struct pdc_pat_pci_rt);
 	sc->sc_int_tbl_sz = nentries;
 	sc->sc_int_tbl = malloc(size, M_DEVBUF, M_NOWAIT);
@@ -337,9 +337,9 @@
 	for (i = 0; i < sc->sc_int_tbl_sz; i++) {
 		printf("type=%x ", sc->sc_int_tbl[i].type);
 		printf("len=%d ", sc->sc_int_tbl[i].len);
-		printf("itype=%d ", sc->sc_int_tbl[i].itype);			
-		printf("trigger=%x ", sc->sc_int_tbl[i].trigger);		
-		printf("pin=%x ", sc->sc_int_tbl[i].pin);		
+		printf("itype=%d ", sc->sc_int_tbl[i].itype);
+		printf("trigger=%x ", sc->sc_int_tbl[i].trigger);
+		printf("pin=%x ", sc->sc_int_tbl[i].pin);
 		printf("bus=%d ", sc->sc_int_tbl[i].bus);
 		printf("line=%d ", sc->sc_int_tbl[i].line);
 		printf("addr=%llx\n", sc->sc_int_tbl[i].addr);



CVS commit: src/sys/arch/hp700/dev

2011-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 13 21:44:13 UTC 2011

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.14 src/sys/arch/hp700/dev/uturn.c:1.15
--- src/sys/arch/hp700/dev/uturn.c:1.14	Thu Jan 13 21:15:14 2011
+++ src/sys/arch/hp700/dev/uturn.c	Thu Jan 13 21:44:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.14 2011/01/13 21:15:14 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.15 2011/01/13 21:44:13 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -112,7 +112,7 @@
 
 int	uturnmatch(device_t, cfdata_t, void *);
 void	uturnattach(device_t, device_t, void *);
-static device_t uturn_callback(device_t self, struct confargs *ca);
+static device_t uturn_callback(device_t, struct confargs *);
 
 CFATTACH_DECL_NEW(uturn, sizeof(struct uturn_softc),
 uturnmatch, uturnattach, NULL, NULL);



CVS commit: src/sys/arch/hp700/dev

2010-12-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Dec 24 15:29:09 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: lcd.c

Log Message:
Unwrap/reformat long lines.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/lcd.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/hp700/dev/lcd.c
diff -u src/sys/arch/hp700/dev/lcd.c:1.2 src/sys/arch/hp700/dev/lcd.c:1.3
--- src/sys/arch/hp700/dev/lcd.c:1.2	Mon Dec  6 10:24:04 2010
+++ src/sys/arch/hp700/dev/lcd.c	Fri Dec 24 15:29:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lcd.c,v 1.2 2010/12/06 10:24:04 skrll Exp $	*/
+/*	$NetBSD: lcd.c,v 1.3 2010/12/24 15:29:08 skrll Exp $	*/
 /*	OpenBSD: lcd.c,v 1.2 2007/07/20 22:13:45 kettenis Exp 	*/
 
 /*
@@ -78,14 +78,13 @@
 	sc->sc_dv = self;
 	sc->sc_iot = ca->ca_iot;
 
-	if (bus_space_map(sc->sc_iot, pdc_lcd->cmd_addr,
-		1, 0, &sc->sc_cmdh)) {
+	if (bus_space_map(sc->sc_iot, pdc_lcd->cmd_addr, 1, 0, &sc->sc_cmdh)) {
 		aprint_error(": can't map cmd register\n");
 		return;
 	}
 
-	if (bus_space_map(sc->sc_iot, pdc_lcd->data_addr,
-		1, 0, &sc->sc_datah)) {
+	if (bus_space_map(sc->sc_iot, pdc_lcd->data_addr, 1, 0,
+	&sc->sc_datah)) {
 		aprint_error(": can't map data register\n");
 		bus_space_unmap(sc->sc_iot, sc->sc_cmdh, 1);
 		return;



CVS commit: src/sys/arch/hp700/dev

2010-12-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec  8 09:48:28 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Update hp700_intr_establish call. Missed in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.15 src/sys/arch/hp700/dev/cpu.c:1.16
--- src/sys/arch/hp700/dev/cpu.c:1.15	Sun Jun  6 12:13:35 2010
+++ src/sys/arch/hp700/dev/cpu.c	Wed Dec  8 09:48:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.15 2010/06/06 12:13:35 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.16 2010/12/08 09:48:27 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.28 2004/12/28 05:18:25 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.15 2010/06/06 12:13:35 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.16 2010/12/08 09:48:27 skrll Exp $");
 
 #include 
 #include 
@@ -152,9 +152,8 @@
 
 	/* sanity against luser amongst config editors */
 	if (ca->ca_irq == 31) {
-		sc->sc_ih = hp700_intr_establish(sc->sc_dev, IPL_CLOCK,
-		clock_intr, NULL /*clockframe*/, &int_reg_cpu,
-		ca->ca_irq);
+		sc->sc_ih = hp700_intr_establish(IPL_CLOCK, clock_intr,
+		NULL /*clockframe*/, &int_reg_cpu, ca->ca_irq);
 	} else {
 		aprint_error_dev(self, "bad irq number %d\n", ca->ca_irq);
 	}



CVS commit: src/sys/arch/hp700/dev

2010-12-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec  6 10:24:05 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: lcd.c

Log Message:
s/cannot/can't/ for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp700/dev/lcd.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/hp700/dev/lcd.c
diff -u src/sys/arch/hp700/dev/lcd.c:1.1 src/sys/arch/hp700/dev/lcd.c:1.2
--- src/sys/arch/hp700/dev/lcd.c:1.1	Tue Jun  1 10:20:29 2010
+++ src/sys/arch/hp700/dev/lcd.c	Mon Dec  6 10:24:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lcd.c,v 1.1 2010/06/01 10:20:29 skrll Exp $	*/
+/*	$NetBSD: lcd.c,v 1.2 2010/12/06 10:24:04 skrll Exp $	*/
 /*	OpenBSD: lcd.c,v 1.2 2007/07/20 22:13:45 kettenis Exp 	*/
 
 /*
@@ -80,13 +80,13 @@
 
 	if (bus_space_map(sc->sc_iot, pdc_lcd->cmd_addr,
 		1, 0, &sc->sc_cmdh)) {
-		aprint_error(": cannot map cmd register\n");
+		aprint_error(": can't map cmd register\n");
 		return;
 	}
 
 	if (bus_space_map(sc->sc_iot, pdc_lcd->data_addr,
 		1, 0, &sc->sc_datah)) {
-		aprint_error(": cannot map data register\n");
+		aprint_error(": can't map data register\n");
 		bus_space_unmap(sc->sc_iot, sc->sc_cmdh, 1);
 		return;
 	}



CVS commit: src/sys/arch/hp700/dev

2010-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Nov  8 23:10:24 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: dino.c elroy.c

Log Message:
Fix the count usage of various bus_space methods that take a count.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hp700/dev/dino.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp700/dev/elroy.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.25 src/sys/arch/hp700/dev/dino.c:1.26
--- src/sys/arch/hp700/dev/dino.c:1.25	Sat Mar  6 16:57:00 2010
+++ src/sys/arch/hp700/dev/dino.c	Mon Nov  8 23:10:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.25 2010/03/06 16:57:00 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.26 2010/11/08 23:10:24 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.25 2010/03/06 16:57:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.26 2010/11/08 23:10:24 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -955,7 +955,6 @@
 			p++;
 	}
 
-	c /= 2;
 	while (c--)
 		*a++ = *p;
 }
@@ -977,7 +976,6 @@
 		p = (volatile uint32_t *)&r->pci_io_data;
 	}
 
-	c /= 4;
 	while (c--)
 		*a++ = *p;
 }
@@ -1008,7 +1006,6 @@
 			p++;
 	}
 
-	c /= 2;
 	while (c--)
 		*p = *a++;
 }
@@ -1030,7 +1027,6 @@
 		p = (volatile uint32_t *)&r->pci_io_data;
 	}
 
-	c /= 4;
 	while (c--)
 		*p = *a++;
 }
@@ -1206,7 +1202,6 @@
 {
 	volatile uint16_t *p;
 
-	c /= 2;
 	h += o;
 	if (h & HPPA_IOSPACE) {
 		p = (volatile uint16_t *)h;
@@ -1232,7 +1227,6 @@
 {
 	volatile uint32_t *p;
 
-	c /= 4;
 	h += o;
 	if (h & HPPA_IOSPACE) {
 		p = (volatile uint32_t *)h;
@@ -1262,7 +1256,6 @@
 {
 	volatile uint16_t *p;
 
-	c /= 2;
 	h += o;
 	if (h & HPPA_IOSPACE) {
 		p = (volatile uint16_t *)h;

Index: src/sys/arch/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.9 src/sys/arch/hp700/dev/elroy.c:1.10
--- src/sys/arch/hp700/dev/elroy.c:1.9	Sat Apr  3 08:01:42 2010
+++ src/sys/arch/hp700/dev/elroy.c	Mon Nov  8 23:10:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.9 2010/04/03 08:01:42 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.10 2010/11/08 23:10:24 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -706,7 +706,6 @@
 
 	h += o;
 	p = (volatile uint16_t *)h;
-	c /= 2;
 	while (c--)
 		*q++ = *p;
 }
@@ -719,7 +718,6 @@
 
 	h += o;
 	p = (volatile uint32_t *)h;
-	c /= 4;
 	while (c--)
 		*q++ = *p;
 }
@@ -732,7 +730,6 @@
 
 	h += o;
 	p = (volatile uint64_t *)h;
-	c /= 8;
 	while (c--)
 		*q++ = *p;
 }
@@ -746,7 +743,6 @@
 
 	h += o;
 	p = (volatile uint16_t *)h;
-	c /= 2;
 	while (c--)
 		*p = *q++;
 }
@@ -760,7 +756,6 @@
 
 	h += o;
 	p = (volatile uint32_t *)h;
-	c /= 4;
 	while (c--)
 		*p = *q++;
 }
@@ -774,7 +769,6 @@
 
 	h += o;
 	p = (volatile uint64_t *)h;
-	c /= 8;
 	while (c--)
 		*p = *q++;
 }
@@ -885,7 +879,6 @@
 {
 	volatile uint16_t *p, *q = a;
 
-	c /= 2;
 	h += o;
 	p = (volatile uint16_t *)h;
 	while (c--)
@@ -898,7 +891,6 @@
 {
 	volatile uint32_t *p, *q = a;
 
-	c /= 4;
 	h += o;
 	p = (volatile uint32_t *)h;
 	while (c--)
@@ -911,7 +903,6 @@
 {
 	volatile uint64_t *p, *q = a;
 
-	c /= 8;
 	h += o;
 	p = (volatile uint64_t *)h;
 	while (c--)
@@ -925,7 +916,6 @@
 	volatile uint16_t *p;
 	const uint16_t *q = a;
 
-	c /= 2;
 	h += o;
 	p = (volatile uint16_t *)h;
 	while (c--)
@@ -939,7 +929,6 @@
 	volatile uint32_t *p;
 	const uint32_t *q = a;
 
-	c /= 4;
 	h += o;
 	p = (volatile uint32_t *)h;
 	while (c--)
@@ -953,7 +942,6 @@
 	volatile uint64_t *p;
 	const uint64_t *q = a;
 
-	c /= 8;
 	h += o;
 	p = (volatile uint64_t *)h;
 	while (c--)



CVS commit: src/sys/arch/hp700/dev

2010-06-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jun 21 11:04:28 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Remove some debug code.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.10 src/sys/arch/hp700/dev/uturn.c:1.11
--- src/sys/arch/hp700/dev/uturn.c:1.10	Mon Jun 21 09:06:03 2010
+++ src/sys/arch/hp700/dev/uturn.c	Mon Jun 21 11:04:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.10 2010/06/21 09:06:03 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.11 2010/06/21 11:04:27 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -267,7 +267,6 @@
 	struct uturn_softc *sc = v;
 	int err;
 	int i;
-	int d = 0;
 
 	DPRINTF(("%s: map %p addr %p size %lx proc %p flags %x\n", __func__,
 	map, addr, size, p, flags));
@@ -279,12 +278,7 @@
 	for (i = 0; i < map->dm_nsegs; i++) {
 		DPRINTF(("%s: seg %2d ds_addr %lx _ds_va %lx\n", __func__, i,
 		map->dm_segs[i].ds_addr, map->dm_segs[i]._ds_va)); 
-		if (map->dm_segs[i].ds_addr != map->dm_segs[i]._ds_va)
-			d = 1;
 	}
-	DPRINTF(("%s:\n", __func__));
-	if (uturndebug && d)
-		Debugger();
 
 	return err;
 }



CVS commit: src/sys/arch/hp700/dev

2010-06-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jun 21 09:06:03 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Don't define UTURNDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.9 src/sys/arch/hp700/dev/uturn.c:1.10
--- src/sys/arch/hp700/dev/uturn.c:1.9	Mon Jun 21 07:09:59 2010
+++ src/sys/arch/hp700/dev/uturn.c	Mon Jun 21 09:06:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.9 2010/06/21 07:09:59 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.10 2010/06/21 09:06:03 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -46,7 +46,6 @@
 
 #include 
 
-#define	UTURNDEBUG
 #ifdef UTURNDEBUG
 
 #define	DPRINTF(s)	do {	\



CVS commit: src/sys/arch/hp700/dev

2010-06-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jun 21 07:09:59 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Fixup uturn DMA for real mode. That is, use uncacheable directly mapped
pages.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.8 src/sys/arch/hp700/dev/uturn.c:1.9
--- src/sys/arch/hp700/dev/uturn.c:1.8	Fri Jun 18 06:30:53 2010
+++ src/sys/arch/hp700/dev/uturn.c	Mon Jun 21 07:09:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.8 2010/06/18 06:30:53 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.9 2010/06/21 07:09:59 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -34,7 +34,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
+#include 
+
+#include 
 #include 
 #include 
 
@@ -99,7 +105,10 @@
 struct uturn_softc {
 	device_t sc_dv;
 
+	bus_dma_tag_t sc_dmat;
 	struct uturn_regs volatile *sc_regs;
+
+	struct hppa_bus_dma_tag sc_dmatag;
 };
 
 int	uturnmatch(device_t, cfdata_t, void *);
@@ -111,6 +120,35 @@
 
 extern struct cfdriver uturn_cd;
 
+int uturn_dmamap_create(void *, bus_size_t, int, bus_size_t, bus_size_t, int,
+bus_dmamap_t *);
+void uturn_dmamap_destroy(void *, bus_dmamap_t);
+int uturn_dmamap_load(void *, bus_dmamap_t, void *, bus_size_t, struct proc *,
+int);
+int uturn_dmamap_load_mbuf(void *, bus_dmamap_t, struct mbuf *, int);
+int uturn_dmamap_load_uio(void *, bus_dmamap_t, struct uio *, int);
+int uturn_dmamap_load_raw(void *, bus_dmamap_t, bus_dma_segment_t *, int,
+bus_size_t, int);
+void uturn_dmamap_unload(void *, bus_dmamap_t);
+void uturn_dmamap_sync(void *, bus_dmamap_t, bus_addr_t, bus_size_t, int);
+int uturn_dmamem_alloc(void *, bus_size_t, bus_size_t, bus_size_t,
+bus_dma_segment_t *, int, int *, int);
+void uturn_dmamem_free(void *, bus_dma_segment_t *, int);
+int uturn_dmamem_map(void *, bus_dma_segment_t *, int, size_t, void **, int);
+void uturn_dmamem_unmap(void *, void *, size_t);
+paddr_t uturn_dmamem_mmap(void *, bus_dma_segment_t *, int, off_t, int, int);
+
+const struct hppa_bus_dma_tag uturn_dmat = {
+	NULL,
+	uturn_dmamap_create, uturn_dmamap_destroy,
+	uturn_dmamap_load, uturn_dmamap_load_mbuf,
+	uturn_dmamap_load_uio, uturn_dmamap_load_raw,
+	uturn_dmamap_unload, uturn_dmamap_sync,
+
+	uturn_dmamem_alloc, uturn_dmamem_free, uturn_dmamem_map,
+	uturn_dmamem_unmap, uturn_dmamem_mmap
+};
+
 int
 uturnmatch(device_t parent, cfdata_t cf, void *aux)
 {
@@ -134,6 +172,7 @@
 	struct confargs *ca = aux, nca;
 	struct uturn_softc *sc = device_private(self);
 	bus_space_handle_t ioh;
+	volatile struct uturn_regs *r;
 
 	if (bus_space_map(ca->ca_iot, ca->ca_hpa, IOMOD_HPASIZE, 0, &ioh)) {
 		aprint_error(": can't map IO space\n");
@@ -141,13 +180,20 @@
 	}
 
 	sc->sc_dv = self;
-	sc->sc_regs = (struct uturn_regs *)ca->ca_hpa;
+	sc->sc_dmat = ca->ca_dmatag;
+	sc->sc_regs = r = bus_space_vaddr(ca->ca_iot, ioh);
+
+	aprint_normal(": %x-%x", r->io_io_low << 16, r->io_io_high << 16);
+	aprint_normal(": %x-%x", r->io_io_low_hv << 16, r->io_io_high_hv << 16);
 
 	aprint_normal(": %s rev %d\n",
 	ca->ca_type.iodc_revision < 0x10 ? "U2" : "UTurn",
 	ca->ca_type.iodc_revision & 0xf);
 
-	((struct iomod *)ioh)->io_control = UTURN_REAL_MODE;
+	r->io_control = UTURN_REAL_MODE;
+
+	sc->sc_dmatag = uturn_dmat;
+	sc->sc_dmatag._cookie = sc;
 
 	/*
 	 * U2/UTurn is actually a combination of an Upper Bus Converter (UBC)
@@ -157,6 +203,7 @@
 	 */
 	nca = *ca;
 	nca.ca_hpabase = 0;
+	nca.ca_dmatag = &sc->sc_dmatag;
 	nca.ca_nmodules = MAXMODBUS - 1;
 	pdc_scanbus(self, &nca, uturn_callback);
 
@@ -172,7 +219,7 @@
 
 	case HPPA_BOARD_HP800D:
 	case HPPA_BOARD_HP821:
-		nca.ca_hpabase = ((struct iomod *)ioh)->io_io_low << 16;
+		nca.ca_hpabase = r->io_io_low << 16;
 		pdc_scanbus(self, &nca, uturn_callback);
 		break;
 	default:
@@ -186,3 +233,223 @@
 
 	config_found_sm_loc(self, "gedoens", NULL, ca, mbprint, mbsubmatch);
 }
+
+
+int
+uturn_dmamap_create(void *v, bus_size_t size, int nsegments, 
+bus_size_t maxsegsz, bus_size_t boundary, int flags, bus_dmamap_t *dmamap)
+{
+	struct uturn_softc *sc = v;
+	int err;
+
+	DPRINTF(("%s: size %lx nsegs %d maxsegsz %lx boundary %lx flags %x\n",
+ 	__func__, size, nsegments, maxsegsz, boundary, flags));
+	err = bus_dmamap_create(sc->sc_dmat, size, nsegments, maxsegsz,
+	boundary, flags, dmamap);
+
+	return err;
+}
+
+void
+uturn_dmamap_destroy(void *v, bus_dmamap_t map)
+{
+	struct uturn_softc *sc = v;
+
+	DPRINTF(("%s: map %p\n", __func__, map));
+
+	bus_dmamap_destroy(sc->sc_dmat, map);
+}
+
+
+int
+uturn_dmamap_load(void *v, bus_dmamap_t map, void *addr, bus_size_t size,
+struct proc *p, int flags)
+{
+	struct uturn_softc *sc = v;
+	int err;
+	int i;
+	int d 

CVS commit: src/sys/arch/hp700/dev

2010-06-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jun 18 06:30:54 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Flesh out uturn_regs.  Replace magic constant with a define.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.7 src/sys/arch/hp700/dev/uturn.c:1.8
--- src/sys/arch/hp700/dev/uturn.c:1.7	Fri Jun 18 06:15:31 2010
+++ src/sys/arch/hp700/dev/uturn.c	Fri Jun 18 06:30:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.7 2010/06/18 06:15:31 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.8 2010/06/18 06:30:53 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -40,11 +40,60 @@
 
 #include 
 
+#define	UTURNDEBUG
+#ifdef UTURNDEBUG
+
+#define	DPRINTF(s)	do {	\
+	if (uturndebug)		\
+		printf s;	\
+} while(0)
+
+int uturndebug = 0;
+#else
+#define	DPRINTF(s)	/* */
+#endif
+
 struct uturn_regs {
-	uint64_t	resv0[2];
-	uint64_t	status;		/* 0x10: */
-	uint64_t	resv1[5];
-	uint64_t	debug;		/* 0x40: */
+	/* Runway Supervisory Set */
+	int32_t		unused1[12];
+	uint32_t	io_command;		/* Offset 12 */
+#define	UTURN_CMD_TLB_PURGE		33	/* Purge I/O TLB entry */
+#define	UTURN_CMD_TLB_DIRECT_WRITE	35	/* I/O TLB Writes */
+
+	uint32_t	io_status;		/* Offset 13 */
+	uint32_t	io_control;		/* Offset 14 */
+#define	UTURN_IOCTRL_TLB_REAL		0x
+#define	UTURN_IOCTRL_TLB_ERROR		0x0001
+#define	UTURN_IOCTRL_TLB_NORMAL		0x0002
+
+#define	UTURN_IOCTRL_MODE_OFF		0x
+#define	UTURN_IOCTRL_MODE_INCLUDE	0x0080
+#define	UTURN_IOCTRL_MODE_PEEK		0x0180
+
+#define	UTURN_VIRTUAL_MODE	\
+	(UTURN_IOCTRL_TLB_NORMAL | UTURN_IOCTRL_MODE_INCLUDE)
+
+#define	UTURN_REAL_MODE		\
+	UTURN_IOCTRL_MODE_INCLUDE
+
+	int32_t		unused2[1];
+
+	/* Runway Auxiliary Register Set */
+	uint32_t	io_err_resp;		/* Offset  0 */
+	uint32_t	io_err_info;		/* Offset  1 */
+	uint32_t	io_err_req;		/* Offset  2 */
+	uint32_t	io_err_resp_hi;		/* Offset  3 */
+	uint32_t	io_tlb_entry_m;		/* Offset  4 */
+	uint32_t	io_tlb_entry_l;		/* Offset  5 */
+	uint32_t	unused3[1];
+	uint32_t	io_pdir_base;		/* Offset  7 */
+	uint32_t	io_io_low_hv;		/* Offset  8 */
+	uint32_t	io_io_high_hv;		/* Offset  9 */
+	uint32_t	unused4[1];
+	uint32_t	io_chain_id_mask;	/* Offset 11 */
+	uint32_t	unused5[2];
+	uint32_t	io_io_low;		/* Offset 14 */
+	uint32_t	io_io_high;		/* Offset 15 */
 };
 
 struct uturn_softc {
@@ -98,8 +147,7 @@
 	ca->ca_type.iodc_revision < 0x10 ? "U2" : "UTurn",
 	ca->ca_type.iodc_revision & 0xf);
 
-	/* keep it real */
-	((struct iomod *)ioh)->io_control = 0x80;
+	((struct iomod *)ioh)->io_control = UTURN_REAL_MODE;
 
 	/*
 	 * U2/UTurn is actually a combination of an Upper Bus Converter (UBC)



CVS commit: src/sys/arch/hp700/dev

2010-06-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jun 18 06:15:31 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
White space.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.6 src/sys/arch/hp700/dev/uturn.c:1.7
--- src/sys/arch/hp700/dev/uturn.c:1.6	Sun Nov 15 15:53:05 2009
+++ src/sys/arch/hp700/dev/uturn.c	Fri Jun 18 06:15:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.6 2009/11/15 15:53:05 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.7 2010/06/18 06:15:31 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -95,7 +95,7 @@
 	sc->sc_regs = (struct uturn_regs *)ca->ca_hpa;
 
 	aprint_normal(": %s rev %d\n",
-	ca->ca_type.iodc_revision < 0x10? "U2" : "UTurn",
+	ca->ca_type.iodc_revision < 0x10 ? "U2" : "UTurn",
 	ca->ca_type.iodc_revision & 0xf);
 
 	/* keep it real */



CVS commit: src/sys/arch/hp700/dev

2010-06-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jun  3 22:34:26 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: mem.c

Log Message:
Add a comment and check off in ap.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hp700/dev/mem.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/hp700/dev/mem.c
diff -u src/sys/arch/hp700/dev/mem.c:1.24 src/sys/arch/hp700/dev/mem.c:1.25
--- src/sys/arch/hp700/dev/mem.c:1.24	Wed Apr 28 06:06:11 2010
+++ src/sys/arch/hp700/dev/mem.c	Thu Jun  3 22:34:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.24 2010/04/28 06:06:11 skrll Exp $	*/
+/*	$NetBSD: mem.c,v 1.25 2010/06/03 22:34:26 skrll Exp $	*/
 
 /*	$OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $	*/
 /*
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.24 2010/04/28 06:06:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.25 2010/06/03 22:34:26 skrll Exp $");
 
 #include 
 #include 
@@ -400,16 +400,23 @@
 ap(dev_t dev, off_t off, int prot)
 {
 
+/*
+ * /dev/mem is the only one that makes sense through this
+ * interface.  For /dev/kmem any physaddr we return here
+ * could be transient and hence incorrect or invalid at
+ * a later time.  /dev/null just doesn't make any sense
+ * and /dev/zero is a hack that is handled via the default
+ * pager in mmap().
+ */
+
 	if (minor(dev) != DEV_MEM)
 		return -1;
 
 	/*
 	 * Allow access only in RAM.
 	 */
-#if 0
-	if (off < ptoa(firstusablepage) ||
-	off >= ptoa(lastusablepage + 1))
+	if (off > ptoa(physmem))
 		return -1;
-#endif
+
 	return btop(off);
 }



CVS commit: src/sys/arch/hp700/dev

2010-04-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 28 06:06:11 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: mem.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp700/dev/mem.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/hp700/dev/mem.c
diff -u src/sys/arch/hp700/dev/mem.c:1.23 src/sys/arch/hp700/dev/mem.c:1.24
--- src/sys/arch/hp700/dev/mem.c:1.23	Wed Apr 28 06:02:20 2010
+++ src/sys/arch/hp700/dev/mem.c	Wed Apr 28 06:06:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.23 2010/04/28 06:02:20 skrll Exp $	*/
+/*	$NetBSD: mem.c,v 1.24 2010/04/28 06:06:11 skrll Exp $	*/
 
 /*	$OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $	*/
 /*
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.23 2010/04/28 06:02:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.24 2010/04/28 06:06:11 skrll Exp $");
 
 #include 
 #include 
@@ -368,13 +368,13 @@
 		case DEV_NULL:/*  /dev/null  */
 			if (uio->uio_rw == UIO_WRITE)
 uio->uio_resid = 0;
-			return (0);
+			return 0;
 
 		case DEV_ZERO:			/*  /dev/zero  */
 			/* Write to /dev/zero is ignored. */
 			if (uio->uio_rw == UIO_WRITE) {
 uio->uio_resid = 0;
-return (0);
+return 0;
 			}
 			/*
 			 * On the first call, allocate and zero a page
@@ -390,10 +390,10 @@
 			break;
 
 		default:
-			return (ENXIO);
+			return ENXIO;
 		}
 	}
-	return (error);
+	return error;
 }
 
 paddr_t
@@ -401,7 +401,7 @@
 {
 
 	if (minor(dev) != DEV_MEM)
-		return (-1);
+		return -1;
 
 	/*
 	 * Allow access only in RAM.
@@ -409,7 +409,7 @@
 #if 0
 	if (off < ptoa(firstusablepage) ||
 	off >= ptoa(lastusablepage + 1))
-		return (-1);
+		return -1;
 #endif
-	return (btop(off));
+	return btop(off);
 }



CVS commit: src/sys/arch/hp700/dev

2010-04-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 28 06:02:20 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: mem.c

Log Message:
Use DEV_MEM instead of magic constant.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hp700/dev/mem.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/hp700/dev/mem.c
diff -u src/sys/arch/hp700/dev/mem.c:1.22 src/sys/arch/hp700/dev/mem.c:1.23
--- src/sys/arch/hp700/dev/mem.c:1.22	Wed Feb 10 20:32:02 2010
+++ src/sys/arch/hp700/dev/mem.c	Wed Apr 28 06:02:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.22 2010/02/10 20:32:02 skrll Exp $	*/
+/*	$NetBSD: mem.c,v 1.23 2010/04/28 06:02:20 skrll Exp $	*/
 
 /*	$OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $	*/
 /*
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.22 2010/02/10 20:32:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.23 2010/04/28 06:02:20 skrll Exp $");
 
 #include 
 #include 
@@ -400,7 +400,7 @@
 ap(dev_t dev, off_t off, int prot)
 {
 
-	if (minor(dev) != 0)
+	if (minor(dev) != DEV_MEM)
 		return (-1);
 
 	/*



CVS commit: src/sys/arch/hp700/dev

2010-04-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 24 10:41:22 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
Only post EOI once for shared interrupts.  From Mark Kettenis.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.6 src/sys/arch/hp700/dev/apic.c:1.7
--- src/sys/arch/hp700/dev/apic.c:1.6	Tue Jan  5 13:20:29 2010
+++ src/sys/arch/hp700/dev/apic.c	Sat Apr 24 10:41:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: apic.c,v 1.6 2010/01/05 13:20:29 mbalmer Exp $	*/
+/*	$NetBSD: apic.c,v 1.7 2010/04/24 10:41:21 skrll Exp $	*/
 
 /*	$OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -235,19 +235,19 @@
 	struct apic_iv *iv = v;
 	struct elroy_softc *sc = iv->sc;
 	volatile struct elroy_regs *r = sc->sc_regs;
+	uint32_t irq = APIC_INT_IRQ(iv->ih);
 	int claimed = 0;
 
 	while (iv) {
 		if (iv->handler(iv->arg)) {
 			if (iv->cnt)
 iv->cnt->ev_count++;
-			/* Signal EOI. */
-			elroy_write32(&r->apic_eoi,
-			htole32((31 - APIC_INT_IRQ(iv->ih)) & APIC_ENT0_VEC));
 			claimed = 1;
 		}
 		iv = iv->next;
 	}
+	/* Signal EOI. */
+	elroy_write32(&r->apic_eoi, htole32((31 - irq) & APIC_ENT0_VEC));
 
 	return (claimed);
 }



CVS commit: src/sys/arch/hp700/dev

2010-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  3 08:01:42 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: elroy.c

Log Message:
Wrap long line.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp700/dev/elroy.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/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.8 src/sys/arch/hp700/dev/elroy.c:1.9
--- src/sys/arch/hp700/dev/elroy.c:1.8	Thu Jul 23 13:34:26 2009
+++ src/sys/arch/hp700/dev/elroy.c	Sat Apr  3 08:01:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.8 2009/07/23 13:34:26 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.9 2010/04/03 08:01:42 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -1275,7 +1275,8 @@
 		break;
 	}
 
-	aprint_normal(": %s TR%d.%d%s", p, sc->sc_ver >> 4, sc->sc_ver & 0xf, q);
+	aprint_normal(": %s TR%d.%d%s", p, sc->sc_ver >> 4, sc->sc_ver & 0xf,
+	q);
 	apic_attach(sc);
 	aprint_normal("\n");
 



CVS commit: src/sys/arch/hp700/dev

2010-03-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar 30 07:58:02 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Correct comment.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.13 src/sys/arch/hp700/dev/cpu.c:1.14
--- src/sys/arch/hp700/dev/cpu.c:1.13	Fri May  8 09:33:57 2009
+++ src/sys/arch/hp700/dev/cpu.c	Tue Mar 30 07:58:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.13 2009/05/08 09:33:57 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.14 2010/03/30 07:58:02 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.28 2004/12/28 05:18:25 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.13 2009/05/08 09:33:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2010/03/30 07:58:02 skrll Exp $");
 
 #include 
 #include 
@@ -149,7 +149,7 @@
 	/* sanity against luser amongst config editors */
 	if (ca->ca_irq == 31) {
 		sc->sc_ih = hp700_intr_establish(sc->sc_dev, IPL_CLOCK,
-		clock_intr, NULL /*trapframe*/, &int_reg_cpu,
+		clock_intr, NULL /*clockframe*/, &int_reg_cpu,
 		ca->ca_irq);
 	} else {
 		aprint_error_dev(self, "bad irq number %d\n", ca->ca_irq);



CVS commit: src/sys/arch/hp700/dev

2010-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 10 20:45:35 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
Use Debugger instead of hand crafted asm.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.35 src/sys/arch/hp700/dev/pdc.c:1.36
--- src/sys/arch/hp700/dev/pdc.c:1.35	Wed Feb 10 20:44:14 2010
+++ src/sys/arch/hp700/dev/pdc.c	Wed Feb 10 20:45:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.35 2010/02/10 20:44:14 skrll Exp $	*/
+/*	$NetBSD: pdc.c,v 1.36 2010/02/10 20:45:35 skrll Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.35 2010/02/10 20:44:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.36 2010/02/10 20:45:35 skrll Exp $");
 
 #include 
 #include 
@@ -428,8 +428,7 @@
 
 	if (err < 0) {
 #if defined(DDB) || defined(KGDB)
-		__asm volatile ("break%0, %1"
-			:: "i" (HPPA_BREAK_KERNEL), "i" (HPPA_BREAK_KGDB));
+		Debugger();
 #endif /* DDB || KGDB */
 		delay(25);
 #if 0



CVS commit: src/sys/arch/hp700/dev

2010-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 10 20:44:14 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
G/C CONADDR


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.34 src/sys/arch/hp700/dev/pdc.c:1.35
--- src/sys/arch/hp700/dev/pdc.c:1.34	Sat Dec 12 14:44:10 2009
+++ src/sys/arch/hp700/dev/pdc.c	Wed Feb 10 20:44:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.34 2009/12/12 14:44:10 tsutsui Exp $	*/
+/*	$NetBSD: pdc.c,v 1.35 2010/02/10 20:44:14 skrll Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.34 2009/12/12 14:44:10 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.35 2010/02/10 20:44:14 skrll Exp $");
 
 #include 
 #include 
@@ -61,7 +61,6 @@
 char pdc_consbuf[IODC_MINIOSIZ] PDC_ALIGNMENT;
 iodcio_t pdc_cniodc, pdc_kbdiodc;
 pz_device_t *pz_kbd, *pz_cons;
-int CONADDR;
 
 int pdcmatch(device_t, cfdata_t, void *);
 void pdcattach(device_t, device_t, void *);
@@ -135,7 +134,6 @@
 
 	/* XXX make pdc current console */
 	cn_tab = &constab[0];
-	/* TODO: detect that we are on cereal, and set CONADDR */
 
 	cn_init_magic(&pdc_cnm_state);
 	cn_set_magic("+");



CVS commit: src/sys/arch/hp700/dev

2010-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 10 20:39:04 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Replace a magic constant with a define.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.22 src/sys/arch/hp700/dev/dino.c:1.23
--- src/sys/arch/hp700/dev/dino.c:1.22	Sun Jan 17 08:29:00 2010
+++ src/sys/arch/hp700/dev/dino.c	Wed Feb 10 20:39:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.22 2010/01/17 08:29:00 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.23 2010/02/10 20:39:04 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.22 2010/01/17 08:29:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.23 2010/02/10 20:39:04 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -544,8 +544,8 @@
 	/* Find used PCI MEM and narrow allocateble region down to it. */
 	for (i = 1; i < 31; i++)
 		if ((reg & 1 << i) != 0) {
-			rstart = 0xf000 | i << 23;
-			rend = (0xf000 | (i + 1) << 23) - 1;
+			rstart = HPPA_IOSPACE | i << 23;
+			rend = (HPPA_IOSPACE | (i + 1) << 23) - 1;
 			break;
 		}
 	if ((error = bus_space_alloc(sc->sc_bt, rstart, rend, size, align,
@@ -561,7 +561,7 @@
 	struct dino_softc *sc = v;
 	volatile struct dino_regs *r = sc->sc_regs;
 
-	if (bsh & 0xf000) {
+	if (bsh & HPPA_IOSPACE) {
 		bus_space_unmap(sc->sc_bt, bsh, size);
 		if (--sc->sc_memrefcount[((bsh >> 23) & 0x1f)] == 0)
 			/* Unmap the upper PCI MEM space. */
@@ -605,7 +605,7 @@
 dino_r1(void *v, bus_space_handle_t h, bus_size_t o)
 {
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		return *(volatile uint8_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -622,7 +622,7 @@
 	volatile uint16_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint16_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -642,7 +642,7 @@
 	uint32_t data;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		data = *(volatile uint32_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -661,7 +661,7 @@
 	uint64_t data;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		data = *(volatile uint64_t *)h;
 	else
 		panic("dino_r8: not implemented");
@@ -673,7 +673,7 @@
 dino_w1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t vv)
 {
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		*(volatile uint8_t *)h = vv;
 	else {
 		struct dino_softc *sc = v;
@@ -690,7 +690,7 @@
 	volatile uint16_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint16_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -710,7 +710,7 @@
 {
 	h += o;
 	vv = htole32(vv);
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		*(volatile uint32_t *)h = vv;
 	else {
 		struct dino_softc *sc = v;
@@ -725,7 +725,7 @@
 dino_w8(void *v, bus_space_handle_t h, bus_size_t o, uint64_t vv)
 {
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		*(volatile uint64_t *)h = htole64(vv);
 	else
 		panic("dino_w8: not implemented");
@@ -738,7 +738,7 @@
 	volatile uint8_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint8_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -758,7 +758,7 @@
 	volatile uint16_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint16_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -780,7 +780,7 @@
 	volatile uint32_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint32_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -806,7 +806,7 @@
 	volatile uint8_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint8_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -826,7 +826,7 @@
 	volatile uint16_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint16_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -848,7 +848,7 @@
 	volatile uint32_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint32_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -874,7 +874,7 @@
 	volatile uint8_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint8_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -894,7 +894,7 @@
 	volatile uint16_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint16_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -916,7 +916,7 @@
 	volatile uint32_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint32_t *)h;
 	else {
 		struct dino_softc *sc = v;
@@ -943,7 +943,7 @@
 	volatile uint16_t *p;
 
 	h += o;
-	if (h & 0xf000)
+	if (h & HPPA_IOSPACE)
 		p = (volatile uint16_t *)h;
 	else {
 		struct dino_softc *sc = 

CVS commit: src/sys/arch/hp700/dev

2010-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 10 20:33:27 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: wax.c

Log Message:
Don't panic if bus_space_map fails. Just report the error and return.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp700/dev/wax.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/hp700/dev/wax.c
diff -u src/sys/arch/hp700/dev/wax.c:1.14 src/sys/arch/hp700/dev/wax.c:1.15
--- src/sys/arch/hp700/dev/wax.c:1.14	Tue Nov  3 05:07:25 2009
+++ src/sys/arch/hp700/dev/wax.c	Wed Feb 10 20:33:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: wax.c,v 1.14 2009/11/03 05:07:25 snj Exp $	*/
+/*	$NetBSD: wax.c,v 1.15 2010/02/10 20:33:27 skrll Exp $	*/
 
 /*	$OpenBSD: wax.c,v 1.1 1998/11/23 03:04:10 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.14 2009/11/03 05:07:25 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.15 2010/02/10 20:33:27 skrll Exp $");
 
 #include 
 #include 
@@ -132,8 +132,10 @@
 	 * Map the WAX interrupt registers.
 	 */
 	if (bus_space_map(ca->ca_iot, ca->ca_hpa, sizeof(struct wax_regs),
-	0, &ioh))
-		panic("waxattach: can't map interrupt registers");
+	0, &ioh)) {
+		aprint_error(": can't map interrupt registers\n");
+		return;
+	}
 	sc->sc_regs = (struct wax_regs *)ca->ca_hpa;
 
 	/* interrupts guts */



CVS commit: src/sys/arch/hp700/dev

2010-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 10 20:32:34 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: mongoose.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp700/dev/mongoose.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/hp700/dev/mongoose.c
diff -u src/sys/arch/hp700/dev/mongoose.c:1.18 src/sys/arch/hp700/dev/mongoose.c:1.19
--- src/sys/arch/hp700/dev/mongoose.c:1.18	Sun Jan 17 08:33:54 2010
+++ src/sys/arch/hp700/dev/mongoose.c	Wed Feb 10 20:32:34 2010
@@ -1,6 +1,6 @@
-/*	$NetBSD: mongoose.c,v 1.18 2010/01/17 08:33:54 skrll Exp $	*/
+/*	$NetBSD: mongoose.c,v 1.19 2010/02/10 20:32:34 skrll Exp $	*/
 
-/*	$OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $	*/
+/*	$OpenBSD: mongoose.c,v 1.19 2010/01/01 20:28:42 kettenis Exp $	*/
 
 /*
  * Copyright (c) 1998-2003 Michael Shalayeff
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.18 2010/01/17 08:33:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.19 2010/02/10 20:32:34 skrll Exp $");
 
 #define MONGOOSE_DEBUG 9
 
@@ -614,7 +614,7 @@
 		aprint_error(": can't map control registers\n");
 		bus_space_unmap(ca->ca_iot, (bus_space_handle_t)sc->sc_regs,
 		sizeof(struct mongoose_regs));
-		return;		
+		return;
 	}
 	sc->sc_ctrl = (struct mongoose_ctrl *)ioh;
 



CVS commit: src/sys/arch/hp700/dev

2010-02-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb 10 20:32:03 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: mem.c

Log Message:
Wrap long lines.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/mem.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/hp700/dev/mem.c
diff -u src/sys/arch/hp700/dev/mem.c:1.21 src/sys/arch/hp700/dev/mem.c:1.22
--- src/sys/arch/hp700/dev/mem.c:1.21	Sat May  9 11:39:30 2009
+++ src/sys/arch/hp700/dev/mem.c	Wed Feb 10 20:32:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem.c,v 1.21 2009/05/09 11:39:30 skrll Exp $	*/
+/*	$NetBSD: mem.c,v 1.22 2010/02/10 20:32:02 skrll Exp $	*/
 
 /*	$OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $	*/
 /*
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.21 2009/05/09 11:39:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.22 2010/02/10 20:32:02 skrll Exp $");
 
 #include 
 #include 
@@ -236,8 +236,10 @@
 			((struct vi_ctrl *)&vic)->eisa_den = 1;
 			((struct vi_ctrl *)&vic)->core_prf = 1;
 
-			if (settimeout && ((struct vi_ctrl *)&vic)->vsc_tout == 0)
-((struct vi_ctrl *)&vic)->vsc_tout = 850;	/* clks */
+			if (settimeout &&
+			((struct vi_ctrl *)&vic)->vsc_tout == 0)
+/* clks */
+((struct vi_ctrl *)&vic)->vsc_tout = 850;
 
 			sc->sc_vp->vi_control = vic;
 



CVS commit: src/sys/arch/hp700/dev

2010-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 17 08:33:54 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: mongoose.c

Log Message:
Don't panic when bus_space_map fails. Just report and error and carry on.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp700/dev/mongoose.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/hp700/dev/mongoose.c
diff -u src/sys/arch/hp700/dev/mongoose.c:1.17 src/sys/arch/hp700/dev/mongoose.c:1.18
--- src/sys/arch/hp700/dev/mongoose.c:1.17	Tue Nov  3 05:07:25 2009
+++ src/sys/arch/hp700/dev/mongoose.c	Sun Jan 17 08:33:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mongoose.c,v 1.17 2009/11/03 05:07:25 snj Exp $	*/
+/*	$NetBSD: mongoose.c,v 1.18 2010/01/17 08:33:54 skrll Exp $	*/
 
 /*	$OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.17 2009/11/03 05:07:25 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.18 2010/01/17 08:33:54 skrll Exp $");
 
 #define MONGOOSE_DEBUG 9
 
@@ -603,12 +603,19 @@
 	sc->sc_bt = ca->ca_iot;
 	sc->sc_iomap = ca->ca_hpa;
 	if (bus_space_map(ca->ca_iot, ca->ca_hpa + MONGOOSE_MONGOOSE,
-			  sizeof(struct mongoose_regs), 0, &ioh))
-		panic("mgattach: can't map registers");
+	sizeof(struct mongoose_regs), 0, &ioh)) {
+		aprint_error(": can't map registers\n");
+		return;
+	}
 	sc->sc_regs = (struct mongoose_regs *)ioh;
+
 	if (bus_space_map(ca->ca_iot, ca->ca_hpa + MONGOOSE_CTRL,
-			  sizeof(struct mongoose_ctrl), 0, &ioh))
-		panic("mgattach: can't map control registers");
+	sizeof(struct mongoose_ctrl), 0, &ioh)) {
+		aprint_error(": can't map control registers\n");
+		bus_space_unmap(ca->ca_iot, (bus_space_handle_t)sc->sc_regs,
+		sizeof(struct mongoose_regs));
+		return;		
+	}
 	sc->sc_ctrl = (struct mongoose_ctrl *)ioh;
 
 	viper_eisa_en();



CVS commit: src/sys/arch/hp700/dev

2010-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 17 08:29:01 UTC 2010

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Add some comments.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.21 src/sys/arch/hp700/dev/dino.c:1.22
--- src/sys/arch/hp700/dev/dino.c:1.21	Tue Dec  8 09:56:42 2009
+++ src/sys/arch/hp700/dev/dino.c	Sun Jan 17 08:29:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.21 2009/12/08 09:56:42 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.22 2010/01/17 08:29:00 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.21 2009/12/08 09:56:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.22 2010/01/17 08:29:00 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -62,6 +62,7 @@
 extern struct extent *hp700_io_extent;
 
 struct dino_regs {
+	/* HPA Supervisory Register Set */
 	uint32_t	pad0;		/* 0x000 */
 	uint32_t	iar0;		/* 0x004 rw intr addr reg 0 */
 	uint32_t	iodc;		/* 0x008 rw iodc data/addr */
@@ -78,6 +79,8 @@
 	uint32_t	io_status;	/* 0x034 r  status register */
 	uint32_t	io_control;	/* 0x038 rw control register */
 	uint32_t	pad2;		/* 0x03c AUX registers follow */
+
+	/* HPA Auxiliary Register Set */
 	uint32_t	io_gsc_err_addr;/* 0x040 GSC error address */
 	uint32_t	io_err_info;	/* 0x044 error info register */
 	uint32_t	io_pci_err_addr;/* 0x048 PCI error address */
@@ -89,8 +92,12 @@
 	uint32_t	pci_io_data;	/* 0x06c PCI io data reg */
 	uint32_t	pci_mem_data;	/* 0x070 PCI memory data reg */
 	uint32_t	pad4[0x740/4];	/* 0x074 */
+
+	/* HPA Bus (GSC) Specific-Dependent Register Set */
 	uint32_t	gsc2x_config;	/* 0x7b4 GSC2X config reg */
 	uint32_t	pad5[0x48/4];	/* 0x7b8: BSRS registers follow */
+
+	/* HPA HVERSION (Dino)-Dependent Register Set */
 	uint32_t	gmask;		/* 0x800 GSC arbitration mask */
 	uint32_t	pamr;		/* 0x804 PCI arbitration mask */
 	uint32_t	papr;		/* 0x808 PCI arbitration priority */



CVS commit: src/sys/arch/hp700/dev

2009-12-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec  8 09:56:43 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Remove stray {

ETOOMANYTREES


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.20 src/sys/arch/hp700/dev/dino.c:1.21
--- src/sys/arch/hp700/dev/dino.c:1.20	Tue Dec  8 07:32:45 2009
+++ src/sys/arch/hp700/dev/dino.c	Tue Dec  8 09:56:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.20 2009/12/08 07:32:45 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.21 2009/12/08 09:56:42 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.20 2009/12/08 07:32:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.21 2009/12/08 09:56:42 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -654,7 +654,7 @@
 	uint64_t data;
 
 	h += o;
-	if (h & 0xf000) {
+	if (h & 0xf000)
 		data = *(volatile uint64_t *)h;
 	else
 		panic("dino_r8: not implemented");



CVS commit: src/sys/arch/hp700/dev

2009-12-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec  8 07:32:45 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
io / mem space access fixes. Mostly from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.19 src/sys/arch/hp700/dev/dino.c:1.20
--- src/sys/arch/hp700/dev/dino.c:1.19	Tue Dec  8 06:56:54 2009
+++ src/sys/arch/hp700/dev/dino.c	Tue Dec  8 07:32:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.19 2009/12/08 06:56:54 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.20 2009/12/08 07:32:45 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.19 2009/12/08 06:56:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.20 2009/12/08 07:32:45 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -604,7 +604,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		return *((volatile uint8_t *)&r->pci_io_data + (h & 3));
 	}
 }
@@ -613,24 +613,20 @@
 dino_r2(void *v, bus_space_handle_t h, bus_size_t o)
 {
 	volatile uint16_t *p;
-	volatile uint16_t d;
 
 	h += o;
-	if (h & 0xf000) {
+	if (h & 0xf000)
 		p = (volatile uint16_t *)h;
-		d = le16toh(*p);
-	} else {
+	else {
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
-		d = le16toh(*p);
 	}
-
-	return d;
+	return le16toh(*p);
 }
 
 uint32_t
@@ -655,11 +651,15 @@
 uint64_t
 dino_r8(void *v, bus_space_handle_t h, bus_size_t o)
 {
+	uint64_t data;
+
 	h += o;
-	if (h & 0xf000)
-		return *(volatile uint64_t *)h;
+	if (h & 0xf000) {
+		data = *(volatile uint64_t *)h;
 	else
 		panic("dino_r8: not implemented");
+
+	return le64toh(data);
 }
 
 void
@@ -672,7 +672,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		*((volatile uint8_t *)&r->pci_io_data + (h & 3)) = vv;
 	}
 }
@@ -689,7 +689,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
@@ -719,7 +719,7 @@
 {
 	h += o;
 	if (h & 0xf000)
-		*(volatile uint64_t *)h = vv;
+		*(volatile uint64_t *)h = htole64(vv);
 	else
 		panic("dino_w8: not implemented");
 }
@@ -737,7 +737,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint8_t *)&r->pci_io_data + (h & 3);
 	}
 
@@ -757,7 +757,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
@@ -805,7 +805,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint8_t *)&r->pci_io_data + (h & 3);
 	}
 
@@ -825,7 +825,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
@@ -873,7 +873,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint8_t *)&r->pci_io_data + (h & 3);
 	}
 
@@ -893,7 +893,7 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
@@ -942,12 +942,13 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
 	}
 
+	c /= 2;
 	while (c--)
 		*a++ = *p;
 }
@@ -969,6 +970,7 @@
 		p = (volatile uint32_t *)&r->pci_io_data;
 	}
 
+	c /= 4;
 	while (c--)
 		*a++ = *p;
 }
@@ -993,12 +995,13 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
+		r->pci_addr = h;
 		p = (volatile uint16_t *)&r->pci_io_data;
 		if (h & 2)
 			p++;
 	}
 
+	c /= 2;
 	while (c--)
 		*p = *a++;
 }
@@ -1020,6 +1023,7 @@
 		p = (volatile uint32_t *)&r->pci_io_data;
 	}
 
+	c /= 4;
 	while (c--)
 		*p = *a++;
 }
@@ -1045,12 +1049,10 @@
 		struct dino_softc *sc = v;
 		volatile struct dino_regs *r = sc->sc_regs;
 
-		r->pci_addr = h & ~3;
-		while (c--) {
+		for (; c--; h++) {
+			r->pci_addr = h;
 			p = (volatile uint8_t *)&r->pci_io_data + (h & 3);
 			*a++ = *

CVS commit: src/sys/arch/hp700/dev

2009-12-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec  8 06:56:54 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Simplify and improve dino_intr_map by checking for 0xff as error value.

Inspired by OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.18 src/sys/arch/hp700/dev/dino.c:1.19
--- src/sys/arch/hp700/dev/dino.c:1.18	Thu Dec  3 22:18:04 2009
+++ src/sys/arch/hp700/dev/dino.c	Tue Dec  8 06:56:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.18 2009/12/03 22:18:04 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.19 2009/12/08 06:56:54 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.18 2009/12/03 22:18:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.19 2009/12/08 06:56:54 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -372,13 +372,14 @@
 int
 dino_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
 {
-	pci_chipset_tag_t pc = pa->pa_pc;
-	pcitag_t tag = pa->pa_tag;
-	pcireg_t reg;
-
-	reg = pci_conf_read(pc, tag, PCI_INTERRUPT_REG);
-	*ihp = PCI_INTERRUPT_LINE(reg);
-	return *ihp < 0;
+	int line = pa->pa_intrline;
+
+	if (line == 0xff)
+		return 1;
+
+	*ihp = line;
+
+	return 0;
 }
 
 const char *



CVS commit: src/sys/arch/hp700/dev

2009-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec  3 22:18:05 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Apply errata workarounds.

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.17 src/sys/arch/hp700/dev/dino.c:1.18
--- src/sys/arch/hp700/dev/dino.c:1.17	Tue Dec  1 22:36:31 2009
+++ src/sys/arch/hp700/dev/dino.c	Thu Dec  3 22:18:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.17 2009/12/01 22:36:31 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.18 2009/12/03 22:18:04 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.17 2009/12/01 22:36:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.18 2009/12/03 22:18:04 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -331,9 +331,18 @@
 	struct dino_softc *sc = v;
 	volatile struct dino_regs *r = sc->sc_regs;
 	pcireg_t data;
+	uint32_t pamr;
+
+	/* fix arbitration errata by disabling all pci devs on config read */
+	pamr = r->pamr;
+	r->pamr = 0;
 
 	r->pci_addr = tag | reg;
 	data = r->pci_conf_data;
+
+	/* restore arbitration */
+	r->pamr = pamr;
+
 	return le32toh(data);
 }
 
@@ -343,16 +352,21 @@
 	struct dino_softc *sc = v;
 	volatile struct dino_regs *r = sc->sc_regs;
 	pcireg_t data1;
+	uint32_t pamr;
 
-	/* fix coalescing config writes errata by interleaving w/ a read */
-	r->pci_addr = tag | PCI_ID_REG;
-	data1 = r->pci_conf_data;
+	/* fix arbitration errata by disabling all pci devs on config read */
+	pamr = r->pamr;
+	r->pamr = 0;
 
 	r->pci_addr = tag | reg;
 	r->pci_conf_data = htole32(data);
 
+	/* fix coalescing config and io writes by interleaving w/ a read */
 	r->pci_addr = tag | PCI_ID_REG;
 	data1 = r->pci_conf_data;
+
+	/* restore arbitration */
+	r->pamr = pamr;
 }
 
 int



CVS commit: src/sys/arch/hp700/dev

2009-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec  3 11:54:09 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
Make the pdc_pat_io_num and pdc_pat_pci_rt structures static so they're
definitely VA==PA. Being on a stack doesn't guarantee this.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.4 src/sys/arch/hp700/dev/apic.c:1.5
--- src/sys/arch/hp700/dev/apic.c:1.4	Sun Nov 29 10:30:07 2009
+++ src/sys/arch/hp700/dev/apic.c	Thu Dec  3 11:54:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: apic.c,v 1.4 2009/11/29 10:30:07 skrll Exp $	*/
+/*	$NetBSD: apic.c,v 1.5 2009/12/03 11:54:09 skrll Exp $	*/
 
 /*	$OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -258,15 +258,10 @@
 void
 apic_get_int_tbl(struct elroy_softc *sc)
 {
-	struct pdc_pat_io_num int_tbl_sz PDC_ALIGNMENT;
-	struct pdc_pat_pci_rt int_tbl[MAX_INT_TBL_SZ] PDC_ALIGNMENT;
+	static struct pdc_pat_io_num int_tbl_sz PDC_ALIGNMENT;
+	static struct pdc_pat_pci_rt int_tbl[MAX_INT_TBL_SZ] PDC_ALIGNMENT;
 	size_t size;
 
-	/*
-	 * XXX int_tbl should not be allocated on the stack, but we need a
-	 * 1:1 mapping, and malloc doesn't provide that.
-	 */
-
 	if (pdc_call((iodcio_t)pdc, 0, PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL_SZ,
 	&int_tbl_sz, 0, 0, 0, 0, 0))
 		return;



CVS commit: src/sys/arch/hp700/dev

2009-12-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Dec  1 22:36:32 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.16 src/sys/arch/hp700/dev/dino.c:1.17
--- src/sys/arch/hp700/dev/dino.c:1.16	Mon Nov  9 13:33:08 2009
+++ src/sys/arch/hp700/dev/dino.c	Tue Dec  1 22:36:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.16 2009/11/09 13:33:08 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.17 2009/12/01 22:36:31 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.16 2009/11/09 13:33:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.17 2009/12/01 22:36:31 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -511,7 +511,7 @@
 	int i, error;
 
 	/*
-	 * Allow allocation only when PCI MEM is already maped.
+	 * Allow allocation only when PCI MEM is already mapped.
 	 * Needed to avoid allocation of I/O space used by devices that
 	 * have no driver in the current kernel.
 	 * Dino can map PCI MEM in the range 0xf080..0xff80 only.



CVS commit: src/sys/arch/hp700/dev

2009-11-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 29 13:51:33 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: astro.c

Log Message:
Add a cast so that this actually compiles. oops.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp700/dev/astro.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/hp700/dev/astro.c
diff -u src/sys/arch/hp700/dev/astro.c:1.7 src/sys/arch/hp700/dev/astro.c:1.8
--- src/sys/arch/hp700/dev/astro.c:1.7	Sun Nov 29 10:33:56 2009
+++ src/sys/arch/hp700/dev/astro.c	Sun Nov 29 13:51:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: astro.c,v 1.7 2009/11/29 10:33:56 skrll Exp $	*/
+/*	$NetBSD: astro.c,v 1.8 2009/11/29 13:51:33 skrll Exp $	*/
 
 /*	$OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -736,7 +736,7 @@
 	tte |= IOTTE_V;
 
 	*tte_ptr = htole64(tte);
-	fdcache(HPPA_SID_KERNEL, tte_ptr, sizeof(*tte_ptr));
+	fdcache(HPPA_SID_KERNEL, (vaddr_t)tte_ptr, sizeof(*tte_ptr));
 }
 
 /*



CVS commit: src/sys/arch/hp700/dev

2009-11-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 29 10:33:56 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: astro.c

Log Message:
Use fdcache instead of inline assembler.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp700/dev/astro.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/hp700/dev/astro.c
diff -u src/sys/arch/hp700/dev/astro.c:1.6 src/sys/arch/hp700/dev/astro.c:1.7
--- src/sys/arch/hp700/dev/astro.c:1.6	Sun Nov 29 10:15:07 2009
+++ src/sys/arch/hp700/dev/astro.c	Sun Nov 29 10:33:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: astro.c,v 1.6 2009/11/29 10:15:07 skrll Exp $	*/
+/*	$NetBSD: astro.c,v 1.7 2009/11/29 10:33:56 skrll Exp $	*/
 
 /*	$OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -736,7 +736,7 @@
 	tte |= IOTTE_V;
 
 	*tte_ptr = htole64(tte);
-	__asm volatile("fdc 0(%%sr1, %0)\n\tsync" : : "r" (tte_ptr));
+	fdcache(HPPA_SID_KERNEL, tte_ptr, sizeof(*tte_ptr));
 }
 
 /*



CVS commit: src/sys/arch/hp700/dev

2009-11-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 29 10:30:07 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
Signal EOI correctly rather than deferencing NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.3 src/sys/arch/hp700/dev/apic.c:1.4
--- src/sys/arch/hp700/dev/apic.c:1.3	Thu May  7 15:34:49 2009
+++ src/sys/arch/hp700/dev/apic.c	Sun Nov 29 10:30:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: apic.c,v 1.3 2009/05/07 15:34:49 skrll Exp $	*/
+/*	$NetBSD: apic.c,v 1.4 2009/11/29 10:30:07 skrll Exp $	*/
 
 /*	$OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -241,16 +241,14 @@
 		if (iv->handler(iv->arg)) {
 			if (iv->cnt)
 iv->cnt->ev_count++;
-			else
-claimed = 1;
+			/* Signal EOI. */
+			elroy_write32(&r->apic_eoi,
+			htole32((31 - APIC_INT_IRQ(iv->ih)) & APIC_ENT0_VEC));
+			claimed = 1;
 		}
 		iv = iv->next;
 	}
 
-	/* Signal EOI. */
-	elroy_write32(&r->apic_eoi,
-	htole32((31 - APIC_INT_IRQ(iv->ih)) & APIC_ENT0_VEC));
-
 	return (claimed);
 }
 



CVS commit: src/sys/arch/hp700/dev

2009-11-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 29 10:15:08 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: astro.c

Log Message:
Use lci.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/dev/astro.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/hp700/dev/astro.c
diff -u src/sys/arch/hp700/dev/astro.c:1.5 src/sys/arch/hp700/dev/astro.c:1.6
--- src/sys/arch/hp700/dev/astro.c:1.5	Fri May  8 09:33:57 2009
+++ src/sys/arch/hp700/dev/astro.c	Sun Nov 29 10:15:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: astro.c,v 1.5 2009/05/08 09:33:57 skrll Exp $	*/
+/*	$NetBSD: astro.c,v 1.6 2009/11/29 10:15:07 skrll Exp $	*/
 
 /*	$OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -730,8 +730,7 @@
 	}
 #endif
 
-	mtsp(HPPA_SID_KERNEL, 1);
-	__asm volatile("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (va));
+	ci = lci(HPPA_SID_KERNEL, va);
 
 	tte = (pa & IOTTE_PAMASK) | ((ci >> 12) & IOTTE_CI);
 	tte |= IOTTE_V;



CVS commit: src/sys/arch/hp700/dev

2009-11-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Nov 15 15:53:05 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
Reformat comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.5 src/sys/arch/hp700/dev/uturn.c:1.6
--- src/sys/arch/hp700/dev/uturn.c:1.5	Sun May 24 06:53:34 2009
+++ src/sys/arch/hp700/dev/uturn.c	Sun Nov 15 15:53:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.5 2009/05/24 06:53:34 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.6 2009/11/15 15:53:05 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -102,11 +102,10 @@
 	((struct iomod *)ioh)->io_control = 0x80;
 
 	/*
-	 * U2/UTurn is actually a combination of an Upper Bus
-	 * Converter (UBC) and a Lower Bus Converter (LBC).  This
-	 * driver attaches to the UBC; the LBC isn't very interesting,
-	 * so we skip it.  This is easy, since it always is module 63,
-	 * hence the MAXMODBUS - 1 below.
+	 * U2/UTurn is actually a combination of an Upper Bus Converter (UBC)
+	 * and a Lower Bus Converter (LBC).  This driver attaches to the UBC;
+	 * the LBC isn't very interesting, so we skip it.  This is easy, since
+	 * it always is module 63, hence the MAXMODBUS - 1 below.
 	 */
 	nca = *ca;
 	nca.ca_hpabase = 0;



CVS commit: src/sys/arch/hp700/dev

2009-11-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Nov  9 13:33:08 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
G/C unused sc_memh from dino_softc.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.15 src/sys/arch/hp700/dev/dino.c:1.16
--- src/sys/arch/hp700/dev/dino.c:1.15	Mon Nov  9 13:21:34 2009
+++ src/sys/arch/hp700/dev/dino.c	Mon Nov  9 13:33:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.15 2009/11/09 13:21:34 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.16 2009/11/09 13:33:08 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.15 2009/11/09 13:21:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.16 2009/11/09 13:33:08 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -114,7 +114,6 @@
 	struct hp700_int_reg sc_int_reg;
 	bus_space_tag_t sc_bt;
 	bus_space_handle_t sc_bh;
-	bus_space_handle_t sc_memh;
 	bus_dma_tag_t sc_dmat;
 	volatile struct dino_regs *sc_regs;
 



CVS commit: src/sys/arch/hp700/dev

2009-11-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Nov  9 13:21:34 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.14 src/sys/arch/hp700/dev/dino.c:1.15
--- src/sys/arch/hp700/dev/dino.c:1.14	Thu Jul 23 13:34:26 2009
+++ src/sys/arch/hp700/dev/dino.c	Mon Nov  9 13:21:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.14 2009/07/23 13:34:26 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.15 2009/11/09 13:21:34 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.14 2009/07/23 13:34:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.15 2009/11/09 13:21:34 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -143,12 +143,15 @@
 void dino_decompose_tag(void *, pcitag_t, int *, int *, int *);
 pcireg_t dino_conf_read(void *, pcitag_t, int);
 void dino_conf_write(void *, pcitag_t, int, pcireg_t);
+
 int dino_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
 const char *dino_intr_string(void *, pci_intr_handle_t);
 void *dino_intr_establish(void *, pci_intr_handle_t, int,
 int (*)(void *), void *);
 void dino_intr_disestablish(void *, void *);
+
 void *dino_alloc_parent(device_t, struct pci_attach_args *, int);
+
 int dino_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
 int dino_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
 int dino_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t,



CVS commit: src/sys/arch/hp700/dev

2009-08-19 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Aug 19 15:13:24 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: mongoose.c

Log Message:
Define, and hook into the isa_chipset_tag_t, mg_isa_detach_hook().


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp700/dev/mongoose.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/hp700/dev/mongoose.c
diff -u src/sys/arch/hp700/dev/mongoose.c:1.15 src/sys/arch/hp700/dev/mongoose.c:1.16
--- src/sys/arch/hp700/dev/mongoose.c:1.15	Sun May 24 06:53:34 2009
+++ src/sys/arch/hp700/dev/mongoose.c	Wed Aug 19 15:13:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mongoose.c,v 1.15 2009/05/24 06:53:34 skrll Exp $	*/
+/*	$NetBSD: mongoose.c,v 1.16 2009/08/19 15:13:24 dyoung Exp $	*/
 
 /*	$OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $	*/
 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.15 2009/05/24 06:53:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.16 2009/08/19 15:13:24 dyoung Exp $");
 
 #define MONGOOSE_DEBUG 9
 
@@ -213,6 +213,7 @@
 int mg_intr_map(void *, u_int, eisa_intr_handle_t *);
 const char *mg_intr_string(void *, int);
 void mg_isa_attach_hook(device_t, device_t, struct isabus_attach_args *);
+void mg_isa_detach_hook(isa_chipset_tag_t, device_t);
 void *mg_intr_establish(void *, int, int, int, int (*)(void *), void *);
 void mg_intr_disestablish(void *, void *);
 int mg_intr_check(void *, int, int);
@@ -275,6 +276,12 @@
 
 }
 
+void
+mg_isa_detach_hook(isa_chipset_tag_t ic, device_t self)
+{
+
+}
+
 void *
 mg_intr_establish(void *v, int irq, int type, int pri,
 	int (*handler)(void *), void *arg)
@@ -676,6 +683,7 @@
 
 	sc->sc_ic.ic_v = sc;
 	sc->sc_ic.ic_attach_hook = mg_isa_attach_hook;
+	sc->sc_ic.ic_detach_hook = mg_isa_detach_hook;
 	sc->sc_ic.ic_intr_establish = mg_intr_establish;
 	sc->sc_ic.ic_intr_disestablish = mg_intr_disestablish;
 	sc->sc_ic.ic_intr_check = mg_intr_check;



CVS commit: src/sys/arch/hp700/dev

2009-05-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 30 17:45:59 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: gecko.c

Log Message:
Give pdc_scanbus some help.

Use aprint* while here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp700/dev/gecko.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/hp700/dev/gecko.c
diff -u src/sys/arch/hp700/dev/gecko.c:1.1 src/sys/arch/hp700/dev/gecko.c:1.2
--- src/sys/arch/hp700/dev/gecko.c:1.1	Thu May 28 08:41:29 2009
+++ src/sys/arch/hp700/dev/gecko.c	Sat May 30 17:45:59 2009
@@ -75,17 +75,15 @@
 	}
 	regs = bus_space_vaddr(ca->ca_iot, sc->sc_ioh);
 
-#if 1
-	printf(": %x-%x", regs->io_io_low, regs->io_io_high);
-#endif
+	aprint_verbose(": %x-%x", regs->io_io_low, regs->io_io_high);
 
-	printf("\n");
+	aprint_normal("\n");
 
 	nca = *ca;
-	nca.ca_hpabase = 0;
+	nca.ca_hpabase = regs->io_io_low;
 	nca.ca_nmodules = MAXMODBUS;
 
-	pdc_scanbus(self, &nca, gecko_callback /*regs->io_io_low */);
+	pdc_scanbus(self, &nca, gecko_callback);
 }
 
 static void



CVS commit: src/sys/arch/hp700/dev

2009-05-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri May 29 12:33:35 UTC 2009

Added Files:
src/sys/arch/hp700/dev: ssiovar.h

Log Message:
Missed in previous WIP commit.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp700/dev/ssiovar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/hp700/dev/ssiovar.h
diff -u /dev/null src/sys/arch/hp700/dev/ssiovar.h:1.1
--- /dev/null	Fri May 29 12:33:35 2009
+++ src/sys/arch/hp700/dev/ssiovar.h	Fri May 29 12:33:34 2009
@@ -0,0 +1,31 @@
+/*	$NetBSD: ssiovar.h,v 1.1 2009/05/29 12:33:34 skrll Exp $	*/
+
+/*	$OpenBSD: ssiovar.h,v 1.1 2007/06/19 22:51:26 kettenis Exp $	*/
+
+/*
+ * Copyright (c) 2007 Mark Kettenis
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+struct ssio_attach_args {
+	const char *saa_name;
+	bus_space_tag_t saa_iot;
+	bus_addr_t saa_iobase;
+	int saa_irq;
+};
+
+#define ssiocf_irq	cf_loc[0]
+#define SSIO_UNK_IRQ	-1
+
+void *ssio_intr_establish(int, int, int (*)(void *), void *, const char *);



CVS commit: src/sys/arch/hp700/dev

2009-05-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 23 13:39:55 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: uturn.c

Log Message:
More help for mjf's machine.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp700/dev/uturn.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/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.3 src/sys/arch/hp700/dev/uturn.c:1.4
--- src/sys/arch/hp700/dev/uturn.c:1.3	Thu May  7 15:34:49 2009
+++ src/sys/arch/hp700/dev/uturn.c	Sat May 23 13:39:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uturn.c,v 1.3 2009/05/07 15:34:49 skrll Exp $	*/
+/*	$NetBSD: uturn.c,v 1.4 2009/05/23 13:39:54 skrll Exp $	*/
 
 /*	$OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $	*/
 
@@ -124,6 +124,7 @@
 	case HPPA_BOARD_HP869:
 
 	case HPPA_BOARD_HP800D:
+	case HPPA_BOARD_HP821:
 		nca.ca_hpabase = ((struct iomod *)ioh)->io_io_low << 16;
 		pdc_scanbus(self, &nca, uturn_callback);
 		break;



CVS commit: src/sys/arch/hp700/dev

2009-05-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 18 05:13:26 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: com_dino.c

Log Message:
u_intXX_t -> uintXX_t


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp700/dev/com_dino.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/hp700/dev/com_dino.c
diff -u src/sys/arch/hp700/dev/com_dino.c:1.7 src/sys/arch/hp700/dev/com_dino.c:1.8
--- src/sys/arch/hp700/dev/com_dino.c:1.7	Mon May 18 04:58:23 2009
+++ src/sys/arch/hp700/dev/com_dino.c	Mon May 18 05:13:26 2009
@@ -53,15 +53,15 @@
 };
 
 struct com_dino_regs {
-	u_int8_t	reset;
-	u_int8_t	pad0[3];
-	u_int8_t	test;
+	uint8_t		reset;
+	uint8_t		pad0[3];
+	uint8_t		test;
 #define	COM_DINO_PAR_LOOP	0x01
 #define	COM_DINO_CLK_SEL	0x02
-	u_int8_t	pad1[3];
-	u_int32_t	iodc;
-	u_int8_t	pad2[0x54];
-	u_int8_t	dither;
+	uint8_t		pad1[3];
+	uint32_t	iodc;
+	uint8_t		pad2[0x54];
+	uint8_t		dither;
 };
 
 int	com_dino_match(device_t, cfdata_t, void *);



CVS commit: src/sys/arch/hp700/dev

2009-05-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 18 04:58:23 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: com_dino.c

Log Message:
Use the right interrupt number for com @ dino.

Tested as working by Jonathan Kollasch. Thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp700/dev/com_dino.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/hp700/dev/com_dino.c
diff -u src/sys/arch/hp700/dev/com_dino.c:1.6 src/sys/arch/hp700/dev/com_dino.c:1.7
--- src/sys/arch/hp700/dev/com_dino.c:1.6	Wed May 13 18:44:23 2009
+++ src/sys/arch/hp700/dev/com_dino.c	Mon May 18 04:58:23 2009
@@ -138,7 +138,7 @@
 
 	com_attach_subr(sc);
 
-	ca->ca_irq = 11;
+	ca->ca_irq = 10;
 
 	sc_comdino->sc_ih = dino_intr_establish(sc_dino, ca->ca_irq, IPL_TTY,
 	comintr, sc);



CVS commit: src/sys/arch/hp700/dev

2009-05-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed May 13 18:44:23 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: com_dino.c

Log Message:
Fix fallout from device_t/softc changes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/dev/com_dino.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/hp700/dev/com_dino.c
diff -u src/sys/arch/hp700/dev/com_dino.c:1.5 src/sys/arch/hp700/dev/com_dino.c:1.6
--- src/sys/arch/hp700/dev/com_dino.c:1.5	Fri May  8 09:33:57 2009
+++ src/sys/arch/hp700/dev/com_dino.c	Wed May 13 18:44:23 2009
@@ -86,8 +86,9 @@
 void
 com_dino_attach(device_t parent, device_t self, void *aux)
 {
-	struct com_dino_softc *sc_dino = device_private(self);
-	struct com_softc *sc = &sc_dino->sc_com;
+	void *sc_dino = device_private(parent);
+	struct com_dino_softc *sc_comdino = device_private(self);
+	struct com_softc *sc = &sc_comdino->sc_com;
 	struct confargs *ca = aux;
 	struct com_dino_regs *regs = (struct com_dino_regs *)ca->ca_hpa;
 	int pagezero_cookie;
@@ -139,6 +140,6 @@
 
 	ca->ca_irq = 11;
 
-	sc_dino->sc_ih = dino_intr_establish(parent, ca->ca_irq, IPL_TTY,
+	sc_comdino->sc_ih = dino_intr_establish(sc_dino, ca->ca_irq, IPL_TTY,
 	comintr, sc);
 }



CVS commit: src/sys/arch/hp700/dev

2009-05-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 12 19:35:59 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: mongoose.c

Log Message:
Fix DEBUG builds.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp700/dev/mongoose.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/hp700/dev/mongoose.c
diff -u src/sys/arch/hp700/dev/mongoose.c:1.13 src/sys/arch/hp700/dev/mongoose.c:1.14
--- src/sys/arch/hp700/dev/mongoose.c:1.13	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/dev/mongoose.c	Tue May 12 19:35:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mongoose.c,v 1.13 2009/05/08 09:33:58 skrll Exp $	*/
+/*	$NetBSD: mongoose.c,v 1.14 2009/05/12 19:35:59 skrll Exp $	*/
 
 /*	$OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $	*/
 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.13 2009/05/08 09:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.14 2009/05/12 19:35:59 skrll Exp $");
 
 #define MONGOOSE_DEBUG 9
 
@@ -288,19 +288,15 @@
 		return NULL;
 
 	if (type != IST_LEVEL && type != IST_EDGE) {
-#ifdef DEBUG
-		printf("%s: bad interrupt level (%d)\n", sc->sc_dev.dv_xname,
+		aprint_debug_dev(sc->sc_dev, "bad interrupt level (%d)\n",
 		type);
-#endif
 		return NULL;
 	}
 
 	iv = &sc->sc_iv[irq];
 	if (iv->iv_handler) {
-#ifdef DEBUG
-		printf("%s: irq %d already established\n", sc->sc_dev.dv_xname,
+		aprint_debug_dev(sc->sc_dev, "irq %d already established\n",
 		irq);
-#endif
 		return NULL;
 	}
 



CVS commit: src/sys/arch/hp700/dev

2009-05-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 11 06:10:30 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.11 src/sys/arch/hp700/dev/dino.c:1.12
--- src/sys/arch/hp700/dev/dino.c:1.11	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/dev/dino.c	Mon May 11 06:10:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.11 2009/05/08 09:33:58 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.12 2009/05/11 06:10:30 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.11 2009/05/08 09:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.12 2009/05/11 06:10:30 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -146,7 +146,7 @@
 int dino_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
 const char *dino_intr_string(void *, pci_intr_handle_t);
 void *dino_intr_establish(void *, pci_intr_handle_t, int,
-int (*handler)(void *), void *);
+int (*)(void *), void *);
 void dino_intr_disestablish(void *, void *);
 void *dino_alloc_parent(device_t, struct pci_attach_args *, int);
 int dino_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);



CVS commit: src/sys/arch/hp700/dev

2009-05-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May  9 12:44:30 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
Fix a botch in rev 1.29: return error properly from pdcgettod().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.30 src/sys/arch/hp700/dev/pdc.c:1.31
--- src/sys/arch/hp700/dev/pdc.c:1.30	Sat May  9 12:04:11 2009
+++ src/sys/arch/hp700/dev/pdc.c	Sat May  9 12:44:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.30 2009/05/09 12:04:11 skrll Exp $	*/
+/*	$NetBSD: pdc.c,v 1.31 2009/05/09 12:44:30 tsutsui Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.30 2009/05/09 12:04:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.31 2009/05/09 12:44:30 tsutsui Exp $");
 
 #include 
 #include 
@@ -466,7 +466,7 @@
 		tvp->tv_sec = tod.sec;
 		tvp->tv_usec = tod.usec;
 	}
-	return 0;
+	return error;
 }
 
 static int



CVS commit: src/sys/arch/hp700/dev

2009-05-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  9 12:04:11 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
No need to do the hp700_pagezero_{,un}map dance to get the pdc entry point
as it's stashed in pdc - just use pdc.

Update a comment while I'm here.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.29 src/sys/arch/hp700/dev/pdc.c:1.30
--- src/sys/arch/hp700/dev/pdc.c:1.29	Sat May  9 01:59:17 2009
+++ src/sys/arch/hp700/dev/pdc.c	Sat May  9 12:04:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.29 2009/05/09 01:59:17 tsutsui Exp $	*/
+/*	$NetBSD: pdc.c,v 1.30 2009/05/09 12:04:11 skrll Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.29 2009/05/09 01:59:17 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.30 2009/05/09 12:04:11 skrll Exp $");
 
 #include 
 #include 
@@ -118,7 +118,9 @@
 
 	pagezero_cookie = hp700_pagezero_map();
 
-	/* XXX locore've done it XXX pdc = (pdcio_t)PAGE0->mem_pdc; */
+	/*
+	 * locore has updated pdc with (pdcio_t)PAGE0->mem_pdc
+	 */
 	pz_kbd = &PAGE0->mem_kbd;
 	pz_cons = &PAGE0->mem_cons;
 
@@ -455,13 +457,10 @@
 static int
 pdcgettod(todr_chip_handle_t tch, volatile struct timeval *tvp)
 {
-	int pagezero_cookie;
 	int error;
 
-	pagezero_cookie = hp700_pagezero_map();
-	error = pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_READ,
+	error = pdc_call((iodcio_t)pdc, 1, PDC_TOD, PDC_TOD_READ,
 	&tod, 0, 0, 0, 0, 0);
-	hp700_pagezero_unmap(pagezero_cookie);
 
 	if (error == 0) {
 		tvp->tv_sec = tod.sec;
@@ -473,15 +472,12 @@
 static int
 pdcsettod(todr_chip_handle_t tch, volatile struct timeval *tvp)
 {
-	int pagezero_cookie;
 	int error;
 
 	tod.sec = tvp->tv_sec;
 	tod.usec = tvp->tv_usec;
 
-	pagezero_cookie = hp700_pagezero_map();
-	error = pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_WRITE,
+	error = pdc_call((iodcio_t)pdc, 1, PDC_TOD, PDC_TOD_WRITE,
 	tod.sec, tod.usec);
-	hp700_pagezero_unmap(pagezero_cookie);
 	return error;
 }



CVS commit: src/sys/arch/hp700/dev

2009-05-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May  9 01:59:17 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
Check return values of pdc_call() in pdcgettod() and pdcsettod().


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.28 src/sys/arch/hp700/dev/pdc.c:1.29
--- src/sys/arch/hp700/dev/pdc.c:1.28	Fri May  8 09:33:58 2009
+++ src/sys/arch/hp700/dev/pdc.c	Sat May  9 01:59:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.28 2009/05/08 09:33:58 skrll Exp $	*/
+/*	$NetBSD: pdc.c,v 1.29 2009/05/09 01:59:17 tsutsui Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.28 2009/05/08 09:33:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.29 2009/05/09 01:59:17 tsutsui Exp $");
 
 #include 
 #include 
@@ -456,14 +456,17 @@
 pdcgettod(todr_chip_handle_t tch, volatile struct timeval *tvp)
 {
 	int pagezero_cookie;
+	int error;
 
 	pagezero_cookie = hp700_pagezero_map();
-	pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_READ,
+	error = pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_READ,
 	&tod, 0, 0, 0, 0, 0);
 	hp700_pagezero_unmap(pagezero_cookie);
 
-	tvp->tv_sec = tod.sec;
-	tvp->tv_usec = tod.usec;
+	if (error == 0) {
+		tvp->tv_sec = tod.sec;
+		tvp->tv_usec = tod.usec;
+	}
 	return 0;
 }
 
@@ -471,13 +474,14 @@
 pdcsettod(todr_chip_handle_t tch, volatile struct timeval *tvp)
 {
 	int pagezero_cookie;
+	int error;
 
 	tod.sec = tvp->tv_sec;
 	tod.usec = tvp->tv_usec;
 
 	pagezero_cookie = hp700_pagezero_map();
-	pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_WRITE,
+	error = pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_WRITE,
 	tod.sec, tod.usec);
 	hp700_pagezero_unmap(pagezero_cookie);
-	return 0;
+	return error;
 }



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu May  7 17:30:59 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: pdc.c

Log Message:
Pass proper timeval args to pdc_call() to save TOD with PDC_TOD_WRITE,
Per OpenBSD's hppa/dev/clock.c rev 1.14.

Tested on my 735/125 with a new lithium battery, okay'ed by sk...@.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hp700/dev/pdc.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/hp700/dev/pdc.c
diff -u src/sys/arch/hp700/dev/pdc.c:1.26 src/sys/arch/hp700/dev/pdc.c:1.27
--- src/sys/arch/hp700/dev/pdc.c:1.26	Thu May  7 15:34:49 2009
+++ src/sys/arch/hp700/dev/pdc.c	Thu May  7 17:30:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pdc.c,v 1.26 2009/05/07 15:34:49 skrll Exp $	*/
+/*	$NetBSD: pdc.c,v 1.27 2009/05/07 17:30:59 tsutsui Exp $	*/
 
 /*	$OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $	*/
 
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.26 2009/05/07 15:34:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.27 2009/05/07 17:30:59 tsutsui Exp $");
 
 #include 
 #include 
@@ -476,7 +476,8 @@
 	tod.usec = tvp->tv_usec;
 
 	pagezero_cookie = hp700_pagezero_map();
-	pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_WRITE, &tod);
+	pdc_call((iodcio_t)PAGE0->mem_pdc, 1, PDC_TOD, PDC_TOD_WRITE,
+	tod.sec, tod.usec);
 	hp700_pagezero_unmap(pagezero_cookie);
 	return 0;
 }



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 09:56:50 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: astro.c

Log Message:
Wrap PAGE0 access with hp700_pagezero_{,un}map


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/astro.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/hp700/dev/astro.c
diff -u src/sys/arch/hp700/dev/astro.c:1.2 src/sys/arch/hp700/dev/astro.c:1.3
--- src/sys/arch/hp700/dev/astro.c:1.2	Thu Apr 30 07:03:12 2009
+++ src/sys/arch/hp700/dev/astro.c	Thu May  7 09:56:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: astro.c,v 1.2 2009/04/30 07:03:12 skrll Exp $	*/
+/*	$NetBSD: astro.c,v 1.3 2009/05/07 09:56:50 skrll Exp $	*/
 
 /*	$OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $	*/
 
@@ -34,6 +34,7 @@
 #include 
 
 #include 
+#include 
 
 struct astro_regs {
 	uint32_t	rid;
@@ -234,6 +235,7 @@
 	struct vm_page *m;
 	struct pglist mlist;
 	int iova_bits;
+	int pagezero_cookie;
 
 	sc->sc_dmat = ca->ca_dmatag;
 	if (bus_space_map(ca->ca_iot, ca->ca_hpa, sizeof(struct astro_regs),
@@ -306,8 +308,10 @@
 	 * will stop working if we do.  This is fine since the serial port
 	 * doesn't do DMA.
 	 */
+	pagezero_cookie = hp700_pagezero_map();
 	if (PAGE0->mem_cons.pz_class != PCL_DUPLEX)
 		pdc_call((iodcio_t)pdc, 0, PDC_IO, PDC_IO_RESET_DEVICES);
+	hp700_pagezero_unmap(pagezero_cookie);
 
 	/* Enable iova space. */
 	r->tlb_ibase = htole32(1);



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 09:10:18 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: elroyvar.h

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp700/dev/elroyvar.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/hp700/dev/elroyvar.h
diff -u src/sys/arch/hp700/dev/elroyvar.h:1.3 src/sys/arch/hp700/dev/elroyvar.h:1.4
--- src/sys/arch/hp700/dev/elroyvar.h:1.3	Thu May  7 09:08:02 2009
+++ src/sys/arch/hp700/dev/elroyvar.h	Thu May  7 09:10:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroyvar.h,v 1.3 2009/05/07 09:08:02 skrll Exp $	*/
+/*	$NetBSD: elroyvar.h,v 1.4 2009/05/07 09:10:18 skrll Exp $	*/
 
 /*	$OpenBSD: elroyvar.h,v 1.3 2007/06/17 14:51:21 kettenis Exp $	*/
 
@@ -47,13 +47,13 @@
 	struct hppa_bus_dma_tag sc_dmatag;
 };
 
-void apic_attach(struct elroy_softc *sc);
-int apic_intr(void *v);
-int apic_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp);
-const char *apic_intr_string(void *v, pci_intr_handle_t ih);
-void *apic_intr_establish(void *v, pci_intr_handle_t ih, int pri,
-int (*handler)(void *), void *arg);
-void apic_intr_disestablish(void *v, void *cookie);
+void apic_attach(struct elroy_softc *);
+int apic_intr(void *);
+int apic_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
+const char *apic_intr_string(void *, pci_intr_handle_t);
+void *apic_intr_establish(void *, pci_intr_handle_t, int,
+int (*)(void *), void *);
+void apic_intr_disestablish(void *, void *);
 
-void elroy_write32(volatile uint32_t *p, uint32_t v);
-uint32_t elroy_read32(volatile uint32_t *p);
+void elroy_write32(volatile uint32_t *, uint32_t);
+uint32_t elroy_read32(volatile uint32_t *);



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 09:08:02 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: elroyvar.h

Log Message:
G/C some old stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/elroyvar.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/hp700/dev/elroyvar.h
diff -u src/sys/arch/hp700/dev/elroyvar.h:1.2 src/sys/arch/hp700/dev/elroyvar.h:1.3
--- src/sys/arch/hp700/dev/elroyvar.h:1.2	Thu Apr 30 07:01:26 2009
+++ src/sys/arch/hp700/dev/elroyvar.h	Thu May  7 09:08:02 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroyvar.h,v 1.2 2009/04/30 07:01:26 skrll Exp $	*/
+/*	$NetBSD: elroyvar.h,v 1.3 2009/05/07 09:08:02 skrll Exp $	*/
 
 /*	$OpenBSD: elroyvar.h,v 1.3 2007/06/17 14:51:21 kettenis Exp $	*/
 
@@ -26,7 +26,6 @@
 
 	int sc_ver;
 	hppa_hpa_t sc_hpa;
-// 	struct hp700_int_reg sc_int_reg;
 	bus_space_tag_t sc_bt;
 	bus_space_handle_t sc_bh;
 	bus_dma_tag_t sc_dmat;



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 08:58:13 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: elroy.c

Log Message:
G/C some unused stuff from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp700/dev/elroy.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/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.5 src/sys/arch/hp700/dev/elroy.c:1.6
--- src/sys/arch/hp700/dev/elroy.c:1.5	Thu May  7 08:55:15 2009
+++ src/sys/arch/hp700/dev/elroy.c	Thu May  7 08:58:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.5 2009/05/07 08:55:15 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.6 2009/05/07 08:58:13 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -1305,12 +1305,10 @@
 	sc->sc_dmatag._cookie = sc;
 
 	memset(&pba, 0, sizeof(pba));
-// 	pba.pba_busname = "pci";
 	pba.pba_iot = &sc->sc_iot;
 	pba.pba_memt = &sc->sc_memt;
 	pba.pba_dmat = &sc->sc_dmatag;
 	pba.pba_pc = &sc->sc_pc;
-// 	pba.pba_domain = pci_ndomains++;
 	pba.pba_bus = 0; /* (le32toh(elroy_read32(&r->busnum)) & 0xff) >> 4; */
  	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
 



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 08:55:15 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: elroy.c

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp700/dev/elroy.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/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.4 src/sys/arch/hp700/dev/elroy.c:1.5
--- src/sys/arch/hp700/dev/elroy.c:1.4	Thu May  7 08:54:59 2009
+++ src/sys/arch/hp700/dev/elroy.c	Thu May  7 08:55:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.4 2009/05/07 08:54:59 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.5 2009/05/07 08:55:15 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -67,7 +67,7 @@
 
 int elroy_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
 int elroy_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
-int elroy_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t ,
+int elroy_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t,
 bus_space_handle_t *);
 int elroy_ioalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t,
 bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
@@ -76,8 +76,8 @@
 void elroy_unmap(void *, bus_space_handle_t, bus_size_t);
 void elroy_free(void *, bus_space_handle_t, bus_size_t);
 void elroy_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int);
-void * elroy_alloc_parent(struct device *, struct pci_attach_args *, int);
-void * elroy_vaddr(void *, bus_space_handle_t);
+void *elroy_alloc_parent(struct device *, struct pci_attach_args *, int);
+void *elroy_vaddr(void *, bus_space_handle_t);
 
 uint8_t elroy_r1(void *, bus_space_handle_t, bus_size_t);
 uint16_t elroy_r2(void *, bus_space_handle_t, bus_size_t);
@@ -1049,7 +1049,7 @@
 	NULL, elroy_unmap, elroy_subregion, NULL, elroy_free,
 	elroy_barrier, elroy_vaddr,
 	elroy_r1,elroy_r2,elroy_r4,elroy_r8,
-	elroy_w1,elroy_w2,elroy_w4,elroy_w8,  
+	elroy_w1,elroy_w2,elroy_w4,elroy_w8,
 	elroy_rm_1,  elroy_rm_2,  elroy_rm_4,  elroy_rm_8,
 	elroy_wm_1,  elroy_wm_2,  elroy_wm_4,  elroy_wm_8,
 	elroy_sm_1,  elroy_sm_2,  elroy_sm_4,  elroy_sm_8,



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 08:54:59 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: elroy.c

Log Message:
A bit more KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp700/dev/elroy.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/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.3 src/sys/arch/hp700/dev/elroy.c:1.4
--- src/sys/arch/hp700/dev/elroy.c:1.3	Thu May  7 08:30:40 2009
+++ src/sys/arch/hp700/dev/elroy.c	Thu May  7 08:54:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.3 2009/05/07 08:30:40 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.4 2009/05/07 08:54:59 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -149,11 +149,11 @@
 void elroy_rrr_8(void *, bus_space_handle_t, bus_size_t, uint64_t *,
 bus_size_t);
 void elroy_wrr_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *,
-bus_size_t c);
+bus_size_t);
 void elroy_wrr_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *,
-bus_size_t c);
+bus_size_t);
 void elroy_wrr_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *,
-bus_size_t c);
+bus_size_t);
 void elroy_sr_1(void *, bus_space_handle_t, bus_size_t, uint8_t,
 bus_size_t);
 void elroy_sr_2(void *, bus_space_handle_t, bus_size_t, uint16_t,



CVS commit: src/sys/arch/hp700/dev

2009-05-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May  7 08:30:41 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: elroy.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp700/dev/elroy.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/hp700/dev/elroy.c
diff -u src/sys/arch/hp700/dev/elroy.c:1.2 src/sys/arch/hp700/dev/elroy.c:1.3
--- src/sys/arch/hp700/dev/elroy.c:1.2	Thu Apr 30 07:01:26 2009
+++ src/sys/arch/hp700/dev/elroy.c	Thu May  7 08:30:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: elroy.c,v 1.2 2009/04/30 07:01:26 skrll Exp $	*/
+/*	$NetBSD: elroy.c,v 1.3 2009/05/07 08:30:40 skrll Exp $	*/
 
 /*	$OpenBSD: elroy.c,v 1.5 2009/03/30 21:24:57 kettenis Exp $	*/
 
@@ -55,113 +55,142 @@
 
 extern struct cfdriver elroy_cd;
 
-void elroy_write32(volatile uint32_t *, uint32_t v);
+void elroy_write32(volatile uint32_t *, uint32_t);
 uint32_t elroy_read32(volatile uint32_t *);
-void elroy_attach_hook(struct device *, struct device *self,
-struct pcibus_attach_args *pba);
-int elroy_maxdevs(void *v, int bus);
-pcitag_t elroy_make_tag(void *v, int bus, int dev, int func);
-void elroy_decompose_tag(void *v, pcitag_t tag, int *bus, int *dev, int *func);
-pcireg_t elroy_conf_read(void *v, pcitag_t tag, int reg);
-void elroy_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data);
-
-
-/* 45678901234567890123456789012345678901234567890123456789012345678901234567 */
-int elroy_iomap(void *v, bus_addr_t bpa, bus_size_t size,
-int flags, bus_space_handle_t *bshp);
-int elroy_memmap(void *v, bus_addr_t bpa, bus_size_t size,
-int flags, bus_space_handle_t *bshp);
-int elroy_subregion(void *v, bus_space_handle_t bsh, bus_size_t offset,
-bus_size_t size, bus_space_handle_t *nbshp);
+void elroy_attach_hook(struct device *, struct device *,
+struct pcibus_attach_args *);
+int elroy_maxdevs(void *, int);
+pcitag_t elroy_make_tag(void *, int, int, int);
+void elroy_decompose_tag(void *, pcitag_t, int *, int *, int *);
+pcireg_t elroy_conf_read(void *, pcitag_t, int);
+void elroy_conf_write(void *, pcitag_t, int, pcireg_t);
+
+int elroy_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
+int elroy_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *);
+int elroy_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t ,
+bus_space_handle_t *);
 int elroy_ioalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t,
 bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
 int elroy_memalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t,
 bus_size_t, int, bus_addr_t *, bus_space_handle_t *);
-void elroy_unmap(void *v, bus_space_handle_t bsh, bus_size_t size);
-void elroy_free(void *v, bus_space_handle_t bh, bus_size_t size);
-void elroy_barrier(void *v, bus_space_handle_t, bus_size_t o, bus_size_t l, int op);
-void * elroy_alloc_parent(struct device *self, struct pci_attach_args *pa, int io);
-void * elroy_vaddr(void *v, bus_space_handle_t);
-
-uint8_t elroy_r1(void *, bus_space_handle_t, bus_size_t o);
-uint16_t elroy_r2(void *, bus_space_handle_t, bus_size_t o);
-uint32_t elroy_r4(void *, bus_space_handle_t, bus_size_t o);
-uint64_t elroy_r8(void *, bus_space_handle_t, bus_size_t o);
-void elroy_w1(void *, bus_space_handle_t, bus_size_t o, uint8_t vv);
-void elroy_w2(void *, bus_space_handle_t, bus_size_t o, uint16_t vv);
-void elroy_w4(void *, bus_space_handle_t, bus_size_t o, uint32_t vv);
-void elroy_w8(void *, bus_space_handle_t, bus_size_t o, uint64_t vv);
-void elroy_rm_1(void *, bus_space_handle_t, bus_size_t o, uint8_t *a, bus_size_t c);
-void elroy_rm_2(void *, bus_space_handle_t, bus_size_t o, uint16_t *a, bus_size_t c);
-void elroy_rm_4(void *, bus_space_handle_t, bus_size_t o, uint32_t *a, bus_size_t c);
-void elroy_rm_8(void *, bus_space_handle_t, bus_size_t o, uint64_t *a, bus_size_t c);
-void elroy_wm_1(void *, bus_space_handle_t, bus_size_t o, const uint8_t *a, bus_size_t c);
-void elroy_wm_2(void *, bus_space_handle_t, bus_size_t o, const uint16_t *a, bus_size_t c);
-void elroy_wm_4(void *, bus_space_handle_t, bus_size_t o, const uint32_t *a, bus_size_t c);
-void elroy_wm_8(void *, bus_space_handle_t, bus_size_t o, const uint64_t *a, bus_size_t c);
-void elroy_sm_1(void *, bus_space_handle_t, bus_size_t o, uint8_t, bus_size_t c);
-void elroy_sm_2(void *, bus_space_handle_t, bus_size_t o, uint16_t, bus_size_t c);
-void elroy_sm_4(void *, bus_space_handle_t, bus_size_t o, uint32_t, bus_size_t c);
-void elroy_sm_8(void *, bus_space_handle_t, bus_size_t o, uint64_t, bus_size_t c);
-void elroy_rrm_2(void *, bus_space_handle_t, bus_size_t o, uint16_t *, bus_size_t c);
-void elroy_rrm_4(void *, bus_space_handle_t, bus_size_t o, uint32_t *, bus_size_t c);
-void elroy_rrm_8(void *, bus_space_handle_t, bus_size_t o, uint64_t *, bus_size_t c);
-void elroy_wrm_2(void *, bus_space_handle_t, bu

CVS commit: src/sys/arch/hp700/dev

2009-04-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr 30 07:08:39 UTC 2009

Added Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
Another file missed by me / cvs in the nick-hppapmap merge.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.2 src/sys/arch/hp700/dev/apic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/hp700/dev/apic.c
diff -u /dev/null src/sys/arch/hp700/dev/apic.c:1.2
--- /dev/null	Thu Apr 30 07:08:39 2009
+++ src/sys/arch/hp700/dev/apic.c	Thu Apr 30 07:08:39 2009
@@ -0,0 +1,362 @@
+/*	$NetBSD: apic.c,v 1.2 2009/04/30 07:08:39 skrll Exp $	*/
+
+/*	$OpenBSD: apic.c,v 1.7 2007/10/06 23:50:54 krw Exp $	*/
+
+/*
+ * Copyright (c) 2005 Michael Shalayeff
+ * Copyright (c) 2007 Mark Kettenis
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define APIC_INT_LINE_MASK	0xff00
+#define APIC_INT_LINE_SHIFT	8
+#define APIC_INT_IRQ_MASK	0x001f
+
+#define APIC_INT_LINE(x) (((x) & APIC_INT_LINE_MASK) >> APIC_INT_LINE_SHIFT)
+#define APIC_INT_IRQ(x) ((x) & APIC_INT_IRQ_MASK)
+
+/*
+ * Interrupt types match the Intel MP Specification.
+ */
+
+#define MPS_INTPO_DEF		0
+#define MPS_INTPO_ACTHI		1
+#define MPS_INTPO_ACTLO		3
+#define MPS_INTPO_SHIFT		0
+#define MPS_INTPO_MASK		3
+
+#define MPS_INTTR_DEF		0
+#define MPS_INTTR_EDGE		1
+#define MPS_INTTR_LEVEL		3
+#define MPS_INTTR_SHIFT		2
+#define MPS_INTTR_MASK		3
+
+#define MPS_INT(p,t) \
+p) & MPS_INTPO_MASK) << MPS_INTPO_SHIFT) | \
+ (((t) & MPS_INTTR_MASK) << MPS_INTTR_SHIFT))
+
+struct apic_iv {
+	struct elroy_softc *sc;
+	pci_intr_handle_t ih;
+	int (*handler)(void *);
+	void *arg;
+	struct apic_iv *next;
+	struct evcnt *cnt;
+};
+
+struct apic_iv *apic_intr_list[CPU_NINTS];
+
+void apic_write(volatile struct elroy_regs *, uint32_t, uint32_t);
+uint32_t apic_read(volatile struct elroy_regs *, uint32_t reg);
+
+void	apic_get_int_tbl(struct elroy_softc *);
+uint32_t apic_get_int_ent0(struct elroy_softc *, int);
+#ifdef DEBUG
+void	apic_dump(struct elroy_softc *);
+#endif
+
+void
+apic_write(volatile struct elroy_regs *r, uint32_t reg, uint32_t val)
+{
+	elroy_write32(&r->apic_addr, htole32(reg));
+	elroy_write32(&r->apic_data, htole32(val));
+	elroy_read32(&r->apic_data);
+}
+
+uint32_t
+apic_read(volatile struct elroy_regs *r, uint32_t reg)
+{
+	elroy_write32(&r->apic_addr, htole32(reg));
+	return le32toh(elroy_read32(&r->apic_data));
+}
+
+void
+apic_attach(struct elroy_softc *sc)
+{
+	volatile struct elroy_regs *r = sc->sc_regs;
+	uint32_t data;
+
+	data = apic_read(r, APIC_VERSION);
+	sc->sc_nints = (data & APIC_VERSION_NENT) >> APIC_VERSION_NENT_SHIFT;
+	printf(" APIC ver %x, %d pins",
+	data & APIC_VERSION_MASK, sc->sc_nints);
+
+	sc->sc_irq = malloc(sc->sc_nints * sizeof(int), M_DEVBUF,
+	M_NOWAIT | M_ZERO);
+	if (sc->sc_irq == NULL)
+		panic("apic_attach: cannot allocate irq table\n");
+
+	apic_get_int_tbl(sc);
+
+#ifdef DEBUG
+	apic_dump(sc);
+#endif
+}
+
+int
+apic_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+{
+	struct elroy_softc *sc = pa->pa_pc->_cookie;
+	pci_chipset_tag_t pc = pa->pa_pc;
+	pcitag_t tag = pa->pa_tag;
+	pcireg_t reg;
+	int line;
+
+	reg = pci_conf_read(pc, tag, PCI_INTERRUPT_REG);
+#ifdef DEBUG
+	printf(" pin=%d line=%d ", PCI_INTERRUPT_PIN(reg),
+	PCI_INTERRUPT_LINE(reg));
+#endif
+	line = PCI_INTERRUPT_LINE(reg);
+	if (sc->sc_irq[line] == 0)
+		sc->sc_irq[line] = hp700_intr_allocate_bit(&int_reg_cpu);;
+	*ihp = (line << APIC_INT_LINE_SHIFT) | sc->sc_irq[line];
+	return (APIC_INT_IRQ(*ihp) == 0);
+}
+
+const char *
+apic_intr_string(void *v, pci_intr_handle_t ih)
+{
+	static char buf[32];
+
+	snprintf(buf, sizeof(buf), "line %ld irq %ld",
+	APIC_INT_LINE(ih), APIC_INT_IRQ(ih));
+
+	return (buf);
+}
+
+void *
+apic_intr_establish(void *v, pci_intr_handle_t ih,
+int pri, int (*handler)(void *), void *arg)
+{
+	struct elroy_softc *sc = v;
+	volatile struct elroy_regs *r = sc->sc_regs;
+	hppa_hpa_t hpa = cpu_gethpa(0);
+	struct evcnt *cnt;
+	struct apic_iv *aiv, *biv;
+	void *iv;

CVS commit: src/sys/arch/hp700/dev

2009-04-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr 30 07:03:12 UTC 2009

Added Files:
src/sys/arch/hp700/dev: astro.c uturn.c

Log Message:
Somehow these were missed by me / cvs in the nick-hppapmap merge.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.2 src/sys/arch/hp700/dev/astro.c \
src/sys/arch/hp700/dev/uturn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/hp700/dev/astro.c
diff -u /dev/null src/sys/arch/hp700/dev/astro.c:1.2
--- /dev/null	Thu Apr 30 07:03:12 2009
+++ src/sys/arch/hp700/dev/astro.c	Thu Apr 30 07:03:12 2009
@@ -0,0 +1,770 @@
+/*	$NetBSD: astro.c,v 1.2 2009/04/30 07:03:12 skrll Exp $	*/
+
+/*	$OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $	*/
+
+/*
+ * Copyright (c) 2007 Mark Kettenis
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct astro_regs {
+	uint32_t	rid;
+	uint32_t	pad;
+	uint32_t	ioc_ctrl;
+	uint32_t	pad0008;
+	uint8_t		resv1[0x0300 - 0x0010];
+	uint64_t	lmmio_direct0_base;
+	uint64_t	lmmio_direct0_mask;
+	uint64_t	lmmio_direct0_route;
+	uint64_t	lmmio_direct1_base;
+	uint64_t	lmmio_direct1_mask;
+	uint64_t	lmmio_direct1_route;
+	uint64_t	lmmio_direct2_base;
+	uint64_t	lmmio_direct2_mask;
+	uint64_t	lmmio_direct2_route;
+	uint64_t	lmmio_direct3_base;
+	uint64_t	lmmio_direct3_mask;
+	uint64_t	lmmio_direct3_route;
+	uint64_t	lmmio_dist_base;
+	uint64_t	lmmio_dist_mask;
+	uint64_t	lmmio_dist_route;
+	uint64_t	gmmio_dist_base;
+	uint64_t	gmmio_dist_mask;
+	uint64_t	gmmio_dist_route;
+	uint64_t	ios_dist_base;
+	uint64_t	ios_dist_mask;
+	uint64_t	ios_dist_route;
+	uint8_t		resv2[0x03c0 - 0x03a8];
+	uint64_t	ios_direct_base;
+	uint64_t	ios_direct_mask;
+	uint64_t	ios_direct_route;
+	uint8_t		resv3[0x22000 - 0x03d8];
+	uint64_t	func_id;
+	uint64_t	func_class;
+	uint8_t		resv4[0x22040 - 0x22010];
+	uint64_t	rope_config;
+	uint8_t		resv5[0x22050 - 0x22048];
+	uint64_t	rope_debug;
+	uint8_t		resv6[0x22200 - 0x22058];
+	uint64_t	rope0_control;
+	uint64_t	rope1_control;
+	uint64_t	rope2_control;
+	uint64_t	rope3_control;
+	uint64_t	rope4_control;
+	uint64_t	rope5_control;
+	uint64_t	rope6_control;
+	uint64_t	rope7_control;
+	uint8_t		resv7[0x22300 - 0x22240];
+	uint32_t	tlb_ibase;
+	uint32_t	pad22300;
+	uint32_t	tlb_imask;
+	uint32_t	pad22308;
+	uint32_t	tlb_pcom;
+	uint32_t	pad22310;
+	uint32_t	tlb_tcnfg;
+	uint32_t	pad22318;
+	uint64_t	tlb_pdir_base;
+};
+
+#define ASTRO_IOC_CTRL_TE	0x0001	/* TOC Enable */
+#define ASTRO_IOC_CTRL_CE	0x0002	/* Coalesce Enable */
+#define ASTRO_IOC_CTRL_DE	0x0004	/* Dillon Enable */
+#define ASTRO_IOC_CTRL_IE	0x0008	/* IOS Enable */
+#define ASTRO_IOC_CTRL_OS	0x0010	/* Outbound Synchronous */
+#define ASTRO_IOC_CTRL_IS	0x0020	/* Inbound Synchronous */
+#define ASTRO_IOC_CTRL_RC	0x0040	/* Read Current Enable */
+#define ASTRO_IOC_CTRL_L0	0x0080	/* 0-length Read Enable */
+#define ASTRO_IOC_CTRL_RM	0x0100	/* Real Mode */
+#define ASTRO_IOC_CTRL_NC	0x0200	/* Non-coherent Mode */
+#define ASTRO_IOC_CTRL_ID	0x0400	/* Interrupt Disable */
+#define ASTRO_IOC_CTRL_D4	0x0800	/* Disable 4-byte Coalescing */
+#define ASTRO_IOC_CTRL_CC	0x1000	/* Increase Coalescing counter value */
+#define ASTRO_IOC_CTRL_DD	0x2000	/* Disable distr. range coalescing */
+#define ASTRO_IOC_CTRL_DC	0x4000	/* Disable the coalescing counter */
+
+#define IOTTE_V		0x8000LL	/* Entry valid */
+#define IOTTE_PAMASK	0x00fff000LL
+#define IOTTE_CI	0x00ffLL	/* Coherent index */
+
+struct astro_softc {
+	struct device sc_dv;
+
+	bus_dma_tag_t sc_dmat;
+	struct astro_regs volatile *sc_regs;
+	uint64_t *sc_pdir;
+
+	char sc_dvmamapname[20];
+	struct extent *sc_dvmamap;
+	struct hppa_bus_dma_tag sc_dmatag;
+};
+
+/*
+ * per-map DVMA page table
+ */
+struct iommu_page_entry {
+	SPLAY_ENTRY(iommu_page_entry) ipe_node;
+	paddr_t	ipe_pa;
+	vaddr_t	ipe_va;
+	bus_addr_t ipe_dva;
+};
+
+struct iommu_page_map {
+	SPLAY_HEAD(iommu_page_tree, iommu_page_entry) ipm_tree;
+	int ipm_maxpage;	/* Size of allocated page map */
+	int ipm_pagecnt;	/* Number of entries in use */
+	struct iommu_page_en

CVS commit: src/sys/arch/hp700/dev

2009-04-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr 29 07:14:58 UTC 2009

Modified Files:
src/sys/arch/hp700/dev: dino.c

Log Message:
Don't panic in dino_intr_disesablish. Just note that it needs to be
implemented for now.

Stop gap fix for PR/41295.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp700/dev/dino.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.6 src/sys/arch/hp700/dev/dino.c:1.7
--- src/sys/arch/hp700/dev/dino.c:1.6	Thu Aug 28 08:25:46 2008
+++ src/sys/arch/hp700/dev/dino.c	Wed Apr 29 07:14:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.6 2008/08/28 08:25:46 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.7 2009/04/29 07:14:58 skrll Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.6 2008/08/28 08:25:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.7 2009/04/29 07:14:58 skrll Exp $");
 
 /* #include "cardbus.h" */
 
@@ -387,7 +387,7 @@
 void
 dino_intr_disestablish(void *v, void *cookie)
 {
-	panic("There is no hp700_intr_disestablish()!");
+	/* XXX Implement me */
 }