Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 2014 14:24:13 +0000 (UTC)
From:      Mark Murray <markm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r265818 - in projects/random_number_generator: bin/sh bin/sh/tests/builtins share/man/man4 share/mk sys/arm/arm sys/boot/fdt/dts/mips sys/conf sys/dev/etherswitch/ip17x sys/dev/iicbus s...
Message-ID:  <201405101424.s4AEODib047831@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markm
Date: Sat May 10 14:24:12 2014
New Revision: 265818
URL: http://svnweb.freebsd.org/changeset/base/265818

Log:
  MFC - tracking commit.
  Merging r265741 through r265817.

Added:
  projects/random_number_generator/share/man/man4/lm75.4
     - copied unchanged from r265817, head/share/man/man4/lm75.4
  projects/random_number_generator/share/man/man4/vt.4
     - copied unchanged from r265817, head/share/man/man4/vt.4
  projects/random_number_generator/sys/conf/kern.opts.mk
     - copied unchanged from r265817, head/sys/conf/kern.opts.mk
  projects/random_number_generator/sys/dev/iicbus/lm75.c
     - copied unchanged from r265817, head/sys/dev/iicbus/lm75.c
Modified:
  projects/random_number_generator/bin/sh/main.c
  projects/random_number_generator/bin/sh/options.c
  projects/random_number_generator/bin/sh/tests/builtins/getopts1.0
  projects/random_number_generator/share/man/man4/Makefile
  projects/random_number_generator/share/man/man4/udplite.4
  projects/random_number_generator/share/mk/src.opts.mk
  projects/random_number_generator/sys/arm/arm/cpufunc_asm_armv7.S
  projects/random_number_generator/sys/arm/arm/locore.S
  projects/random_number_generator/sys/boot/fdt/dts/mips/beri-netfpga.dts
  projects/random_number_generator/sys/conf/files
  projects/random_number_generator/sys/conf/kern.pre.mk
  projects/random_number_generator/sys/conf/kmod.mk
  projects/random_number_generator/sys/conf/options.mips
  projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175c.c
  projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175d.c
  projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x.c
  projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x_var.h
  projects/random_number_generator/sys/dev/iwn/if_iwn_chip_cfg.h
  projects/random_number_generator/sys/dev/netfpga10g/nf10bmac/if_nf10bmac.c
  projects/random_number_generator/sys/dev/netfpga10g/nf10bmac/if_nf10bmac_fdt.c
  projects/random_number_generator/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h
  projects/random_number_generator/sys/dev/usb/controller/dwc_otg.c
  projects/random_number_generator/sys/dev/usb/controller/dwc_otg.h
  projects/random_number_generator/sys/dev/usb/controller/dwc_otg_fdt.c
  projects/random_number_generator/sys/dev/usb/controller/dwc_otgreg.h
  projects/random_number_generator/sys/dev/usb/usb_pf.c
  projects/random_number_generator/sys/kern/kern_timeout.c
  projects/random_number_generator/sys/mips/atheros/ar71xx_gpio.c
  projects/random_number_generator/sys/mips/atheros/ar71xx_machdep.c
  projects/random_number_generator/sys/modules/sound/sound/Makefile
  projects/random_number_generator/sys/netinet/udp_usrreq.c
  projects/random_number_generator/usr.bin/systat/ifstat.c
  projects/random_number_generator/usr.bin/systat/main.c
  projects/random_number_generator/usr.bin/systat/systat.1
  projects/random_number_generator/usr.sbin/ndp/ndp.8
  projects/random_number_generator/usr.sbin/ndp/ndp.c
Directory Properties:
  projects/random_number_generator/   (props changed)
  projects/random_number_generator/share/man/man4/   (props changed)
  projects/random_number_generator/sys/   (props changed)
  projects/random_number_generator/sys/boot/   (props changed)
  projects/random_number_generator/sys/conf/   (props changed)

Modified: projects/random_number_generator/bin/sh/main.c
==============================================================================
--- projects/random_number_generator/bin/sh/main.c	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/bin/sh/main.c	Sat May 10 14:24:12 2014	(r265818)
@@ -140,11 +140,13 @@ main(int argc, char *argv[])
 #endif
 	rootpid = getpid();
 	rootshell = 1;
+	INTOFF;
 	initvar();
 	setstackmark(&smark);
 	setstackmark(&smark2);
 	procargs(argc, argv);
 	pwd_init(iflag);
+	INTON;
 	if (iflag)
 		chkmail(1);
 	if (argv[0] && argv[0][0] == '-') {

Modified: projects/random_number_generator/bin/sh/options.c
==============================================================================
--- projects/random_number_generator/bin/sh/options.c	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/bin/sh/options.c	Sat May 10 14:24:12 2014	(r265818)
@@ -474,8 +474,10 @@ atend:
 				err |= setvarsafe("OPTARG", s, 0);
 			}
 			else {
-				out1fmt("Illegal option -%c\n", c);
+				out2fmt_flush("Illegal option -%c\n", c);
+				INTOFF;
 				(void) unsetvar("OPTARG");
+				INTON;
 			}
 			c = '?';
 			goto bad;
