Device /dev/spidev* not found

3

1

I have a Banana Pi M1 and wanted to flash libreboot on a ThinkPad T400. I followed Raspberry Pi (ThinkPad X200), as RPi's GPIO pins are almost the same as BPi's and T400's chip is the same as X200. The only problem is that when it comes to flash the device, it doesn't appear

$ flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip MX25L6405D -r romread1.rom
flashrom v0.9.9-r1955 on Linux 4.10.9-gnu-1 (armv7l)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
linux_spi_init: failed to open /dev/spidev0.0: No such file or directory
Error: Programmer initialization failed.

Of course, if the devices /dev/spidev* do not exist!!

$ ls /dev/spidev*
ls: cannot access '/dev/spidev*': No such file or directory
$ lsmod|grep spi
spidev                  7364  0
spi_sun4i               4955  0

I've tried everything: loading spidev, spi-gpio, spi_sun4i kernels modules, different pinouts, etc. Maybe I've not got the right pinout? /dev/spidev* devices show up if there's nothing connected to the GPIO pins? how can I test them with sth. easier?

In almost all of the problems, people solve it by editing /boot/config.txt but that's only for RPi afaik. Anyways, the kernel I've installed in it does not have that file.


SoC: Allwinner A20
RAM: 1GB
OS: Parabola GNU/Linux-libre (Arch Linux and ALARM based, without proprietary software packages)
BPi's GPIO pins: https://bananapi.gitbooks.io/bpi-m1/content/en/Banana-Pi-GIPO.png
More specs: https://bananapi.gitbooks.io/bpi-m1/en/


EDIT: There are some devices in /dev which look like sth. near to /dev/spidev* devices:

/dev/gpiochip0
/dev/gpiochip1
/dev/hidraw0
/dev/hidraw1
/dev/iio:device0
/dev/iio:device1

I say "near" because flashrom says:

# flashrom -p linux_spi:dev=/dev/gpiochip0
flashrom v0.9.9-r1955 on Linux 4.13.5-gnu-1 (armv7l)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
linux_spi_init: failed to set SPI mode to 0x00: Invalid argument
Error: Programmer initialization failed.

For all those devices it says Invalid argument with whatever I put in "spispeed" (better than Inappropriate ioctl for device). I suspect that /dev/gpiochip0 might be the chip? However, if it is, IDK how to solve the problem of "Invalid argument"

Megver83

Posted 2017-05-02T00:48:30.320

Reputation: 147

Have you figured it out by any chance? – k.stm – 2018-05-24T20:17:45.937

no way, I gave up a long time ago, sorry :( – Megver83 – 2018-05-28T01:43:06.700

Answers

1

Try the following:

  • Type vi /boot/config.txt
  • Press i to enter ‘insert’ mode.
  • Delete the # in front of dtparam=spi=on to un-comment the line
  • Press Esc then :wq
  • Press Enter to save.

Mazzif

Posted 2017-05-02T00:48:30.320

Reputation: 11

"In almost all of the problems, people solve it by editing /boot/config.txt but that's only for RPi afaik. Anyways, the OS I installed in it does not have that file." - I should have say "the kernel I installed in it does not have that file", but you understand that, so read more carefully next time – Megver83 – 2017-10-13T17:18:02.787