[i.MX7D][Yocto 2.1] Read failed for second QSPI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[i.MX7D][Yocto 2.1] Read failed for second QSPI

1,873件の閲覧回数
alex_cheng1
Contributor I

1. I can read success for first QSPI. But I read failed for the second QSPI.
2. The attachment file(qspi_schematic.zip) is the circuit diagram of two QSPI.
3. Two QSPI setting in dts file:
&epdc {
status = "disabled";
};

&iomuxc {
qspi1 {
pinctrl_qspi1_1: qspi1grp_1 {
fsl,pins = <
MX7D_PAD_EPDC_DATA00__QSPI_A_DATA0 0x51
MX7D_PAD_EPDC_DATA01__QSPI_A_DATA1 0x51
MX7D_PAD_EPDC_DATA02__QSPI_A_DATA2 0x51
MX7D_PAD_EPDC_DATA03__QSPI_A_DATA3 0x51
MX7D_PAD_EPDC_DATA05__QSPI_A_SCLK 0x51
MX7D_PAD_EPDC_DATA06__QSPI_A_SS0_B 0x51
MX7D_PAD_EPDC_DATA08__QSPI_B_DATA0 0x51
MX7D_PAD_EPDC_DATA09__QSPI_B_DATA1 0x51
MX7D_PAD_EPDC_DATA10__QSPI_B_DATA2 0x51
MX7D_PAD_EPDC_DATA11__QSPI_B_DATA3 0x51
MX7D_PAD_EPDC_DATA13__QSPI_B_SCLK 0x51
MX7D_PAD_EPDC_DATA14__QSPI_B_SS0_B 0x51
>;
};
};
};

&qspi1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_qspi1_1>;
status = "okay";
ddrsmp=<0>;

flash0: mx66l1g45g@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "macronix,mx66l1g45g";
spi-max-frequency = <29000000>;
reg = <0>;
};

flash1: mx66l1g45g@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "macronix,mx66l1g45g";
spi-max-frequency = <29000000>;
reg = <1>;
};
};

