Can not write to spi nor flash in Linux on IMX6 solo

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Can not write to spi nor flash in Linux on IMX6 solo

跳至解决方案
3,367 次查看
ivyliu
Contributor IV

Hi,

We have a customized board with IMX6 solo which use 64M Micron n25q512a nor flash.

We are using almost same pin assignment in SPI Nor flash part as Sabre AI board.

Spi nor flash Erasing/Reading/Writing command works properly in Uboot.

But In Linux, I can erase and read from this Nor Flash, but I can not write anything to it.

The write enable is on and I have changed pin assignment and other things in Device Tree.

Is there anything I missed to make writing work?

Thanks and Best Regards,

Ivy

0 项奖励
回复
1 解答
2,552 次查看
fabio_estevam
NXP Employee
NXP Employee

Could you try running a 4.2 kernel and in case of issues, please report to the linux-mtd mailing list.

Regards,

Fabio Estevam

在原帖中查看解决方案

0 项奖励
回复
5 回复数
2,552 次查看
fabio_estevam
NXP Employee
NXP Employee

Maybe you could post your dts here?

0 项奖励
回复
2,552 次查看
ivyliu
Contributor IV

Hi Fabio,

Do you know how to attach a file here?

I tried to do it, but it always report the format is forbidden no matter what file extension is.

Below is part of my dts, if you need more information, please let me know.

/ {

aliases {

gpio0 = &gpio1;

gpio1 = &gpio2;

gpio2 = &gpio3;

gpio3 = &gpio4;

gpio4 = &gpio5;

gpio5 = &gpio6;

gpio6 = &gpio7;

i2c0 = &i2c1;

i2c1 = &i2c2;

i2c2 = &i2c3;

ipu0 = &ipu1;

mmc0 = &usdhc1;

mmc1 = &usdhc2;

mmc2 = &usdhc3;

mmc3 = &usdhc4;

serial0 = &uart1;

serial1 = &uart2;

serial2 = &uart3;

serial3 = &uart4;

serial4 = &uart5;

spi0 = &ecspi1;

/* spi1 = &ecspi2;

spi2 = &ecspi3;

spi3 = &ecspi4;*/

usbphy0 = &usbphy1;

usbphy1 = &usbphy2;

};

 

ecspi1: ecspi@02008000 {

#address-cells = <1>;

#size-cells = <0>;

compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";

reg = <0x02008000 0x4000>;

interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;

clocks = <&clks IMX6QDL_CLK_ECSPI1>,

<&clks IMX6QDL_CLK_ECSPI1>;

clock-names = "ipg", "per";

dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;

dma-names = "rx", "tx";

status = "disabled";

};

 

&ecspi1 {

fsl,spi-num-chipselects = <1>;

cs-gpios = <&gpio3 19 0>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_ecspi1>;

status = "okay";

/*

flash: m25p80@0 {

#address-cells = <1>;

#size-cells = <1>;

compatible = "st,m25p32";

spi-max-frequency = <20000000>;

reg = <0>;

};

*/

flash: m25p80@0 {

#address-cells = <1>;

#size-cells = <1>;

compatible = "st,n25q512a";

spi-max-frequency = <20000000>;

reg = <0>;

};

};

Thanks and Best Regards,

Ivy

0 项奖励
回复
2,553 次查看
fabio_estevam
NXP Employee
NXP Employee

Could you try running a 4.2 kernel and in case of issues, please report to the linux-mtd mailing list.

Regards,

Fabio Estevam

0 项奖励
回复
2,552 次查看
ivyliu
Contributor IV

Hi Fabio,

Thank you for the suggestion.

You are right, kernel 3.14.28 does not support for this Nor Flash chip.

Kernel 4.2 supports.

I just ported it from 4.2.

Now it works!

Thanks and Best Regards,

Ivy

0 项奖励
回复
2,551 次查看
fabio_estevam
NXP Employee
NXP Employee

Also, can you try it without enabling DMA for the SPI?

0 项奖励
回复