@@ -493,8 +495,10 @@ atend:
 				c = ':';
 			}
 			else {
-				out1fmt("No arg for -%c option\n", c);
+				out2fmt_flush("No arg for -%c option\n", c);
+				INTOFF;
 				(void) unsetvar("OPTARG");
+				INTON;
 				c = '?';
 			}
 			goto bad;

Modified: projects/random_number_generator/bin/sh/tests/builtins/getopts1.0
==============================================================================
--- projects/random_number_generator/bin/sh/tests/builtins/getopts1.0	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/bin/sh/tests/builtins/getopts1.0	Sat May 10 14:24:12 2014	(r265818)
@@ -15,7 +15,7 @@ printf -- '-2-\n'
 set -- -ab
 getopts "ab:" OPTION
 echo ${OPTION}
-getopts "ab:" OPTION
+getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&-
 echo ${OPTION}
 
 # The 'shift' is aimed at causing an error.

Modified: projects/random_number_generator/share/man/man4/Makefile
==============================================================================
--- projects/random_number_generator/share/man/man4/Makefile	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/share/man/man4/Makefile	Sat May 10 14:24:12 2014	(r265818)
@@ -228,6 +228,7 @@ MAN=	aac.4 \
 	led.4 \
 	lge.4 \
 	${_linux.4} \
+	lm75.4 \
 	lmc.4 \
 	lo.4 \
 	lp.4 \

