Hi!
I have a Macronix mx25r1635f connected to my imx8mmini over the ecspi2 headers.
But when the board boots and 0x9f (RDID) is sent over the line, right after the command the clock stops and cs goes away, so I can't read the JEDEC info:
m25p80 spi1.0: unrecognized JEDEC id bytes: 00, 00, 00
Just like in this link: https://forum.rocketboards.org/t/chip-select-goes-away-soon-after-the-transfer-to-a-spi-slave-is-com...
I have successfully read the id with a simple c-program and spidev-configuration in the device tree. So there is no problem with the hardware/signaling.
I have added the new macronix chip the the spi-nor.c configuration list.
Any help would be greatly appreciated!
Some snippets from my device tree:
---
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x116
MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x116
MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x1916
MX8MM_IOMUXC_ECSPI2_SS0_ECSPI2_SS0 0x116
>;
---
&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
flash1: mx25r1635f@0 {
reg = <0>;
compatible = "macronix,mx25r1635f", "jedec,spi-nor";
spi-max-frequency = <2000000>;
spi-cs-low;
};
};
---
Solved! Go to Solution.
Yes,
when I changed the pinmuxing and specified the cs-gpios it did work!
Where can I find digestible information on how to do the pinctrl?
My new device-tree:
---
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0x40000
MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x82
MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x82
MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x82
>;
---
&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
flash1: mx25r1635f@0 {
reg = <0>;
compatible = "macronix,mx25r1635f", "jedec,spi-nor";
spi-max-frequency = <2000000>;
spi-cs-low;
};
};
---
Hi Andreas
one can check if clock is enabled for ecspi2 using
Table 6-7. CCGR setting by ROM i.MX8M Mini Reference Manual
and try to debug in spi-nor driver using sect.3.8 SPI NOR Flash Memory Technology Device (MTD)
Linux Manual and Linux L4.14.98_2.0.0 Documentation
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Well I must have clock as I'm able to talk with the device when using spidev, right?
And I'm not trying to boot from the device.
one can look on ecspi2 example
Yes,
when I changed the pinmuxing and specified the cs-gpios it did work!
Where can I find digestible information on how to do the pinctrl?
My new device-tree:
---
pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0x40000
MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x82
MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x82
MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x82
>;
---
&ecspi2 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";
flash1: mx25r1635f@0 {
reg = <0>;
compatible = "macronix,mx25r1635f", "jedec,spi-nor";
spi-max-frequency = <2000000>;
spi-cs-low;
};
};
---