CVS commit: [netbsd-7] src/sys/arch/x86/pci

2016-12-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Dec  9 04:48:44 UTC 2016

Modified Files:
src/sys/arch/x86/pci [netbsd-7]: ichlpcib.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1295):
sys/arch/x86/pci/ichlpcib.c: revision 1.50
Add Core 5G (mobile) LPC support.


To generate a diff of this commit:
cvs rdiff -u -r1.43.4.5 -r1.43.4.6 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.43.4.5 src/sys/arch/x86/pci/ichlpcib.c:1.43.4.6
--- src/sys/arch/x86/pci/ichlpcib.c:1.43.4.5	Sun Aug 28 03:38:15 2016
+++ src/sys/arch/x86/pci/ichlpcib.c	Fri Dec  9 04:48:44 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.43.4.5 2016/08/28 03:38:15 snj Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.43.4.6 2016/12/09 04:48:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.43.4.5 2016/08/28 03:38:15 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.43.4.6 2016/12/09 04:48:44 snj Exp $");
 
 #include 
 #include 
@@ -261,6 +261,8 @@ static struct lpcib_device {
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_Z97_LPC, 1, 0 },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_X99_LPC, 1, 0 },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_X99_LPC_2, 1, 0 },
+	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_CORE5G_M_LPC_4, 1, 0 },
+	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_CORE5G_M_LPC_7, 1, 0 },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C222_LPC, 1, 0 },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C224_LPC, 1, 0 },
 	{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C226_LPC, 1, 0 },



CVS commit: [netbsd-7] src/sys/arch/x86/pci

2016-08-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Aug 28 03:38:15 UTC 2016

Modified Files:
src/sys/arch/x86/pci [netbsd-7]: ichlpcib.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #1213):
sys/arch/x86/pci/ichlpcib.c: revision 1.51
Disable gpio(4) attachment to ichlpcib(4) by default.
The GPIO lines on an ICH are usually connected to opaque platform-
defined functionality, and may be manipulated by the ACPI DSDT or other
mechanisms behind our backs.  In one instance, it was found this
in combiation with gpio_resume() sabotaged repeated suspend/resume cycles.
GPIO functionality can be enabled by setting ichlpcib_gpio_disable to 0,
for instance with `gdb -write`.


To generate a diff of this commit:
cvs rdiff -u -r1.43.4.4 -r1.43.4.5 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.43.4.4 src/sys/arch/x86/pci/ichlpcib.c:1.43.4.5
--- src/sys/arch/x86/pci/ichlpcib.c:1.43.4.4	Thu Apr 30 19:27:20 2015
+++ src/sys/arch/x86/pci/ichlpcib.c	Sun Aug 28 03:38:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.43.4.4 2015/04/30 19:27:20 snj Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.43.4.5 2016/08/28 03:38:15 snj Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.43.4.4 2015/04/30 19:27:20 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.43.4.5 2016/08/28 03:38:15 snj Exp $");
 
 #include 
 #include 
@@ -279,6 +279,14 @@ static struct lpcib_device {
 };
 
 /*
+ * Allow user to enable GPIO functionality if they really need it.  The
+ * vast majority of systems with an ICH should not expose GPIO to the
+ * kernel or user.  In at least one instance the gpio_resume() handler
+ * on ICH GPIO was found to sabotage S3 suspend/resume.
+ */
+int	ichlpcib_gpio_disable = 1;
+
+/*
  * Autoconf callbacks.
  */
 static int
@@ -1073,6 +1081,9 @@ lpcib_gpio_configure(device_t self)
 	int pin, shift, base_reg, cntl_reg, reg;
 	int rv;
 