Copied: projects/random_number_generator/share/man/man4/lm75.4 (from r265817, head/share/man/man4/lm75.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/share/man/man4/lm75.4	Sat May 10 14:24:12 2014	(r265818, copy of r265817, head/share/man/man4/lm75.4)
@@ -0,0 +1,191 @@
+.\"
+.\" Copyright (c) 2014 Luiz Otavio O Souza <loos@freebsd.org>
+.\" 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 ``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 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd March 7, 2014
+.Dt LM75 4
+.Os
+.Sh NAME
+.Nm lm75
+.Nd lm75 i2c digital temperature sensor driver
+.Sh SYNOPSIS
+.Cd "device iic"
+.Cd "device iicbus"
+.Cd "device lm75"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides access to sensor data and configuration over the
+.Xr iicbus 4 .
+.Pp
+It provides an easy and simple way to check the functionality of an i2c bus
+as it provides read and write access to the
+.Nm
+configuration register.
+.Pp
+The access to
+.Nm
+data is made via the
+.Xr sysctl 8
+interface:
+.Bd -literal
+dev.lm75.0.%desc: LM75 temperature sensor
+dev.lm75.0.%driver: lm75
+dev.lm75.0.%location: addr=0x49
+dev.lm75.0.%pnpinfo: name=lm750 compat=national,lm75
+dev.lm75.0.%parent: iicbus3
+dev.lm75.0.temperature: 27.1C
+dev.lm75.0.thyst: 75.0C
+dev.lm75.0.tos: 80.0C
+dev.lm75.0.faults: 1
+dev.lm75.0.mode: comparator
+dev.lm75.0.polarity: active-low
+dev.lm75.0.shutdown: 0
+.Ed
+.Bl -tag -width ".Va dev.lm75.%d.temperature"
+.It Va dev.lm75.%d.temperature
+Is the read-only value of the current temperature read by the sensor.
+.It Va dev.lm75.%d.thyst
+Sets the hysteresis temperature.
+Once the temperature get over the overtemperature shutdown value (tos)
+it need to drop bellow the hysteresis temperature to disable the output
+(interrupt) pin again.
+.It Va dev.lm75.%d.tos
+Sets the overtemperature shutdown value.
+Once the temperature get over this value the output pin will be enabled.
+The way the output (interrupt) pin works, depends on the mode configuration.
+.It Va dev.lm75.%d.faults
+Is the number of faults that must occur consecutively to activate the
+interrupt (output) pin.
+It can be set to 1, 2, 4, and 6.
+.It Va dev.lm75.%d.mode
+Set the operation mode for the sensor interrupt pin.
+It can be set to 'comparator' (default) or 'interrupt'.
+.It Va dev.lm75.%d.polarity
+Set the polarity of the sensor interrupt pin.
+It can be set to 'active-low' (default) or 'active-high'.
+Please note that the output pin is an open-drain output and it needs a
+proper pull-up resistor to work.
+.It Va dev.lm75.%d.shutdown
+When set to '1' it shutdown the sensor.
+The temperature convertion stops but the sensor remains with its i2c bus
+active, i.e., it can be woken up by setting this option to '0' again.
+.El
+.Pp
+Please check the
+.Nm
+datasheet for more details.
+.Pp
+When used together with
+.Xr snmp_lm75 3
+it allows the monitoring of
+.Nm
+temperature data over SNMP.
+.Pp
+The
+.Nm
+driver supports both the low and the high resolution models.
+.Pp
+The low resolution model (lm75) provides a 9 bit output with the LSB
+representing 0.5C.
+.Pp
+The high resolution model (lm75a) provides an 11 bit output with the LSB
+representing 0.125C.
+.Pp
+The driver tries to auto-detect the
+.Nm
+model, but the detection of some
+.Nm
+clones may not work reliably.
+.Pp
+On a
+.Xr device.hints 5
+based system, like
+.Li MIPS ,
+these values are configurable for the
+.Nm :
+.Bl -tag -width ".Va hint.lm75.%d.addr"
+.It Va hint.lm75.%d.at
+Is the
+.Xr iicbus 4
+you are attaching to.
+.It Va hint.lm75.%d.addr
+Is the
+.Nm
+i2c address on the
+.Xr iicbus 4 .
+.El
+.Pp
+On a
+.Xr FDT 4
+based system, like
+.Li ARM ,
+the DTS part for a
+.Nm
+device usually looks like:
+.Bd -literal
+i2c {
+
+	...
+
+	lm750 {
+		compatible = "national,lm75";
+		i2c-address = <0x49>;
+	};
+};
+.Ed
+.Pp
+Where:
+.Bl -tag -width ".Va i2c-address"
+.It Va compatible
+Should always be set to "national,lm75".
+.It Va i2c-address
+The
+.Va i2c-address
+property indicates which i2c address the
+.Nm
+is wired at.
+.Nm
+temperature sensors can be wired to 8 different address, allowing up to 8
+sensors on the same
+.Xr iicbus 4 .
+.El
+.Sh SEE ALSO
+.Xr snmp_lm75 3 ,
+.Xr fdt 4 ,
+.Xr iic 4 ,
+.Xr iicbus 4 ,
+.Xr sysctl 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 11.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver and this manual page was written by
+.An Luiz Otavio O Souza Aq loos@FreeBSD.org

Modified: projects/random_number_generator/share/man/man4/udplite.4
==============================================================================
--- projects/random_number_generator/share/man/man4/udplite.4	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/share/man/man4/udplite.4	Sat May 10 14:24:12 2014	(r265818)
@@ -35,7 +35,7 @@
 .In sys/socket.h
 .In netinet/udplite.h
 .Ft int
-.Fn socket AF_INET SOCK_STREAM IPPROTO_UDPLITE
+.Fn socket AF_INET SOCK_DGRAM IPPROTO_UDPLITE
 .Sh DESCRIPTION
 The
 .Tn UDP-Lite

Copied: projects/random_number_generator/share/man/man4/vt.4 (from r265817, head/share/man/man4/vt.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/share/man/man4/vt.4	Sat May 10 14:24:12 2014	(r265818, copy of r265817, head/share/man/man4/vt.4)
@@ -0,0 +1,230 @@
+.\" Copyright (c) 2014 Warren Block
+.\" 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 AUTHORS 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 AUTHORS 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 9, 2014
+.Dt "VIRTUAL TERMINALS" 4
+.Os
+.Sh NAME
+.Nm vt
+.Nd virtual terminal console driver
+.Sh SYNOPSIS
+.Cd "options VT_MAXWINDOWS=N"
+.Cd "options VT_ALT_TO_ESC_HACK=1"
+.Cd "options VT_TWOBUTTON_MOUSE"
+.Cd "options VT_FB_DEFAULT_WIDTH=X"
+.Cd "options VT_FB_DEFAULT_HEIGHT=Y"
+.Cd "options SC_NO_CUTPASTE"
+.Cd "options SC_NO_SYSMOUSE"
+.Cd "device vt"
+.Pp
+In
+.Xr loader.conf 5 :
+.Cd hw.vga.textmode=1
+.Sh DESCRIPTION
+The
+.Nm
+device provides multiple virtual terminals with an extensive feature
+set:
+.Bl -item -offset indent
+.It
+Unicode UTF-8 text with double-width characters.
+.It
+Large font maps in graphics mode, including support for Asian
+character sets.
+.It
+Graphics-mode consoles.
+.It
+Integration with
+KMS
+.Pq Kernel Mode Setting
+video drivers for switching between the
+.Em X Window System
+and virtual terminals.
+.El
+.Ss Virtual Terminals
+Multiple virtual terminals are provided on a single computer.
+Up to sixteen virtual terminals can be defined.
+A single virtual terminal is connected to the screen and keyboard
+at a time.
+Key combinations are used to select a virtual terminal.
+Alt-F1 through Alt-F12 correspond to the first twelve virtual terminals.
+If more than twelve virtual terminals are created, Shift-Alt-F1 through
+Shift-Alt-F4 are used to switch to the additional terminals.
+.Ss Copying and Pasting Text with a Mouse
+Copying and pasting text from the screen with a mouse is supported.
+Press and hold down mouse button 1, usually the left button, while
+moving the mouse to select text.
+Selected text is highlighted with reversed foreground and background
+colors.
+To select more text after releasing mouse button 1, press mouse button
+3, usually the right button.
+To paste text that has been selected, press mouse button 2, usually the
+middle button.
+The text is entered as if it were typed at the keyboard.
+The
+.Dv VT_TWOBUTTON_MOUSE
+kernel option can be used with mice that only have two buttons.
+Setting this option makes the second mouse button into the
+paste button.
+See
+.Xr moused 8
+for more information.
+.Ss Scrolling Back
+Output that has scrolled off the screen can be reviewed by pressing the
+Scroll Lock key, then scrolling up and down with the arrow keys.
+The Page Up and Page Down keys scroll up or down a full screen at a
+time.
+The Home and End keys jump to the beginning or end of the scrollback
+buffer.
+When finished reviewing, press the Scroll Lock key again to return to
+normal use.
+.Sh DRIVER CONFIGURATION
+.Ss Kernel Configuration Options
+These kernel options control the
+.Nm
+driver.
+.Bl -tag -width MAXCONS
+.It Dv VT_MAXWINDOWS=N
+Set the number of virtual terminals to be created to
+.Fa N .
+The value defaults to 12.
+.It Dv VT_ALT_TO_ESC_HACK=1
+When the Alt key is held down while pressing another key, send an ESC
+sequence instead of the Alt key.
+.It Dv VT_TWOBUTTON_MOUSE
+If defined, swap the functions of mouse buttons 2 and 3.
+In effect, this makes the right-hand mouse button perform a paste.
+These options are checked in the order shown.
+.It Dv SC_NO_CUTPASTE
+Disable mouse support.
+.It VT_FB_DEFAULT_WIDTH=X
+Set the default width to
+.Fa X .
+.It VT_FB_DEFAULT_HEIGHT=Y
+Set the default height to
+.Fa Y .
+.El
+.Sh BACKWARDS COMPATIBILITY
+Several options are provided for compatibility with the previous
+console device,
+.Xr sc 4 .
+These options will be removed in a future
+.Fx
+version.
+.Bl -column -offset indent ".Sy vt VT_TWOBUTTON_MOUSE" ".Sy SC_TWOBUTTON_MOUSE"
+.It Sy vt Option Name Ta Sy sc Option Name
+.It Dv VT_TWOBUTTON_MOUSE Ta Dv SC_TWOBUTTON_MOUSE
+.It Dv VT_MAXWINDOWS Ta Dv MAXCONS
+.It none Ta Dv SC_NO_CUTPASTE
+.It none Ta Dv SC_NO_SYSMOUSE
+.El
+.Sh START-UP OPERATION WITH X86 BIOS SYSTEMS
+The computer BIOS starts in text mode, and
+the
+.Fx
+.Xr loader 8
+runs, loading the kernel.
+If
+.Va hw.vga.textmode
+is set, the system remains in text mode.
+Otherwise,
+.Nm
+switches to 640x480x16 VGA mode using
+.Fn vt_vga .
+If a KMS
+.Pq Kernel Mode Switching
+video driver is available, the display is switched to high resolution
+and the KMS driver takes over.
+When a KMS driver is not available,
+.Fn vt_vga
+remains active.
+.Sh LOADER TUNABLES
+These settings can be entered at the
+.Xr loader 8
+prompt or in
+.Xr loader.conf 5 .
+.Bl -tag -width indent
+.It Va hw.vga.textmode
+Set to 1 to use virtual terminals in text mode instead of graphics mode.
+Features that require graphics mode, like loadable fonts, will be
+disabled.
+.El
+.Sh FILES
+.Bl -tag -width /usr/share/syscons/keymaps/* -compact
+.It Pa /dev/console
+.It Pa /dev/consolectl
+.It Pa /dev/ttyv*
+virtual terminals
+.It Pa /etc/ttys
+terminal initialization information
+.El
+.Sh SEE ALSO
+.Xr kbdcontrol 1 ,
+.Xr login 1 ,
+.Xr vidcontrol 1 ,
+.Xr atkbd 4 ,
+.Xr atkbdc 4 ,
+.Xr keyboard 4 ,
+.Xr screen 4 ,
+.Xr splash 4 ,
+.Xr syscons 4 ,
+.Xr ukbd 4 ,
+.Xr vga 4 ,
+.Xr kbdmap 5 ,
+.Xr rc.conf 5 ,
+.Xr ttys 5 ,
+.Xr config 8 ,
+.Xr getty 8 ,
+.Xr kbdmux 8 ,
+.Xr kldload 8 ,
+.Xr moused 8
+.\" WB: to be uncommented when an actual release contains vt(4)
+.\" .Sh HISTORY
+.\" The
+.\" Nm
+.\" driver first appeared in
+.\" .Fx 9.3 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+device driver was developed by
+.An Ed Schouten Aq ed@FreeBSD.org ,
+.An Ed Maste Aq emaste@FreeBSD.org ,
+and
+.An Aleksandr Rybalko Aq ray@FreeBSD.org ,
+with sponsorship provided by the
+.Fx
+Foundation.
+This manual page was written by
+.An Warren Block <wblock@FreeBSD.org>.
+.Sh CAVEATS
+Paste buffer size is limited by the system value
+.Brq Dv MAX_INPUT ,
+the number of bytes that can be stored in the terminal
+input queue, usually 1024 bytes
+(see
+.Xr termios 4 ) .

Modified: projects/random_number_generator/share/mk/src.opts.mk
==============================================================================
--- projects/random_number_generator/share/mk/src.opts.mk	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/share/mk/src.opts.mk	Sat May 10 14:24:12 2014	(r265818)
@@ -24,7 +24,7 @@
 #
 # Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
 # exception is made for _WITHOUT_SRCONF which turns off this mechanism
-# completely).
+# completely inside bsd.*.mk files).
 #
 
 .if !target(__<src.opts.mk>__)
@@ -84,7 +84,6 @@ __DEFAULT_YES_OPTIONS = \
     FDT \
     FLOPPY \
     FMTREE \
-    FORMAT_EXTENSIONS \
     FORTH \
     FP_LIBC \
     FREEBSD_UPDATE \
@@ -105,7 +104,6 @@ __DEFAULT_YES_OPTIONS = \
     IPFW \
     JAIL \
     KDUMP \
-    KERNEL_SYMBOLS \
     KVM \
     LDNS \
     LDNS_UTILS \

Modified: projects/random_number_generator/sys/arm/arm/cpufunc_asm_armv7.S
==============================================================================
--- projects/random_number_generator/sys/arm/arm/cpufunc_asm_armv7.S	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/arm/arm/cpufunc_asm_armv7.S	Sat May 10 14:24:12 2014	(r265818)
@@ -319,6 +319,10 @@ ENTRY(armv7_auxctrl)
 	RET
 END(armv7_auxctrl)
 
+/*
+ * Invalidate all I+D+branch cache.  Used by startup code, which counts
+ * on the fact that only r0-r3,ip are modified and no stack space is used.
+ */
 ENTRY(armv7_idcache_inv_all)
 	mov     r0, #0
 	mcr     p15, 2, r0, c0, c0, 0   @ set cache level to L1

Modified: projects/random_number_generator/sys/arm/arm/locore.S
==============================================================================
--- projects/random_number_generator/sys/arm/arm/locore.S	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/arm/arm/locore.S	Sat May 10 14:24:12 2014	(r265818)
@@ -353,24 +353,24 @@ ASENTRY_NP(mpentry)
 	orr	r7, r7, #(I32_bit|F32_bit)
 	msr	cpsr_c, r7
 
-
-	adr     r7, Ltag
-	bic     r7, r7, #0xf0000000
-	orr     r7, r7, #PHYSADDR
-			
-	/* Disable MMU for a while */
+	/* Disable MMU.  It should be disabled already, but make sure. */
 	mrc	p15, 0, r2, c1, c0, 0
 	bic	r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\
 	    CPU_CONTROL_WBUF_ENABLE)
 	bic	r2, r2, #(CPU_CONTROL_IC_ENABLE)
 	bic	r2, r2, #(CPU_CONTROL_BPRD_ENABLE)
 	mcr	p15, 0, r2, c1, c0, 0
-
 	nop
 	nop
 	nop
+	CPWAIT(r0)
+
+#if defined(ARM_MMU_V6)
+	bl	armv6_idcache_inv_all	/* Modifies r0 only */
+#elif defined(ARM_MMU_V7)
+	bl	armv7_idcache_inv_all	/* Modifies r0-r3, ip */
+#endif
 
-Ltag:
 	ldr	r0, Lstartup_pagetable_secondary
 	bic	r0, r0, #0xf0000000
 	orr	r0, r0, #PHYSADDR
@@ -389,7 +389,10 @@ Ltag:
 	mrc	p15, 0, r0, c1, c0, 0
 	orr	r0, r0, #CPU_CONTROL_V6_EXTPAGE
 	orr	r0, r0, #CPU_CONTROL_AF_ENABLE
-	orr	r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE)
+	orr	r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\
+	    CPU_CONTROL_WBUF_ENABLE)
+	orr	r0, r0, #(CPU_CONTROL_IC_ENABLE)
+	orr	r0, r0, #(CPU_CONTROL_BPRD_ENABLE)
 	mcr	p15, 0, r0, c1, c0, 0
 	nop
 	nop

