CVS commit: src/sys/dev/pci/ixgbe

2021-05-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 14 05:15:17 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Keep m_len and m_pkthdr.len consistent to prevent panic on arm.

   Arm's bus_dmamap_load_mbuf() keeps a pointer to the original mbuf
  and bus_dmamap_sync() refers it. ixgbe_rxeof() modified mbuf's m_len
  inconsistently with m_pkthdr and dm_mapsize. "ifconfig down up" made
  panic by referring the inconsistent mbuf length.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/ixgbe/ix_txrx.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/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.73 src/sys/dev/pci/ixgbe/ix_txrx.c:1.74
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.73	Fri May 14 01:30:06 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri May 14 05:15:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.73 2021/05/14 01:30:06 knakahara Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.74 2021/05/14 05:15:17 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.73 2021/05/14 01:30:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.74 2021/05/14 05:15:17 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1949,7 +1949,6 @@ ixgbe_rxeof(struct ix_queue *que)
 		 * buffer struct and pass this along from one
 		 * descriptor to the next, until we get EOP.
 		 */
-		mp->m_len = len;
 		/*
 		 * See if there is a stored head
 		 * that determines what we are
@@ -1958,6 +1957,7 @@ ixgbe_rxeof(struct ix_queue *que)
 		if (sendmp != NULL) {  /* secondary frag */
 			rbuf->buf = newmp;
 			rbuf->fmp = NULL;
+			mp->m_len = len;
 			mp->m_flags &= ~M_PKTHDR;
 			sendmp->m_pkthdr.len += mp->m_len;
 		} else {
@@ -1983,12 +1983,13 @@ ixgbe_rxeof(struct ix_queue *que)
 			if (sendmp == NULL) {
 rbuf->buf = newmp;
 rbuf->fmp = NULL;
+mp->m_len = len;
 sendmp = mp;
 			}
 
 			/* first desc of a non-ps chain */
 			sendmp->m_flags |= M_PKTHDR;
-			sendmp->m_pkthdr.len = mp->m_len;
+			sendmp->m_pkthdr.len = len;
 		}
 		++processed;
 



CVS commit: src/sys/dev/pci/ixgbe

2021-05-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 14 05:15:17 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Keep m_len and m_pkthdr.len consistent to prevent panic on arm.

   Arm's bus_dmamap_load_mbuf() keeps a pointer to the original mbuf
  and bus_dmamap_sync() refers it. ixgbe_rxeof() modified mbuf's m_len
  inconsistently with m_pkthdr and dm_mapsize. "ifconfig down up" made
  panic by referring the inconsistent mbuf length.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/ixgbe/ix_txrx.c

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



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/i2c

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 03:57:52 UTC 2021

Modified Files:
src/sys/dev/i2c [thorpej-i2c-spi-conf]: pcai2cmux.c

Log Message:
No need to device_set_handle(); it's done for us by the i2c enumeration
code.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/dev/i2c/pcai2cmux.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/i2c/pcai2cmux.c
diff -u src/sys/dev/i2c/pcai2cmux.c:1.8.4.2 src/sys/dev/i2c/pcai2cmux.c:1.8.4.3
--- src/sys/dev/i2c/pcai2cmux.c:1.8.4.2	Sun May  9 23:26:53 2021
+++ src/sys/dev/i2c/pcai2cmux.c	Fri May 14 03:57:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcai2cmux.c,v 1.8.4.2 2021/05/09 23:26:53 thorpej Exp $	*/
+/*	$NetBSD: pcai2cmux.c,v 1.8.4.3 2021/05/14 03:57:51 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcai2cmux.c,v 1.8.4.2 2021/05/09 23:26:53 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcai2cmux.c,v 1.8.4.3 2021/05/14 03:57:51 thorpej Exp $");
 
 /*
  * Driver for NXP PCA954x / PCA984x I2C switches and multiplexers.
@@ -334,11 +334,8 @@ pcaiicmux_attach(device_t parent, device
 {
 	struct pcaiicmux_softc * const sc = device_private(self);
 	struct i2c_attach_args * const ia = aux;
-	devhandle_t devhandle = ia->ia_devhandle;
 	int error;
 
-	device_set_handle(self, devhandle);
-
 	sc->sc_iicmux.sc_dev = self;
 	sc->sc_iicmux.sc_config = _config;
 	sc->sc_iicmux.sc_i2c_parent = ia->ia_tag;
@@ -352,6 +349,7 @@ pcaiicmux_attach(device_t parent, device
 	sc->sc_type->enable_bit ? "mux" : "switch");
 
 #if defined(I2CMUX_USE_FDT)
+	devhandle_t devhandle = device_handle(self);
 	if (devhandle_type(devhandle) == DEVHANDLE_TYPE_OF) {
 		const int phandle = devhandle_to_of(devhandle);
 		if (of_hasprop(phandle, "i2c-mux-idle-disconnect")) {



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/i2c

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 03:57:52 UTC 2021

Modified Files:
src/sys/dev/i2c [thorpej-i2c-spi-conf]: pcai2cmux.c

Log Message:
No need to device_set_handle(); it's done for us by the i2c enumeration
code.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/dev/i2c/pcai2cmux.c

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



CVS commit: [thorpej-i2c-spi-conf] src/sys/arch/sparc64/dev

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 03:11:49 UTC 2021

Modified Files:
src/sys/arch/sparc64/dev [thorpej-i2c-spi-conf]: jbus-i2c.c

Log Message:
Adapt jbusi2c to the new i2c device enumeration scheme.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/sparc64/dev/jbus-i2c.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/sparc64/dev/jbus-i2c.c
diff -u src/sys/arch/sparc64/dev/jbus-i2c.c:1.6 src/sys/arch/sparc64/dev/jbus-i2c.c:1.6.2.1
--- src/sys/arch/sparc64/dev/jbus-i2c.c:1.6	Sat Apr 24 23:36:49 2021
+++ src/sys/arch/sparc64/dev/jbus-i2c.c	Fri May 14 03:11:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: jbus-i2c.c,v 1.6 2021/04/24 23:36:49 thorpej Exp $	*/
+/*	$NetBSD: jbus-i2c.c,v 1.6.2.1 2021/05/14 03:11:49 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: jbus-i2c.c,v 1.6 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jbus-i2c.c,v 1.6.2.1 2021/05/14 03:11:49 thorpej Exp $");
 
 #include 
 #include 
@@ -79,11 +79,8 @@ struct jbusi2c_softc {
 	struct i2c_controller sc_i2c;
 	bus_space_tag_t sc_bustag;
 	bus_space_handle_t sc_regh;
-	int sc_node;
 };
 
-static void jbusi2c_setup_i2c(struct jbusi2c_softc *);
-
 CFATTACH_DECL_NEW(jbusi2c, sizeof(struct jbusi2c_softc),
 jbusi2c_match, jbusi2c_attach, NULL, NULL);
 
@@ -112,11 +109,11 @@ jbusi2c_attach(device_t parent, device_t
 {
 	struct jbusi2c_softc *sc = device_private(self);
 	struct mainbus_attach_args *ma = aux;
+	struct i2cbus_attach_args iba;
 
 	aprint_normal(": addr %" PRIx64 "\n", ma->ma_reg[0].ur_paddr);
 
 	sc->sc_dev = self;
-	sc->sc_node = ma->ma_node;
 	sc->sc_bustag = ma->ma_bustag;
 
 	if (bus_space_map(sc->sc_bustag, ma->ma_reg[0].ur_paddr, 16, 0,
@@ -125,21 +122,6 @@ jbusi2c_attach(device_t parent, device_t
 		return;
 	}
 
-	jbusi2c_setup_i2c(sc);
-}
-
-
-
-static void
-jbusi2c_setup_i2c(struct jbusi2c_softc *sc)
-{
-	struct i2cbus_attach_args iba;
-	prop_array_t cfg;
-	prop_dictionary_t dev;
-	prop_dictionary_t dict = device_properties(sc->sc_dev);
-	int devs, regs[2], addr;
-	char name[64], compat[256];
-
 	iic_tag_init(>sc_i2c);
 	sc->sc_i2c.ic_cookie = sc;
 	sc->sc_i2c.ic_send_start = jbusi2c_i2c_send_start;
@@ -148,37 +130,11 @@ jbusi2c_setup_i2c(struct jbusi2c_softc *
 	sc->sc_i2c.ic_read_byte = jbusi2c_i2c_read_byte;
 	sc->sc_i2c.ic_write_byte = jbusi2c_i2c_write_byte;
 
-	/* round up i2c devices */
-	devs = OF_child(sc->sc_node);
-	cfg = prop_array_create();
-	prop_dictionary_set(dict, "i2c-child-devices", cfg);
-	prop_object_release(cfg);
-	while (devs != 0) {
-		if (OF_getprop(devs, "name", name, 256) <= 0)
-			goto skip;
-		memset(compat, 0, sizeof(compat));
-		if (OF_getprop(devs, "compatible",
-		compat, 255) <= 0)
-			goto skip;
-		if (OF_getprop(devs, "reg", regs, 8) <= 0)
-			goto skip;
-		if (regs[0] != 0) goto skip;
-		addr = (regs[1] & 0xff) >> 1;
-		DPRINTF("-> %s@%d,%x\n", name, regs[0], addr);
-		dev = prop_dictionary_create();
-		prop_dictionary_set_string(dev, "name", name);
-		prop_dictionary_set_data(dev, "compatible", compat,
-		strlen(compat)+1);
-		prop_dictionary_set_uint32(dev, "addr", addr);
-		prop_dictionary_set_uint64(dev, "cookie", devs);
-		prop_array_add(cfg, dev);
-		prop_object_release(dev);
-	skip:
-		devs = OF_peer(devs);
-	}
 	memset(, 0, sizeof(iba));
 	iba.iba_tag = >sc_i2c;
