i.MX8QXP FlexSPI bus B data IO issue

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

i.MX8QXP FlexSPI bus B data IO issue

1,039 次查看
nmi
Contributor I

Hello,

I have issue with FlexSPI bus B similar to https://community.nxp.com/t5/i-MX-Processors/i-MX8QXP-driver-spi-nxp-fspi-c-flexpsi-bus-B-not-workin...
i.MX8QXP SoC (driver spi-nxp-fspi.c, kernel 5.4.70). Chip select B0 and clock are ok but no data on IO0..IO3

FlexSPI FLASH selection in device tree is provided by <reg> parameter (according to spi-nxp-fspi.txt):
- reg : There are two buses (A and B) with two chip selects each.
This encodes to which bus and CS the flash is connected:
- <0>: Bus A, CS 0
- <1>: Bus A, CS 1
- <2>: Bus B, CS 0
- <3>: Bus B, CS 1

Device tree for fspi is following:

&flexspi0 {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_flexspi0>;
  status = "okay";

  flash0: w25q64dw@0 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "winbond,w25q64dw", "jedec,spi-nor";
    spi-max-frequency = <133000000>;
    reg = <0>;
    spi-nor,quad-read;

    partition@0 {
      label = "boot";
      reg = <0x0000000 0x400000>;
    };

    partition@400000 {
      label = "failsafe";
      reg = <0x400000 0x3e0000>;
    };

    partition@7e0000 {
      label = "reserved";
      reg = <0x7e0000 0x20000>;
      read-only;
    };
  };


  flash2: w25q64dw@2 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "winbond,w25q64dw", "jedec,spi-nor";
    spi-max-frequency = <133000000>;
    reg = <2>;
    spi-nor,quad-read;

    partition@0 {
      label = "boot";
      reg = <0x0000000 0x400000>;
    };

    partition@400000 {
      label = "failsafe";
      reg = <0x400000 0x3e0000>;
    };

    partition@7e0000 {
      label = "reserved";
      reg = <0x7e0000 0x20000>;
      read-only;
    };
  };
};

flexspi0: spi@5d120000 {
  #address-cells = <1>;
  #size-cells = <0>;
  compatible = "nxp,imx8qxp-fspi";
  reg = <0x5d120000 0x10000>, <0x08000000 0x10000000>;
  reg-names = "fspi_base", "fspi_mmap";
  interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
  clocks = <&clk IMX_SC_R_FSPI_0 IMX_SC_PM_CLK_PER>,
  <&clk IMX_SC_R_FSPI_0 IMX_SC_PM_CLK_PER>;
  clock-names = "fspi", "fspi_en";
  power-domains = <&pd IMX_SC_R_FSPI_0>;
  status = "disabled";
};

pinmux:
pinctrl_flexspi0: flexspi0grp {
  fsl,pins = <
    IMX8QXP_QSPI0A_DATA0_LSIO_QSPI0A_DATA0 0x06000021
    IMX8QXP_QSPI0A_DATA1_LSIO_QSPI0A_DATA1 0x06000021
    IMX8QXP_QSPI0A_DATA2_LSIO_QSPI0A_DATA2 0x06000021
    IMX8QXP_QSPI0A_DATA3_LSIO_QSPI0A_DATA3 0x06000021
    //--- IMX8QXP_QSPI0A_DQS_LSIO_QSPI0A_DQS 0x06000021
    IMX8QXP_QSPI0A_SS0_B_LSIO_QSPI0A_SS0_B 0x06000021
    //--- IMX8QXP_QSPI0A_SS1_B_LSIO_QSPI0A_SS1_B 0x06000021
    IMX8QXP_QSPI0A_SCLK_LSIO_QSPI0A_SCLK 0x06000021
    IMX8QXP_QSPI0B_SCLK_LSIO_QSPI0B_SCLK 0x06000021
    IMX8QXP_QSPI0B_DATA0_LSIO_QSPI0B_DATA0 0x06000021
    IMX8QXP_QSPI0B_DATA1_LSIO_QSPI0B_DATA1 0x06000021
    IMX8QXP_QSPI0B_DATA2_LSIO_QSPI0B_DATA2 0x06000021
    IMX8QXP_QSPI0B_DATA3_LSIO_QSPI0B_DATA3 0x06000021
    IMX8QXP_QSPI0B_SS0_B_LSIO_QSPI0B_SS0_B 0x06000021
    IMX8QXP_QSPI0B_SS1_B_LSIO_QSPI0B_SS1_B 0x06000021
  >;
};


During Linux startup flash0 is detected properly
[ 1.457701] spi-nor spi4.0: w25q64dw (8192 Kbytes)
[ 1.462528] 3 fixed-partitions partitions found on MTD device 5d120000.spi-0
[ 1.469592] Creating 3 MTD partitions on "5d120000.spi-0":