Modified: projects/random_number_generator/sys/boot/fdt/dts/mips/beri-netfpga.dts
==============================================================================
--- projects/random_number_generator/sys/boot/fdt/dts/mips/beri-netfpga.dts	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/boot/fdt/dts/mips/beri-netfpga.dts	Sat May 10 14:24:12 2014	(r265818)
@@ -135,13 +135,14 @@
 
 		ethernet@7f005000 {
 			compatible = "netfpag10g,nf10bmac";
-			// TX, RX, LOOP
-			reg = <0x7f005010 0xc
-			       0x7f005020 0xc
-			       0x7f005030 0x4>;
+			// LOOP, TX, RX, INTR
+			reg = <0x7f005000 0x20
+			       0x7f005020 0x30
+			       0x7f005050 0x30
+			       0x7f005100 0x10>;
 			// RX
-			#interrupts = <1>;
-			#interrupt-parent = <&beripic>;
+			interrupts = <1>;
+			interrupt-parent = <&beripic>;
 		};
 	};
 

Modified: projects/random_number_generator/sys/conf/files
==============================================================================
--- projects/random_number_generator/sys/conf/files	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/conf/files	Sat May 10 14:24:12 2014	(r265818)
@@ -1444,6 +1444,7 @@ dev/iicbus/iiconf.c		optional iicbus
 dev/iicbus/iicsmb.c		optional iicsmb				\
 	dependency	"iicbus_if.h"
 dev/iicbus/iicoc.c		optional iicoc
