Patchwork Support for Intel I350 card.

login
register
about
Submitter Stefan Tauner
Date 2016-02-21 16:51:31
Message ID <201602211651.u1LGpWQh017019@mail2.student.tuwien.ac.at>
Download mbox | patch
Permalink /patch/4394/
State New
Headers show

Comments

Stefan Tauner - 2016-02-21 16:51:31
On Mon, 18 Jan 2016 12:18:45 +0000
Grzegorz Hetman <ghet@softserveinc.com> wrote:

> 
> Hello ;)
> 
> 
> I have a card called:
> 05:00.0 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
> 05:00.1 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
> 05:00.2 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
> 05:00.3 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
> 
> I update nicintel_spi.c to match product ID but when I try to probe it, flashroom freeze after a while:
> 
> ./flashrom -VVV -p nicintel_spi:pci='05:00.0' -o probe.log
> flashrom v0.9.8-r1916 on Linux 4.2.2-coreos-r1 (x86_64)
> flashrom is free software, get the source code at https://flashrom.org
> 
> flashrom was built with libpci 3.2.1, GCC 4.8.4, little endian
> Command line (5 args): ./flashrom -VVV -p nicintel_spi:pci=05:00.0 -o probe.log
> Calibrating delay loop... OS timer resolution is 1 usecs, 1224M loops per second, 10 myus = 10 us, 100 myus = 102 us, 1000 myus = 1028 us, 10000 myus = 9996 us, 4 myus = 16 us, OK.
> Initializing nicintel_spi programmer
> Found "Intel I350 Gigabit Network Connection (rev 01)" (8086:1521, BDF 05:00.0).
> ===
> This PCI device is UNTESTED. Please report the 'flashrom -p xxxx' output
> to flashrom@flashrom.org if it works for you. Please add the name of your
> PCI device to the subject. Thank you for your help!
> ===
> PCI header type 0x00
> Requested BAR is of type MEM, 32bit, not prefetchable
> PCI header type 0x00
> Requested BAR is of type MEM, 32bit, not prefetchable
> page_size=1000
> pre-rounding:  start=0x00000000dfb70000, len=0x1000, end=0x00000000dfb71000
> post-rounding: start=0x00000000dfb70000, len=0x1000, end=0x00000000dfb71000
> 
> 
> Datasheet for this chipset can be found here:
> http://www.intel.com/content/dam/www/public/us/en/documents/datasheets/ethernet-controller-i350-datasheet.pdf
> 
> Also I found:
> https://downloadcenter.intel.com/download/19186/Intel-Ethernet-Connections-Boot-Utility-Preboot-images-and-EFI-Drivers
> 
> When run it: ./bootutil64e
> 
> Intel(R) Ethernet Flash Firmware Utility
> BootUtil version 1.5.72.1
> Copyright (C) 2003-2015 Intel Corporation
> 
> Type BootUtil -? for help
> 
> Port Network Address Location Series  WOL Flash Firmware                Version
> ==== =============== ======== ======= === ============================= =======
>   1   002590E72B10     5:00.0 Gigabit YES FLASH Not Present
>   2   002590E72B11     5:00.1 Gigabit NO  FLASH Not Present
>   3   002590E72B12     5:00.2 Gigabit NO  FLASH Not Present
>   4   002590E72B13     5:00.3 Gigabit NO  FLASH Not Present
> 
> 
> Any chance to have support for this card by flashroom ?

Hi,

the addresses of the control register has changed between the 1 Gb and
10 Gb generations and the flashrom code sets the border at device ID
0x10d8. Anything lower than that will be handled with the old scheme
due to the if at line 201 of nicintel_spi.c. However, your card should
not be treated the new way but due to its ID is.
I have created a patch that might work better... see attachment.

Patch

From ffe39a5884f82b5ebd395352788fe69db8d9292a Mon Sep 17 00:00:00 2001
From: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Date: Sun, 21 Feb 2016 17:48:34 +0100
Subject: [PATCH] nicintel_spi: add support for Intel I350 cards.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
---
 nicintel_spi.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/nicintel_spi.c b/nicintel_spi.c
index 9195c79..bd6fa16 100644
--- a/nicintel_spi.c
+++ b/nicintel_spi.c
@@ -91,6 +91,13 @@  const struct dev_entry nics_intel_spi[] = {
 	{PCI_VENDOR_ID_INTEL, 0x10fc, OK, "Intel", "82599 10 Gigabit XAUI/BX4 Dual Port Network Controller"},
 	{PCI_VENDOR_ID_INTEL, 0x1517, NT, "Intel", "82599 10 Gigabit KR Network Controller"},
 	{PCI_VENDOR_ID_INTEL, 0x151c, NT, "Intel", "82599 10 Gigabit TN Network Controller"},
+
+	{PCI_VENDOR_ID_INTEL, 0x1520, NT, "Intel", "I350 Ethernet Controller Virtual Function"},
+	{PCI_VENDOR_ID_INTEL, 0x1521, NT, "Intel", "I350 Gigabit Network Connection"},
+	{PCI_VENDOR_ID_INTEL, 0x1522, NT, "Intel", "I350 Gigabit Fiber Network Connection"},
+	{PCI_VENDOR_ID_INTEL, 0x1523, NT, "Intel", "I350 Gigabit Backplane Connection"},
+	{PCI_VENDOR_ID_INTEL, 0x1524, NT, "Intel", "I350 Gigabit Connection"},
+
 	{PCI_VENDOR_ID_INTEL, 0x1529, NT, "Intel", "82599 10 Gigabit Dual Port Network Controller with FCoE"},
 	{PCI_VENDOR_ID_INTEL, 0x152a, NT, "Intel", "82599 10 Gigabit Dual Port Backplane Controller with FCoE"},
 	{PCI_VENDOR_ID_INTEL, 0x1557, NT, "Intel", "82599 10 Gigabit SFI Network Controller"},
@@ -198,7 +205,10 @@  int nicintel_spi_init(void)
 	if (!io_base_addr)
 		return 1;
 
-	if (dev->device_id < 0x10d8) {
+	/* 10 Gb devices have the registers at offset 0x10000 (see the "Register(s) Summary" table in the
+	 * "Programming Interface" chapter of the respective datasheet). Unfortunately there is no easy way to
+	 * distinguish them apart from the device ID and we can not easily tag the devices in nics_intel_spi. */
+	if (dev->device_id < 0x10d8 || (dev->device_id >= 0x1520 && dev->device_id <= 0x1524)) {
 		nicintel_spibar = rphysmap("Intel Gigabit NIC w/ SPI flash", io_base_addr,
 					   MEMMAP_SIZE);
 	} else {
-- 
Kind regards, Stefan Tauner