Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcmips/vr - vrc4172 address map definisions.



details:   https://anonhg.NetBSD.org/src/rev/9ac103185e81
branches:  trunk
changeset: 499097:9ac103185e81
user:      sato <sato%NetBSD.org@localhost>
date:      Sat Nov 11 04:42:08 2000 +0000

description:
- vrc4172 address map definisions.
- vrc4172 gpio/ucy/pcs/pmu/pwm register definitions.
- vrc4172 pwm driver (not yet completely)

diffstat:

 sys/arch/hpcmips/vr/vrc4172gpioreg.h |   55 ++++++++
 sys/arch/hpcmips/vr/vrc4172icureg.h  |   40 ++++++
 sys/arch/hpcmips/vr/vrc4172pcsreg.h  |   70 +++++++++++
 sys/arch/hpcmips/vr/vrc4172pmureg.h  |   49 ++++++++
 sys/arch/hpcmips/vr/vrc4172pwm.c     |  214 +++++++++++++++++++++++++++++++++++
 sys/arch/hpcmips/vr/vrc4172pwmreg.h  |   44 +++++++
 sys/arch/hpcmips/vr/vrc4172pwmvar.h  |   46 +++++++
 sys/arch/hpcmips/vr/vrc4172reg.h     |   41 ++++++
 8 files changed, 559 insertions(+), 0 deletions(-)

diffs (truncated from 591 to 300 lines):