+dev/iicbus/lm75.c		optional lm75
 dev/iicbus/pcf8563.c		optional pcf8563
 dev/iicbus/s35390a.c		optional s35390a
 dev/iir/iir.c			optional iir

Copied: projects/random_number_generator/sys/conf/kern.opts.mk (from r265817, head/sys/conf/kern.opts.mk)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/sys/conf/kern.opts.mk	Sat May 10 14:24:12 2014	(r265818, copy of r265817, head/sys/conf/kern.opts.mk)
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+# Options set in the build system that affect the kernel somehow.
+
+#
+# Define MK_* variables (which are either "yes" or "no") for users
+# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
+# make(1) environment.
+# These should be tested with `== "no"' or `!= "no"' in makefiles.
+# The NO_* variables should only be set by makefiles for variables
+# that haven't been converted over.
+#
+
+# These options are used by the kernel build process (kern.mk and kmod.mk)
+# They have to be listed here so we can build modules outside of the
+# src tree.
+
+__DEFAULT_YES_OPTIONS = \
+    FORMAT_EXTENSIONS \
+    KERNEL_SYMBOLS
+
+__DEFAULT_NO_OPTIONS = \
+
+.include "../../share/mk/bsd.mkopt.mk"

Modified: projects/random_number_generator/sys/conf/kern.pre.mk
==============================================================================
--- projects/random_number_generator/sys/conf/kern.pre.mk	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/conf/kern.pre.mk	Sat May 10 14:24:12 2014	(r265818)
@@ -5,6 +5,7 @@
 
 .include <src.opts.mk>
 .include <bsd.compiler.mk>
