CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-10-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 05:58:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #362):
usr.sbin/sysinst/disks.c: revision 1.52
Remove a hardcoded assumption that for BIOS boot we always will have
the first partition as root - in mixed EFI/BIOS setups this might not
be true (and in general the user is free to define arbitrary orders).
Pointed out by Robert Nestor.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.6 -r1.44.2.7 src/usr.sbin/sysinst/disks.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-10-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 23 05:58:13 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #362):
usr.sbin/sysinst/disks.c: revision 1.52
Remove a hardcoded assumption that for BIOS boot we always will have
the first partition as root - in mixed EFI/BIOS setups this might not
be true (and in general the user is free to define arbitrary orders).
Pointed out by Robert Nestor.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.6 -r1.44.2.7 src/usr.sbin/sysinst/disks.c

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

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.44.2.6 src/usr.sbin/sysinst/disks.c:1.44.2.7
--- src/usr.sbin/sysinst/disks.c:1.44.2.6	Fri Aug  9 06:21:00 2019
+++ src/usr.sbin/sysinst/disks.c	Wed Oct 23 05:58:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.6 2019/08/09 06:21:00 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.7 2019/10/23 05:58:13 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1928,12 +1928,30 @@ check_swap(const char *disk, int remove_
 char *
 bootxx_name(struct install_partition_desc *install)
 {
-	int fstype;
+	size_t i;
+	int fstype = -1;
 	const char *bootxxname;
 	char *bootxx;
 
+	/* find a partition to be mounted as / */
+	for (i = 0; i < install->num; i++) {
+		if ((install->infos[i].instflags & PUIINST_MOUNT)
+		&& strcmp(install->infos[i].mount, "/") == 0) {
+			fstype = install->infos[i].fs_type;
+			break;
+		}
+	}
+	if (fstype < 0) {
+		/* not found? take first root type partition instead */
+		for (i = 0; i < install->num; i++) {
+			if (install->infos[i].type == PT_root) {
+fstype = install->infos[i].fs_type;
+break;
+			}
+		}
+	}
+
 	/* check we have boot code for the root partition type */
-	fstype = install->infos[0].fs_type;
 	switch (fstype) {
 #if defined(BOOTXX_FFSV1) || defined(BOOTXX_FFSV2)
 	case FS_BSDFFS:



CVS commit: src/sys

2019-10-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Oct 23 05:20:52 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_sdhc.c
src/sys/dev/sdmmc: sdhc.c sdhcreg.h sdhcvar.h sdmmc.c sdmmcchip.h
sdmmcvar.h

Log Message:
Add SDHC flags.

+ SDHC_FLAG_BROKEN_ADMA2_ZEROLEN
  Broken ADMA2 Zero length descriptor.
  Can't 64K Byte data transfer.
+ SDHC_FLAG_NO_1_8_V
  Support no 1.8V Supply.
  Disable UHS-I bus speed mode (SDR50, DDR50, SDR104).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/imx6_sdhc.c
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/sdmmc/sdhcreg.h
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sdmmc/sdhcvar.h
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/sdmmc/sdmmc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/sdmmc/sdmmcchip.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sdmmc/sdmmcvar.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/arm/imx/fdt/imx6_sdhc.c
diff -u src/sys/arch/arm/imx/fdt/imx6_sdhc.c:1.3 src/sys/arch/arm/imx/fdt/imx6_sdhc.c:1.4
--- src/sys/arch/arm/imx/fdt/imx6_sdhc.c:1.3	Fri Sep 27 02:54:57 2019
+++ src/sys/arch/arm/imx/fdt/imx6_sdhc.c	Wed Oct 23 05:20:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_sdhc.c,v 1.3 2019/09/27 02:54:57 hkenken Exp $	*/
+/*	$NetBSD: imx6_sdhc.c,v 1.4 2019/10/23 05:20:52 hkenken Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_sdhc.c,v 1.3 2019/09/27 02:54:57 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_sdhc.c,v 1.4 2019/10/23 05:20:52 hkenken Exp $");
 
 #include "opt_fdt.h"
 
@@ -120,10 +120,13 @@ imx6_sdhc_attach(device_t parent, device
 	SDHC_FLAG_32BIT_ACCESS |
 	SDHC_FLAG_USE_ADMA2 |
 	SDHC_FLAG_USDHC |
-	SDHC_FLAG_NO_BUSY_INTR;
+	SDHC_FLAG_NO_BUSY_INTR |
+	SDHC_FLAG_BROKEN_ADMA2_ZEROLEN;
 
 	if (bus_width == 8)
 		sc->sc_sdhc.sc_flags |= SDHC_FLAG_8BIT_MODE;
+	if (of_hasprop(faa->faa_phandle, "no-1-8-v"))
+		sc->sc_sdhc.sc_flags |= SDHC_FLAG_NO_1_8_V;
 
 	sc->sc_sdhc.sc_host = >sc_host;
 

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.103 src/sys/dev/sdmmc/sdhc.c:1.104
--- src/sys/dev/sdmmc/sdhc.c:1.103	Wed Jul  3 23:10:08 2019
+++ src/sys/dev/sdmmc/sdhc.c	Wed Oct 23 05:20:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.103 2019/07/03 23:10:08 jmcneill Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.104 2019/10/23 05:20:52 hkenken Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.103 2019/07/03 23:10:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.104 2019/10/23 05:20:52 hkenken Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -476,21 +476,23 @@ sdhc_host_found(struct sdhc_softc *sc, b
 		SET(hp->ocr, MMC_OCR_HCS);
 		aprint_normal(" HS");
 	}
-	if (ISSET(caps2, SDHC_SDR50_SUPP)) {
-		SET(hp->ocr, MMC_OCR_S18A);
-		aprint_normal(" SDR50");
-	}
-	if (ISSET(caps2, SDHC_DDR50_SUPP)) {
-		SET(hp->ocr, MMC_OCR_S18A);
-		aprint_normal(" DDR50");
-	}
-	if (ISSET(caps2, SDHC_SDR104_SUPP)) {
-		SET(hp->ocr, MMC_OCR_S18A);
-		aprint_normal(" SDR104 HS200");
-	}
-	if (ISSET(caps, SDHC_VOLTAGE_SUPP_1_8V)) {
-		SET(hp->ocr, MMC_OCR_1_65V_1_95V);
-		aprint_normal(" 1.8V");
+	if (!ISSET(hp->sc->sc_flags, SDHC_FLAG_NO_1_8_V)) {
+		if (ISSET(caps2, SDHC_SDR50_SUPP)) {
+			SET(hp->ocr, MMC_OCR_S18A);
+			aprint_normal(" SDR50");
+		}
+		if (ISSET(caps2, SDHC_DDR50_SUPP)) {
+			SET(hp->ocr, MMC_OCR_S18A);
+			aprint_normal(" DDR50");
+		}
+		if (ISSET(caps2, SDHC_SDR104_SUPP)) {
+			SET(hp->ocr, MMC_OCR_S18A);
+			aprint_normal(" SDR104 HS200");
+		}
+		if (ISSET(caps, SDHC_VOLTAGE_SUPP_1_8V)) {
+			SET(hp->ocr, MMC_OCR_1_65V_1_95V);
+			aprint_normal(" 1.8V");
+		}
 	}
 	if (ISSET(caps, SDHC_VOLTAGE_SUPP_3_0V)) {
 		SET(hp->ocr, MMC_OCR_2_9V_3_0V | MMC_OCR_3_0V_3_1V);
@@ -620,6 +622,10 @@ adma_done:
 		saa.saa_caps |= SMC_CAPS_SINGLE_ONLY;
 	if (ISSET(sc->sc_flags, SDHC_FLAG_POLL_CARD_DET))
 		saa.saa_caps |= SMC_CAPS_POLL_CARD_DET;
+
+	if (ISSET(sc->sc_flags, SDHC_FLAG_BROKEN_ADMA2_ZEROLEN))
+		saa.saa_max_seg = 65535;
+
 	hp->sdmmc = config_found(sc->sc_dev, , sdhc_cfprint);
 
 	return 0;
@@ -1818,12 +1824,9 @@ sdhc_start_command(struct sdhc_host *hp,
 		if (ISSET(hp->sc->sc_flags, SDHC_FLAG_USDHC)) {
 			/* mode bits is in MIX_CTRL register on uSDHC */
 			HWRITE4(hp, SDHC_MIX_CTRL, mode |
-			(HREAD4(hp, SDHC_MIX_CTRL) &
-			~(SDHC_MULTI_BLOCK_MODE |
-			SDHC_READ_MODE |
-			SDHC_AUTO_CMD12_ENABLE |
-			SDHC_BLOCK_COUNT_ENABLE |
-			SDHC_DMA_ENABLE)));
+			(HREAD4(hp, SDHC_MIX_CTRL) & ~SDHC_TRANSFER_MODE_MASK));
+			if (cmd->c_opcode == MMC_STOP_TRANSMISSION)
+command |= SDHC_COMMAND_TYPE_ABORT;
 

CVS commit: src/sys

2019-10-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Oct 23 05:20:52 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_sdhc.c
src/sys/dev/sdmmc: sdhc.c sdhcreg.h sdhcvar.h sdmmc.c sdmmcchip.h
sdmmcvar.h

Log Message:
Add SDHC flags.

+ SDHC_FLAG_BROKEN_ADMA2_ZEROLEN
  Broken ADMA2 Zero length descriptor.
  Can't 64K Byte data transfer.
+ SDHC_FLAG_NO_1_8_V
  Support no 1.8V Supply.
  Disable UHS-I bus speed mode (SDR50, DDR50, SDR104).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/fdt/imx6_sdhc.c
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/sdmmc/sdhcreg.h
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/sdmmc/sdhcvar.h
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/sdmmc/sdmmc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/sdmmc/sdmmcchip.h
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/sdmmc/sdmmcvar.h

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



CVS commit: src/sys/arch/arm/imx/fdt

2019-10-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Oct 23 02:34:43 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_platform.c

Log Message:
Implement platform reset for i.MX6.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/fdt/imx6_platform.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/arm/imx/fdt/imx6_platform.c
diff -u src/sys/arch/arm/imx/fdt/imx6_platform.c:1.7 src/sys/arch/arm/imx/fdt/imx6_platform.c:1.8
--- src/sys/arch/arm/imx/fdt/imx6_platform.c:1.7	Fri Oct 18 12:53:08 2019
+++ src/sys/arch/arm/imx/fdt/imx6_platform.c	Wed Oct 23 02:34:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_platform.c,v 1.7 2019/10/18 12:53:08 hkenken Exp $	*/
+/*	$NetBSD: imx6_platform.c,v 1.8 2019/10/23 02:34:43 hkenken Exp $	*/
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.7 2019/10/18 12:53:08 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.8 2019/10/23 02:34:43 hkenken Exp $");
 
 #include "arml2cc.h"
 #include "opt_console.h"
@@ -57,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: imx6_platfor
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -197,6 +198,27 @@ imx_platform_mpstart(void)
 static void
 imx6_platform_reset(void)
 {
+	bus_space_tag_t bst = _generic_bs_tag;
+	bus_space_handle_t bsh;
+
+	if (bus_space_map(bst, IMX6_AIPS1_BASE + AIPS1_WDOG1_BASE, AIPS1_WDOG_SIZE, 0, ))
+		panic("couldn't map wdog1 registers");
+
+	delay(1000);	/* wait for flushing FIFO of serial console */
+
+	cpsid(I32_bit|F32_bit);
+
+	/* software reset signal on wdog */
+	bus_space_write_2(bst, bsh, IMX_WDOG_WCR, WCR_WDE);
+
+	/*
+	 * write twice due to errata.
+	 * Reference: ERR004346: IMX6DQCE Chip Errata for the i.MX 6Dual/6Quad
+	 */
+	bus_space_write_2(bst, bsh, IMX_WDOG_WCR, WCR_WDE);
+
+	for (;;)
+		__asm("wfi");
 }
 
 const struct arm_platform imx6_platform = {



CVS commit: src/sys/arch/arm/imx/fdt

2019-10-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Wed Oct 23 02:34:43 UTC 2019

Modified Files:
src/sys/arch/arm/imx/fdt: imx6_platform.c

Log Message:
Implement platform reset for i.MX6.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/fdt/imx6_platform.c

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



CVS commit: src/sys/dev/usb

2019-10-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 23 01:30:54 UTC 2019

Modified Files:
src/sys/dev/usb: uvideo.c

Log Message:
we want to check that the allocation is going to be zero, not whether
some pointer is NULL (oops).

Should be the right version this time!


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/uvideo.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/dev/usb/uvideo.c
diff -u src/sys/dev/usb/uvideo.c:1.51 src/sys/dev/usb/uvideo.c:1.52
--- src/sys/dev/usb/uvideo.c:1.51	Wed Oct 23 01:03:36 2019
+++ src/sys/dev/usb/uvideo.c	Wed Oct 23 01:30:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvideo.c,v 1.51 2019/10/23 01:03:36 maya Exp $	*/
+/*	$NetBSD: uvideo.c,v 1.52 2019/10/23 01:30:54 maya Exp $	*/
 
 /*
  * Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.51 2019/10/23 01:03:36 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.52 2019/10/23 01:30:54 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -999,7 +999,7 @@ static usbd_status
 uvideo_unit_alloc_controls(struct uvideo_unit *vu, uint8_t size,
 			   const uint8_t *controls)
 {
-	if ((vu->vu_controls == 0) || (size == 0))
+	if (size == 0)
 		return USBD_INVAL;
 
 	vu->vu_controls = kmem_alloc(sizeof(*vu->vu_controls) * size, KM_SLEEP);



CVS commit: src/sys/dev/usb

2019-10-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 23 01:30:54 UTC 2019

Modified Files:
src/sys/dev/usb: uvideo.c

Log Message:
we want to check that the allocation is going to be zero, not whether
some pointer is NULL (oops).

Should be the right version this time!


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/uvideo.c

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



CVS commit: src/sys/dev/usb

2019-10-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 23 01:03:36 UTC 2019

Modified Files:
src/sys/dev/usb: uvideo.c

Log Message:
Check if size is zero, too.

PR kern/53734


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/uvideo.c

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



CVS commit: src/sys/dev/usb

2019-10-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 23 01:03:36 UTC 2019

Modified Files:
src/sys/dev/usb: uvideo.c

Log Message:
Check if size is zero, too.

PR kern/53734


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/uvideo.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/dev/usb/uvideo.c
diff -u src/sys/dev/usb/uvideo.c:1.50 src/sys/dev/usb/uvideo.c:1.51
--- src/sys/dev/usb/uvideo.c:1.50	Wed Oct 23 00:52:39 2019
+++ src/sys/dev/usb/uvideo.c	Wed Oct 23 01:03:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvideo.c,v 1.50 2019/10/23 00:52:39 maya Exp $	*/
+/*	$NetBSD: uvideo.c,v 1.51 2019/10/23 01:03:36 maya Exp $	*/
 
 /*
  * Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.50 2019/10/23 00:52:39 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.51 2019/10/23 01:03:36 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -999,7 +999,7 @@ static usbd_status
 uvideo_unit_alloc_controls(struct uvideo_unit *vu, uint8_t size,
 			   const uint8_t *controls)
 {
-	if (vu->vu_controls == 0)
+	if ((vu->vu_controls == 0) || (size == 0))
 		return USBD_INVAL;
 
 	vu->vu_controls = kmem_alloc(sizeof(*vu->vu_controls) * size, KM_SLEEP);



CVS commit: src/sys/dev/usb

2019-10-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 23 00:52:39 UTC 2019

Modified Files:
src/sys/dev/usb: uvideo.c

Log Message:
Avoid kmem_alloc(0,..), which hits an assertion.

PR kern/53734: Prevent kernel panic during Wide Vision FHD Camera detection


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/uvideo.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/dev/usb/uvideo.c
diff -u src/sys/dev/usb/uvideo.c:1.49 src/sys/dev/usb/uvideo.c:1.50
--- src/sys/dev/usb/uvideo.c:1.49	Tue Oct  1 18:00:08 2019
+++ src/sys/dev/usb/uvideo.c	Wed Oct 23 00:52:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvideo.c,v 1.49 2019/10/01 18:00:08 chs Exp $	*/
+/*	$NetBSD: uvideo.c,v 1.50 2019/10/23 00:52:39 maya Exp $	*/
 
 /*
  * Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.49 2019/10/01 18:00:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.50 2019/10/23 00:52:39 maya Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -999,6 +999,9 @@ static usbd_status
 uvideo_unit_alloc_controls(struct uvideo_unit *vu, uint8_t size,
 			   const uint8_t *controls)
 {
+	if (vu->vu_controls == 0)
+		return USBD_INVAL;
+
 	vu->vu_controls = kmem_alloc(sizeof(*vu->vu_controls) * size, KM_SLEEP);
 	vu->vu_control_size = size;
 	memcpy(vu->vu_controls, controls, size);



CVS commit: src/sys/dev/usb

2019-10-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed Oct 23 00:52:39 UTC 2019

Modified Files:
src/sys/dev/usb: uvideo.c

Log Message:
Avoid kmem_alloc(0,..), which hits an assertion.

PR kern/53734: Prevent kernel panic during Wide Vision FHD Camera detection


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/uvideo.c

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



CVS commit: xsrc/external/mit/xedit/dist/lisp

2019-10-22 Thread Kamil Rytarowski
Module Name:xsrc
Committed By:   kamil
Date:   Wed Oct 23 00:06:07 UTC 2019

Modified Files:
xsrc/external/mit/xedit/dist/lisp: pathname.c

Log Message:
Switch strncpy(3) with length of source to strlcpy(3) in xedit

Fixes build with gcc8.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 xsrc/external/mit/xedit/dist/lisp/pathname.c

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



CVS commit: xsrc/external/mit/xedit/dist/lisp

2019-10-22 Thread Kamil Rytarowski
Module Name:xsrc
Committed By:   kamil
Date:   Wed Oct 23 00:06:07 UTC 2019

Modified Files:
xsrc/external/mit/xedit/dist/lisp: pathname.c

Log Message:
Switch strncpy(3) with length of source to strlcpy(3) in xedit

Fixes build with gcc8.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 xsrc/external/mit/xedit/dist/lisp/pathname.c

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

Modified files:

Index: xsrc/external/mit/xedit/dist/lisp/pathname.c
diff -u xsrc/external/mit/xedit/dist/lisp/pathname.c:1.1.1.2 xsrc/external/mit/xedit/dist/lisp/pathname.c:1.2
--- xsrc/external/mit/xedit/dist/lisp/pathname.c:1.1.1.2	Sun Jul 19 19:37:31 2015
+++ xsrc/external/mit/xedit/dist/lisp/pathname.c	Wed Oct 23 00:06:07 2019
@@ -1056,8 +1056,8 @@ Lisp_UserHomedirPathname(LispBuiltin *bu
  */
 {
 GC_ENTER();
-int length;
 char *home = getenv("HOME"), data[PATH_MAX + 1];
+char sepstr[] = {PATH_SEP, '\0'};
 LispObj *result;
 
 LispObj *host;
@@ -1067,16 +1067,15 @@ Lisp_UserHomedirPathname(LispBuiltin *bu
 if (host != UNSPEC && !STRINGP(host))
 	LispDestroy("%s: bad hostname %s", STRFUN(builtin), STROBJ(host));
 
-length = 0;
 if (home) {
-	length = strlen(home);
-	strncpy(data, home, length);
-	if (length && home[length - 1] != PATH_SEP)
-	data[length++] = PATH_SEP;
+	strlcpy(data, home, sizeof(data));
+	if (data[0] != '\0' && data[strlen(data) - 1] != PATH_SEP)
+		strlcat(data, sepstr, sizeof(data));
+} else {
+	data[0] = '\0';
 }
-data[length] = '\0';
 
-result = LSTRING(data, length);
+result = STRING(data);
 GC_PROTECT(result);
 result = APPLY1(Oparse_namestring, result);
 GC_LEAVE();



CVS commit: src/sys/dev/ic

2019-10-22 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Oct 22 22:03:27 UTC 2019

Modified Files:
src/sys/dev/ic: ssdfb.c ssdfbvar.h

Log Message:
allow to have a per-product init function


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/ssdfb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/ssdfbvar.h

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



CVS commit: src/sys/dev/ic

2019-10-22 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Oct 22 22:03:27 UTC 2019

Modified Files:
src/sys/dev/ic: ssdfb.c ssdfbvar.h

Log Message:
allow to have a per-product init function


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/ssdfb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/ssdfbvar.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/dev/ic/ssdfb.c
diff -u src/sys/dev/ic/ssdfb.c:1.7 src/sys/dev/ic/ssdfb.c:1.8
--- src/sys/dev/ic/ssdfb.c:1.7	Tue Oct 22 21:41:01 2019
+++ src/sys/dev/ic/ssdfb.c	Tue Oct 22 22:03:27 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfb.c,v 1.7 2019/10/22 21:41:01 tnn Exp $ */
+/* $NetBSD: ssdfb.c,v 1.8 2019/10/22 22:03:27 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.7 2019/10/22 21:41:01 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.8 2019/10/22 22:03:27 tnn Exp $");
 
 #include "opt_ddb.h"
 
@@ -72,7 +72,7 @@ static void	ssdfb_eraserows(void *, int,
 static void	ssdfb_cursor(void *, int, int, int);
 
 /* hardware interface */
-static int	ssdfb_init(struct ssdfb_softc *);
+static int	ssdfb_init_ssd1306(struct ssdfb_softc *);
 static int	ssdfb_set_contrast(struct ssdfb_softc *, uint8_t, bool);
 static int	ssdfb_set_display_on(struct ssdfb_softc *, bool, bool);
 static int	ssdfb_set_mode(struct ssdfb_softc *, u_int);
@@ -100,7 +100,8 @@ static void	ssdfb_ddb_trap_callback(int)
 static const char *ssdfb_controller_names[] = {
 	[SSDFB_CONTROLLER_UNKNOWN] =	"unknown",
 	[SSDFB_CONTROLLER_SSD1306] =	"Solomon Systech SSD1306",
-	[SSDFB_CONTROLLER_SH1106] =	"Sino Wealth SH1106"
+	[SSDFB_CONTROLLER_SH1106] =	"Sino Wealth SH1106",
+	[SSDFB_CONTROLLER_SSD1322] =	"Solomon Systech SSD1322"
 };
 
 /*
@@ -124,7 +125,8 @@ static const struct ssdfb_product ssdfb_
 		.p_default_contrast =	0x7f,
 		.p_multiplex_ratio =	0x3f,
 		.p_chargepump_cmd =	SSD1306_CMD_SET_CHARGE_PUMP,
-		.p_chargepump_arg =	SSD1306_CHARGE_PUMP_ENABLE
+		.p_chargepump_arg =	SSD1306_CHARGE_PUMP_ENABLE,
+		.p_init =		ssdfb_init_ssd1306
 	},
 	{
 		.p_product_id =		SSDFB_PRODUCT_SH1106_GENERIC,
@@ -143,7 +145,8 @@ static const struct ssdfb_product ssdfb_
 		.p_default_contrast =	0x80,
 		.p_multiplex_ratio =	0x3f,
 		.p_chargepump_cmd =	SH1106_CMD_SET_CHARGE_PUMP_7V4,
-		.p_chargepump_arg =	SSDFB_CMD_NOP
+		.p_chargepump_arg =	SSDFB_CMD_NOP,
+		.p_init =		ssdfb_init_ssd1306
 	},
 	{
 		.p_product_id =		SSDFB_PRODUCT_ADAFRUIT_938,
@@ -161,7 +164,8 @@ static const struct ssdfb_product ssdfb_
 		.p_default_contrast =	0x8f,
 		.p_multiplex_ratio =	0x3f,
 		.p_chargepump_cmd =	SSD1306_CMD_SET_CHARGE_PUMP,
-		.p_chargepump_arg =	SSD1306_CHARGE_PUMP_ENABLE
+		.p_chargepump_arg =	SSD1306_CHARGE_PUMP_ENABLE,
+		.p_init =		ssdfb_init_ssd1306
 	},
 	{
 		.p_product_id =		SSDFB_PRODUCT_ADAFRUIT_931,
@@ -179,7 +183,8 @@ static const struct ssdfb_product ssdfb_
 		.p_default_contrast =	0x8f,
 		.p_multiplex_ratio =	0x1f,
 		.p_chargepump_cmd =	SSD1306_CMD_SET_CHARGE_PUMP,
-		.p_chargepump_arg =	SSD1306_CHARGE_PUMP_ENABLE
+		.p_chargepump_arg =	SSD1306_CHARGE_PUMP_ENABLE,
+		.p_init =		ssdfb_init_ssd1306
 	}
 };
 
@@ -294,7 +299,7 @@ ssdfb_attach(struct ssdfb_softc *sc, int
 	/*
 	 * Initialize hardware.
 	 */
-	error = ssdfb_init(sc);
+	error = p->p_init(sc);
 	if (error)
 		goto out;
 
@@ -581,7 +586,7 @@ ssdfb_cursor(void *cookie, int on, int r
 }
 
 static int
-ssdfb_init(struct ssdfb_softc *sc)
+ssdfb_init_ssd1306(struct ssdfb_softc *sc)
 {
 	int error;
 	uint8_t cmd[2];

Index: src/sys/dev/ic/ssdfbvar.h
diff -u src/sys/dev/ic/ssdfbvar.h:1.3 src/sys/dev/ic/ssdfbvar.h:1.4
--- src/sys/dev/ic/ssdfbvar.h:1.3	Tue Oct 22 21:40:10 2019
+++ src/sys/dev/ic/ssdfbvar.h	Tue Oct 22 22:03:27 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfbvar.h,v 1.3 2019/10/22 21:40:10 tnn Exp $ */
+/* $NetBSD: ssdfbvar.h,v 1.4 2019/10/22 22:03:27 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -209,6 +209,8 @@
 	#define SSD1322_COMMAND_UNLOCK_MAGIC		0x12
 	#define SSD1322_COMMAND_LOCK_MAGIC		0x16
 
+struct ssdfb_softc;
+
 typedef enum {
 	SSDFB_CONTROLLER_UNKNOWN=0,
 	SSDFB_CONTROLLER_SSD1306=1,
@@ -254,6 +256,7 @@ struct ssdfb_product {
 	uint8_tp_multiplex_ratio;
 	uint8_tp_chargepump_cmd;
 	uint8_tp_chargepump_arg;
+	int(*p_init)(struct ssdfb_softc *);
 };
 
 struct ssdfb_softc {



CVS commit: src/sys/dev/ic

2019-10-22 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Oct 22 21:41:01 UTC 2019

Modified Files:
src/sys/dev/ic: ssdfb.c

Log Message:
use __SHIFTIN


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/ssdfb.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/dev/ic/ssdfb.c
diff -u src/sys/dev/ic/ssdfb.c:1.6 src/sys/dev/ic/ssdfb.c:1.7
--- src/sys/dev/ic/ssdfb.c:1.6	Wed Jun  5 20:32:28 2019
+++ src/sys/dev/ic/ssdfb.c	Tue Oct 22 21:41:01 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfb.c,v 1.6 2019/06/05 20:32:28 tnn Exp $ */
+/* $NetBSD: ssdfb.c,v 1.7 2019/10/22 21:41:01 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.6 2019/06/05 20:32:28 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.7 2019/10/22 21:41:01 tnn Exp $");
 
 #include "opt_ddb.h"
 
@@ -638,20 +638,16 @@ ssdfb_init(struct ssdfb_softc *sc)
 	 * Configure timing characteristics.
 	 */
 	SSDFB_CMD2(SSDFB_CMD_SET_DISPLAY_CLOCK_RATIO,
-	((sc->sc_p->p_fosc << SSDFB_DISPLAY_CLOCK_OSCILLATOR_SHIFT) &
-	 SSDFB_DISPLAY_CLOCK_OSCILLATOR_MASK) |
-	((sc->sc_p->p_fosc_div << SSDFB_DISPLAY_CLOCK_DIVIDER_SHIFT) &
-	 SSDFB_DISPLAY_CLOCK_DIVIDER_MASK));
+	__SHIFTIN(sc->sc_p->p_fosc, SSDFB_DISPLAY_CLOCK_OSCILLATOR_MASK) |
+	__SHIFTIN(sc->sc_p->p_fosc_div, SSDFB_DISPLAY_CLOCK_DIVIDER_MASK));
 	if (error)
 		return error;
 	SSDFB_CMD2(SSDFB_CMD_SET_CONTRAST_CONTROL, sc->sc_contrast);
 	if (error)
 		return error;
 	SSDFB_CMD2(SSDFB_CMD_SET_PRECHARGE_PERIOD,
-	((sc->sc_p->p_precharge << SSDFB_PRECHARGE_SHIFT) &
-	 SSDFB_PRECHARGE_MASK) |
-	((sc->sc_p->p_discharge << SSDFB_DISCHARGE_SHIFT) &
-	 SSDFB_DISCHARGE_MASK));
+	__SHIFTIN(sc->sc_p->p_precharge, SSDFB_PRECHARGE_MASK) |
+	__SHIFTIN(sc->sc_p->p_discharge, SSDFB_DISCHARGE_MASK));
 	if (error)
 		return error;
 	SSDFB_CMD2(SSDFB_CMD_SET_VCOMH_DESELECT_LEVEL,



CVS commit: src/sys/dev/ic

2019-10-22 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Oct 22 21:41:01 UTC 2019

Modified Files:
src/sys/dev/ic: ssdfb.c

Log Message:
use __SHIFTIN


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/ssdfb.c

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



CVS commit: src/sys/dev/ic

2019-10-22 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Oct 22 21:40:10 UTC 2019

Modified Files:
src/sys/dev/ic: ssdfbvar.h

Log Message:
define SSD1322 command set


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/ssdfbvar.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/dev/ic/ssdfbvar.h
diff -u src/sys/dev/ic/ssdfbvar.h:1.2 src/sys/dev/ic/ssdfbvar.h:1.3
--- src/sys/dev/ic/ssdfbvar.h:1.2	Sun Mar 17 04:03:17 2019
+++ src/sys/dev/ic/ssdfbvar.h	Tue Oct 22 21:40:10 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfbvar.h,v 1.2 2019/03/17 04:03:17 tnn Exp $ */
+/* $NetBSD: ssdfbvar.h,v 1.3 2019/10/22 21:40:10 tnn Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -101,15 +101,11 @@
  * SH1106 Rev 0.1 p.24,25,26
  */
 #define SSDFB_CMD_SET_DISPLAY_CLOCK_RATIO		0xd5
-	#define SSDFB_DISPLAY_CLOCK_DIVIDER_MASK	0x0f
-	#define SSDFB_DISPLAY_CLOCK_DIVIDER_SHIFT	0
-	#define SSDFB_DISPLAY_CLOCK_OSCILLATOR_MASK	0xf0
-	#define SSDFB_DISPLAY_CLOCK_OSCILLATOR_SHIFT	4
+	#define SSDFB_DISPLAY_CLOCK_DIVIDER_MASK	__BITS(3, 0)
+	#define SSDFB_DISPLAY_CLOCK_OSCILLATOR_MASK	__BITS(7, 4)
 #define SSDFB_CMD_SET_PRECHARGE_PERIOD			0xd9
-	#define SSDFB_PRECHARGE_MASK			0x0f
-	#define SSDFB_PRECHARGE_SHIFT			0
-	#define SSDFB_DISCHARGE_MASK			0xf0
-	#define SSDFB_DISCHARGE_SHIFT			4
+	#define SSDFB_PRECHARGE_MASK			__BITS(3, 0)
+	#define SSDFB_DISCHARGE_MASK			__BITS(7, 4)
 #define SSDFB_CMD_SET_VCOMH_DESELECT_LEVEL		0xdb
 	#define SSD1306_VCOMH_DESELECT_LEVEL_0_65_VCC	0x00
 	#define SSD1306_VCOMH_DESELECT_LEVEL_0_77_VCC	0x20
@@ -146,10 +142,78 @@
 	#define SH1106_DC_DC_OFF			0x8a
 	#define SH1106_DC_DC_ON0x8b
 
+/*
+ * SSD1322 command set
+ */
+#define SSD1322_CMD_ENABLE_GRAY_SCALE_TABLE		0x00
+#define SSD1322_CMD_SET_COLUMN_ADDRESS			0x15
+#define SSD1322_CMD_WRITE_RAM0x5c
+#define SSD1322_CMD_READ_RAM0x5d
+#define SSD1322_CMD_SET_ROW_ADDRESS			0x75
+#define SSD1322_CMD_SET_REMAP_AND_DUAL_COM_LINE_MODE	0xa0
+#define SSD1322_CMD_SET_DISPLAY_START_LINE		0xa1
+#define SSD1322_CMD_SET_DISPLAY_OFFSET			0xa2
+
+/* These are the same as SSDFB generic commands */
+#define SSD1322_CMD_ENTIRE_DISPLAY_OFF			0xa4
+#define SSD1322_CMD_ENTIRE_DISPLAY_ON			0xa5
+#define SSD1322_CMD_NORMAL_DISPLAY			0xa6
+#define SSD1322_CMD_INVERSE_DISPLAY			0xa7
+
+#define SSD1322_CMD_ENABLE_PARTIAL_DISPLAY		0xa8
+#define SSD1322_CMD_EXIT_PARTIAL_DISPLAY		0xa9
+#define SSD1322_CMD_FUNCTION_SELECTION			0xab
+	#define SSD1322_FUNCTION_SELECTION_EXTERNAL_VDD	0
+	#define SSD1322_FUNCTION_SELECTION_INTERNAL_VDD	__BIT(0)
+#define SSD1322_CMD_SET_SLEEP_MODE_ON			0xae
+#define SSD1322_CMD_SET_SLEEP_MODE_OFF			0xaf
+#define SSD1322_CMD_SET_PHASE_LENGTH			0xb1
+	#define SSD1322_PHASE_LENGTH_PHASE_2_MASK	__BITS(7, 4)
+	#define SSD1322_DEFAULT_PHASE_2			7
+	#define SSD1322_PHASE_LENGTH_PHASE_1_MASK	__BITS(3, 0)
+	#define SSD1322_DEFAULT_PHASE_1			4
+#define SSD1322_CMD_SET_FRONT_CLOCK_DIVIDER		0xb3
+	#define SSD1322_FREQUENCY_MASK			__BITS(7, 4)
+	#define SSD1322_DEFAULT_FREQUENCY		5
+	#define SSD1322_DIVIDER_MASK			__BITS(3, 0)
+	#define SSD1322_DEFAULT_DIVIDER			0
+#define SSD1322_CMD_DISPLAY_ENHANCEMENT_A		0xb4
+	#define SSD1322_DISPLAY_ENHANCEMENT_A_MAGIC1	0xa2
+	#define SSD1322_DISPLAY_ENHANCEMENT_A_MAGIC2	0xb5
+#define SSD1322_CMD_SET_GPIO0xb5
+	#define SSD1322_GPIO0_DISABLED			0
+	#define SSD1322_GPIO0_TRISTATE			__BIT(0)
+	#define SSD1322_GPIO0_LOW			__BIT(1)
+	#define SSD1322_GPIO0_HIGH			__BITS(1, 0)
+	#define SSD1322_GPIO1_DISABLED			0
+	#define SSD1322_GPIO1_TRISTATE			__BIT(2)
+	#define SSD1322_GPIO1_LOW			__BIT(3)
+	#define SSD1322_GPIO1_HIGH			__BITS(3, 2)
+#define SSD1322_CMD_SET_SECOND_PRECHARGE_PERIOD		0xb6
+	#define SSD1322_DEFAULT_SECOND_PRECHARGE	8
+#define SSD1322_CMD_SET_GRAY_SCALE_TABLE		0xb8
+#define SSD1322_CMD_SET_DEFAULT_GRAY_SCALE_TABLE	0xb9
+#define SSD1322_CMD_SET_PRE_CHARGE_VOLTAGE_LEVEL	0xbb
+	#define SSD1322_DEFAULT_PRE_CHARGE_VOLTAGE_LEVEL	0x17
+#define SSD1322_CMD_SET_VCOMH0xbe
+	#define SSD1322_DEFAULT_VCOMH			0x04
+#define SSD1322_CMD_SET_CONTRAST_CURRENT		0xc1
+	#define SSD1322_DEFAULT_CONTRAST_CURRENT	0x7f
+#define SSD1322_CMD_MASTER_CONTRAST_CURRENT_CONTROL	0xc7
+	#define SSD1322_DEFAULT_MASTER_CONTRAST_CURRENT_CONTROL	0xf
+#define SSD1322_CMD_SET_MUX_RATIO			0xca
+#define SSD1322_CMD_DISPLAY_ENHANCEMENT_B		0xd1
+	#define SSD1322_DISPLAY_ENHANCEMENT_B_MAGIC1	0xa2
+	#define SSD1322_DISPLAY_ENHANCEMENT_B_MAGIC2	0x20
+#define SSD1322_CMD_SET_COMMAND_LOCK			0xfd
+	#define SSD1322_COMMAND_UNLOCK_MAGIC		0x12
+	#define SSD1322_COMMAND_LOCK_MAGIC		0x16
+
 typedef enum {
 	SSDFB_CONTROLLER_UNKNOWN=0,
 	SSDFB_CONTROLLER_SSD1306=1,
 	SSDFB_CONTROLLER_SH1106=2,
+	SSDFB_CONTROLLER_SSD1322=3,
 } ssdfb_controller_id_t;
 
 typedef enum {
@@ -158,6 +222,7 @@ typedef enum {
 	SSDFB_PRODUCT_SH1106_GENERIC=2,
 	SSDFB_PRODUCT_ADAFRUIT_931=3,
 	SSDFB_PRODUCT_ADAFRUIT_938=4,
+	

CVS commit: src/sys/dev/ic

2019-10-22 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Tue Oct 22 21:40:10 UTC 2019

Modified Files:
src/sys/dev/ic: ssdfbvar.h

Log Message:
define SSD1322 command set


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/ssdfbvar.h

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



CVS commit: src/sys/arch/arm/dts

2019-10-22 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Tue Oct 22 18:43:14 UTC 2019

Modified Files:
src/sys/arch/arm/dts: socfpga_cyclone5_de0_nano_soc.dts

Log Message:
Disable private timer whose new driver clashes with the global timer's one.

Stopgap measure to make the DE0 Nano Soc work again, targeted for netbsd-9
pullup. We'll see later if we switch to using the private timer.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts

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/arm/dts/socfpga_cyclone5_de0_nano_soc.dts
diff -u src/sys/arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts:1.2 src/sys/arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts:1.3
--- src/sys/arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts:1.2	Tue Jan 22 15:30:57 2019
+++ src/sys/arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts	Tue Oct 22 18:43:14 2019
@@ -4,6 +4,10 @@
 
 / {
 	soc {
+		timer@fffec600 {
+			status = "disabled";
+		};
+
 		gtimer@fffec200 {
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0xfffec200 0x20>;



CVS commit: src/sys/arch/arm/dts

2019-10-22 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Tue Oct 22 18:43:14 UTC 2019

Modified Files:
src/sys/arch/arm/dts: socfpga_cyclone5_de0_nano_soc.dts

Log Message:
Disable private timer whose new driver clashes with the global timer's one.

Stopgap measure to make the DE0 Nano Soc work again, targeted for netbsd-9
pullup. We'll see later if we switch to using the private timer.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts

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



CVS commit: src/share/mk

2019-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct 22 13:49:30 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
move a{md,arch}64 to gcc 8


To generate a diff of this commit:
cvs rdiff -u -r1.1156 -r1.1157 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1156 src/share/mk/bsd.own.mk:1.1157
--- src/share/mk/bsd.own.mk:1.1156	Sun Oct 13 06:12:13 2019
+++ src/share/mk/bsd.own.mk	Tue Oct 22 09:49:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1156 2019/10/13 10:12:13 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1157 2019/10/22 13:49:30 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -58,7 +58,12 @@ TOOLCHAIN_MISSING?=	no
 #
 # What GCC is used?
 #
+.if ${MACHINE} == "amd64" || \
+${MACHINE_CPU} == "aarch64"
+HAVE_GCC?=	8
+.else
 HAVE_GCC?=	7
+.endif
 
 #
 # Platforms that can't run a modern GCC natively



CVS commit: src/share/mk

2019-10-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct 22 13:49:30 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
move a{md,arch}64 to gcc 8


To generate a diff of this commit:
cvs rdiff -u -r1.1156 -r1.1157 src/share/mk/bsd.own.mk

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



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2019-10-22 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Tue Oct 22 13:19:47 UTC 2019

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: r128_drv.h

Log Message:
When building r128drm(4), gcc objects to shifting into bit 31 of a
(signed) int. Make sure we are shifting an unsigned in those cases.

See also .

XXX There are probably more of these in the header.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm/dist/shared-core/r128_drv.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/external/bsd/drm/dist/shared-core/r128_drv.h
diff -u src/sys/external/bsd/drm/dist/shared-core/r128_drv.h:1.2 src/sys/external/bsd/drm/dist/shared-core/r128_drv.h:1.3
--- src/sys/external/bsd/drm/dist/shared-core/r128_drv.h:1.2	Thu Feb 24 07:59:44 2011
+++ src/sys/external/bsd/drm/dist/shared-core/r128_drv.h	Tue Oct 22 13:19:47 2019
@@ -277,7 +277,7 @@ extern long r128_compat_ioctl(struct fil
  */
 #define R128_PM4_BUFFER_OFFSET		0x0700
 #define R128_PM4_BUFFER_CNTL		0x0704
-#	define R128_PM4_MASK			(15 << 28)
+#	define R128_PM4_MASK			(15u << 28)
 #	define R128_PM4_NONPM4			(0  << 28)
 #	define R128_PM4_192PIO			(1  << 28)
 #	define R128_PM4_192BM			(2  << 28)
@@ -286,8 +286,8 @@ extern long r128_compat_ioctl(struct fil
 #	define R128_PM4_64PIO_128INDBM		(5  << 28)
 #	define R128_PM4_64BM_128INDBM		(6  << 28)
 #	define R128_PM4_64PIO_64VCBM_64INDBM	(7  << 28)
-#	define R128_PM4_64BM_64VCBM_64INDBM	(8  << 28)
-#	define R128_PM4_64PIO_64VCPIO_64INDPIO	(15 << 28)
+#	define R128_PM4_64BM_64VCBM_64INDBM	(8u  << 28)
+#	define R128_PM4_64PIO_64VCPIO_64INDPIO	(15u << 28)
 #	define R128_PM4_BUFFER_CNTL_NOUPDATE	(1  << 27)
 
 #define R128_PM4_BUFFER_WM_CNTL		0x0708



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2019-10-22 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Tue Oct 22 13:19:47 UTC 2019

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: r128_drv.h

Log Message:
When building r128drm(4), gcc objects to shifting into bit 31 of a
(signed) int. Make sure we are shifting an unsigned in those cases.

See also .

XXX There are probably more of these in the header.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm/dist/shared-core/r128_drv.h

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



CVS commit: src/sys/dev/ic

2019-10-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 22 12:09:11 UTC 2019

Modified Files:
src/sys/dev/ic: wdc.c

Log Message:
Fix channel locking - patch from Christos.


To generate a diff of this commit:
cvs rdiff -u -r1.292 -r1.293 src/sys/dev/ic/wdc.c

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



CVS commit: src/sys/dev/ic

2019-10-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 22 12:09:11 UTC 2019

Modified Files:
src/sys/dev/ic: wdc.c

Log Message:
Fix channel locking - patch from Christos.


To generate a diff of this commit:
cvs rdiff -u -r1.292 -r1.293 src/sys/dev/ic/wdc.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/dev/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.292 src/sys/dev/ic/wdc.c:1.293
--- src/sys/dev/ic/wdc.c:1.292	Sat Sep 14 17:11:39 2019
+++ src/sys/dev/ic/wdc.c	Tue Oct 22 12:09:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc.c,v 1.292 2019/09/14 17:11:39 tsutsui Exp $ */
+/*	$NetBSD: wdc.c,v 1.293 2019/10/22 12:09:11 martin Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.292 2019/09/14 17:11:39 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.293 2019/10/22 12:09:11 martin Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -295,15 +295,16 @@ wdc_drvprobe(struct ata_channel *chp)
 	u_int8_t st0 = 0, st1 = 0;
 	int i, j, error, tfd;
 
+	ata_channel_lock(chp);
 	if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0)
 		return;
 	if (wdcprobe1(chp, 0) == 0) {
 		/* No drives, abort the attach here. */
 		atabus_free_drives(chp);
+		ata_channel_unlock(chp);
 		return;
 	}
 
-	ata_channel_lock(chp);
 	/* for ATA/OLD drives, wait for DRDY, 3s timeout */
 	for (i = 0; i < mstohz(3000); i++) {
 		/*
@@ -498,7 +499,9 @@ wdcprobe_with_reset(struct wdc_regs *wdr
 	/* check the MD reset method */
 	wdc.reset = (do_reset != NULL) ? do_reset : wdc_do_reset;
 
+	ata_channel_lock();
 	rv = wdcprobe1(, 1);
+	ata_channel_unlock();
 
 	ata_channel_destroy();
 
@@ -522,7 +525,6 @@ wdcprobe1(struct ata_channel *chp, int p
 	 * Sanity check to see if the wdc channel responds at all.
 	 */
 
-	ata_channel_lock(chp);
 	if ((wdc->cap & WDC_CAPABILITY_NO_EXTRA_RESETS) == 0) {
 		while (wdc_probe_count-- > 0) {
 			if (wdc->select)
@@ -675,7 +677,6 @@ wdcprobe1(struct ata_channel *chp, int p
 		}
 
 		if (ret_value == 0) {
-			ata_channel_unlock(chp);
 			return 0;
 		}
 	}
@@ -723,7 +724,6 @@ wdcprobe1(struct ata_channel *chp, int p
 
 	/* if reset failed, there's nothing here */
 	if (ret_value == 0) {
-		ata_channel_unlock(chp);
 		return 0;
 	}
 
@@ -776,7 +776,6 @@ wdcprobe1(struct ata_channel *chp, int p
 		(void)bus_space_read_1(wdr->cmd_iot,
 		wdr->cmd_iohs[wd_status], 0);
 	}
-	ata_channel_unlock(chp);
 	return (ret_value);
 }
 



CVS commit: src/distrib/sets/lists/xetc

2019-10-22 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Oct 22 06:28:18 UTC 2019

Modified Files:
src/distrib/sets/lists/xetc: md.x68k mi

Log Message:
Give syspkg names to xetc files


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/sets/lists/xetc/md.x68k
cvs rdiff -u -r1.36 -r1.37 src/distrib/sets/lists/xetc/mi

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



CVS commit: src/distrib/sets/lists/xetc

2019-10-22 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Oct 22 06:28:18 UTC 2019

Modified Files:
src/distrib/sets/lists/xetc: md.x68k mi

Log Message:
Give syspkg names to xetc files


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/sets/lists/xetc/md.x68k
cvs rdiff -u -r1.36 -r1.37 src/distrib/sets/lists/xetc/mi

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

Modified files:

Index: src/distrib/sets/lists/xetc/md.x68k
diff -u src/distrib/sets/lists/xetc/md.x68k:1.5 src/distrib/sets/lists/xetc/md.x68k:1.6
--- src/distrib/sets/lists/xetc/md.x68k:1.5	Thu Mar 29 04:43:55 2018
+++ src/distrib/sets/lists/xetc/md.x68k	Tue Oct 22 06:28:18 2019
@@ -1,2 +1,2 @@
-# $NetBSD: md.x68k,v 1.5 2018/03/29 04:43:55 snj Exp $
-./etc/X11/X68kConfig	-unknown-	xorg
+# $NetBSD: md.x68k,v 1.6 2019/10/22 06:28:18 uki Exp $
+./etc/X11/X68kConfig	xetc-x11-etc	xorg

Index: src/distrib/sets/lists/xetc/mi
diff -u src/distrib/sets/lists/xetc/mi:1.36 src/distrib/sets/lists/xetc/mi:1.37
--- src/distrib/sets/lists/xetc/mi:1.36	Sun Aug 18 07:25:54 2019
+++ src/distrib/sets/lists/xetc/mi	Tue Oct 22 06:28:18 2019
@@ -1,87 +1,87 @@
-# $NetBSD: mi,v 1.36 2019/08/18 07:25:54 maya Exp $
+# $NetBSD: mi,v 1.37 2019/10/22 06:28:18 uki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
-./etc/X11/ctwm/system.ctwmrc-unknown-	xorg
-./etc/X11/fs/config	-unknown-	xorg
+./etc/X11/ctwm/system.ctwmrcxetc-ctwm-etc	xorg
+./etc/X11/fs/config	xetc-xfs-etc	xorg
 ./etc/X11/lbxproxy/AtomControlxetc-obsolete	obsolete,xorg
-./etc/X11/proxymngr/pmconfig-unknown-	xorg
-./etc/X11/twm/system.twmrc-unknown-	xorg
-./etc/X11/xdm/GiveConsole-unknown-	xorg
-./etc/X11/xdm/TakeConsole-unknown-	xorg
-./etc/X11/xdm/Xaccess	-unknown-	xorg
-./etc/X11/xdm/Xreset	-unknown-	xorg
-./etc/X11/xdm/Xresources-unknown-	xorg
-./etc/X11/xdm/Xservers	-unknown-	xorg
-./etc/X11/xdm/Xservers.fs-unknown-	xorg
-./etc/X11/xdm/Xservers.ws-unknown-	xorg
-./etc/X11/xdm/Xsession	-unknown-	xorg
-./etc/X11/xdm/Xsetup_0	-unknown-	xorg
-./etc/X11/xdm/Xstartup	-unknown-	xorg
-./etc/X11/xdm/Xwilling	-unknown-	xorg
-./etc/X11/xdm/xdm-config-unknown-	xorg
+./etc/X11/proxymngr/pmconfigxetc-proxymngr-etc	xorg
+./etc/X11/twm/system.twmrcxetc-twm-etc	xorg
+./etc/X11/xdm/GiveConsolexetc-xdm-etc	xorg
+./etc/X11/xdm/TakeConsolexetc-xdm-etc	xorg
+./etc/X11/xdm/Xaccess	xetc-xdm-etc	xorg
+./etc/X11/xdm/Xreset	xetc-xdm-etc	xorg
+./etc/X11/xdm/Xresourcesxetc-xdm-etc	xorg
+./etc/X11/xdm/Xservers	xetc-xdm-etc	xorg
+./etc/X11/xdm/Xservers.fsxetc-xdm-etc	xorg
+./etc/X11/xdm/Xservers.wsxetc-xdm-etc	xorg
+./etc/X11/xdm/Xsession	xetc-xdm-etc	xorg
+./etc/X11/xdm/Xsetup_0	xetc-xdm-etc	xorg
+./etc/X11/xdm/Xstartup	xetc-xdm-etc	xorg
+./etc/X11/xdm/Xwilling	xetc-xdm-etc	xorg
+./etc/X11/xdm/xdm-configxetc-xdm-etc	xorg
 ./etc/X11/xdm/xorg-bw.xpmxetc-obsolete	obsolete
 ./etc/X11/xdm/xorg.xpm	xetc-obsolete	obsolete
-./etc/X11/xinit/xinitrc	-unknown-	xorg
-./etc/X11/xsm/system.xsm-unknown-	xorg
-./etc/drirc		-unknown-	xorg
-./etc/fonts/conf.avail/10-autohint.conf			-unknown-	xorg
-./etc/fonts/conf.avail/10-hinting-full.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-hinting-medium.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-hinting-none.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-hinting-slight.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-no-sub-pixel.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-scale-bitmap-fonts.conf	-unknown-	xorg
-./etc/fonts/conf.avail/10-sub-pixel-bgr.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-sub-pixel-rgb.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-sub-pixel-vbgr.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-sub-pixel-vrgb.conf		-unknown-	xorg
-./etc/fonts/conf.avail/10-unhinted.conf			-unknown-	xorg
-./etc/fonts/conf.avail/11-lcdfilter-default.conf	-unknown-	xorg
-./etc/fonts/conf.avail/11-lcdfilter-legacy.conf		-unknown-	xorg
-./etc/fonts/conf.avail/11-lcdfilter-light.conf		-unknown-	xorg
-./etc/fonts/conf.avail/20-fix-globaladvance.conf	-unknown-	obsolete
-./etc/fonts/conf.avail/20-unhint-small-vera.conf	-unknown-	xorg
-./etc/fonts/conf.avail/25-unhint-nonlatin.conf		-unknown-	xorg
-./etc/fonts/conf.avail/30-metric-aliases.conf		-unknown-	xorg
-./etc/fonts/conf.avail/30-urw-aliases.conf		-unknown-	obsolete
-./etc/fonts/conf.avail/40-nonlatin.conf			-unknown-	xorg
-./etc/fonts/conf.avail/45-generic.conf			-unknown-	xorg
-./etc/fonts/conf.avail/45-latin.conf			-unknown-	xorg
-./etc/fonts/conf.avail/49-sansserif.conf		-unknown-	xorg
-./etc/fonts/conf.avail/50-user.conf			-unknown-	xorg
-./etc/fonts/conf.avail/51-local.conf			-unknown-	xorg
-./etc/fonts/conf.avail/60-generic.conf			-unknown-	xorg
-./etc/fonts/conf.avail/60-latin.conf			-unknown-	xorg