Source-Changes-HG archive

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

[src/trunk]: src Port lom(4) driver for LOMlite lights out management hardwar...



details:   https://anonhg.NetBSD.org/src/rev/fe482f216904
branches:  trunk
changeset: 747791:fe482f216904
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Fri Oct 02 15:09:16 2009 +0000

description:
Port lom(4) driver for LOMlite lights out management hardware monitor
and watchdog timer from OpenBSD.

It supports the LOMlite found on Sun Netra t1 and the LOMlite2 found
on Sun Netra T1/X1 and Sun Fire V100/V120.

diffstat:

 distrib/sets/lists/man/mi            |    5 +-
 share/man/man4/man4.sparc64/Makefile |    4 +-
 share/man/man4/man4.sparc64/lom.4    |   61 ++
 sys/arch/sparc64/conf/GENERIC        |    5 +-
 sys/arch/sparc64/conf/files.sparc64  |    6 +-
 sys/arch/sparc64/dev/lom.c           |  900 +++++++++++++++++++++++++++++++++++
 6 files changed, 975 insertions(+), 6 deletions(-)

diffs (truncated from 1062 to 300 lines):

diff -r 962ea2df7f4d -r fe482f216904 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Fri Oct 02 15:05:42 2009 +0000
+++ b/distrib/sets/lists/man/mi Fri Oct 02 15:09:16 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1160 2009/09/30 22:32:04 jmcneill Exp $
+# $NetBSD: mi,v 1.1161 2009/10/02 15:09:16 nakayama Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1461,6 +1461,7 @@
 ./usr/share/man/cat4/sparc64/envctrl.0         man-sys-catman          .cat
 ./usr/share/man/cat4/sparc64/fdc.0             man-sys-catman          .cat
 ./usr/share/man/cat4/sparc64/intro.0           man-sys-catman          .cat
+./usr/share/man/cat4/sparc64/lom.0             man-sys-catman          .cat
 ./usr/share/man/cat4/sparc64/sab.0             man-sys-catman          .cat
 ./usr/share/man/cat4/sparc64/sabtty.0          man-sys-catman          .cat
 ./usr/share/man/cat4/spc.0                     man-sys-catman          .cat
@@ -4012,6 +4013,7 @@
 ./usr/share/man/html4/sparc64/envctrl.html     man-sys-htmlman         html
 ./usr/share/man/html4/sparc64/fdc.html         man-sys-htmlman         html
 ./usr/share/man/html4/sparc64/intro.html       man-sys-htmlman         html
+./usr/share/man/html4/sparc64/lom.html         man-sys-htmlman         html
 ./usr/share/man/html4/sparc64/sab.html         man-sys-htmlman         html
 ./usr/share/man/html4/sparc64/sabtty.html      man-sys-htmlman         html
 ./usr/share/man/html4/spc.html                 man-sys-htmlman         html
@@ -6479,6 +6481,7 @@
 ./usr/share/man/man4/sparc64/envctrl.4         man-sys-man             .man
 ./usr/share/man/man4/sparc64/fdc.4             man-sys-man             .man
 ./usr/share/man/man4/sparc64/intro.4           man-sys-man             .man
+./usr/share/man/man4/sparc64/lom.4             man-sys-man             .man
 ./usr/share/man/man4/sparc64/sab.4             man-sys-man             .man
 ./usr/share/man/man4/sparc64/sabtty.4          man-sys-man             .man
 ./usr/share/man/man4/spc.4                     man-sys-man             .man
diff -r 962ea2df7f4d -r fe482f216904 share/man/man4/man4.sparc64/Makefile
--- a/share/man/man4/man4.sparc64/Makefile      Fri Oct 02 15:05:42 2009 +0000
+++ b/share/man/man4/man4.sparc64/Makefile      Fri Oct 02 15:09:16 2009 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2007/05/08 19:23:18 jnemeth Exp $
+# $NetBSD: Makefile,v 1.5 2009/10/02 15:09:16 nakayama Exp $
 
 MANSUBDIR=/sparc64
 
-MAN=   envctrl.4 fdc.4 intro.4 sab.4
+MAN=   envctrl.4 fdc.4 intro.4 lom.4 sab.4
 
 MLINKS+=       sab.4 sabtty.4
 