+.include "kern.opts.mk"
 
 # backwards compat option for older systems.
 MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}

Modified: projects/random_number_generator/sys/conf/kmod.mk
==============================================================================
--- projects/random_number_generator/sys/conf/kmod.mk	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/conf/kmod.mk	Sat May 10 14:24:12 2014	(r265818)
@@ -72,9 +72,15 @@ OBJCOPY?=	objcopy
 .error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND"
 .endif
 
-.include <src.opts.mk>
+# Note: we're really bsd.kmod.mk, so we have to allow src.opts.mk to be
+# optional. Include it if we can so we can get /etc/src.conf changes,
+# if we're in the tree. If we can't include it that's OK. kern.opts.mk
+# has all the kernel options in it, and should be included after src.opts.mk
+# so it picks everything up.
+.sinclude <src.opts.mk>
 .include <bsd.init.mk>
 .include <bsd.compiler.mk>
+.include "kern.opts.mk"
 
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
 

Modified: projects/random_number_generator/sys/conf/options.mips
==============================================================================
--- projects/random_number_generator/sys/conf/options.mips	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/conf/options.mips	Sat May 10 14:24:12 2014	(r265818)
@@ -104,6 +104,7 @@ ARGE_MDIO			opt_arge.h
 AR71XX_REALMEM			opt_ar71xx.h
 AR71XX_ENV_UBOOT		opt_ar71xx.h
 AR71XX_ENV_REDBOOT		opt_ar71xx.h
+AR71XX_ENV_ROUTERBOOT		opt_ar71xx.h
 AR71XX_ATH_EEPROM		opt_ar71xx.h
 
 #

Modified: projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175c.c
==============================================================================
--- projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175c.c	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175c.c	Sat May 10 14:24:12 2014	(r265818)
@@ -63,7 +63,7 @@ ip175c_reset(struct ip17x_softc *sc)
 	if (ip17x_writephy(sc->sc_dev, IP175C_RESET_PHY, IP175C_RESET_REG,
 	    0x175c))
 		return (-1);
-	DELAY(2);
+	DELAY(2000);
 
 	/* Force IP175C mode. */
 	data = ip17x_readphy(sc->sc_dev, IP175C_MODE_PHY, IP175C_MODE_REG);

Modified: projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175d.c
==============================================================================
--- projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175d.c	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/dev/etherswitch/ip17x/ip175d.c	Sat May 10 14:24:12 2014	(r265818)
@@ -62,7 +62,7 @@ ip175d_reset(struct ip17x_softc *sc)
 
 	/* Reset all the switch settings. */
 	ip17x_writephy(sc->sc_dev, IP175D_RESET_PHY, IP175D_RESET_REG, 0x175d);
-	DELAY(2);
+	DELAY(2000);
 
 	/* Disable the special tagging mode. */
 	ip17x_updatephy(sc->sc_dev, 21, 22, 0x3, 0x0);