4. Log information:
# dmesg |grep spi
[ 1.001371] fsl-quadspi 30bb0000.qspi: mx66l1g45g (131072 Kbytes)
[ 1.007737] fsl-quadspi 30bb0000.qspi: mx66l1g45g (131072 Kbytes)
#
# hexdump -C /dev/mtd0 -n 1024
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 01 00 00 00 40 00 00 00 02 00 00 03 00 00 00 02 |....@...........|
00000020 03 00 00 00 03 00 00 00 00 00 00 08 00 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 |................|
00000040 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 0b 04 18 08 08 0c 04 1c |................|
00000070 00 24 00 00 00 00 00 00 05 04 01 1c 00 24 00 00 |.$...........$..|
00000080 00 00 00 00 00 00 00 00 06 04 00 24 00 00 00 00 |...........$....|
00000090 00 00 00 00 00 00 00 00 01 04 01 20 00 24 00 00 |........... .$..|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000160 00 00 00 00 00 00 00 00 01 00 00 01 00 00 00 00 |................|
00000170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 01 ee ff c0 |................|
00000200 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000400
#
# dmesg |grep spi
[ 1.001371] fsl-quadspi 30bb0000.qspi: mx66l1g45g (131072 Kbytes)
[ 1.007737] fsl-quadspi 30bb0000.qspi: mx66l1g45g (131072 Kbytes)
#
# hexdump -C /dev/mtd1 -n 1024
Unhandled fault: external abort on non-linefetch (0x008) at 0xf1000000
pgd = d8798000
[f1000000] *pgd=d87dd811, *pte=70000653, *ppte=70000453
Internal error: : 8 [#1] PREEMPT SMP ARM
Modules linked in: ath3k mxc_v4l2_capture ipu_bg_overlay_sdc ipu_still v4l2_int_device ipu_prp_enc ipu_csi_enc ipu_fg_overlay_sdc usb_f_acm u_serial g_serial libcompos
CPU: 0 PID: 999 Comm: hexdump Not tainted 4.1.15-2.1.0 #1
Hardware name: Freescale i.MX7 Dual (Device Tree)
task: d8549400 ti: d8b20000 task.ti: d8b20000
PC is at memcpy+0x48/0x330
LR is at fsl_qspi_read+0xd0/0x13c
pc : [<802d0ce8>] lr : [<80427230>] psr: 20070013
sp : d8b21e04 ip : 00000000 fp : d8b20000
r10: 00400000 r9 : 10000000 r8 : d8b21ea8
r7 : 00000000 r6 : 10000000 r5 : 00001000 r4 : d80f0010
r3 : 00000012 r2 : 00000f80 r1 : f1000000 r0 : d848e000
Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: d879806a DAC: 00000015
Process hexdump (pid: 999, stack limit = 0xd8b20210)
Stack: (0xd8b21e04 to 0xd8b22000)
1e00: 00001000 10000000 00000000 d8b21ea8 d848e000 d80f0010 80427230
1e20: 00000000 d80f0ab8 00000000 00000000 d8d10dc0 00000000 d848e000 80425614
1e40: 00001000 d8b21ea8 d848e000 00000000 d867f010 d80f04e0 00000000 d8b21f88
1e60: 00000000 8041e658 00001000 d8b21ea8 d848e000 d8b21f88 d80f04e0 00001000
1e80: 01930740 d8b21f88 d80f04e0 80423304 00001000 d8b21ea8 d848e000 d8b21fb0
1ea0: d88828c0 00000817 00000000 00001000 d88bdcb8 d88828f8 00000055 8001cfb0
1ec0: 8000f604 7e9bcb48 00000068 00000000 00000000 d881cc00 80423248 d8b21f88
1ee0: 00001000 8000f604 d8b20000 00000000 00029320 80104ec4 01931744 d8b21fb0
1f00: 0000270f 000001ff 76ea760c 80009288 7e9bcac4 7e9bcac4 d8b20000 80422fd0
1f20: 7e9bcac4 d83d5340 d881cc00 00000000 7e9bcac4 80115a14 000004b1 00000000
1f40: 7e9bcb48 d881cc00 01930740 d8b21f88 00001000 8000f604 d8b20000 801056ac
1f60: 00000001 00000000 00000000 d881cc00 d881cc00 01930740 00001000 8000f604
1f80: d8b20000 80105f44 00000000 00000000 76f166d0 76ec3648 00000000 ffffffff
1fa0: 00000003 8000f480 76ec3648 00000000 00000000 01930740 00001000 00000000
1fc0: 76ec3648 00000000 ffffffff 00000003 00000010 00000010 0192d640 00029320
1fe0: 00000000 7e9bcbac 76df4ce8 76e4b530 60070010 00000000 00000000 00000000
[<802d0ce8>] (memcpy) from [<80427230>] (fsl_qspi_read+0xd0/0x13c)
[<80427230>] (fsl_qspi_read) from [<80425614>] (spi_nor_read+0x60/0x90)
[<80425614>] (spi_nor_read) from [<8041e658>] (mtd_read+0x78/0xa8)
[<8041e658>] (mtd_read) from [<80423304>] (mtdchar_read+0xbc/0x200)
[<80423304>] (mtdchar_read) from [<80104ec4>] (__vfs_read+0x1c/0xd0)
[<80104ec4>] (__vfs_read) from [<801056ac>] (vfs_read+0x7c/0x108)
[<801056ac>] (vfs_read) from [<80105f44>] (SyS_read+0x44/0x9c)
[<80105f44>] (SyS_read) from [<8000f480>] (ret_fast_syscall+0x0/0x3c)
Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8)
---[ end trace eeb2708ad919c7bb ]---
Segmentation fault

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: Internal error: : 8 [#1] PREEMPT SMP ARM

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: Process hexdump (pid: 999, stack limit = 0xd8b20210)

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1e00: 00001000 10000000 00000000 d8b21ea8 d848e000 d80f0010 80427230

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1e20: 00000000 d80f0ab8 00000000 00000000 d8d10dc0 00000000 d848e000 80425614

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1e60: 00000000 8041e658 00001000 d8b21ea8 d848e000 d8b21f88 d80f04e0 00001000

Message from syslogd@imx7dat Tue Oct 2 09:43:04 2018 ...

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7de kernel: 1e40: 00001000 d8b21ea8 d848e000 00000000 d867f010 d80f04e0 00000000 d8b21f88kernel: 1e80: 01930740 d8b21f88 d80f04e0 80423304 00


Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1ea0: d88828c0 00000817 00000000 00001000 d88bdcb8 d88828f8 00000055 8001cfb0

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1ec0: 8000f604 7e9bcb48 00000068 00000000 00000000 d881cc00 80423248 d8b21f88

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: Stack: (0xd8b21e04 to 0xd8b22000)

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1ee0: 00001000 8000f604 d8b20000 00000000 00029320 80104ec4 01931744 d8b21fb0

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1f20: 7e9bcac4 d83d5340 d881cc00 00000000 7e9bcac4 80115a14 000004b1 00000000

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1f40: 7e9bcb48 d881cc00 01930740 d8b21f88 00001000 8000f604 d8b20000 801056ac

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1f80: d8b20000 80105f44 00000000 00000000 76f166d0 76ec3648 00000000 ffffffff

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1fc0: 76ec3648 00000000 ffffffff 00000003 00000010 00000010 0192d640 00029320

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1f00: 0000270f 000001ff 76ea760c 80009288 7e9bcac4 7e9bcac4 d8b20000 80422fd0

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1fa0: 00000003 8000f480 76ec3648 00000000 00000000 01930740 00001000 00000000

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1f60: 00000001 00000000 00000000 d881cc00 d881cc00 01930740 00001000 8000f604

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: Code: ba000002 f5d1f03c f5d1f05c f5d1f07c (e8b151f8)

Message from syslogd@imx7d at Tue Oct 2 09:43:04 2018 ...
imx7d kernel: 1fe0: 00000000 7e9bcbac 76df4ce8 76e4b530 60070010 00000000 00000000 00000000

# dmesg |grep spi
[ 1.001371] fsl-quadspi 30bb0000.qspi: mx66l1g45g (131072 Kbytes)
[ 1.007737] fsl-quadspi 30bb0000.qspi: mx66l1g45g (131072 Kbytes)
[ 72.380658] LR is at fsl_qspi_read+0xd0/0x13c
[ 72.535223] [<802d0ce8>] (memcpy) from [<80427230>] (fsl_qspi_read+0xd0/0x13c)
[ 72.541155] [<80427230>] (fsl_qspi_read) from [<80425614>] (spi_nor_read+0x60/0x90)
[ 72.547519] [<80425614>] (spi_nor_read) from [<8041e658>] (mtd_read+0x78/0xa8)

Can you help to solve the issue about reading failed for the second QSPI?

Thank you.

Best Regards,
Alex Cheng

ラベル(2)
0 件の賞賛
返信
9 返答(返信)

1,401件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Alex

one can check if EPDC_DATA08-14 are not used by other modules. Also similar configuration is
used with N25Q256A13EF840 on i.MX6SX Sabre SD board and one can look at its example in imx6sx-sdb.dtsi
https://source.codeaurora.org/external/imx/linux-imx/tree/arch/arm/boot/dts/imx6sx-sdb.dtsi?h=imx_4....
Schematics (1)
IMX6SOLOX-SABRESDB-DESIGNFILES
i.MX 6SoloX SABRE Development Board|NXP 


Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

1,401件の閲覧回数
alex_cheng1
Contributor I

Hi Igor,

1. I checked that EPDC_DATA08-14 are not used by other modules.
2. My dts file was previously written with reference to i.mx6solox (imx6sx-sdb.dts, imx6sx-sdb.dtsi).
But the second QSPI still cannot work fine. Two QSPI setting in imx6sx dts file below:

pinctrl_qspi2: qspi2grp {
fsl,pins = <
MX6SX_PAD_NAND_WP_B__QSPI2_A_DATA_0 0x70f1
MX6SX_PAD_NAND_READY_B__QSPI2_A_DATA_1 0x70f1
MX6SX_PAD_NAND_CE0_B__QSPI2_A_DATA_2 0x70f1
MX6SX_PAD_NAND_CE1_B__QSPI2_A_DATA_3 0x70f1
MX6SX_PAD_NAND_CLE__QSPI2_A_SCLK 0x70f1
MX6SX_PAD_NAND_ALE__QSPI2_A_SS0_B 0x70f1
MX6SX_PAD_NAND_DATA01__QSPI2_B_DATA_0 0x70f1
MX6SX_PAD_NAND_DATA00__QSPI2_B_DATA_1 0x70f1
MX6SX_PAD_NAND_WE_B__QSPI2_B_DATA_2 0x70f1
MX6SX_PAD_NAND_RE_B__QSPI2_B_DATA_3 0x70f1
MX6SX_PAD_NAND_DATA02__QSPI2_B_SCLK 0x70f1
MX6SX_PAD_NAND_DATA03__QSPI2_B_SS0_B 0x70f1
>;
};

&qspi2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_qspi2>;
status = "okay";

#ifndef SPANSIONFLASH
ddrsmp=<0>;

flash0: n25q256a@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "micron,n25q256a";
spi-max-frequency = <29000000>;
reg = <0>;
};