diff -r 962ea2df7f4d -r fe482f216904 share/man/man4/man4.sparc64/lom.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/man4.sparc64/lom.4 Fri Oct 02 15:09:16 2009 +0000
@@ -0,0 +1,61 @@
+.\"     $NetBSD: lom.4,v 1.1 2009/10/02 15:09:16 nakayama Exp $
+.\"     $OpenBSD: lom.4,v 1.4 2009/09/23 22:08:07 kettenis Exp $
+.\"
+.\" Copyright (c) 2009 Mark Kettenis <kettenis%openbsd.org@localhost>
+.\"
+.\" 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.
+.\"
+.Dd $Mdocdate: October 2 2009 $
+.Dt LOM 4 sparc64
+.Os
+.Sh NAME
+.Nm lom
+.Nd lights out management
+.Sh SYNOPSIS
+.Cd "lom* at ebus?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the LOMlite lights out management module
+found on Sun Netra t1 systems and the LOMlite2 module found on Sun
+Fire V100/V120 and Sun Netra T1/X1 systems.
+Temperature readings, PSU status and fan status provided by the LOM
+are made available through the
+.Xr envstat 8
+interface.
+The integrated watchdog timer can be configured through the
+.Xr wdogctl 8
+interface.
+The watchdog timer supports timeouts between 1 and 126 seconds.
+.Pp
+The
+.Nm
+driver will update the hostname stored in the LOM whenever the
+system's hostname is changed.
+.Sh SEE ALSO
+.Xr hostname 1 ,
+.Xr envsys 4 ,
+.Xr envstat 8 ,
+.Xr wdogctl 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Ox 4.7
+and was then ported to
+.Nx 5.1 .
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Mark Kettenis Aq kettenis%openbsd.org@localhost .
diff -r 962ea2df7f4d -r fe482f216904 sys/arch/sparc64/conf/GENERIC
--- a/sys/arch/sparc64/conf/GENERIC     Fri Oct 02 15:05:42 2009 +0000
+++ b/sys/arch/sparc64/conf/GENERIC     Fri Oct 02 15:09:16 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.110 2009/03/06 20:31:52 joerg Exp $
+# $NetBSD: GENERIC,v 1.111 2009/10/02 15:09:16 nakayama Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.110 $"
+#ident                 "GENERIC-$Revision: 1.111 $"
 
 maxusers       64
 
@@ -884,6 +884,7 @@
 
 psm*           at ebus?                # Ultrabook IIi microcontroller
 envctrl*       at ebus?                # Ultra E450 environmental monitoring
+lom*           at ebus?                # LOMlite lights out management
 
 # Netra X1 / T1 style environmental monitoring
 alipm*         at pci?
diff -r 962ea2df7f4d -r fe482f216904 sys/arch/sparc64/conf/files.sparc64
--- a/sys/arch/sparc64/conf/files.sparc64       Fri Oct 02 15:05:42 2009 +0000
+++ b/sys/arch/sparc64/conf/files.sparc64       Fri Oct 02 15:09:16 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.sparc64,v 1.120 2008/12/10 05:56:22 mrg Exp $
+#      $NetBSD: files.sparc64,v 1.121 2009/10/02 15:09:16 nakayama Exp $
 
 # @(#)files.sparc64    8.1 (Berkeley) 7/19/93
 # sparc64-specific configuration info
@@ -67,6 +67,10 @@
 attach envctrl at ebus
 file   arch/sparc64/dev/envctrl.c      envctrl
 
+device lom: sysmon_envsys, sysmon_wdog
+attach lom at ebus
+file   arch/sparc64/dev/lom.c                  lom
+
 device cpu
 attach cpu at mainbus
 file   arch/sparc64/sparc64/cpu.c