but flash2 is unrecognized
[ 1.507803] spi-nor spi4.2: unrecognized JEDEC id bytes: ff ff ff ff ff ff
DIO0..DIO3 are high-level with no activity during JEDEC ID request.

If I disconnect flash and pull-down the IO0..IO3 with 10kOhm resistors I see that IO0..IO3 are low-level and works as input during JEDEC ID request properly:
[ 1.507803] spi-nor spi4.2: unrecognized JEDEC id bytes: 00 00 00 00 00 00
but also no activity on IO0..IO3 during ID request.

I tried flash2: w25q64dw@0 and flash2: w25q64dw@1 in device tree as recommended in the link above but have no positive result.


Also I tried to create separate device for channel B in device tree. I used FlexSPI1 0x5d130000 base address for device, as described in i.MX8 reference manual:

flexspi1: spi@5d130000 {
  #address-cells = <1>;
  #size-cells = <0>;
  compatible = "nxp,imx8qxp-fspi";
  reg = <0x5d130000 0x10000>, <0x08000000 0x10000000>;
  reg-names = "fspi_base", "fspi_mmap";
  interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
  clocks = <&clk IMX_SC_R_FSPI_1 IMX_SC_PM_CLK_PER>,
  <&clk IMX_SC_R_FSPI_1 IMX_SC_PM_CLK_PER>;
  clock-names = "fspi", "fspi_en";
  power-domains = <&pd IMX_SC_R_FSPI_1>;
  status = "disabled";
};

&flexspi1 {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_flexspi1>;
  status = "okay";

  flash1: w25q64dw@0 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "winbond,w25q64dw", "jedec,spi-nor";
    spi-max-frequency = <133000000>;
    reg = <0>;
    spi-nor,quad-read;

    partition@0 {
      label = "boot";
      reg = <0x0000000 0x400000>;
    };

    partition@400000 {
      label = "failsafe";
      reg = <0x400000 0x3e0000>;
    };

    partition@7e0000 {
      label = "reserved";
      reg = <0x7e0000 0x20000>;
      read-only;
    };
  };
};

pinctrl_flexspi0: flexspi0grp {
  fsl,pins = <
    IMX8QXP_QSPI0A_DATA0_LSIO_QSPI0A_DATA0 0x06000021
    IMX8QXP_QSPI0A_DATA1_LSIO_QSPI0A_DATA1 0x06000021
    IMX8QXP_QSPI0A_DATA2_LSIO_QSPI0A_DATA2 0x06000021
    IMX8QXP_QSPI0A_DATA3_LSIO_QSPI0A_DATA3 0x06000021
    //--- IMX8QXP_QSPI0A_DQS_LSIO_QSPI0A_DQS 0x06000021
    IMX8QXP_QSPI0A_SS0_B_LSIO_QSPI0A_SS0_B 0x06000021
    //--- IMX8QXP_QSPI0A_SS1_B_LSIO_QSPI0A_SS1_B 0x06000021
    IMX8QXP_QSPI0A_SCLK_LSIO_QSPI0A_SCLK 0x06000021
  >;
};

pinctrl_flexspi1: flexspi1grp {
  fsl,pins = <
    IMX8QXP_QSPI0B_SCLK_LSIO_QSPI0B_SCLK 0x06000021
    IMX8QXP_QSPI0B_DATA0_LSIO_QSPI0B_DATA0 0x06000021
    IMX8QXP_QSPI0B_DATA1_LSIO_QSPI0B_DATA1 0x06000021
    IMX8QXP_QSPI0B_DATA2_LSIO_QSPI0B_DATA2 0x06000021
    IMX8QXP_QSPI0B_DATA3_LSIO_QSPI0B_DATA3 0x06000021
    IMX8QXP_QSPI0B_SS0_B_LSIO_QSPI0B_SS0_B 0x06000021
    IMX8QXP_QSPI0B_SS1_B_LSIO_QSPI0B_SS1_B 0x06000021
  >;
};

But also negative result. Chip select, clock and data are no active. Corresponding boot log is following:

[ 1.455262] spi-nor spi4.0: w25q64dw (8192 Kbytes)
[ 1.460097] 3 fixed-partitions partitions found on MTD device 5d120000.spi
[ 1.466987] Creating 3 MTD partitions on "5d120000.spi":
[ 1.472313] 0x000000000000-0x000000400000 : "boot"
[ 1.481746] 0x000000400000-0x0000007e0000 : "failsafe"
[ 1.489684] 0x0000007e0000-0x000000800000 : "reserved"
[ 1.508282] spi-nor spi5.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00

Thanks,

标记 (3)
0 项奖励
回复
0 回复数