This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5726: McSPI driver cannot read blocks larger than 64 KB

Part Number: AM5726
Other Parts Discussed in Thread: BEAGLEBOARD-X15

Tool/software:

Hi,

We have a SPI NOR flash connected to McSPI2 on our AM57-based platform, with linux-ti-staging 6.1 (SDK 09.03.06.05).
It is mostly working, except when reading more than 64 KB at once:

$ dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65534
1+0 records in
1+0 records out
65534 bytes (64.0KB) copied, 0.034515 seconds, 1.8MB/s
$ hexdump -C /tmp/dump -n128
00000000  00 00 00 00 01 00 00 00  10 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  01 00 00 00 34 00 00 00  |............4...|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  |................|
00000050  58 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |X...............|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000080

$ dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65535
1+0 records in
1+0 records out
65535 bytes (64.0KB) copied, 0.034546 seconds, 1.8MB/s
$ hexdump -C /tmp/dump -n128
00000000  00 00 00 00 01 00 00 00  10 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  01 00 00 00 34 00 00 00  |............4...|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  |................|
00000050  58 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |X...............|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000080

$ dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65536
(hangs forever)

I have traced this issue down to the wait_for_completion() call inside spi-omap2-mcspi.c, which never returns.

Could you reproduce that on your side, maybe on a AM57xx IDK?
We only have the BeagleBoard-X15, which does not have McSPI wired out.

  • I have also tried this with linux-ti-staging 6.12, and the effect is a bit different there:

    $ dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65535
    1+0 records in
    1+0 records out
    65535 bytes (64.0KB) copied, 0.034576 seconds, 1.8MB/s
    $ hexdump -C /tmp/dump -n128
    00000000  00 00 00 00 01 00 00 00  10 00 00 00 00 00 00 00  |................|
    00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000020  00 00 00 00 00 00 00 00  01 00 00 00 34 00 00 00  |............4...|
    00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000040  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  |................|
    00000050  58 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |X...............|
    00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    00000080

    $ dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65536
    1+0 records in
    1+0 records out
    65536 bytes (64.0KB) copied, 0.041382 seconds, 1.5MB/s
    $ hexdump -C /tmp/dump -n128
    00000000  00 00 00 00 01 00 00 00  10 00 00 00 00 00 00 00  |................|
    00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000020  00 00 00 00 00 00 00 00  01 00 00 00 34 00 00 00  |............4...|
    00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00000040  00 00 00 00 00 00 00 00  00 00 00 00 01 00 00 00  |................|
    00000050  58 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |X...............|
    00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    00000080

    $ dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65537
    1+0 records in
    1+0 records out
    65537 bytes (64.0KB) copied, 0.000427 seconds, 146.4MB/s
    $ hexdump -C /tmp/dump -n128
    00000000  00 00 00 02 00 00 24 01  00 50 c4 48 04 00 01 09  |......$..P.H....|
    00000010  ff ff ff ff ff ff d7 ed  fe ff ff fd ef f7 d5 fe  |................|
    00000020  00 00 2a 36 04 82 00 86  00 00 80 44 00 00 3b 90  |..*6.......D..;.|
    00000030  ff ff 5f f7 ff ff fa fe  fe ff ff ff ff ff ff ff  |.._.............|
    00000040  04 00 89 01 00 20 00 00  00 00 43 00 c0 00 00 00  |..... ....C.....|
    00000050  ff ff ff ff ff fd ff df  ff ff ef ff ff ff ff 7f  |................|
    00000060  00 00 82 0c 00 08 02 b4  10 80 34 20 00 00 00 20  |..........4 ... |
    00000070  7f bf ff ff ff ef ff 7f  7f bf 7f 7f fe df fe ff  |................|
    00000080

    This time the max block size is 1 byte more somehow.
    It also no longer hangs above this threshold, but returns garbage instead.

    Thanks in advance for your support!

  • Hi Julien,

    Will try to replicate by the end of the week.

    Just to clarify, you are doing this from Linux prompt/user space correct?

    -Josue

  • Julien,

    I do not see this limitation on my side. 

    root@am57xx-evm:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00040000 00010000 "QSPI.SPL"
    mtd1: 00100000 00010000 "QSPI.u-boot"
    mtd2: 00080000 00010000 "QSPI.u-boot-spl-os"
    mtd3: 00010000 00010000 "QSPI.u-boot-env"
    mtd4: 00010000 00010000 "QSPI.u-boot-env.backup1"
    mtd5: 00800000 00010000 "QSPI.kernel"
    mtd6: 01620000 00010000 "QSPI.file-system"
    root@am57xx-evm:~# dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65536
    1+0 records in
    1+0 records out
    65536 bytes (66 kB, 64 KiB) copied, 0.00314331 s, 20.8 MB/s
    root@am57xx-evm:~# hexdump -C /tmp/dump -n128
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080
    root@am57xx-evm:~# dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65534
    1+0 records in
    1+0 records out
    65534 bytes (66 kB, 64 KiB) copied, 0.00314331 s, 20.8 MB/s
    root@am57xx-evm:~# hexdump -C /tmp/dump -n128
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080
    root@am57xx-evm:~# dd if=/dev/mtd0 of=/tmp/dump count=1 bs=65536
    1+0 records in
    1+0 records out
    65536 bytes (66 kB, 64 KiB) copied, 0.00314331 s, 20.8 MB/s
    root@am57xx-evm:~# dd if=/dev/mtd0 of=/tmp/dump2 count=1 bs=66560
    1+0 records in
    1+0 records out
    66560 bytes (67 kB, 65 KiB) copied, 0.00323486 s, 20.6 MB/s
    root@am57xx-evm:~# hexdump -C /tmp/dump2 -n128
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080
    root@am57xx-evm:~# diff /tmp/dump /tmp/dump2
    Files /tmp/dump and /tmp/dump2 differ
    root@am57xx-evm:~#
    root@am57xx-evm:~#
    root@am57xx-evm:~#
    root@am57xx-evm:~# diff -help
    diff: invalid option -- 'h'
    BusyBox v1.35.0 () multi-call binary.
    
    Usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2
    root@am57xx-evm:~# hexdump -C /tmp/dump2 -n256
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
    00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
    000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
    000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
    000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
    000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
    000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
    000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
    00000100
    root@am57xx-evm:~# hexdump -C /tmp/dump -n256
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
    00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
    000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
    000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
    000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
    000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
    000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
    000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
    00000100
    root@am57xx-evm:~# hexdump -C /tmp/dump -n512
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
    00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
    000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
    000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
    000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
    000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
    000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
    000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
    00000100  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000110  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000120  20 21 22 23 24 25 26 27  28 29 2a 2b 00 00 00 00  | !"#$%&'()*+....|
    00000130  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
    *
    00000200
    root@am57xx-evm:~# hexdump -C /tmp/dump2 -n512
    00000000  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000010  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000020  20 21 22 23 24 25 26 27  28 29 2a 2b 2c 2d 2e 2f  | !"#$%&'()*+,-./|
    00000030  30 31 32 33 34 35 36 37  38 39 3a 3b 3c 3d 3e 3f  |0123456789:;<=>?|
    00000040  40 41 42 43 44 45 46 47  48 49 4a 4b 4c 4d 4e 4f  |@ABCDEFGHIJKLMNO|
    00000050  50 51 52 53 54 55 56 57  58 59 5a 5b 5c 5d 5e 5f  |PQRSTUVWXYZ[\]^_|
    00000060  60 61 62 63 64 65 66 67  68 69 6a 6b 6c 6d 6e 6f  |`abcdefghijklmno|
    00000070  70 71 72 73 74 75 76 77  78 79 7a 7b 7c 7d 7e 7f  |pqrstuvwxyz{|}~.|
    00000080  80 81 82 83 84 85 86 87  88 89 8a 8b 8c 8d 8e 8f  |................|
    00000090  90 91 92 93 94 95 96 97  98 99 9a 9b 9c 9d 9e 9f  |................|
    000000a0  a0 a1 a2 a3 a4 a5 a6 a7  a8 a9 aa ab ac ad ae af  |................|
    000000b0  b0 b1 b2 b3 b4 b5 b6 b7  b8 b9 ba bb bc bd be bf  |................|
    000000c0  c0 c1 c2 c3 c4 c5 c6 c7  c8 c9 ca cb cc cd ce cf  |................|
    000000d0  d0 d1 d2 d3 d4 d5 d6 d7  d8 d9 da db dc dd de df  |................|
    000000e0  e0 e1 e2 e3 e4 e5 e6 e7  e8 e9 ea eb ec ed ee ef  |................|
    000000f0  f0 f1 f2 f3 f4 f5 f6 f7  f8 f9 fa fb fc fd fe ff  |................|
    00000100  00 01 02 03 04 05 06 07  08 09 0a 0b 0c 0d 0e 0f  |................|
    00000110  10 11 12 13 14 15 16 17  18 19 1a 1b 1c 1d 1e 1f  |................|
    00000120  20 21 22 23 24 25 26 27  28 29 2a 2b 00 00 00 00  | !"#$%&'()*+....|
    00000130  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
    *
    00000200
    root@am57xx-evm:~#
    root@am57xx-evm:~# uname -r
    6.1.119-ti-ge4e8b16e66f5
    root@am57xx-evm:~#

    -Josue

  • Yes, this is from the shell/userspace (dd command, etc).

  • This I also have with the QSPI NOR flash: everything is fine there. The issue is with the McSPI bus/driver.

    When I did my tests the QSPI driver (spi-ti-qspi) was not yet loaded, only the McSPI one.
    That's why its mtd id was 0. For you it will probably be mtd7 or more.

    Do you have a NOR flash chip hooked on one of the McSPI buses though?
    You probably also need to add it to the devicetree, with at least one partition for it to show up in /proc/mtd, e.g:

    &mcspi2 {
    	ti,pindir-d0-out-d1-in;
    	status = "okay";
    
    	flash@0 {
    		compatible = "jedec,spi-nor";
    		reg = <0>;
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		partition@0 {
    			label = "mcspi-test-part";
    			reg = <0 0x80000>;
    		};
    	};
    };



  • Hi Julien,

    This is what the IDK manual says:

    and this is the u-boot entry:

    &qspi {
            status = "okay";
    
            spi-max-frequency = <76800000>;
            flash@0 {
                    compatible = "s25fl256s1", "jedec,spi-nor";
                    spi-max-frequency = <76800000>;
                    reg = <0>;
                    spi-tx-bus-width = <1>;
                    spi-rx-bus-width = <4>;
                    #address-cells = <1>;
                    #size-cells = <1>;
    
                    /* MTD partition table.
                     * The ROM checks the first four physical blocks
                     * for a valid file to boot and the flash here is
                     * 64KiB block size.
                     */
                    partition@0 {
                            label = "QSPI.SPL";
                            reg = <0x00000000 0x00040000>;
                    };
                    partition@1 {
                            label = "QSPI.u-boot";
                            reg = <0x00040000 0x00100000>;
                    };
                    partition@2 {
                            label = "QSPI.u-boot-spl-os";
                            reg = <0x00140000 0x00080000>;
                    };
                    partition@3 {
                            label = "QSPI.u-boot-env";
                            reg = <0x001c0000 0x00010000>;
                    };
                    partition@4 {
                            label = "QSPI.u-boot-env.backup1";
                            reg = <0x001d0000 0x0010000>;
                    };
                    partition@5 {
                            label = "QSPI.kernel";
                            reg = <0x001e0000 0x0800000>;
                    };
                    partition@6 {
                            label = "QSPI.file-system";
                            reg = <0x009e0000 0x01620000>;
                    };
            };
    };

    So we do not have a direct way to test your setup on your board.

    -Josue

  • Hi Josue,

    My hope is that you could just connect an external SPI NOR Flash to the expansion connector (J21 on the IDK):
    McSPI2 seems to be freely available there.

    This extra chip is not meant to replace the QSPI one (boot source), so there should be not major change/issue with the IDK. Only the devicetree addition from above. The pinmuxing (mux_data.h in U-Boot) also looks fine for SPI2 on the IDK.

    Thanks for your support.

    Julien

  • Julien,

    I will have to see if we have this available. I will let you know by EOD.

    Josue

  • Julien,

    It looks like we do not have this available to test internally. This unfortunately falls under not supported by our SDK due to not being an integrated module in our EVMs,  you will have to proceed on your own with testing.

    This limitation seems to be something that is know as explained in the following app note: https://www.ti.com/lit/an/sprad26/sprad26.pdf

    "McSPI can transmit or receive 64K-1 bytes per transfer, therefore, SPI slave driver needs to make sure to break larger read/write transactions into 64K-1 chunks and master must make sure slave is ready to send/receive data before starting the clock."

    So I would assume that there is an issue with SPI slave driver here. Have you made sure that your SPI driver is setup correctly? Has its function been verified before?

    From your DT node,

    I see you are missing a compatible as defined in the YAML file as well as the spi-max-frequency entry.
    See ti-linux-kernel-6.1.119+gitAUTOINC+e4e8b16e66-ti/Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml

    Also keep in mind that there are plenty of outside sources for FOSS support. See our disclaimer:

    https://software-dl.ti.com/processor-sdk-linux/esd/AM57X/09_03_06_05/exports/docs/linux/Overview_Technical_Support.html#open-source-software-support-disclaimer

    Best, 

    Josue

  • Hi Josue,

    Thanks for the application note.

    The spi-max-frequency is the one from the bus if not defined, which is okay. The extra compatible should also be set, though it did not help here. The slave chip has been validated with another platform/master.

    The McSPI is the master also in this case, but I guess the limitations mentioned above somehow apply when reading from the slave. Too bad that the kernel driver is not able to handle or warn about such cases.

    Thanks for looking into it anyway!

    Regards,
    Julien

  • Julien, 

    The slave, or peripheral driver should be working correctly, meaning that the read should not be limited to 64KBs. The driver should be handling it correctly. Have you tried other memories ort devices on the same bus? 

    How does a loopback test perform?

    -Josue

  • I don't have the possibility to test the McSPI further right now, I will see what can be done here.

    The slave peripheral (= NOR Flash chip) can be read correctly (more than 64KB at once) when driven from another master though (not the AM57x's McSPI). So the slave itself looks fine.