Pcie ethernet i210 flash failed

It worked by changing the Address to 0x1740000000, thank you.
Kind regards

Hi Wayne:

we use I210 as same as you, but we can’t get any device for lspci command.
What change in your device tree about pcie? Thanks a lot.

Hi sevm89,

Could you please explain what did you change in the flashrom source code, to get this result?

Best,

Hi mustafa.gueler

before using flashrom, you need to execute:

sudo echo 1 | tee /sys/bus/pci/devices/0004:01:00.0/enable (Using the address of your I210)

Then I think we had to change in the function nicintel_spi_init (nicintel_spi.c file) the variable io_base_addr directly to the address Region 0 of the Ethernet Controller (can be found with “lspci -vvvv”) after it has been initialized.

I hope you can make it work.

Kind regards

hello, i am running in the same problem on xavier nx and our custom carrier board with i210 and iNVM / Flash supported.

as i try to implement @sevm89 hint, i change the line:

uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);

to

uint32_t io_base_addr = 0x1740000000

The result when compiling is:

root@jan-ac100-dbg:~/src/flashrom# make
Replacing all version templates with v1.2-dirty.
Checking for a C compiler... found.
Target arch is arm
Target OS is Linux
Checking for libpci headers... found.
Checking version of pci_get_dev... new version (including PCI domain parameter).
Checking if libpci is present and sufficient... yes.
Checking for libusb-1.0 headers... found.
Checking if libusb-1.0 is usable... yes.
Checking for FTDI support... not found.
Checking if Linux MTD headers are present... yes.
Checking if Linux SPI headers are present... yes.
Checking for utsname support... found.
Checking for clock_gettime support... found.
cc -MMD -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings -Werror -I/usr/include/libusb-1.0  -D'CONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_INVALID' -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="''"' -D'CONFIG_SERPROG=1' -D'CONFIG_PONY_SPI=1' -D'CONFIG_BITBANG_SPI=1' -D'CONFIG_GFXNVIDIA=1' -D'CONFIG_SATASII=1' -D'CONFIG_ATAVIA=1' -D'CONFIG_IT8212=1'   -D'CONFIG_PICKIT2_SPI=1' -D'CONFIG_STLINKV3_SPI=1'   -D'CONFIG_DUMMY=1' -D'CONFIG_DRKAISER=1' -D'CONFIG_NICINTEL=1' -D'CONFIG_NICINTEL_SPI=1' -D'CONFIG_NICINTEL_EEPROM=1' -D'CONFIG_OGP_SPI=1' -D'CONFIG_BUSPIRATE_SPI=1' -D'CONFIG_DEDIPROG=1' -D'CONFIG_DEVELOPERBOX_SPI=1' -D'CONFIG_LINUX_MTD=1' -D'CONFIG_LINUX_SPI=1' -D'CONFIG_CH341A_SPI=1' -D'CONFIG_DIGILENT_SPI=1' -D'NEED_PCI=1'  -D'NEED_RAW_ACCESS=1' -D'NEED_LIBUSB1=1' -D'HAVE_UTSNAME=1' -D'HAVE_CLOCK_GETTIME=1' -D'FLASHROM_VERSION="v1.2-dirty"' -o nicintel_spi.o -c nicintel_spi.c
nicintel_spi.c: In function 'nicintel_spi_init':
nicintel_spi.c:259:26: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
  uint32_t io_base_addr = 0x1740000000;
                          ^~~~~~~~~~~~
cc1: all warnings being treated as errors
Makefile:1146: recipe for target 'nicintel_spi.o' failed

This seems to be totally correct, because we define a 32bit unsigned integer which should be truncated if a too big value is assigned.
The value assigned is clearly larger than the maximum number which can be represented by uint32.
Because gcc is running with -Werror=overflow, it prints a warning and immediately aborts because of

cc1: all warnings being treated as errors

So, how did you redefined this uint32_t to the desired value?
Or is this an issue in more recent versions of flashcmd, so this would be running fine /w some older versions?

Could you pls share your solution with us (we have a deadline for our project ticking and this is one of the last things we need to fix)?

Much thanks ahead @all users in this discussion, big and only help /w this issue i found yet.

Can you try again but define uint64_t io_base_addr = 0x1740000000.
Does it work?

Hello,
thanks for your quick reply.

I changed it to uint64_t and it works, means it compiles and can flash intel provided images.

But now we need to change the mac address and run into the problem of setting it via eepromaccesstool (unsupported platform). Have you experienced the same issue, how have you solved it?

Hi J4n_J4ns3N

Great to hear that it worked.
The MAC address we program with the ethtool and the option -E, check the following link:

Kind regards

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.