How to change spidev2.1 frequency?

Hi, currently I’m working with Winbond Serial SPI NorFlash on PocketBeagle, C++.

Debian version:

root@beaglebone:~# cat /etc/issue Debian GNU/Linux 9 \n \l BeagleBoard.org Debian Image 2019-08-03

I can read and write to memory connected to spidev2.1 so it works.

But I cant get reading speed from memory upper 2 megabytes/s regardless which frequency I set in my C++ code (from 30 to 100 MHz). But in the same time - reading speed on OrangePI Zero is around 5 megabytes/s with the same SPI NorFlash module.

In OrangePI it was pretty simple to add and init SPI interface with needed frequency value by adding /boot/armbienEnv.txt:

overlays=spi-spidev param_spidev_spi_bus=0 param_spidev_spi_cs=0 param_spidev_max_freq=50000000

It seems the spidev2.1 interface in PocketBeagle has already been initialized and created by some config in Debian with some predefined frequency value (near 30 MHz).
I read on this forum that SPI is used by PRU and it is needed to edit some *.dtb file, compile and flash PRU with it, but I don’t know which file must be changed, where it lays and how to flash PRU with it to change spidev2.1 frequency from default value to ~50-80 MHz.

24Mhz:

https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v4.19.x-ti/src/arm/am335x-pocketbeagle.dts#L1114-L1161

You didn't specify your kernel version, so i can't give you more
specific directions and which branch to use..

https://github.com/beagleboard/BeagleBoard-DeviceTrees

Regards,

100MHz? that’s NOT going to work…

use this repo:

git clone -b v4.14.x-ti https://github.com/beagleboard/BeagleBoard-DeviceTrees
cd ./BeagleBoard-DeviceTrees/
nano ./src/arm/am335x-pocketbeagle.dts
make
sudo make install

https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v4.14.x-ti/src/arm/am335x-pocketbeagle.dts#L21-L61

i’ve pushed it to 50Mhz:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/PB-SPI0-MICROSD-CLICK.dts#L76

But, yeah…

Regards,

image.png

image.jpg

Please keep the BeagleBoard group on CC…

What you’ve done should work.

Sorry don’t have time to actually verify what’s going on today, but maybe other members of the community will step up… (i’ve got a real job)

Regards,

image.png

Will do, thanks!

Mailtrack Sender notified by
Mailtrack 18.12.19, 19:23:31

ср, 18 дек. 2019 г. в 18:58, Robert Nelson <robertcnelson@gmail.com>:

image.png