How to change SPI clock frequency on Colibri IMX6DL?

I’ve been tryng to change SPI clock on my Colibri board changing the device tree file (.dts) whitout sucess, that’s the correct way to do that, or exist other?

I have this device tree (.dts) file:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2020-2021 Toradex
 */

// LT161010 display (7inch) with a resolution of 800x480 pixel and capacitive touch This display can be ordered at Toradex.

/dts-v1/;
/plugin/;


/ {
	compatible = "toradex,apalis_imx6q",
		     "toradex,apalis-imx8x",
		     "toradex,colibri_imx6dl",
		     "toradex,colibri-imx6ull-emmc",
		     "toradex,colibri-imx7d",
		     "toradex,colibri-imx7s",
		     "toradex,colibri-imx7d-emmc",
		     "toradex,colibri-imx8x";
};


&{/panel-dpi} {
	status = "okay";

	width-mm = <154>;
	height-mm = <86>;

	panel-timing {
		clock-frequency = <33230769>;
		hactive = <800>;
		vactive = <480>;
		hsync-len = <128>;
		hfront-porch = <40>;
		hback-porch = <88>;
		vsync-len = <1>;
		vfront-porch = <10>;
		vback-porch = <33>;
		pixelclk-active = <1>;
	};
};

&atmel_mxt_ts {
	status = "okay";
};

&i2c3 {
	status = "okay";
};

&weim {
	status = "disabled";
};

/* Colibri SSP */
&ecspi4 {
	status = "okay";

	mcp251x0: mcp251x@0 {
		compatible = "microchip,mcp2515";
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio3>;
		interrupts = <27 0x2>;
		spi-max-frequency = <10000000>;
		status = "disabled";
	};

	spidev0: spidev@1 {
		compatible = "toradex,evalspi";
		reg = <1>;
		spi-max-frequency = <1000000>;
		status = "okay";
	};
};

( PS: the firsts part of .dts file are for the Capacitive Touch Display 7" Parallel and it’s working fine)

After change that, I use the command:

$ torizoncore-builder dto deploy --remote-host 192.168.1.148 --remote-password torizon --force --reboot device-trees/overlays/colibri-imx6dl-custom.dts

And the board reboots with the new device tree, is that procediment correct?

I know that the clock frequency doesn’t change because i’ve already mensure it on oscilloscope.

PS: There is two clocks because i’ve monitoring the SPI clock on arduino header and raspberry header too.

Hi @LincolnWallace ,

The spi-max-frequency parameter configures just the maximum frequency, because of this you won’t be able to measure the value configured if the device doesn’t request it.

Why exactly do you want to change the SPI clock to a specific value? Normally the driver should check the request from the device and then the clock is configured, please check this question as reference.

If you really wanna change the clock to a specific value, it is also possible to do some configuration on the userspace side, please check this example as a reference.

Best regards,
Daniel Morais