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.

TMDS64GPEVM: NOR memory issue on TMDS64GPEVM develoment board

Part Number: TMDS64GPEVM

Hi

We are using TMDS64GPEVM board. We have  issues with NOR memory... Is there a some problem with driver?

We are using processor_sdk_linux_am64x_07_03_00_02 SDK

These are commands and outputs

  • root@am64xx-evm:~/sh# cat /proc/mtd

dev:    size   erasesize  name

mtd0: 00080000 00040000 "ospi.tiboot3"

mtd1: 00200000 00040000 "ospi.tispl"

mtd2: 00400000 00040000 "ospi.u-boot"

mtd3: 00040000 00040000 "ospi.env"

mtd4: 00040000 00040000 "ospi.env.backup"

mtd5: 037c0000 00040000 "ospi.rootfs"

mtd6: 00040000 00040000 "ospi.phypattern"

  • root@am64xx-evm:~/sh# flash_erase /dev/mtd4 0 0

 

  • root@am64xx-evm:~# insmod /lib/modules/5.10.30-gd85aee3e19/kernel/drivers/mtd/tests/mtd_speedtest.ko dev=4

[   72.077410]

[   72.078976] =================================================

[   72.084863] mtd_speedtest: MTD device: 0

[   72.088903] mtd_speedtest: MTD device size 524288, eraseblock size 262144, page size 16, count of eraseblocks 2, pages per eraseblock 16384, OOB size 0

[   73.800299] mtd_speedtest: testing eraseblock write speed

[   75.056076] mtd_speedtest: eraseblock write speed is 409 KiB/s

[   75.061927] mtd_speedtest: testing eraseblock read speed

[   75.069373] mtd_speedtest: eraseblock read speed is 512000 KiB/s

[   76.757181] mtd_speedtest: testing page write speed

[   90.939357] mtd_speedtest: page write speed is 36 KiB/s

[   90.944591] mtd_speedtest: testing page read speed

[   91.312217] mtd_speedtest: page read speed is 1414 KiB/s

[   93.013265] mtd_speedtest: testing 2 page write speed

[  100.517743] mtd_speedtest: 2 page write speed is 68 KiB/s

[  100.523257] mtd_speedtest: testing 2 page read speed

[  102.062632] ti-bcdma 485c0100.dma-controller: chan0 teardown timeout!

[  102.069856] cadence-qspi fc40000.spi: DMA wait_for_completion_timeout

[  102.078677] spi-nor spi0.0: operation failed with -110

[  102.084014] mtd_test: error: read failed at 0x1fa0

[  102.088891] mtd_speedtest: error -110 occurred

[  102.088896] =================================================

insmod: ERROR: could not insert module /lib/modules/5.10.30-gd85aee3e19/kernel/drivers/mtd/tests/mtd_speedtest.ko: Connection timed out

  1. ubiformat /dev/mtd5
  2. ubiattach -p /dev/mtd5
  3. ubimkvol /dev/ubi0 -N flash_fs -s 20MiB
  4. mkdir /mnt/flash
  5. mount -t ubifs ubi0:flash_fs /mnt/flash/