Modified: projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x.c
==============================================================================
--- projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x.c	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x.c	Sat May 10 14:24:12 2014	(r265818)
@@ -141,9 +141,7 @@ ip17x_attach_phys(struct ip17x_softc *sc
 		sc->ifp[port]->if_softc = sc;
 		sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST |
 		    IFF_DRV_RUNNING | IFF_SIMPLEX;
-		sc->ifname[port] = malloc(strlen(name)+1, M_IP17X, M_WAITOK);
-		bcopy(name, sc->ifname[port], strlen(name)+1);
-		if_initname(sc->ifp[port], sc->ifname[port], port);
+		if_initname(sc->ifp[port], name, port);
 		sc->miibus[port] = malloc(sizeof(device_t), M_IP17X,
 		    M_WAITOK | M_ZERO);
 		err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
@@ -204,8 +202,6 @@ ip17x_attach(device_t dev)
 	    M_WAITOK | M_ZERO);
 	sc->pvid = malloc(sizeof(uint32_t) * sc->numports, M_IP17X,
 	    M_WAITOK | M_ZERO);
-	sc->ifname = malloc(sizeof(char *) * sc->numports, M_IP17X,
-	    M_WAITOK | M_ZERO);
 	sc->miibus = malloc(sizeof(device_t *) * sc->numports, M_IP17X,
 	    M_WAITOK | M_ZERO);
 	sc->portphy = malloc(sizeof(int) * sc->numports, M_IP17X,
@@ -257,13 +253,11 @@ ip17x_detach(device_t dev)
 			device_delete_child(dev, (*sc->miibus[port]));
 		if (sc->ifp[port] != NULL)
 			if_free(sc->ifp[port]);
-		free(sc->ifname[port], M_IP17X);
 		free(sc->miibus[port], M_IP17X);
 	}
 
 	free(sc->portphy, M_IP17X);
 	free(sc->miibus, M_IP17X);
-	free(sc->ifname, M_IP17X);
 	free(sc->pvid, M_IP17X);
 	free(sc->ifp, M_IP17X);
 
@@ -490,12 +484,13 @@ ip17x_ifmedia_upd(struct ifnet *ifp)
 	struct ip17x_softc *sc;
 	struct mii_data *mii;
 
-	DPRINTF(sc->sc_dev, "%s\n", __func__);
  	sc = ifp->if_softc;
+	DPRINTF(sc->sc_dev, "%s\n", __func__);
  	mii = ip17x_miiforport(sc, ifp->if_dunit);
 	if (mii == NULL)
 		return (ENXIO);
 	mii_mediachg(mii);
+
 	return (0);
 }
 