-	config_found(sc->sc_dev, , iicbus_print, CFARG_EOL);
+	config_found(sc->sc_dev, , iicbus_print,
+	CFARG_DEVHANDLE, device_handle(self),
+	CFARG_EOL);
 }
 
 static inline void



CVS commit: [thorpej-i2c-spi-conf] src/sys/arch/sparc64/dev

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 03:11:49 UTC 2021

Modified Files:
src/sys/arch/sparc64/dev [thorpej-i2c-spi-conf]: jbus-i2c.c

Log Message:
Adapt jbusi2c to the new i2c device enumeration scheme.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/sparc64/dev/jbus-i2c.c

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



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 03:05:52 UTC 2021

Modified Files:
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Do that again, but slightly differently: a "compatible" property is
required by the Device Tree i2c bindings, and is present on all of
the Sun i2c device nodes that are useful (the notable exception being
the i2c "idprom" nodes, which are actually duplicates of a regular
serial eeprom node).  However, Apple's older OpenFirmware implementations
are rife with i2c nodes that lack a "compatible" property.  So, define
a OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY quirk, and enable it in
the __HAVE_OPENFIRMWARE_VARIANT_AAPL case.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.6 -r1.1.6.7 src/sys/dev/ofw/ofw_i2c_subr.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/ofw/ofw_i2c_subr.c
diff -u src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.6 src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.7
--- src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.6	Fri May 14 02:51:43 2021
+++ src/sys/dev/ofw/ofw_i2c_subr.c	Fri May 14 03:05:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.6 2021/05/14 02:51:43 thorpej Exp $	*/
+/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.7 2021/05/14 03:05:52 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.6 2021/05/14 02:51:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.7 2021/05/14 03:05:52 thorpej Exp $");
 
 #include 
 #include 
@@ -79,6 +79,12 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr
  */
 #define	OFW_I2C_ADDRESS_MASK	__BITS(0,7)
 #define	OFW_I2C_ADDRESS_SHIFT	1
+
+/*
+ * Some of Apple's older OpenFirmware implementations are rife with
+ * nodes lacking "compatible" properties.
+ */
+#define	OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY
 #endif /* __HAVE_OPENFIRMWARE_VARIANT_AAPL */
 
 #ifdef __HAVE_OPENFIRMWARE_VARIANT_SUNW
@@ -176,6 +182,11 @@ of_i2c_enumerate_devices(device_t dev, d
 		}
 
 		clist_size = OF_getproplen(node, "compatible");
