Module Name: src
Committed By: yamaguchi
Date: Thu Jul 16 01:20:38 UTC 2020
Modified Files:
src/sys/dev/pci: if_ixl.c
Log Message:
Set PCI_COMMAND_MASTER_ENABLE and PCI_COMMAND_MEM_ENABLE
to activate the pci devices
This configuration is needed when BIOS or UEFI do not make them set.
To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_ixl.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/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.67 src/sys/dev/pci/if_ixl.c:1.68
--- src/sys/dev/pci/if_ixl.c:1.67 Thu Jun 11 02:39:30 2020
+++ src/sys/dev/pci/if_ixl.c Thu Jul 16 01:20:38 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ixl.c,v 1.67 2020/06/11 02:39:30 thorpej Exp $ */
+/* $NetBSD: if_ixl.c,v 1.68 2020/07/16 01:20:38 yamaguchi Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.67 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.68 2020/07/16 01:20:38 yamaguchi Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -764,7 +764,8 @@ static unsigned int ixl_param_tx_ndescs
static unsigned int ixl_param_rx_ndescs = 1024;
static enum i40e_mac_type
- ixl_mactype(pci_product_id_t);
+ ixl_mactype(pci_product_id_t);
+static void ixl_pci_csr_setup(pci_chipset_tag_t, pcitag_t);
static void ixl_clear_hw(struct ixl_softc *);
static int ixl_pf_reset(struct ixl_softc *);
@@ -1107,6 +1108,8 @@ ixl_attach(device_t parent, device_t sel
sc->sc_mac_type = ixl_mactype(PCI_PRODUCT(pa->pa_id));
+ ixl_pci_csr_setup(pa->pa_pc, pa->pa_tag);
+
memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, IXL_PCIREG);
if (pci_mapreg_map(pa, IXL_PCIREG, memtype, 0,
&sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems)) {
@@ -1943,6 +1946,17 @@ ixl_mactype(pci_product_id_t id)
return I40E_MAC_GENERIC;
}
+static void
+ixl_pci_csr_setup(pci_chipset_tag_t pc, pcitag_t tag)
+{
+ pcireg_t csr;
+
+ csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
+ csr |= (PCI_COMMAND_MASTER_ENABLE |
+ PCI_COMMAND_MEM_ENABLE);
+ pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
+}
+
static inline void *
ixl_hmc_kva(struct ixl_softc *sc, enum ixl_hmc_types type, unsigned int i)
{