@@ -505,9 +500,8 @@ ip17x_ifmedia_sts(struct ifnet *ifp, str
 	struct ip17x_softc *sc;
 	struct mii_data *mii;
 
-	DPRINTF(sc->sc_dev, "%s\n", __func__);
-
  	sc = ifp->if_softc;
+	DPRINTF(sc->sc_dev, "%s\n", __func__);
 	mii = ip17x_miiforport(sc, ifp->if_dunit);
 	if (mii == NULL)
 		return;

Modified: projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x_var.h
==============================================================================
--- projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x_var.h	Sat May 10 13:18:20 2014	(r265817)
+++ projects/random_number_generator/sys/dev/etherswitch/ip17x/ip17x_var.h	Sat May 10 14:24:12 2014	(r265818)
@@ -52,7 +52,6 @@ struct ip17x_softc {
 	int		phyport[MII_NPHY];
 	int		numports;	/* number of ports */
 	int		*portphy;
-	char		**ifname;
 	device_t	**miibus;
 	etherswitch_info_t	info;
 	ip17x_switch_type	sc_switchtype;

Copied: projects/random_number_generator/sys/dev/iicbus/lm75.c (from r265817, head/sys/dev/iicbus/lm75.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/random_number_generator/sys/dev/iicbus/lm75.c	Sat May 10 14:24:12 2014	(r265818, copy of r265817, head/sys/dev/iicbus/lm75.c)
@@ -0,0 +1,574 @@
+/*-
+ * Copyright (c) 2010 Andreas Tobler.
+ * Copyright (c) 2013-2014 Luiz Otavio O Souza <loos@freebsd.org>
+ * 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 ``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 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/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_platform.h"
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/endian.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+#include <sys/systm.h>
+
+#include <machine/bus.h>
+
+#include <dev/iicbus/iicbus.h>
+#include <dev/iicbus/iiconf.h>
+
+#ifdef FDT
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#endif
+
+/* LM75 registers. */
+#define	LM75_TEMP	0x0
+#define	LM75_CONF	0x1
+#define	LM75_CONF_FSHIFT	3
+#define	LM75_CONF_FAULT		0x18
+#define	LM75_CONF_POL		0x04
+#define	LM75_CONF_MODE		0x02
+#define	LM75_CONF_SHUTD		0x01
+#define	LM75_CONF_MASK		0x1f
+#define	LM75_THYST	0x2
+#define	LM75_TOS	0x3
+
+/* LM75 constants. */
+#define	LM75_TEST_PATTERN	0xa
+#define	LM75_MIN_TEMP		-55
+#define	LM75_MAX_TEMP		125
+#define	LM75_0500C		0x80
+#define	LM75_0250C		0x40
+#define	LM75_0125C		0x20
+#define	LM75_MSB		0x8000
+#define	LM75_NEG_BIT		LM75_MSB
+#define	TZ_ZEROC		2732
+
+/* LM75 supported models. */
+#define	HWTYPE_LM75		1
+#define	HWTYPE_LM75A		2
+
+/* Regular bus attachment functions */
+static int  lm75_probe(device_t);
+static int  lm75_attach(device_t);
+
+struct lm75_softc {
+	device_t		sc_dev;
+	struct intr_config_hook enum_hook;
+	int32_t			sc_hwtype;
+	uint32_t		sc_addr;
+	uint32_t		sc_conf;
+};
+
+static int lm75_faults[4] = { 1, 2, 4, 6 };
+
+/* Utility functions */
+static int  lm75_conf_read(struct lm75_softc *);
+static int  lm75_conf_write(struct lm75_softc *);
+static int  lm75_temp_read(struct lm75_softc *, uint8_t, int *);
+static int  lm75_temp_write(struct lm75_softc *, uint8_t, int);
+static void lm75_start(void *);
+static int  lm75_read(device_t, uint32_t, uint8_t, uint8_t *, size_t);
+static int  lm75_write(device_t, uint32_t, uint8_t *, size_t);
+static int  lm75_str_mode(char *);
+static int  lm75_str_pol(char *);
+static int  lm75_temp_sysctl(SYSCTL_HANDLER_ARGS);
+static int  lm75_faults_sysctl(SYSCTL_HANDLER_ARGS);
+static int  lm75_mode_sysctl(SYSCTL_HANDLER_ARGS);
+static int  lm75_pol_sysctl(SYSCTL_HANDLER_ARGS);
+static int  lm75_shutdown_sysctl(SYSCTL_HANDLER_ARGS);
+
+static device_method_t  lm75_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		lm75_probe),
+	DEVMETHOD(device_attach,	lm75_attach),
+
+	DEVMETHOD_END
+};
+
+static driver_t lm75_driver = {
+	"lm75",
+	lm75_methods,
+	sizeof(struct lm75_softc)
+};
+
+static devclass_t lm75_devclass;
+
+DRIVER_MODULE(lm75, iicbus, lm75_driver, lm75_devclass, 0, 0);
+
+static int
+lm75_read(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data, size_t len)
+{
+	struct iic_msg msg[2] = {
+	    { addr, IIC_M_WR | IIC_M_NOSTOP, 1, &reg },
+	    { addr, IIC_M_RD, len, data },
+	};
+
+	if (iicbus_transfer(dev, msg, 2) != 0)
+		return (-1);
+
+	return (0);
+}
+
+static int
+lm75_write(device_t dev, uint32_t addr, uint8_t *data, size_t len)
+{
+	struct iic_msg msg[1] = {
+	    { addr, IIC_M_WR, len, data },
+	};
+
+	if (iicbus_transfer(dev, msg, 1) != 0)
+		return (-1);
+
+	return (0);
+}
+
+static int
+lm75_probe(device_t dev)
+{
+	struct lm75_softc *sc;
+
+	sc = device_get_softc(dev);
+	sc->sc_hwtype = HWTYPE_LM75;
+#ifdef FDT
+	if (!ofw_bus_is_compatible(dev, "national,lm75"))
+		return (ENXIO);
+#endif
+	device_set_desc(dev, "LM75 temperature sensor");
+
+	return (BUS_PROBE_GENERIC);
+}
+
+static int
+lm75_attach(device_t dev)
+{
+	struct lm75_softc *sc;
+
+	sc = device_get_softc(dev);
+	sc->sc_dev = dev;
+	sc->sc_addr = iicbus_get_addr(dev);
+
+	sc->enum_hook.ich_func = lm75_start;
+	sc->enum_hook.ich_arg = dev;
+
+	/*
+	 * We have to wait until interrupts are enabled.  Usually I2C read
+	 * and write only works when the interrupts are available.
+	 */
+	if (config_intrhook_establish(&sc->enum_hook) != 0)
+		return (ENOMEM);
+
+	return (0);
+}
+
+static int
+lm75_type_detect(struct lm75_softc *sc)
+{
+	int i, lm75a;
+	uint8_t buf8;
+	uint32_t conf;
+
+	/* Save the contents of the configuration register. */
+	if (lm75_conf_read(sc) != 0)
+		return (-1);
+	conf = sc->sc_conf;
+
+	/*
+	 * Just write some pattern at configuration register so we can later
+	 * verify.  The test pattern should be pretty harmless.
+	 */
+	sc->sc_conf = LM75_TEST_PATTERN;
+	if (lm75_conf_write(sc) != 0)
+		return (-1);
+
+	/*
+	 * Read the configuration register again and check for our test
+	 * pattern.
+	 */
+	if (lm75_conf_read(sc) != 0)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405101424.s4AEODib047831>