diff -r a2c86d9e93ce -r 9ac103185e81 sys/arch/hpcmips/vr/vrc4172gpioreg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vrc4172gpioreg.h      Sat Nov 11 04:42:08 2000 +0000
@@ -0,0 +1,55 @@
+/*     $NetBSD: vrc4172gpioreg.h,v 1.1 2000/11/11 04:42:08 sato Exp $  */
+
+/*
+ * Copyright (c) 2000 SATO Kazumi.  All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ *     Vrc4172 GPIO (General Purpose I/O) Unit Registers.
+ */
+#define VRC2_EXGPREG_MAX       0x4a
+
+#define VRC2_EXGPDATA0         0x00    /* I/O data (0..15) */
+#define VRC2_EXGPDIR0          0x02    /* direction (0..15) */
+#define VRC2_EXGPINTEN0                0x04    /* interrupt enable (0..15) */
+#define VRC2_EXGPINTST0                0x06    /* interrupt status (0..15) */
+#define VRC2_EXGPINTTYP0       0x08    /* interrupt type (0..15) */
+#define VRC2_EXGPINTLV0L       0x0a    /* interrupt level low (0..15) */
+#define VRC2_EXGPINTLV0H       0x0c    /* interrupt level high (0..15) */
+
+#define VRC2_EXGPDATA1         0x40    /* I/O data (16..23) */
+#define VRC2_EXGPDIR1          0x42    /* direction (16..23) */
+#define VRC2_EXGPINTEN1                0x44    /* interrupt enable (16..23) */
+#define VRC2_EXGPINTST1                0x46    /* interrupt status (16..23) */
+#define VRC2_EXGPINTTYP1       0x48    /* interrupt type (16..23) */
+#define VRC2_EXGPINTLV1L       0x4a    /* interrupt level low (16..23) */
+
+#define VRC2_EXGPINTTYP_EDGE   1
+#define VRC2_EXGPINTTYP_LEVEL  0
+#define VRC2_EXGPINTAL_HIGH    1
+#define VRC2_EXGPINTAL_LOW     0
+#define VRC2_EXGPINTHT_HOLD    1
+#define VRC2_EXGPINTHT_THROUGH 0
+
+/* end */
diff -r a2c86d9e93ce -r 9ac103185e81 sys/arch/hpcmips/vr/vrc4172icureg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vrc4172icureg.h       Sat Nov 11 04:42:08 2000 +0000
@@ -0,0 +1,40 @@
+/* $NetBSD: vrc4172icureg.h,v 1.1 2000/11/11 04:42:08 sato Exp $ */
+/*
+ * Copyright (c) 2000 SATO Kazumi.  All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ * Vrc4172 ICU unit register definition
+ */
+#define VRC2_ICU_1284INTRQ     0x0
+#define        VRC2_ICU_1284IRQ        0x08    /* interrupt to IRQ */
+#define        VRC2_ICU_1284INTRP      0x04    /* interrupt to INTRP */
+#define        VRC2_ICU_1284THRU       0x02    /* turu status */
+#define        VRC2_ICU_1284LATCH      0x01    /* latched status and clear */
+
+#define VRC2_ICU_16550INTRQ    0x2
+#define        VRC2_ICU_16550THRU      0x02    /* turu status */
+#define        VRC2_ICU_16550LATCH     0x01    /* latched status and clear */
+
+/* end */
diff -r a2c86d9e93ce -r 9ac103185e81 sys/arch/hpcmips/vr/vrc4172pcsreg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vrc4172pcsreg.h       Sat Nov 11 04:42:08 2000 +0000
@@ -0,0 +1,70 @@
+/*     $NetBSD: vrc4172pcsreg.h,v 1.1 2000/11/11 04:42:09 sato Exp $   */
+
+/*
+ * Copyright (c) 2000 SATO Kazumi.  All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ *     Vrc4172 PCS (Programable Chip Select) Unit Registers.
+ */
+#define VRC2_EXCSREG_MAX               0x30
+
+#define VRC2_EXCS0SELL 0x00
+#define VRC2_EXCS0SELH 0x02
+#define VRC2_EXCS0MSKL 0x04
+#define VRC2_EXCS0MSKH 0x06
+#define VRC2_EXCS1SELL 0x08
+#define VRC2_EXCS1SELH 0x0a
+#define VRC2_EXCS1MSKL 0x0c
+#define VRC2_EXCS1MSKH 0x0e
+#define VRC2_EXCS2SELL 0x10
+#define VRC2_EXCS2SELH 0x12
+#define VRC2_EXCS2MSKL 0x14
+#define VRC2_EXCS2MSKH 0x16
+#define VRC2_EXCS3SELL 0x18
+#define VRC2_EXCS3SELH 0x1a
+#define VRC2_EXCS3MSKL 0x1c
+#define VRC2_EXCS3MSKH 0x1e
+#define VRC2_EXCS4SELL 0x20
+#define VRC2_EXCS4SELH 0x22
+#define VRC2_EXCS4MSKL 0x24
+#define VRC2_EXCS4MSKH 0x26
+#define VRC2_EXCS5SELL 0x28
+#define VRC2_EXCS5SELH 0x2a
+#define VRC2_EXCS5MSKL 0x2c
+#define VRC2_EXCS5MSKH 0x2e
+
+/* for EXCSnSELL */
+#define VRC2_EXCSSELLMASK      0xfffe
+/* for EXCSnSELH */
+#define VRC2_EXCSSELHMASK      0x01ff
+
+/* for EXCSnMSKL */
+#define VRC2_EXCSENMASK        0x1
+#define VRC2_EXCSEN            0x1
+#define VRC2_EXCSDIS           0x00
+#define VRC2_EXCSMSKLMASK      0xfffe
+/* for EXCSnMSKH */
+#define VRC2_EXCSMSKHMASK      0x01ff
+/* end */
diff -r a2c86d9e93ce -r 9ac103185e81 sys/arch/hpcmips/vr/vrc4172pmureg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vrc4172pmureg.h       Sat Nov 11 04:42:08 2000 +0000
@@ -0,0 +1,49 @@
+/* $NetBSD: vrc4172pmureg.h,v 1.1 2000/11/11 04:42:09 sato Exp $ */
+/*
+ * Copyright (c) 2000 SATO Kazumi.  All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+
+/*
+ * Vrc4172 PMU unit register definition
+ */
+
+#define VRC2_PMU_SYSCLKCTRL    0x00
+#define        VRC2_PMU_IRST           0x20    /* internal reset */
+#define                VRC2_PMU_OSCDIS         0x10    /* OSC disable */
+#define        VRC2_PMU_CKO48          0x01    /* CKO48 enable */
+#define VRC2_PMU_1284CTRL      0x02
+#define        VRC2_PMU_1284EN         0x04    /* 1284 enable */
+#define        VRC2_PMU_1284RST        0x02    /* 1284 reset (>= 1us) */
+#define        VRC2_PMU_1284CLKDIS     0x01    /* 1284 clock disanle */
+#define VRC2_PMU_16550CTRL     0x04
+#define        VRC2_PMU_16550RST       0x02    /* 16550 reset (>= 200ms) */
+#define        VRC2_PMU_16550CLKDIS    0x01    /* 16550 clock disable */
+#define VRC2_PMU_USBCTL                0x0c
+#define        VRC2_PMU_USBCLKDIS      0x01    /* USB clock disable  */
+#define VRC2_PMU_PS2PWMCTL     0x0e
+#define        VRC2_PMU_PWMCLKDIS      0x10    /* PWM clock disable */
+#define                VRC2_PMU_PS2RST         0x02    /* PS2 reset */
+#define                VRC2_PMU_PS2CLKDIS      0x01    /* PS2 clock disable */
+
+/* end */
diff -r a2c86d9e93ce -r 9ac103185e81 sys/arch/hpcmips/vr/vrc4172pwm.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpcmips/vr/vrc4172pwm.c  Sat Nov 11 04:42:08 2000 +0000
@@ -0,0 +1,214 @@
+/*     $NetBSD: vrc4172pwm.c,v 1.1 2000/11/11 04:42:09 sato Exp $      */
+
+/*
+ * Copyright (c) 2000 SATO Kazumi. All rights reserved.
+ *
+ * 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 AUTHOR 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 AUTHOR 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.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/reboot.h>
+
+#include <machine/bus.h>
+#include <machine/config_hook.h>
+#include <machine/platid.h>
+
+#include <hpcmips/vr/vrc4172pwmvar.h>
+#include <hpcmips/vr/vrc4172pwmreg.h>
+
+
+#ifdef VRC2PWMDEBUG
+#ifndef VRC2PWMDEBUG_CONF
+#define VRC2PWMDEBUG_CONF 0
+#endif /* VRC2PWMDEBUG_CONF */
+int vrc4172pwmdebug = VRC2PWMDEBUG_CONF;
+#define DPRINTF(arg) if (vrc4172pwmdebug) printf arg;
+#define VPRINTF(arg) if (bootverbose||vrc4172pwmdebug) printf arg;
+#define VDUMPREG(arg) if (bootverbose||vrc4172pwmdebug) vrc4172_dumpreg arg;
+#else /* VRC2PWMDEBUG */
+#define DPRINTF(arg)
+#define VPRINTF(arg) if (bootverbose) printf arg;
+#define VDUMPREG(arg) if (bootverbose) vrc4172_dumpreg arg;
+#endif /* VRC2PWMDEBUG */
+
+static int vrc4172pwmmatch __P((struct device *, struct cfdata *, void *));
+static void vrc4172pwmattach __P((struct device *, struct device *, void *));
+
+static void vrc4172pwm_write __P((struct vrc4172pwm_softc *, int, unsigned short));
+static unsigned short vrc4172pwm_read __P((struct vrc4172pwm_softc *, int));
+
+static int vrc4172pwm_event __P((void *, int, long, void *));
+static int vrc4172pwm_pmevent __P((void *, int, long, void *));
+
+static void vrc4172pwm_dumpreg __P((struct vrc4172pwm_softc *));
+static void vrc4172pwm_init_brightness __P((void));
+



Home | Main Index | Thread Index | Old Index