diff -r 962ea2df7f4d -r fe482f216904 sys/arch/sparc64/dev/lom.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sparc64/dev/lom.c        Fri Oct 02 15:09:16 2009 +0000
@@ -0,0 +1,900 @@
+/*     $NetBSD: lom.c,v 1.1 2009/10/02 15:09:16 nakayama Exp $ */
+/*     $OpenBSD: lom.c,v 1.15 2009/09/27 18:08:42 kettenis Exp $       */
+/*
+ * Copyright (c) 2009 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 <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: lom.c,v 1.1 2009/10/02 15:09:16 nakayama Exp $");
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/kernel.h>
+#include <sys/proc.h>
+#include <sys/envsys.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+
+#include <machine/autoconf.h>
+
+#include <dev/ebus/ebusreg.h>
+#include <dev/ebus/ebusvar.h>
+#include <dev/sysmon/sysmonvar.h>
+
+/*
+ * LOMlite is a so far unidentified microcontroller.
+ */
+#define LOM1_STATUS            0x00    /* R */
+#define  LOM1_STATUS_BUSY      0x80
+#define LOM1_CMD               0x00    /* W */
+#define LOM1_DATA              0x01    /* R/W */
+
+/*
+ * LOMlite2 is implemented as a H8/3437 microcontroller which has its
+ * on-chip host interface hooked up to EBus.
+ */
+#define LOM2_DATA              0x00    /* R/W */
+#define LOM2_CMD               0x01    /* W */
+#define LOM2_STATUS            0x01    /* R */
+#define  LOM2_STATUS_OBF       0x01    /* Output Buffer Full */
+#define  LOM2_STATUS_IBF       0x02    /* Input Buffer Full  */
+
+#define LOM_IDX_CMD            0x00
+#define  LOM_IDX_CMD_GENERIC   0x00
+#define  LOM_IDX_CMD_TEMP      0x04
+#define  LOM_IDX_CMD_FAN       0x05
+
+#define LOM_IDX_FW_REV         0x01    /* Firmware revision  */
+
+#define LOM_IDX_FAN1           0x04    /* Fan speed */
+#define LOM_IDX_FAN2           0x05
+#define LOM_IDX_FAN3           0x06
+#define LOM_IDX_FAN4           0x07
+#define LOM_IDX_PSU1           0x08    /* PSU status */
+#define LOM_IDX_PSU2           0x09
+#define LOM_IDX_PSU3           0x0a
+#define  LOM_PSU_INPUTA                0x01
+#define  LOM_PSU_INPUTB                0x02
+#define  LOM_PSU_OUTPUT                0x04
+#define  LOM_PSU_PRESENT       0x08
+#define  LOM_PSU_STANDBY       0x10
+
+#define LOM_IDX_TEMP1          0x18    /* Temperature */
+#define LOM_IDX_TEMP2          0x19
+#define LOM_IDX_TEMP3          0x1a
+#define LOM_IDX_TEMP4          0x1b
+#define LOM_IDX_TEMP5          0x1c
+#define LOM_IDX_TEMP6          0x1d
+#define LOM_IDX_TEMP7          0x1e
+#define LOM_IDX_TEMP8          0x1f
+
+#define LOM_IDX_LED1           0x25
+
+#define LOM_IDX_ALARM          0x30
+#define LOM_IDX_WDOG_CTL       0x31
+#define  LOM_WDOG_ENABLE       0x01
+#define  LOM_WDOG_RESET                0x02
+#define  LOM_WDOG_AL3_WDOG     0x04
+#define  LOM_WDOG_AL3_FANPSU   0x08
+#define LOM_IDX_WDOG_TIME      0x32
+#define  LOM_WDOG_TIME_MAX     126
+
+#define LOM1_IDX_HOSTNAME1     0x33
+#define LOM1_IDX_HOSTNAME2     0x34
+#define LOM1_IDX_HOSTNAME3     0x35
+#define LOM1_IDX_HOSTNAME4     0x36
+#define LOM1_IDX_HOSTNAME5     0x37
+#define LOM1_IDX_HOSTNAME6     0x38
+#define LOM1_IDX_HOSTNAME7     0x39
+#define LOM1_IDX_HOSTNAME8     0x3a
+#define LOM1_IDX_HOSTNAME9     0x3b
+#define LOM1_IDX_HOSTNAME10    0x3c
+#define LOM1_IDX_HOSTNAME11    0x3d
+#define LOM1_IDX_HOSTNAME12    0x3e
+
+#define LOM2_IDX_HOSTNAMELEN   0x38
+#define LOM2_IDX_HOSTNAME      0x39
+
+#define LOM_IDX_CONFIG         0x5d
+#define LOM_IDX_FAN1_CAL       0x5e
+#define LOM_IDX_FAN2_CAL       0x5f
+#define LOM_IDX_FAN3_CAL       0x60
+#define LOM_IDX_FAN4_CAL       0x61
+#define LOM_IDX_FAN1_LOW       0x62
+#define LOM_IDX_FAN2_LOW       0x63
+#define LOM_IDX_FAN3_LOW       0x64
+#define LOM_IDX_FAN4_LOW       0x65
+
+#define LOM_IDX_CONFIG2                0x66
+#define LOM_IDX_CONFIG3                0x67
+
+#define LOM_IDX_PROBE55                0x7e    /* Always returns 0x55 */
+#define LOM_IDX_PROBEAA                0x7f    /* Always returns 0xaa */
+
+#define LOM_IDX_WRITE          0x80
+
+#define LOM_IDX4_TEMP_NAME_START       0x40
+#define LOM_IDX4_TEMP_NAME_END         0xff
+
+#define LOM_IDX5_FAN_NAME_START                0x40
+#define LOM_IDX5_FAN_NAME_END          0xff
+
+#define LOM_MAX_FAN    4
+#define LOM_MAX_PSU    3
+#define LOM_MAX_TEMP   8
+
+struct lom_cmd {



Home | Main Index | Thread Index | Old Index