+#ifndef OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY
+		if (clist_size <= 0) {
+			continue;
+		}
+#endif
 		clist = kmem_tmpbuf_alloc(clist_size,
 		compat_buf, sizeof(compat_buf), KM_SLEEP);
 		if (OF_getprop(node, "compatible", clist, clist_size) <



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 03:05:52 UTC 2021

Modified Files:
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Do that again, but slightly differently: a "compatible" property is
required by the Device Tree i2c bindings, and is present on all of
the Sun i2c device nodes that are useful (the notable exception being
the i2c "idprom" nodes, which are actually duplicates of a regular
serial eeprom node).  However, Apple's older OpenFirmware implementations
are rife with i2c nodes that lack a "compatible" property.  So, define
a OFW_I2C_ALLOW_MISSING_COMPATIBLE_PROPERTY quirk, and enable it in
the __HAVE_OPENFIRMWARE_VARIANT_AAPL case.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.6 -r1.1.6.7 src/sys/dev/ofw/ofw_i2c_subr.c

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



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 02:51:43 UTC 2021

Modified Files:
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Ooops, no, revert that.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.5 -r1.1.6.6 src/sys/dev/ofw/ofw_i2c_subr.c

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



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 02:51:43 UTC 2021

Modified Files:
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Ooops, no, revert that.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.5 -r1.1.6.6 src/sys/dev/ofw/ofw_i2c_subr.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/ofw/ofw_i2c_subr.c
diff -u src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.5 src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.6
--- src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.5	Fri May 14 02:48:43 2021
+++ src/sys/dev/ofw/ofw_i2c_subr.c	Fri May 14 02:51:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.5 2021/05/14 02:48:43 thorpej Exp $	*/
+/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.6 2021/05/14 02:51:43 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.5 2021/05/14 02:48:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.6 2021/05/14 02:51:43 thorpej Exp $");
 
 #include 
 #include 
@@ -176,9 +176,6 @@ of_i2c_enumerate_devices(device_t dev, d
 		}
 
 		clist_size = OF_getproplen(node, "compatible");
-		if (clist_size <= 0) {
-			continue;
-		}
 		clist = kmem_tmpbuf_alloc(clist_size,
 		compat_buf, sizeof(compat_buf), KM_SLEEP);
 		if (OF_getprop(node, "compatible", clist, clist_size) <



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 02:48:43 UTC 2021

Modified Files:
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Skip nodes without a "compatible" property.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.4 -r1.1.6.5 src/sys/dev/ofw/ofw_i2c_subr.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/ofw/ofw_i2c_subr.c
diff -u src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.4 src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.5
--- src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.4	Fri May 14 01:52:36 2021
+++ src/sys/dev/ofw/ofw_i2c_subr.c	Fri May 14 02:48:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.4 2021/05/14 01:52:36 thorpej Exp $	*/
+/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.5 2021/05/14 02:48:43 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.4 2021/05/14 01:52:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.5 2021/05/14 02:48:43 thorpej Exp $");
 
 #include 
 #include 
@@ -176,6 +176,9 @@ of_i2c_enumerate_devices(device_t dev, d
 		}
 
 		clist_size = OF_getproplen(node, "compatible");
+		if (clist_size <= 0) {
+			continue;
+		}
 		clist = kmem_tmpbuf_alloc(clist_size,
 		compat_buf, sizeof(compat_buf), KM_SLEEP);
 		if (OF_getprop(node, "compatible", clist, clist_size) <



CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/ofw

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 02:48:43 UTC 2021

Modified Files:
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Skip nodes without a "compatible" property.


To generate a diff of this commit:
cvs rdiff -u -r1.1.6.4 -r1.1.6.5 src/sys/dev/ofw/ofw_i2c_subr.c

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



CVS commit: [thorpej-i2c-spi-conf] src/sys

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 01:52:36 UTC 2021

Modified Files:
src/sys/arch/sparc64/include [thorpej-i2c-spi-conf]: types.h
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Define __HAVE_OPENFIRMWARE_VARIANT_SUNW for sparc64 systems and handle
its OpenFirmware quirks with respect to i2c:

- "reg" property is 2 cells, the first one containing the channel the
  device is on, the second one containing the i2c device address.
- The i2c device address is shifted left 1 bit to account for the r/w
  bit on the wire.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.16.1 src/sys/arch/sparc64/include/types.h
cvs rdiff -u -r1.1.6.3 -r1.1.6.4 src/sys/dev/ofw/ofw_i2c_subr.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/sparc64/include/types.h
diff -u src/sys/arch/sparc64/include/types.h:1.28 src/sys/arch/sparc64/include/types.h:1.28.16.1
--- src/sys/arch/sparc64/include/types.h:1.28	Sat Apr  6 03:06:27 2019
+++ src/sys/arch/sparc64/include/types.h	Fri May 14 01:52:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: types.h,v 1.28 2019/04/06 03:06:27 thorpej Exp $*/
+/*   $NetBSD: types.h,v 1.28.16.1 2021/05/14 01:52:36 thorpej Exp $*/
 
 #ifndef _SPARC64_TYPES_H_
 #define	_SPARC64_TYPES_H_
@@ -11,5 +11,6 @@
 
 #define	__HAVE_COMPAT_NETBSD32
 #define	__HAVE_UCAS_FULL
+#define	__HAVE_OPENFIRMWARE_VARIANT_SUNW
 
 #endif

Index: src/sys/dev/ofw/ofw_i2c_subr.c
diff -u src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.3 src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.4
--- src/sys/dev/ofw/ofw_i2c_subr.c:1.1.6.3	Fri May 14 00:44:13 2021
+++ src/sys/dev/ofw/ofw_i2c_subr.c	Fri May 14 01:52:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.3 2021/05/14 00:44:13 thorpej Exp $	*/
+/*	$NetBSD: ofw_i2c_subr.c,v 1.1.6.4 2021/05/14 01:52:36 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.3 2021/05/14 00:44:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr.c,v 1.1.6.4 2021/05/14 01:52:36 thorpej Exp $");
 
 #include 
 #include 
@@ -70,27 +70,80 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_i2c_subr
 #include 
 #include 
 
+#ifdef __HAVE_OPENFIRMWARE_VARIANT_AAPL
+/*
+ * Apple OpenFirmware implementations have the i2c device
+ * address shifted left 1 bit to account for the r/w bit
+ * on the wire.  We also want to look at only the least-
+ * significant 8 bits of the address cell.
+ */
+#define	OFW_I2C_ADDRESS_MASK	__BITS(0,7)
+#define	OFW_I2C_ADDRESS_SHIFT	1
+#endif /* __HAVE_OPENFIRMWARE_VARIANT_AAPL */
+
+#ifdef __HAVE_OPENFIRMWARE_VARIANT_SUNW
+/*
+ * Sun OpenFirmware implementations use 2 cells for the
+ * i2c device "reg" property, the first containing the
+ * channel number, the second containing the i2c device
+ * address shifted left 1 bit to account for the r/w bit
+ * on the wire.
+ */
+#define	OFW_I2C_REG_NCELLS	2
+#define	OFW_I2C_REG_CHANNEL	0
+#define	OFW_I2C_REG_ADDRESS	1
+#define	OFW_I2C_ADDRESS_SHIFT	1
+#endif /* __HAVE_OPENFIRMWARE_VARIANT_SUNW */
+
+#ifndef OFW_I2C_REG_NCELLS
+#define	OFW_I2C_REG_NCELLS	1
+#endif
+
+#ifndef OFW_I2C_REG_ADDRESS
+#define	OFW_I2C_REG_ADDRESS	0
+#endif
+
+/* No default for OFW_I2C_REG_CHANNEL. */
+
+#ifndef OFW_I2C_ADDRESS_MASK
+#define	OFW_I2C_ADDRESS_MASK	__BITS(0,31)
+#endif
+
+#ifndef OFW_I2C_ADDRESS_SHIFT
+#define	OFW_I2C_ADDRESS_SHIFT	0
+#endif
+
 static bool
-of_i2c_get_address(int node, uint32_t *addrp)
+of_i2c_get_address(i2c_tag_t tag, int node, uint32_t *addrp)
 {
-	uint32_t reg;
-
-	if (OF_getprop(node, "reg", , sizeof(reg)) != sizeof(reg)) {
+	uint32_t reg[OFW_I2C_REG_NCELLS];
+	uint32_t addr;
+#ifdef OFW_I2C_REG_CHANNEL
+	uint32_t channel;
+#endif
+
+	if (OF_getprop(node, "reg", reg, sizeof(reg)) != sizeof(reg)) {
+		/*
+		 * "reg" property is malformed; reject the device.
+		 */
 		return false;
 	}
 
-	reg = be32toh(reg);
+	addr = be32toh(reg[OFW_I2C_REG_ADDRESS]);
+	addr = (addr & OFW_I2C_ADDRESS_MASK) >> OFW_I2C_ADDRESS_SHIFT;
 
-#ifdef __HAVE_OPENFIRMWARE_VARIANT_AAPL
+#ifdef OFW_I2C_REG_CHANNEL
 	/*
-	 * Apple OpenFirmware implementations have the i2c device
-	 * address shifted left 1 bit to account for the r/w bit
-	 * on the wire.
+	 * If the channel in the "reg" property does not match,
+	 * reject the device.
 	 */
-	reg = (reg & 0xff) >> 1;
-#endif /* __HAVE_OPENFIRMWARE_VARIANT_AAPL */
+	channel = be32toh(reg[OFW_I2C_REG_CHANNEL]);
+	if (channel != tag->ic_channel) {
+		return false;
+	}
+#endif
 
-	*addrp = reg;
+	*addrp = addr;
 	return true;
 }
 
@@ -118,7 +171,7 @@ of_i2c_enumerate_devices(device_t dev, d
 		if (OF_getprop(node, "name", name, sizeof(name)) <= 0) {
 			continue;
 		}
-		if (!of_i2c_get_address(node, )) {
+		if (!of_i2c_get_address(args->ia->ia_tag, node, )) {
 			continue;
 		}
 



CVS commit: [thorpej-i2c-spi-conf] src/sys

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 01:52:36 UTC 2021

Modified Files:
src/sys/arch/sparc64/include [thorpej-i2c-spi-conf]: types.h
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c

Log Message:
Define __HAVE_OPENFIRMWARE_VARIANT_SUNW for sparc64 systems and handle
its OpenFirmware quirks with respect to i2c:

- "reg" property is 2 cells, the first one containing the channel the
  device is on, the second one containing the i2c device address.
- The i2c device address is shifted left 1 bit to account for the r/w
  bit on the wire.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.16.1 src/sys/arch/sparc64/include/types.h
cvs rdiff -u -r1.1.6.3 -r1.1.6.4 src/sys/dev/ofw/ofw_i2c_subr.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/pci/ixgbe

2021-05-13 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri May 14 01:30:06 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Comment out flow director processing in fast path.

ixgbe_xmit() is per-queue fast path.  It should reduce access to
per-device data (adapter->feat_en).


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ixgbe/ix_txrx.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/pci/ixgbe

2021-05-13 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri May 14 01:30:06 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Comment out flow director processing in fast path.

ixgbe_xmit() is per-queue fast path.  It should reduce access to
per-device data (adapter->feat_en).


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/ixgbe/ix_txrx.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/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.72 src/sys/dev/pci/ixgbe/ix_txrx.c:1.73
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.72	Tue May 11 01:30:30 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri May 14 01:30:06 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.72 2021/05/11 01:30:30 rin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.73 2021/05/14 01:30:06 knakahara Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.72 2021/05/11 01:30:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.73 2021/05/14 01:30:06 knakahara Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -485,6 +485,7 @@ retry:
 		return (error);
 	}
 
+#ifdef IXGBE_FDIR
 	/* Do the flow director magic */
 	if ((adapter->feat_en & IXGBE_FEATURE_FDIR) &&
 	(txr->atr_sample) && (!adapter->fdir_reinit)) {
@@ -494,6 +495,7 @@ retry:
 			txr->atr_count = 0;
 		}
 	}
+#endif
 
 	olinfo_status |= IXGBE_ADVTXD_CC;
 	i = txr->next_avail_desc;



CVS commit: [thorpej-i2c-spi-conf] src/sys

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 01:08:53 UTC 2021

Modified Files:
src/sys/arch/macppc/dev [thorpej-i2c-spi-conf]: ki2c.c smu.c
src/sys/dev/i2c [thorpej-i2c-spi-conf]: i2c_subr.c i2cmux.c i2cvar.h

Log Message:
Move the bus/channel number for multi-channel / mux controllers out of
i2cbus_attach_args and stash it in the i2c_tag_t instead.  This makes it
accessible to platform device tree code when enumerating devices.


To generate a diff of this commit:
cvs rdiff -u -r1.31.2.1 -r1.31.2.2 src/sys/arch/macppc/dev/ki2c.c
cvs rdiff -u -r1.13.2.2 -r1.13.2.3 src/sys/arch/macppc/dev/smu.c
cvs rdiff -u -r1.1.72.1 -r1.1.72.2 src/sys/dev/i2c/i2c_subr.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/sys/dev/i2c/i2cmux.c
cvs rdiff -u -r1.24.2.3 -r1.24.2.4 src/sys/dev/i2c/i2cvar.h

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



CVS commit: [thorpej-i2c-spi-conf] src/sys

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 01:08:53 UTC 2021

Modified Files:
src/sys/arch/macppc/dev [thorpej-i2c-spi-conf]: ki2c.c smu.c
src/sys/dev/i2c [thorpej-i2c-spi-conf]: i2c_subr.c i2cmux.c i2cvar.h

Log Message:
Move the bus/channel number for multi-channel / mux controllers out of
i2cbus_attach_args and stash it in the i2c_tag_t instead.  This makes it
accessible to platform device tree code when enumerating devices.


To generate a diff of this commit:
cvs rdiff -u -r1.31.2.1 -r1.31.2.2 src/sys/arch/macppc/dev/ki2c.c
cvs rdiff -u -r1.13.2.2 -r1.13.2.3 src/sys/arch/macppc/dev/smu.c
cvs rdiff -u -r1.1.72.1 -r1.1.72.2 src/sys/dev/i2c/i2c_subr.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/sys/dev/i2c/i2cmux.c
cvs rdiff -u -r1.24.2.3 -r1.24.2.4 src/sys/dev/i2c/i2cvar.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/macppc/dev/ki2c.c
diff -u src/sys/arch/macppc/dev/ki2c.c:1.31.2.1 src/sys/arch/macppc/dev/ki2c.c:1.31.2.2
--- src/sys/arch/macppc/dev/ki2c.c:1.31.2.1	Sat May  8 21:58:12 2021
+++ src/sys/arch/macppc/dev/ki2c.c	Fri May 14 01:08:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ki2c.c,v 1.31.2.1 2021/05/08 21:58:12 thorpej Exp $	*/
+/*	$NetBSD: ki2c.c,v 1.31.2.2 2021/05/14 01:08:53 thorpej Exp $	*/
 /*	Id: ki2c.c,v 1.7 2002/10/05 09:56:05 tsubai Exp	*/
 
 /*-
@@ -326,13 +326,13 @@ ki2c_attach(device_t parent, device_t se
 		ch = >sc_channels[i];
 
 		iic_tag_init(>ch_i2c);
+		ch->ch_i2c.ic_channel = ch->ch_channel = i;
 		ch->ch_i2c.ic_cookie = ch;
 		ch->ch_i2c.ic_acquire_bus = ki2c_i2c_acquire_bus;
 		ch->ch_i2c.ic_release_bus = ki2c_i2c_release_bus;
 		ch->ch_i2c.ic_exec = ki2c_i2c_exec;
 
 		ch->ch_ki2c = sc;
-		ch->ch_channel = i;
 	}
 
 	/*
@@ -409,11 +409,10 @@ ki2c_attach(device_t parent, device_t se
 		}
 		devhandle.impl = >sc_devhandle_impl;
 
-		locs[I2CBUSCF_BUS] = ch->ch_channel;
+		locs[I2CBUSCF_BUS] = ch->ch_i2c.ic_channel;
 
 		memset(, 0, sizeof(iba));
 		iba.iba_tag = >ch_i2c;
-		iba.iba_bus = ch->ch_channel;
 		config_found(sc->sc_dev, , iicbus_print_multi,
 		CFARG_SUBMATCH, config_stdsubmatch,
 		CFARG_LOCATORS, locs,

Index: src/sys/arch/macppc/dev/smu.c
diff -u src/sys/arch/macppc/dev/smu.c:1.13.2.2 src/sys/arch/macppc/dev/smu.c:1.13.2.3
--- src/sys/arch/macppc/dev/smu.c:1.13.2.2	Fri May 14 00:44:13 2021
+++ src/sys/arch/macppc/dev/smu.c	Fri May 14 01:08:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: smu.c,v 1.13.2.2 2021/05/14 00:44:13 thorpej Exp $	*/
+/*	$NetBSD: smu.c,v 1.13.2.3 2021/05/14 01:08:53 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2013 Phileas Fogg
@@ -476,11 +476,11 @@ smu_setup_iicbus(struct smu_softc *sc)
 
 		iic_tag_init(>i2c);
 		iicbus->i2c.ic_cookie = iicbus;
+		iicbus->i2c.ic_channel = iicbus->reg;
 		iicbus->i2c.ic_exec = smu_iicbus_exec;
 
 		memset(, 0, sizeof(iba));
 		iba.iba_tag = >i2c;
-		iba.iba_bus = iicbus->reg;
 
 		config_found(sc->sc_dev, , iicbus_print_multi,
 		CFARG_DEVHANDLE, devhandle_from_of(node),

Index: src/sys/dev/i2c/i2c_subr.c
diff -u src/sys/dev/i2c/i2c_subr.c:1.1.72.1 src/sys/dev/i2c/i2c_subr.c:1.1.72.2
--- src/sys/dev/i2c/i2c_subr.c:1.1.72.1	Sat May  8 14:23:15 2021
+++ src/sys/dev/i2c/i2c_subr.c	Fri May 14 01:08:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c_subr.c,v 1.1.72.1 2021/05/08 14:23:15 thorpej Exp $	*/
+/*	$NetBSD: i2c_subr.c,v 1.1.72.2 2021/05/14 01:08:53 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c_subr.c,v 1.1.72.1 2021/05/08 14:23:15 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c_subr.c,v 1.1.72.2 2021/05/14 01:08:53 thorpej Exp $");
 
 #include 
 #include 
@@ -61,7 +61,7 @@ iicbus_print_multi(void *aux, const char
 
 	if (pnp != NULL)
 		aprint_normal("iic at %s", pnp);
-	aprint_normal(" bus %d", iba->iba_bus);
+	aprint_normal(" bus %d", iba->iba_tag->ic_channel);
 
 	return UNCONF;
 }

Index: src/sys/dev/i2c/i2cmux.c
diff -u src/sys/dev/i2c/i2cmux.c:1.5.2.3 src/sys/dev/i2c/i2cmux.c:1.5.2.4
--- src/sys/dev/i2c/i2cmux.c:1.5.2.3	Sat May  8 15:10:44 2021
+++ src/sys/dev/i2c/i2cmux.c	Fri May 14 01:08:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2cmux.c,v 1.5.2.3 2021/05/08 15:10:44 thorpej Exp $	*/
+/*	$NetBSD: i2cmux.c,v 1.5.2.4 2021/05/14 01:08:53 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2cmux.c,v 1.5.2.3 2021/05/08 15:10:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2cmux.c,v 1.5.2.4 2021/05/14 01:08:53 thorpej Exp $");
 
 #include 
 #include 
@@ -131,6 +131,7 @@ iicmux_attach_bus(struct iicmux_softc * 
 
 	iic_tag_init(>controller);
 	bus->controller.ic_cookie = bus;
+	bus->controller.ic_channel = bus->busidx;
 	bus->controller.ic_acquire_bus = iicmux_acquire_bus;
 	bus->controller.ic_release_bus = iicmux_release_bus;
 	bus->controller.ic_exec = iicmux_exec;
@@ -144,7 +145,6 @@ 

CVS commit: [thorpej-i2c-spi-conf] src/sys

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 00:44:13 UTC 2021

Modified Files:
src/sys/arch/macppc/dev [thorpej-i2c-spi-conf]: pmu.c smu.c
src/sys/arch/macppc/include [thorpej-i2c-spi-conf]: types.h
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c openfirm.h

Log Message:
Deal with quirks / differences in OpenFirmware implementations'
interpreation of the i2c "reg" property by embedding knowledge
of those quicks directly, rather than forcing lots of drivers
to provide their own devhandle implementations.  We default to
assuming the Device Tree bindings, and tweak based on platform-
specific #ifdefs.

Start with __HAVE_OPENFIRMWARE_VARIANT_AAPL (all i2c "reg" properties
encode an address that's shifted left 1 bit to account for the R/W bit
that appears on the wire).


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/sys/arch/macppc/dev/pmu.c
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/sys/arch/macppc/dev/smu.c
cvs rdiff -u -r1.14 -r1.14.70.1 src/sys/arch/macppc/include/types.h
cvs rdiff -u -r1.1.6.2 -r1.1.6.3 src/sys/dev/ofw/ofw_i2c_subr.c
cvs rdiff -u -r1.47.2.1 -r1.47.2.2 src/sys/dev/ofw/openfirm.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/macppc/dev/pmu.c
diff -u src/sys/arch/macppc/dev/pmu.c:1.37.2.1 src/sys/arch/macppc/dev/pmu.c:1.37.2.2
--- src/sys/arch/macppc/dev/pmu.c:1.37.2.1	Sat May  8 22:39:41 2021
+++ src/sys/arch/macppc/dev/pmu.c	Fri May 14 00:44:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmu.c,v 1.37.2.1 2021/05/08 22:39:41 thorpej Exp $ */
+/*	$NetBSD: pmu.c,v 1.37.2.2 2021/05/14 00:44:13 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2006 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.37.2.1 2021/05/08 22:39:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.37.2.2 2021/05/14 00:44:13 thorpej Exp $");
 
 #include 
 #include 
@@ -91,12 +91,6 @@ struct pmu_softc {
 	bus_space_tag_t sc_memt;
 	bus_space_handle_t sc_memh;
 
-	/*
-	 * We provide our own i2c device enumeration method, so we
-	 * need to provide our own devhandle_impl.
-	 */
-	struct devhandle_impl sc_devhandle_impl;
-
 	uint32_t sc_flags;
 #define PMU_HAS_BACKLIGHT_CONTROL	1
 	int sc_node;
@@ -242,42 +236,6 @@ static const char *has_two_smart_batteri
 	"PowerBook1,1",
 	NULL };
 
-static bool
-pmu_i2c_get_address(int node, uint32_t *addrp)
-{
-	uint32_t reg;
-
-	if (of_getprop_uint32(node, "reg", ) == -1) {
-		return false;
-	}
-
-	*addrp = (reg & 0xff) >> 1;
-	return true;
-}
-
-static int
-pmu_i2c_enumerate_devices(device_t dev, devhandle_t call_handle, void *v)
-{
-	/*
-	 * This follows the OpenFirmware I2C binding for the most
-	 * part, but has the address shifted left for the READ bit.
-	 */
-	return of_i2c_enumerate_devices_ext(dev, call_handle, v,
-	pmu_i2c_get_address);
-}
-
-static device_call_t
-pmu_devhandle_lookup_device_call(devhandle_t handle, const char *name,
-devhandle_t *call_handlep)
-{
-	if (strcmp(name, "i2c-enumerate-devices") == 0) {
-		return pmu_i2c_enumerate_devices;
-	}
-
-	/* Defer everything else to the "super". */
-	return NULL;
-}
-
 static int
 pmu_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -382,18 +340,6 @@ pmu_attach(device_t parent, device_t sel
 			goto next;
 
 		if (strncmp(name, "pmu-i2c", 8) == 0) {
-			/*
-			 * Give the OFW node to the i2c bus instance,
-			 * but provide our own devhandle_impl, because
-			 * we have our own device enumeration method.
-			 */
-			devhandle_t devhandle = devhandle_from_of(node);
-			devhandle_impl_inherit(>sc_devhandle_impl,
-			devhandle.impl);
-			sc->sc_devhandle_impl.lookup_device_call =
-			pmu_devhandle_lookup_device_call;
-			devhandle.impl = >sc_devhandle_impl;
-
 			/* fill in the i2c tag */
 			iic_tag_init(>sc_i2c);
 			sc->sc_i2c.ic_cookie = sc;
@@ -403,7 +349,7 @@ pmu_attach(device_t parent, device_t sel
 			iba.iba_tag = >sc_i2c;
 			config_found(sc->sc_dev, , iicbus_print,
 			CFARG_IATTR, "i2cbus",
-			CFARG_DEVHANDLE, devhandle,
+			CFARG_DEVHANDLE, devhandle_from_of(node),
 			CFARG_EOL);
 			goto next;
 		}

Index: src/sys/arch/macppc/dev/smu.c
diff -u src/sys/arch/macppc/dev/smu.c:1.13.2.1 src/sys/arch/macppc/dev/smu.c:1.13.2.2
--- src/sys/arch/macppc/dev/smu.c:1.13.2.1	Sun May  9 21:37:04 2021
+++ src/sys/arch/macppc/dev/smu.c	Fri May 14 00:44:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: smu.c,v 1.13.2.1 2021/05/09 21:37:04 thorpej Exp $	*/
+/*	$NetBSD: smu.c,v 1.13.2.2 2021/05/14 00:44:13 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2013 Phileas Fogg
@@ -117,11 +117,6 @@ struct smu_softc {
 	int sc_num_fans;
 	struct smu_fan sc_fans[SMU_MAX_FANS];
 
-	/*
-	 * We provide our own i2c device enumeration method, so we
-	 * need to provide our own devhandle_impl.
-	 */
-	struct devhandle_impl sc_devhandle_impl;
 	LIST_HEAD(, smu_iicbus) sc_iic_busses;
 
 	struct todr_chip_handle 

CVS commit: [thorpej-i2c-spi-conf] src/sys

2021-05-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri May 14 00:44:13 UTC 2021

Modified Files:
src/sys/arch/macppc/dev [thorpej-i2c-spi-conf]: pmu.c smu.c
src/sys/arch/macppc/include [thorpej-i2c-spi-conf]: types.h
src/sys/dev/ofw [thorpej-i2c-spi-conf]: ofw_i2c_subr.c openfirm.h

Log Message:
Deal with quirks / differences in OpenFirmware implementations'
interpreation of the i2c "reg" property by embedding knowledge
of those quicks directly, rather than forcing lots of drivers
to provide their own devhandle implementations.  We default to
assuming the Device Tree bindings, and tweak based on platform-
specific #ifdefs.

Start with __HAVE_OPENFIRMWARE_VARIANT_AAPL (all i2c "reg" properties
encode an address that's shifted left 1 bit to account for the R/W bit
that appears on the wire).


To generate a diff of this commit:
cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/sys/arch/macppc/dev/pmu.c
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/sys/arch/macppc/dev/smu.c
cvs rdiff -u -r1.14 -r1.14.70.1 src/sys/arch/macppc/include/types.h
cvs rdiff -u -r1.1.6.2 -r1.1.6.3 src/sys/dev/ofw/ofw_i2c_subr.c
cvs rdiff -u -r1.47.2.1 -r1.47.2.2 src/sys/dev/ofw/openfirm.h

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



CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common

2021-05-13 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu May 13 09:05:19 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_dataset.c

Log Message:
this is not FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c

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

Modified files:

Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c
diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c:1.4 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c:1.5
--- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c:1.4	Mon May 28 21:05:06 2018
+++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c	Thu May 13 09:05:19 2021
@@ -1135,7 +1135,7 @@ badlabel:
 			m_label_free(new_sl);	/* OK if null */
 #else	/* !illumos */
 			zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-			"mlslabel is not supported on FreeBSD"));
+			"mlslabel is not supported on NetBSD"));
 			(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
 #endif	/* illumos */
 			goto error;
@@ -1644,7 +1644,7 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl
 		case ZFS_PROP_NBMAND:
 		case ZFS_PROP_MLSLABEL:
 			(void) snprintf(errbuf, sizeof (errbuf),
-			"property '%s' not supported on FreeBSD",
+			"property '%s' not supported on NetBSD",
 			nvpair_name(elem));
 			ret = zfs_error(hdl, EZFS_PERM, errbuf);
 			goto error;



CVS commit: src/external/cddl/osnet/dist/lib/libzfs/common

2021-05-13 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu May 13 09:05:19 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_dataset.c

Log Message:
this is not FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c

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



CVS commit: src/external/cddl/osnet/dist/cmd/zfs

2021-05-13 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu May 13 09:03:35 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/cmd/zfs: zfs_main.c

Log Message:
zfs: this is not FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c

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



CVS commit: src/external/cddl/osnet/dist/cmd/zfs

2021-05-13 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu May 13 09:03:35 UTC 2021

Modified Files:
src/external/cddl/osnet/dist/cmd/zfs: zfs_main.c

Log Message:
zfs: this is not FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c

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

Modified files:

Index: src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c
diff -u src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c:1.7 src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c:1.8
--- src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c:1.7	Sun Sep 15 19:38:09 2019
+++ src/external/cddl/osnet/dist/cmd/zfs/zfs_main.c	Thu May 13 09:03:35 2021
@@ -6130,7 +6130,7 @@ share_mount(int op, int argc, char **arg
 			break;
 
 		case 'O':
-			warnx("no overlay mounts support on FreeBSD, ignoring");
+			warnx("no overlay mounts support on NetBSD, ignoring");
 			break;
 		case ':':
 			(void) fprintf(stderr, gettext("missing argument for "



CVS commit: src/sys/fs/ntfs

2021-05-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu May 13 08:57:29 UTC 2021

Modified Files:
src/sys/fs/ntfs: ntfs_subr.c

Log Message:
ntfs_loadntnode(): Use bread() when ntm_sysvn[NTFS_MFTINO] is NULL.

May happen when loading node 0 (MFT) during mount and some
attributes are stored in another ntnode.

PR kern/56160 (Mount ntfs usb disk)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/fs/ntfs/ntfs_subr.c

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



CVS commit: src/sys/fs/ntfs

2021-05-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu May 13 08:57:29 UTC 2021

Modified Files:
src/sys/fs/ntfs: ntfs_subr.c

Log Message:
ntfs_loadntnode(): Use bread() when ntm_sysvn[NTFS_MFTINO] is NULL.

May happen when loading node 0 (MFT) during mount and some
attributes are stored in another ntnode.

PR kern/56160 (Mount ntfs usb disk)


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/fs/ntfs/ntfs_subr.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/fs/ntfs/ntfs_subr.c
diff -u src/sys/fs/ntfs/ntfs_subr.c:1.63 src/sys/fs/ntfs/ntfs_subr.c:1.64
--- src/sys/fs/ntfs/ntfs_subr.c:1.63	Fri Jan 17 20:08:08 2020
+++ src/sys/fs/ntfs/ntfs_subr.c	Thu May 13 08:57:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntfs_subr.c,v 1.63 2020/01/17 20:08:08 ad Exp $	*/
+/*	$NetBSD: ntfs_subr.c,v 1.64 2021/05/13 08:57:29 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko (sem...@freebsd.org)
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.63 2020/01/17 20:08:08 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.64 2021/05/13 08:57:29 hannken Exp $");
 
 #include 
 #include 
@@ -267,7 +267,8 @@ ntfs_loadntnode(struct ntfsmount *ntmp, 
 
 	mfrp = malloc(ntfs_bntob(ntmp->ntm_bpmftrec), M_TEMP, M_WAITOK);
 
-	if (ip->i_number < NTFS_SYSNODESNUM) {
+	if (ip->i_number < NTFS_SYSNODESNUM ||
+	ntmp->ntm_sysvn[NTFS_MFTINO] == NULL) {
 		struct buf *bp;
 		daddr_t bn;
 		off_t boff;



CVS commit: src/sys/arch/mac68k/obio

2021-05-13 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Thu May 13 08:47:21 UTC 2021

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
We do not match machines whose SWIM does not support the IWM register
set used by this driver (SWIM II/III, SWIM behind IOP, AV models' DMA
based controllers).  Unfortunately, this distinction does not run
cleanly along MACH_CLASS* lines, and we have to look at MACH_MAC{model} tags.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.59 src/sys/arch/mac68k/obio/iwm_fd.c:1.60
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.59	Sat Apr 24 23:36:41 2021
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Thu May 13 08:47:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.59 2021/04/24 23:36:41 thorpej Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.60 2021/05/13 08:47:21 hauke Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.59 2021/04/24 23:36:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.60 2021/05/13 08:47:21 hauke Exp $");
 
 #include "locators.h"
 
@@ -65,11 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1
 #include 
 #include 
 
-/**
- **	Private functions
- **/
-static int map_iwm_base(vm_offset_t);
-
 /* Autoconfig */
 int	iwm_match(device_t, cfdata_t, void *);
 void	iwm_attach(device_t, device_t, void *);
@@ -78,6 +73,10 @@ int	fd_match(device_t, cfdata_t, void *)
 void	fd_attach(device_t, device_t, void *);
 int	fd_print(void *, const char *);
 
+/**
+ **	Private functions
+ **/
+
 /* Disklabel stuff */
 static void fdGetDiskLabel(fd_softc_t *, dev_t);
 static void fdPrintDiskLabel(struct disklabel *);
@@ -164,7 +163,7 @@ int iwmDebugging = 0 /* | M_TRACE_OP
  ** Module-global Variables
  **/
 
-/* The IWM base address */
+/* The controller base address */
 u_long IWMBase;
 
 /*
@@ -273,30 +272,71 @@ struct dkdriver fd_dkDriver = {
  * to match against. After all, that's what the obio concept is 
  * about: Onboard components that are present depending (only) 
  * on machine type.
+ *
+ * While here, map the machine-dependent physical IO address of IWM
+ * to VM address.
+ *
+ * We do not match, nor return an IWMBase address for machines whose
+ * SWIM does not support the IWM register set used by this driver
+ * (SWIM II/III, SWIM behind IOP, AV models' DMA based controllers).
+ * Unfortunately, this distinction does not run cleanly along
+ * MACH_CLASS* lines, and we will have to look at MACH_MAC{model} tags.
+ *
+ * See also "What chips are in what Macs?" at
+ * ,
  */
 int
 iwm_match(device_t parent, cfdata_t match, void *aux)
 {
-	int matched;
+	int matched = 0;
 	extern u_long IOBase;		/* from mac68k/machdep.c */
 	extern u_long IWMBase;
-	
-	if (0 == map_iwm_base(IOBase)) {
-		/* 
-		 * Unknown machine HW:
-		 * The SWIM II/III chips that are present in post-Q700
-		 * '040 Macs have dropped the IWM register structure.
-		 * We know next to nothing about the SWIM.
-		 */
-		matched = 0;
-		if (TRACE_CONFIG)
-			printf("IWM or SWIM not found: Unknown location (SWIM II?).\n");
-	} else {
+
+	IWMBase = 0L;
+
+	switch (current_mac_model->class) {
+	case MACH_CLASSPB:	/* Not: 5x0, 190x */
+		if (current_mac_model->machineid == MACH_MACPB500 ||
+		current_mac_model->machineid == MACH_MACPB190 ||
+		current_mac_model->machineid == MACH_MACPB190CS)
+			break;
+		/* FALLTHROUGH */
+	case MACH_CLASSLC:	/* Only: LC II, Classic II */
+		if (current_mac_model->machineid != MACH_MACLCII &&
+		current_mac_model->machineid != MACH_MACCLASSICII)
+			break;
+		/* FALLTHROUGH */
+	case MACH_CLASSII:	/* All */
+	case MACH_CLASSIIci:	/* All */
+	case MACH_CLASSIIsi:	/* All */
+	case MACH_CLASSIIvx:	/* All */
+	case MACH_CLASSDUO:	/* All */
+		IWMBase = IOBase + 0x16000;
 		matched = 1;
-		if (TRACE_CONFIG) {
-			printf("iwm: IWMBase mapped to 0x%lx in VM.\n", 
-			IWMBase);
+		break;
+	case MACH_CLASSQ:	/* Only: 700 */
+		if (current_mac_model->machineid == MACH_MACQ700) {
+			IWMBase = IOBase + 0x1E000;
+			matched = 1;
+			break;
 		}
+		/* FALLTHROUGH */
+	case MACH_CLASSQ2:	/* None */
+	case MACH_CLASSP580:	/* None */
+	case MACH_CLASSIIfx:	/* None */
+	case MACH_CLASSAV:	/* None */
+	default:
+		IWMBase = 0L;
+		matched = 0;
+		break;
+	}
+
+	if (TRACE_CONFIG) {
+		if (matched == 0)
+			printf("IWM or original SWIM not found.\n");
+		else
+			printf("IWMBase mapped to VM addr 0x%lx.\n",
+			IWMBase);
 	}
 	return matched;
 }
@@ -337,7 +377,7 @@ iwm_attach(device_t parent, device_t sel
 		if (TRACE_CONFIG)
 			printf("iwm: Initialization completed.\n");
 	} else {
-		printf("iwm: Chip revision not supported (%d)\n", 

CVS commit: src/sys/arch/mac68k/obio

2021-05-13 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Thu May 13 08:47:21 UTC 2021

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
We do not match machines whose SWIM does not support the IWM register
set used by this driver (SWIM II/III, SWIM behind IOP, AV models' DMA
based controllers).  Unfortunately, this distinction does not run
cleanly along MACH_CLASS* lines, and we have to look at MACH_MAC{model} tags.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/obio/iwm_fd.c

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/rockchip

2021-05-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 13 06:15:41 UTC 2021

Modified Files:
src/sys/arch/arm/rockchip: rk3399_iomux.c

Log Message:
 Use unsigned to avoid undefined behavior in GRF_GPIO_P_{CTL,WRITE_EN}.
Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/rockchip/rk3399_iomux.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/rockchip/rk3399_iomux.c
diff -u src/sys/arch/arm/rockchip/rk3399_iomux.c:1.11 src/sys/arch/arm/rockchip/rk3399_iomux.c:1.12
--- src/sys/arch/arm/rockchip/rk3399_iomux.c:1.11	Sat Apr 24 23:36:28 2021
+++ src/sys/arch/arm/rockchip/rk3399_iomux.c	Thu May 13 06:15:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_iomux.c,v 1.11 2021/04/24 23:36:28 thorpej Exp $ */
+/* $NetBSD: rk3399_iomux.c,v 1.12 2021/05/13 06:15:41 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -29,7 +29,7 @@
 //#define RK3399_IOMUX_DEBUG
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.11 2021/04/24 23:36:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.12 2021/05/13 06:15:41 msaitoh Exp $");
 
 #include 
 #include 
@@ -45,8 +45,8 @@ __KERNEL_RCSID(0, "$NetBSD: rk3399_iomux
 #include 
 
 /* PU/PD control */
-#define	 GRF_GPIO_P_CTL(_idx)		(0x3 << (((_idx) & 7) * 2))
-#define	 GRF_GPIO_P_WRITE_EN(_idx)	(0x3 << (((_idx) & 7) * 2 + 16))
+#define	 GRF_GPIO_P_CTL(_idx)		(0x3U << (((_idx) & 7) * 2))
+#define	 GRF_GPIO_P_WRITE_EN(_idx)	(0x3U << (((_idx) & 7) * 2 + 16))
 /* Different bias value mapping based on pull type of pin */
 #define	  IO_DEF_GPIO_P_CTL_Z		0
 #define	  IO_DEF_GPIO_P_CTL_PULLUP	1



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

2021-05-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 13 06:15:41 UTC 2021

Modified Files:
src/sys/arch/arm/rockchip: rk3399_iomux.c

Log Message:
 Use unsigned to avoid undefined behavior in GRF_GPIO_P_{CTL,WRITE_EN}.
Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/rockchip/rk3399_iomux.c

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



CVS commit: src/sys/arch/mips/mips

2021-05-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu May 13 06:15:29 UTC 2021

Modified Files:
src/sys/arch/mips/mips: fp.S

Log Message:
Update ISA for some "L" variant instructions after checking the R4400 UM.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mips/mips/fp.S

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/mips/mips/fp.S
diff -u src/sys/arch/mips/mips/fp.S:1.55 src/sys/arch/mips/mips/fp.S:1.56
--- src/sys/arch/mips/mips/fp.S:1.55	Thu May 13 04:55:12 2021
+++ src/sys/arch/mips/mips/fp.S	Thu May 13 06:15:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fp.S,v 1.55 2021/05/13 04:55:12 simonb Exp $	*/
+/*	$NetBSD: fp.S,v 1.56 2021/05/13 06:15:29 simonb Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -350,7 +350,7 @@ func_single_tbl:
 	PTR_WORD ill		# func 34 42
 	PTR_WORD ill		# func 35 43
 	PTR_WORD cvt_w_s	# func 36 44	CVT.W.S
-	PTR_WORD cvt_l_s	# func 37 45	CVT.L.S		MIPS64r2
+	PTR_WORD cvt_l_s	# func 37 45	CVT.L.S		MIPS3/MIPS64
 	PTR_WORD cvt_ps_s	# func 38 46	CVT.PS.S	MIPS32r2
 	PTR_WORD ill		# func 39 47
 	PTR_WORD ill		# func 40 50
@@ -387,10 +387,10 @@ func_double_tbl:
 	PTR_WORD abs_d		# func  5 05	ABS.D
 	PTR_WORD mov_d		# func  6 06	MOV.D
 	PTR_WORD neg_d		# func  7 07	NEG.D 
-	PTR_WORD round_l_d	# func  8 10	ROUND.L.D	MIPS64r2
-	PTR_WORD trunc_l_d	# func  9 11	TRUNC.L.D	MIPS64r2
-	PTR_WORD ceil_l_d	# func 10 12	CEIL.L.D	MIPS64r2
-	PTR_WORD floor_l_d	# func 11 13	FLOOR.L.D	MIPS64r2
+	PTR_WORD round_l_d	# func  8 10	ROUND.L.D	MIPS3/MIPS64
+	PTR_WORD trunc_l_d	# func  9 11	TRUNC.L.D	MIPS3/MIPS64
+	PTR_WORD ceil_l_d	# func 10 12	CEIL.L.D	MIPS3/MIPS64
+	PTR_WORD floor_l_d	# func 11 13	FLOOR.L.D	MIPS3/MIPS64
 	PTR_WORD round_w_d	# func 12 14	ROUND.W.D
 	PTR_WORD trunc_w_d	# func 13 15	TRUNC.W.D
 	PTR_WORD ceil_w_d	# func 14 16	CEIL.W.D
@@ -416,7 +416,7 @@ func_double_tbl:
 	PTR_WORD ill		# func 34 42
 	PTR_WORD ill		# func 35 43
 	PTR_WORD cvt_w_d	# func 36 44	CVT.W.D
-	PTR_WORD cvt_l_d	# func 37 45	CVT.L.D		MIPS64r2
+	PTR_WORD cvt_l_d	# func 37 45	CVT.L.D		MIPS3/MIPS64
 	PTR_WORD ill		# func 38 46
 	PTR_WORD ill		# func 39 47
 	PTR_WORD ill		# func 40 50
@@ -543,8 +543,8 @@ func_long_fixed_tbl:
 	PTR_WORD ill		# func 29 35
 	PTR_WORD ill		# func 30 36
 	PTR_WORD ill		# func 31 37
-	PTR_WORD cvt_s_l	# func 32 40	CVT.S.L		MIPS32r2
-	PTR_WORD cvt_d_l	# func 33 41	CVT.D.L		MIPS32r2
+	PTR_WORD cvt_s_l	# func 32 40	CVT.S.L		MIPS3/MIPS64
+	PTR_WORD cvt_d_l	# func 33 41	CVT.D.L		MIPS3/MIPS64
 	PTR_WORD ill		# func 34 42
 	PTR_WORD ill		# func 35 43
 	PTR_WORD ill		# func 36 44



CVS commit: src/sys/arch/mips/mips

2021-05-13 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu May 13 06:15:29 UTC 2021

Modified Files:
src/sys/arch/mips/mips: fp.S

Log Message:
Update ISA for some "L" variant instructions after checking the R4400 UM.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mips/mips/fp.S

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