Hi friends,
My board have mx66u51235f flash.
If I check at u-boot I detect like this:
=> sf probe
SF: select 4B addr cmd set
SF: Detected mx66u51235f with page size 256 Bytes, erase size 64 KiB, total 64 MiB
SF: read_cmd c
SF: erase_cmd dc
SF: write_cmd 12
So then I added spi-nor.c and another module to run flash from kernel.
My device-tree like that :
pinctrl_flexspi0: flexspi0grp {
fsl,pins = <SC_P_QSPI0A_DATA0_LSIO_QSPI0A_DATA0 0x00000040
SC_P_QSPI0A_DATA1_LSIO_QSPI0A_DATA1 0x00000040
SC_P_QSPI0A_DATA2_LSIO_QSPI0A_DATA2 0x00000040
SC_P_QSPI0A_DATA3_LSIO_QSPI0A_DATA3 0x00000040
SC_P_QSPI0A_DQS_LSIO_QSPI0A_DQS 0x00000040
SC_P_QSPI0A_SCLK_LSIO_QSPI0A_SCLK 0x00000040
SC_P_QSPI0A_SS0_B_LSIO_QSPI0A_SS0_B 0x00000020
SC_P_QSPI0A_SS1_B_LSIO_QSPI0A_SS1_B 0x00000020>;
};&flexspi0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexspi0>;
status = "okay";
fpgacom: fpgacom0@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;
compatible = "macronix,mx66u51235f";
spi-max-frequency = <108000000>;
spi-nor,ddr-quad-read-dummy = <8>;
};
};
But after init system I get error :
root@imx8qxpmek:~# dmesg | grep flex
[ 2.263447] fsl-flexspi 5d120000.flexspi: can't select read settings supported by both the SPI controller and memory.
[ 2.274153] fsl-flexspi 5d120000.flexspi: Freescale FlexSPI probe failed
[ 2.280979] fsl-flexspi: probe of 5d120000.flexspi failed with error -22
What is the problem? Can you help me? I want to access flash from linux side via mtd access.
Thanks.
Best regards.
Hi berat
for "read settings" error one can try to recheck timings of this qspi
using its datasheet and driver timings defined in LUT, adjust them appropriately
fsl-flexspi.c\spi-nor\mtd\drivers - linux-imx - i.MX Linux kernel
LUT is described in sect.18.2.4.7 Look Up Table
i.MX 8DualXPlus/8QuadXPlus Applications Processor Reference Manual
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks for your reply igorpadykov
Refer to https://community.nxp.com/thread/513231 , I did fixes.
&flexspi0 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexspi0>;
status = "okay";flash0: mx66u51235f@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <1>;
compatible = "macronix,mx66u51235f";
spi-max-frequency = <84000000>;
status = "okay";
spi-nor,ddr-quad-read-dummy = <6>;
};
};
And now flexspi start correctly.
root@imx8qxpmek:~# dmesg | grep flex
[ 2.232151] fsl-flexspi 5d120000.flexspi: mx66u51235f (65536 Kbytes)
Also read sequence with mtd_debug tool, but I dont know it is true or not.
root@imx8qxpmek:~# mtd_debug read /dev/mtd0 0 5 read_test.txt
Copied 5 bytes from address 0x00000000 in flash to read_test.txt
root@imx8qxpmek:~# cat read_test.txt
����aroot@imx8qxpmek:~#
Because I think there is a problem. I want to help from you here.
root@imx8qxpmek:~# mtd_debug write /dev/mtd0 0 5 write_test.txt
[ 1069.324509] fsl-flexspi 5d120000.flexspi: Unsupported cmd 0x12
Copied 5 bytes from write_test.txt to address 0x00000000 in flash
That I must do for write?
Hi berat
I do not think this is due to some flexspi bugs, suggest to debug driver, as
macronix parts may require different initialization. Just as example please refer to
sect.18.2.5.3 Application on Serial NOR Flash device This section provides the example
sequences for serial NOR flash device (Cypress Flash S25FS128S).
i.MX 8DualXPlus/8QuadXPlus Applications Processor Reference Manual
Use it as example and make appropriate settings for macronix part according to
its datasheet https://www.macronix.com/Lists/Datasheet/Attachments/7674/MX66U51235F,%201.8V,%20512Mb,%20v1.1.pdf
Best regards
igor