flash1: n25q256a@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "micron,n25q256a";
spi-max-frequency = <29000000>;
reg = <1>;
};
#endif
};

Can you help to solve the issue about reading failed for the second QSPI?

Thank you.

Best Regards,
Alex Cheng

0 件の賞賛
返信

1,401件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Alex

just for test could you try N25Q256A13EF840 on custom board

Best regards
igor

0 件の賞賛
返信

1,401件の閲覧回数
alex_cheng1
Contributor I

Hi Igor,

Since we don't have the QSPI of "N25Q256A13EF840", we can't verify it. Our device is supporting two 128MB QSPIs.
I tried to reduce the size of the two QSPIs to 64MB and found that the second QSPI would work.
But I look at the i.MX7 datasheet, QSPI can support 256MB.

qspi_Memory_Map.png
How can I solve this problem?

Thank you.

Best Regards,
Alex Cheng

0 件の賞賛
返信

1,401件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Alex

one can check one more n25q256a example with i.MX7D

linux/arch/arm/boot/dts/imx7d-12x12-lpddr3-arm2-qspi.dts

linux-imx.git - i.MX Linux Kernel 

Size issues may be debugged using sect.10.2.3.4.4 Parallel Flash Mode

i.MX7D Reference Manual

http://cache.nxp.com/files/32bit/doc/ref_manual/IMX7DRM.pdf