+	if (ichlpcib_gpio_disable != 0)
+		return;
+
 	/* this implies ICH >= 6, and thus different mapreg */
 	if (sc->sc_has_rcba) {
 		base_reg = LPCIB_PCI_GPIO_BASE_ICH6;



CVS commit: [netbsd-7] src/sys/arch/x86/pci

2015-01-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 26 16:16:11 UTC 2015

Modified Files:
src/sys/arch/x86/pci [netbsd-7]: ichlpcib.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #455):
sys/arch/x86/pci/ichlpcib.c: revision 1.46

The PMBASE and GPIOBASE registers are not compatible with the PCI spec
and the map sizes are fixed to 128bytes. The pci_mapreg_submap()
function has a code to check the range of the BAR. The
PCI_MAPREG_IO_SIZE() macro returns lower than 128bytes on some
machines. This makes it impossible to use pci_mapreg_submap(). Use
pci_conf_read() and bus_space_map() directly.


To generate a diff of this commit:
cvs rdiff -u -r1.43.4.1 -r1.43.4.2 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.43.4.1 src/sys/arch/x86/pci/ichlpcib.c:1.43.4.2
--- src/sys/arch/x86/pci/ichlpcib.c:1.43.4.1	Thu Jan  8 11:39:38 2015
+++ src/sys/arch/x86/pci/ichlpcib.c	Mon Jan 26 16:16:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.43.4.1 2015/01/08 11:39:38 martin Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.43.4.2 2015/01/26 16:16:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ichlpcib.c,v 1.43.4.1 2015/01/08 11:39:38 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: ichlpcib.c,v 1.43.4.2 2015/01/26 16:16:11 martin Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -301,6 +301,7 @@ lpcibattach(device_t parent, device_t se
 	struct pci_attach_args *pa = aux;
 	struct lpcib_softc *sc = device_private(self);
 	struct lpcib_device *lpcib_dev;
+	pcireg_t pmbase;
 
 	sc-sc_pa = *pa;
 
@@ -322,12 +323,16 @@ lpcibattach(device_t parent, device_t se
 	 *
 	 * The PMBASE register is alike PCI BAR but not completely compatible
 	 * with it. The PMBASE define the base address and the type but
-	 * not describe the size.
+	 * not describe the size. The value of the register may be lower
+	 * than LPCIB_PCI_PM_SIZE. It makes impossible to use
+	 * pci_mapreg_submap() because the function does range check.
 	 */
-	if (pci_mapreg_submap(pa, LPCIB_PCI_PMBASE, PCI_MAPREG_TYPE_IO, 0,
-		LPCIB_PCI_PM_SIZE, 0, sc-sc_iot, sc-sc_ioh, NULL,
-		sc-sc_iosize)) {
-		aprint_error_dev(self, can't map power management i/o space\n);
+	sc-sc_iot = pa-pa_iot;
+	pmbase = pci_conf_read(pa-pa_pc, pa-pa_tag, LPCIB_PCI_PMBASE);
+	if (bus_space_map(sc-sc_iot, PCI_MAPREG_IO_ADDR(pmbase),
+	LPCIB_PCI_PM_SIZE, 0, sc-sc_ioh) != 0) {
+		aprint_error_dev(self,
+		can't map power management i/o space\n);
 		return;
 	}
 
@@ -1080,11 +1085,14 @@ lpcib_gpio_configure(device_t self)
 	/*
 	 * The GPIO_BASE register is alike PCI BAR but not completely
 	 * compatible with it. The PMBASE define the base address and the type
-	 * but not describe the size.
+	 * but not describe the size. The value of the register may be lower
+	 * than LPCIB_PCI_GPIO_SIZE. It makes impossible to use
+	 * pci_mapreg_submap() because the function does range check.
 	 */
-	rv = pci_mapreg_submap(sc-sc_pa, base_reg, PCI_MAPREG_TYPE_IO, 0,
-	LPCIB_PCI_GPIO_SIZE, 0, sc-sc_gpio_iot, sc-sc_gpio_ioh,
-	NULL, sc-sc_gpio_ios);
+	sc-sc_gpio_iot = sc-sc_pa.pa_iot;
+	reg = pci_conf_read(sc-sc_pa.pa_pc, sc-sc_pa.pa_tag, base_reg);
+	rv = bus_space_map(sc-sc_gpio_iot, PCI_MAPREG_IO_ADDR(reg),
+	LPCIB_PCI_GPIO_SIZE, 0, sc-sc_gpio_ioh);
 	if (rv != 0) {
 		aprint_error_dev(self, can't map general purpose i/o space(rv = %d)\n, rv);
 		return;



CVS commit: [netbsd-7] src/sys/arch/x86/pci

2015-01-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 25 08:25:12 UTC 2015

Modified Files:
src/sys/arch/x86/pci [netbsd-7]: pci_machdep.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #451):
sys/arch/x86/pci/pci_machdep.c: revision 1.68
we don't need to keep track of curmode if not vga_post.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.2.1 src/sys/arch/x86/pci/pci_machdep.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/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.67 src/sys/arch/x86/pci/pci_machdep.c:1.67.2.1
--- src/sys/arch/x86/pci/pci_machdep.c:1.67	Tue May  6 18:54:34 2014
+++ src/sys/arch/x86/pci/pci_machdep.c	Sun Jan 25 08:25:11 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.67 2014/05/06 18:54:34 christos Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.67.2.1 2015/01/25 08:25:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.67 2014/05/06 18:54:34 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.67.2.1 2015/01/25 08:25:11 martin Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -789,24 +789,28 @@ static bool
 x86_genfb_setmode(struct genfb_softc *sc, int newmode)
 {
 #if NGENFB  0
+# if NACPICA  0  defined(VGA_POST)
 	static int curmode = WSDISPLAYIO_MODE_EMUL;
+# endif
 
 	switch (newmode) {
 	case WSDISPLAYIO_MODE_EMUL:
 		x86_genfb_mtrr_init(sc-sc_fboffset,
 		sc-sc_height * sc-sc_stride);
-#if NACPICA  0  defined(VGA_POST)
+# if NACPICA  0  defined(VGA_POST)
 		if (curmode != newmode) {
 			if (vga_posth != NULL  acpi_md_vesa_modenum != 0) {
 vga_post_set_vbe(vga_posth,
 acpi_md_vesa_modenum);
 			}
 		}
-#endif
+# endif
 		break;
 	}
 
+# if NACPICA  0  defined(VGA_POST)
 	curmode = newmode;
+# endif
 #endif
 	return true;
 }



CVS commit: [netbsd-7] src/sys/arch/x86/pci

2014-08-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 14 06:52:38 UTC 2014

Modified Files:
src/sys/arch/x86/pci [netbsd-7]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by hikaru in ticket #15):
sys/arch/x86/pci/if_vmx.c: revision 1.5
Set ifflags callback so that the device can enter promiscuous mode.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/arch/x86/pci/if_vmx.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/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.4 src/sys/arch/x86/pci/if_vmx.c:1.4.4.1
--- src/sys/arch/x86/pci/if_vmx.c:1.4	Sat Jul 19 06:12:24 2014
+++ src/sys/arch/x86/pci/if_vmx.c	Thu Aug 14 06:52:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.4 2014/07/19 06:12:24 hikaru Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.4.4.1 2014/08/14 06:52:38 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_vmx.c,v 1.4 2014/07/19 06:12:24 hikaru Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_vmx.c,v 1.4.4.1 2014/08/14 06:52:38 martin Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -158,6 +158,7 @@ void vmxnet3_evintr(struct vmxnet3_softc
 void vmxnet3_txintr(struct vmxnet3_softc *, struct vmxnet3_txqueue *);
 void vmxnet3_rxintr(struct vmxnet3_softc *, struct vmxnet3_rxqueue *);
 void vmxnet3_iff(struct vmxnet3_softc *);
+int vmxnet3_ifflags_cb(struct ethercom *);
 void vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *, struct mbuf *);
 int vmxnet3_getbuf(struct vmxnet3_softc *, struct vmxnet3_rxring *);
 void vmxnet3_stop(struct ifnet *, int disable);
@@ -308,6 +309,7 @@ vmxnet3_attach(device_t parent, device_t
 
 	if_attach(ifp);
 	ether_ifattach(ifp, enaddr);
+	ether_set_ifflags_cb(sc-sc_ethercom, vmxnet3_ifflags_cb);
 	vmxnet3_link_state(sc);
 }
 
@@ -859,6 +861,15 @@ setit:
 	WRITE_CMD(sc, VMXNET3_CMD_SET_RXMODE);
 }
 
+int
+vmxnet3_ifflags_cb(struct ethercom *ec)
+{
+
+	vmxnet3_iff((struct vmxnet3_softc *)ec-ec_if.if_softc);
+
+	return 0;
+}
+
 
 void
 vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *rxcd, struct mbuf *m)