root@am64xx-evm:/mnt/flash# touch something
root@am64xx-evm:/mnt/flash# ls -la
[ 1403.375731] UBIFS error (ubi0:0 pid 851): ubifs_read_node: bad node type (255 but expected 2)
[ 1403.384464] UBIFS error (ubi0:0 pid 851): ubifs_read_node: bad node at LEB 11:160, LEB mapping status 1
[ 1403.394015] Not a node, first 24 bytes:
[ 1403.394029] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ........................
[ 1403.410867] CPU: 1 PID: 851 Comm: ls Not tainted 5.10.30-gd85aee3e19 #1
total 4
drwxr-xr-x 2 root root 232 Jun 16 18:40 .
drwxr-xr-x 3 root ro[ 1403.410872] Hardware name: Texas Instruments AM642 EVM (DT)
ot 4096 Jun 16 18:20 ..
[ 1403.410877] Call trace:
[ 1403.410895] dump_backtrace+0x0/0x1a0
root@am64xx-evm:/mnt/flash# [ 1403.410903] show_stack+0x18/0x68
[ 1403.410913] dump_stack+0xd0/0x12c
[ 1403.410921] ubifs_read_node+0x228/0x250
[ 1403.410927] ubifs_read_node_wbuf+0xbc/0x2a8
[ 1403.410935] ubifs_tnc_read_node+0x48/0xe8
[ 1403.410941] tnc_read_hashed_node+0xac/0x1e0
[ 1403.410947] ubifs_tnc_next_ent+0x190/0x1e0
[ 1403.410952] ubifs_readdir+0x2f4/0x360
[ 1403.410961] iterate_dir+0x160/0x1b0
[ 1403.410967] __arm64_sys_getdents64+0x68/0x180
[ 1403.410975] el0_svc_common.constprop.0+0x78/0x1a0
[ 1403.410981] do_el0_svc+0x24/0x90
[ 1403.410988] el0_svc+0x14/0x20
[ 1403.410993] el0_sync_handler+0xb0/0xb8
[ 1403.410998] el0_sync+0x174/0x180
[ 1403.411015] UBIFS error (ubi0:0 pid 851): ubifs_readdir: cannot find next direntry, error -22

  • Hello,

    Apologies for the delayed response. Let me take an initial look at this tomorrow. I'll be going on vacation soon, so it might be a week before we are able to get a substantive reply going.

    Regards,

    Nick

  • Hello,

    When I ran the basic copy / paste / check md5sum test in the kernel documentation, the NOR flash behaved as expected on my AM64x GP EVM:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/07_03_01_006/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.html

    I am going on vacation now. I will respond to your reply next week.

    Regards,

    Nick

  • Yes these basic tests are working fine for us too... We have this issue when we do more detailed tests like

    • create and use UBI and ubifs
    • when we used mtd_speedtest.ko

     

  • Hello Milan,

    I am able to replicate the speedtest error you observed on the SDK 8.0 release:

    root@am64xx-evm:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00080000 00040000 "ospi.tiboot3"
    mtd1: 00200000 00040000 "ospi.tispl"
    mtd2: 00400000 00040000 "ospi.u-boot"
    mtd3: 00040000 00040000 "ospi.env"
    mtd4: 00040000 00040000 "ospi.env.backup"
    mtd5: 037c0000 00040000 "ospi.rootfs"
    mtd6: 00040000 00040000 "ospi.phypattern"
    root@am64xx-evm:~# insmod /lib/modules/5.10.41-g4c2eade9f7/kernel/drivers/mtd/tests/mtd_speedtest.ko dev=4
    [ 1018.585517]
    [ 1018.587028] =================================================
    [ 1018.592842] mtd_speedtest: MTD device: 4
    [ 1018.596928] mtd_speedtest: MTD device size 262144, eraseblock size 262144, page size 16, count of eraseblocks 1, pages per eraseblock 16384, OOB size 0
    [ 1019.532365] mtd_speedtest: testing eraseblock write speed
    [ 1020.165447] mtd_speedtest: eraseblock write speed is 408 KiB/s
    [ 1020.171297] mtd_speedtest: testing eraseblock read speed
    [ 1020.177692] mtd_speedtest: eraseblock read speed is 0 KiB/s
    [ 1020.977883] mtd_speedtest: testing page write speed
    [ 1028.382304] mtd_speedtest: page write speed is 34 KiB/s
    [ 1028.387544] mtd_speedtest: testing page read speed
    [ 1028.857630] mtd_speedtest: page read speed is 552 KiB/s
    [ 1029.655296] mtd_speedtest: testing 2 page write speed
    [ 1033.587527] mtd_speedtest: 2 page write speed is 65 KiB/s
    [ 1033.592948] mtd_speedtest: testing 2 page read speed
    [ 1035.184874] ti-bcdma 485c0100.dma-controller: chan0 teardown timeout!
    [ 1035.192097] cadence-qspi fc40000.spi: DMA wait_for_completion_timeout
    [ 1035.198950] spi-nor spi0.0: operation failed with -110
    [ 1035.204704] mtd_test: error: read failed at 0xa920
    [ 1035.209854] mtd_speedtest: error -110 occurred
    [ 1035.214397] =================================================
    
    root@am64xx-evm:~# insmod /lib/modules/5.10.41-g4c2eade9f7/kernel/drivers/mtd/tests/mtd_speedtest.ko dev=4
    [ 1102.675287]
    [ 1102.676798] =================================================
    [ 1102.683911] mtd_speedtest: MTD device: 4
    [ 1102.688045] mtd_speedtest: MTD device size 262144, eraseblock size 262144, page size 16, count of eraseblocks 1, pages per eraseblock 16384, OOB size 0
    [ 1103.217008] cadence-qspi fc40000.spi: DMA wait_for_completion_timeout
    [ 1103.223480] spi-nor spi0.0: operation failed with -110
    [ 1103.228766] mtd_test: error -110 while erasing EB 0
    [ 1103.233737] mtd_speedtest: error -110 occurred
    [ 1103.233742] =================================================
    insmod: ERROR: could not insert module /lib/modules/5.10.41-g4c2eade9f7/kernel/drivers/mtd/tests/mtd_speedtest.ko: Connection timed out

    It will take me a couple days to look into this. I will provide another response within a couple of days. I am on vacation the last two weeks of December, so we will do what we can to make progress this week.

    Regards,

    Nick

  • Hello Milan,

    This issue is related to a hardware bug in AM64x Silicon Revision 1. We are still working on the silicon errata, but here is the summary:

    Block Copy DMA (BCDMA) can get corrupted in specific situations. For example, reading from NOR / NAND flash through GPMC or OSPI will result in a corrupted BCDMA. For now, the workaround is to disable DMA in the SPI driver.

    Temporary HACK:

    diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
    index 53ba8502b988..103e08a286ef 100644
    --- a/drivers/spi/spi-cadence-quadspi.c
    +++ b/drivers/spi/spi-cadence-quadspi.c
    @@ -2356,11 +2356,13 @@ static int cqspi_probe(struct platform_device *pdev)
                    goto probe_setup_failed;
            }
     
    +#if 0
            if (cqspi->use_direct_mode) {
                    ret = cqspi_request_mmap_dma(cqspi);
                    if (ret == -EPROBE_DEFER)
                            goto probe_setup_failed;
            }
    +#endif
    

    Regards,

    Nick