Hello,
I am trying to run the Jetson Nano SPI Hardware closer to the stated maximum. I have been able to reach 25MHz (ground truth verified by an oscilloscope) but have not been able to exceed that. Based on this (SPI maximum frequency - #6 by AliHaeri) post I have tried recompiling the kernel specifying the max_speed_hz to be 65000000 (65 MHz), however after compilation and flashing the CS still does not exceed 25MHz.
Based on this post (How to set spi max frequency more than 24MHz?) I have tried adding debug output and have gotten this from running:
./spidev_test -D /dev/spidev1.0 -s 50000000
[ 2241.376295] spidev spi1.0: setup 8 bpw, ~cpol, ~cpha, 33000000Hz
[ 2241.376404] spidev spi1.0: setup 8 bpw, ~cpol, ~cpha, 33000000Hz
[ 2241.376456] spidev spi1.0: setup 8 bpw, ~cpol, ~cpha, 50000000Hz
[ 2241.377461] spi-tegra114 7000d600.spi: Setting clk_src pll_p
[ 2241.377706] spi-tegra114 7000d600.spi: prod settings failed with error -19
[ 2241.377725] spi-tegra114 7000d600.spi: The def 0x47d08000 and written 0x43c01827
The dtb output of the current flash I have is:
spi@70410000 {
compatible = “nvidia,tegra210-qspi”;
clocks = <0x26 0xd3 0x26 0x119>;
resets = <0x26 0xd3>;
clock-names = “qspi”, “qspi_out”;
status = “okay”;
#address-cells = <0x1>;
interrupts = <0x0 0xa 0x4>;
#size-cells = <0x0>;
dma-names = “rx”, “tx”;
phandle = <0xfc>;
reg = <0x0 0x70410000 0x0 0x1000>;
iommus = <0x30 0xe>;
dmas = <0x51 0x5 0x51 0x5>;
reset-names = “qspi”;
linux,phandle = <0xfc>;
spi-max-frequency = <0x632ea00>;
spiflash@0 {
compatible = "MX25U3235F";
#address-cells = <0x1>;
#size-cells = <0x1>;
reg = <0x0>;
spi-max-frequency = <0x632ea00>;
controller-data {
nvidia,ctrl-bus-clk-ratio = [01];
nvidia,x1-bus-speed = <0x632ea00>;
nvidia,x1-dymmy-cycle = <0x8>;
nvidia,x1-len-limit = <0x10>;
nvidia,x4-bus-speed = <0x632ea00>;
nvidia,x4-dymmy-cycle = <0x8>;
};
};
};
The hex value there for spi-max-frequency is (in decimal)104,000,000, so we should be able to toggle up to 104MHz based on that (but I assume with the hardware limitation of 65MHz bringing that down to 65)
Is there something I’m doing wrong here?