TX1 SPI hardware performance help needed

Hello,

I have an SPI chip that I have working with hardware chip select mode. Its performance is consistent, but there is a lot of wasted time between chip select activation and data transmission, then again a lot of wasted time between data transmission and chip select deactivation.

Example: When I sent a message I see on my scope CS-low, 3us dead time, 1us of CLK/MOSI time, then 8us of dead time, and finally CS-high.

92% overhead is very bad! I have to poll my chip very frequently during usage, and the overhead is limiting me severely. I’m open to any suggestions that can help slim down the dead time.

Can anyone shed light on what the register values in the prod-settings do?

Here is my device tree (edited to show decompiled tree rather than my dtsi code):

spi@7000d400 {
		compatible = "nvidia,tegra210-spi";
		reg = <0x0 0x7000d400 0x0 0x200>;
		interrupts = <0x0 0x3b 0x4>;
		iommus = <0x4d 0xe>;
		#address-cells = <0x1>;
		#size-cells = <0x0>;
		dmas = <0x69 0xf 0x69 0xf>;
		dma-names = "rx", "tx";
		nvidia,clk-parents = "pll_p", "clk_m";
		clocks = <0x41 0x29 0x41 0xf3 0x41 0xe9>;
		clock-names = "spi", "pll_p", "clk_m";
		resets = <0x41 0x29>;
		reset-names = "spi";
		status = "okay";
		nvidia,polling-mode;
		nvidia,disable-runtime-pm;
		num-cs = <0x2>;

		prod-settings {
			#prod-cells = <0x3>;

			prod {
				prod = <0x0 0x73fff83f 0x43c01807 0xc 0x3f 0x20>;
			};

			prod_c_flash {
				status = "disabled";
				prod = <0x4 0x3f 0x7>;
			};

			prod_c_loop {
				status = "disabled";
				prod = <0x4 0xfff 0x44b>;
			};

			prod_c_cs0 {
				prod = <0x4 0xfff 0x8 0x8 0xff00 0x0>;
			};

			prod_c_cs1 {
				prod = <0x4 0xfff 0x8 0x8 0xff00 0x0>;
			};
		};

		max14830@0 {
			#address-cells = <0x1>;
			#size-cells = <0x0>;
			compatible = "maxim,max14830";
			status = "okay";
			reg = <0x0>;
			spi-max-frequency = <0xf42400>;
			clocks = <0x78>;
			clock-names = "xtal";
			interrupt-parent = <0x79>;
			interrupts = <0xba 0x2>;
			gpio-controller;
			#gpio-cells = <0x2>;

			controller-data {
				nvidia,enable-hw-based-cs;
				nvidia,cs-setup-clk-count = <0x0>;
				nvidia,cs-hold-clk-count = <0x0>;
				nvidia,rx-clk-tap-delay = <0x0>;
				nvidia,tx-clk-tap-delay = <0x0>;
				nvidia,cs-inactive-cycles = <0x0>;
				nvidia,clk-delay-between-packets = <0x0>;
			};
		};
	};

Could you try add below to your DT to try.
spi@xxxxx{

  •   nvidia,polling-mode;
    
  •   nvidia,disable-runtime-pm;
      status = "okay";
    
    };

Hi ahuska,

Have you tried the suggestions? Any result can be shared?

Thanks

Hi ahuska

Does boost to performance mode help on this?

sudo ./jetson_clocks.sh