Skip to contentSkip to conversation

imx53 cspi clock problem

DISCUSSION Jonas Andersson 2 participants 5 messages May 22, 2013 – May 23, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

i have found a problem when using the cspi port in a imx53 soc. I am using kernel 3.10-rc2. This is the dts defenition:

cspi: cspi at 63fc0000 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
	reg = <0x63fc0000 0x4000>;
	interrupts = <38>;
	clocks = <&clks 55>, <&clks 0>;
	clock-names = "ipg", "per";
	status = "disabled";
};

then in the driver spi-imx.c:

spi_imx->spi_clk = clk_get_rate(spi_imx->clk_per);

clk_get_rate() will return the rate 0. In function mx31_config, this line:

reg |= spi_imx_clkdiv_2(spi_imx->spi_clk, config->speed_hz) <<

	MX31_CSPICTRL_DR_SHIFT;

will always configure the port for full speed (16.7 MHz in my system).

This "per" clock rate should be around 67MHz.

Jonas

#1 lore raw
Quoted 5 lines · Jonas Andersson

Hi,

i have found a problem when using the cspi port in a imx53 soc. I am using kernel 3.10-rc2. This is the dts defenition:

Quoted 7 lines
cspi: cspi at 63fc0000 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
	reg = <0x63fc0000 0x4000>;
	interrupts = <38>;
	clocks = <&clks 55>, <&clks 0>;

Unlike the eCSPI controller the CSPI controller seems to have only one clock. This should probably be

	clocks = <&clks 55>, <&clks 55>;

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw
Quoted 10 lines · Sascha Hauer
Quoted 4 lines · Jonas Andersson
	compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
	reg = <0x63fc0000 0x4000>;
	interrupts = <38>;
	clocks = <&clks 55>, <&clks 0>;

Unlike the eCSPI controller the CSPI controller seems to have only one clock. This should probably be

	clocks = <&clks 55>, <&clks 55>;

This works fine.

Is it the right solution to define both clocks to the same in all the imx*.dtsi files? imx25.dtsi defines only one clock "ipg" so spi_imx_probe() will probably fail.

Jonas

#3 lore raw
Quoted 9 lines · Jonas Andersson
Quoted 8 lines · Sascha Hauer
Quoted 4 lines · Jonas Andersson
	compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
	reg = <0x63fc0000 0x4000>;
	interrupts = <38>;
	clocks = <&clks 55>, <&clks 0>;

Unlike the eCSPI controller the CSPI controller seems to have only one clock. This should probably be

Quoted 7 lines
Quoted 2 lines
	clocks = <&clks 55>, <&clks 55>;

This works fine.

Is it the right solution to define both clocks to the same in all the imx*.dtsi files? imx25.dtsi defines only one clock "ipg" so spi_imx_probe() will probably fail.

Yes, they should all be fixed that way. Care to send a patch?

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw
Quoted 2 lines · Sascha Hauer

Yes, they should all be fixed that way. Care to send a patch?

Yes i can send a patch.

Jonas