Best regards
igor

0 件の賞賛
返信

1,401件の閲覧回数
alex_cheng1
Contributor I

Hi Igor,

I have seen the file you said (imx7d-12x12-lpddr3-arm2-qspi.dts). This device has four QSPIs.

The total size of four QSPIs is 128MB. So there will be no previous problems I said.
I read the contents of the file you mentioned (i.MX7D Reference Manual). I still don't know how to debug kernel code.
Can you please tell me how to debug and solve this issue in kernel code?
According to the i.MX7 datasheet, QSPI can support 256MB. Please help to solve this issue.

Thank you.

Best Regards,
Alex Cheng

0 件の賞賛
返信

1,401件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Alex

was you able to boot with updated Serial Flash A,B parameters described in

Table 6-50. QuadSPI configuration parameters i.MX7D Reference Manual

http://cache.nxp.com/files/32bit/doc/ref_manual/IMX7DRM.pdf

What is available memory in uboot ?

Best regards
igor

0 件の賞賛
返信

1,401件の閲覧回数
alex_cheng1
Contributor I

Hi Igor,

I can boot from the first QSPI. But your suggestion (QuadSPI configuration parameters) is related to QSPI boot.
I don't think there is anything related to my problem.
Suppose your suggestion is related to my question. If I don't set "QuadSPI configuration parameters", I should have problems when I read/write the first QSPI (128 MB) in the kernel.
I didn't set "QuadSPI configuration parameters" and only tried to modify kernel code to reduce the total size of the two QSPIs from 256MB to 128MB, then I found that the second QSPI (size: 64MB) would work.
I look at the i.MX7 datasheet, QSPI can support 256MB.
Can you please help me to test whether it can really support 256MB QSPI in i.MX7 demo board?
Are there other suggestions to solve this issue in the kernel?

Thank you.

Best Regards,

Alex Cheng

0 件の賞賛
返信

1,401件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Alex 

I have not other suggestion and looking for similar configurations internally

unfortunately did not find examples. Suggest to proceed with Professional Services

to develop custom driver for this part

NXP Professional Services|NXP 

Best regards
igor

0 件の賞賛
返信