TMDS64EVM: About the GPMC Clock

Part Number: TMDS64EVM
Other Parts Discussed in Thread: TMDXEVM3358

Tool/software:

Hi, support.

I have two questions about GPMC.

1. Can I read/write and boot from NAND Flash using GPMC with PSDK9.1.0.8?

2. What is the operating clock of the GPMC? And how can I check it? I need it to calculate the write/read timing.

The operating environment is as follows.

EVM: TMDS64EVM (connecting to custom NAND board from HSC)

PSDK: 9.1.0.8

Best Regards,

TO

  • Hi TO,

    1. Can I read/write and boot from NAND Flash using GPMC with PSDK9.1.0.8?

    Yes.

    2. What is the operating clock of the GPMC?

    The SDK configures GPMC FCLK to 133MHz, but it can be configured to 100, 80, and 60MHz too.

    And how can I check it?

    One way to run the following command in Linux:

    # k3conf dump clock 80

    for example:

    root@am64xx-evm:~# k3conf dump clock 80
    |------------------------------------------------------------------------------|
    | VERSION INFO                                                                 |
    |------------------------------------------------------------------------------|
    | K3CONF | (version 0.3-nogit built Wed Mar 06 14:29:58 UTC 2024)              |
    | SoC    | AM64x SR2.0                                                         |
    | SYSFW  | ABI: 3.1 (firmware version 0x0009 '9.2.8--v09.02.08 (Kool Koala))') |
    |------------------------------------------------------------------------------|
    
    |-------------------------------------------------------------------------------------------------------------------------|
    | Device ID | Clock ID | Clock Name                                                   | Status          | Clock Frequency |
    |-------------------------------------------------------------------------------------------------------------------------|
    |    80     |     0    | DEV_GPMC0_FUNC_CLK                                           | CLK_STATE_READY | 133333333       |
    |    80     |     1    | DEV_GPMC0_FUNC_CLK_PARENT_HSDIV4_16FFT_MAIN_0_HSDIVOUT3_CLK  | CLK_STATE_READY | 133333333       |
    |    80     |     2    | DEV_GPMC0_FUNC_CLK_PARENT_POSTDIV4_16FF_MAIN_2_HSDIVOUT7_CLK | CLK_STATE_READY | 100000000       |
    |    80     |     3    | DEV_GPMC0_PI_GPMC_RET_CLK                                    | CLK_STATE_READY | 0               |
    |    80     |     4    | DEV_GPMC0_VBUSM_CLK                                          | CLK_STATE_READY | 250000000       |
    |    80     |     5    | DEV_GPMC0_PO_GPMC_DEV_CLK                                    | CLK_STATE_READY | 0               |
    |-------------------------------------------------------------------------------------------------------------------------|

  • Hi, Bin.

    Thank you for introducing this useful tool.

    I adjusted the NAND timing and checked it. But it doesn't work...

    I have several additional questions.

    1. I checked and the current clock frequency was 133MHz.
      How can I change it to 100MHz? Please let me know where to modify the source code.

    2. I've adjusted the device tree timings and checked dmesg.
      I am getting the following error, is there something wrong with the timing?


      error 1:
      Is this just a warning and not a problem?
      [    6.646347] mtdblock: MTD device 'NAND.tiboot3' is NAND, please consider using UBI block devices instead.
      [    6.740584] mtdblock: MTD device 'NAND.tispl' is NAND, please consider using UBI block devices instead.
      [    6.786904] mtdblock: MTD device 'NAND.tiboot3.backup' is NAND, please consider using UBI block devices instead.
      [    6.899275] mtdblock: MTD device 'NAND.u-boot' is NAND, please consider using UBI block devices instead.
      [    6.988535] mtdblock: MTD device 'NAND.u-boot-env' is NAND, please consider using UBI block devices instead.
      [    7.113752] mtdblock: MTD device 'NAND.u-boot-env.backup' is NAND, please consider using UBI block devices instead.
      [    7.209012] mtdblock: MTD device 'NAND.file-system' is NAND, please consider using UBI block devices instead.


      error 2:
      Is this errors caused by incorrect timing?
      [   11.873804] mtdblock: MTD device 'NAND.file-system' is NAND, please consider using UBI block devices instead.
      [   11.884905] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   11.891294] I/O error, dev mtdblock6, sector 502656 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
      [   11.903146] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   11.909533] I/O error, dev mtdblock6, sector 502656 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
      [   11.918770] Buffer I/O error on dev mtdblock6, logical block 62832, async page read
      
      [   11.927644] mtdblock: MTD device 'NAND.u-boot-env' is NAND, please consider using UBI block devices instead.
      [   11.938352] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   11.944871] I/O error, dev mtdblock4, sector 8 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
      [   11.954319] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   11.960650] I/O error, dev mtdblock4, sector 8 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
      [   11.969305] Buffer I/O error on dev mtdblock4, logical block 1, async page read
      
      [   12.006356] mtdblock: MTD device 'NAND.tiboot3.backup' is NAND, please consider using UBI block devices instead.
      [   12.017408] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.023836] I/O error, dev mtdblock2, sector 3968 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
      [   12.033593] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.039936] I/O error, dev mtdblock2, sector 3968 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
      [   12.048841] Buffer I/O error on dev mtdblock2, logical block 496, async page read
      
      [   12.057756] mtdblock: MTD device 'NAND.tiboot3' is NAND, please consider using UBI block devices instead.
      [   12.068353] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.074693] I/O error, dev mtdblock0, sector 3968 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
      [   12.084367] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.090805] I/O error, dev mtdblock0, sector 3968 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
      [   12.099934] Buffer I/O error on dev mtdblock0, logical block 496, async page read
      
      [   12.114512] mtdblock: MTD device 'NAND.u-boot-env.backup' is NAND, please consider using UBI block devices instead.
      [   12.129757] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.140820] I/O error, dev mtdblock5, sector 8 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2
      [   12.155816] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.167139] I/O error, dev mtdblock5, sector 8 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
      [   12.180065] Buffer I/O error on dev mtdblock5, logical block 1, async page read
      
      [   12.233106] mtdblock: MTD device 'NAND.u-boot' is NAND, please consider using UBI block devices instead.
      [   12.243429] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.250255] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.256630] Buffer I/O error on dev mtdblock3, logical block 1008, async page read
      
      [   12.265633] mtdblock: MTD device 'NAND.tispl' is NAND, please consider using UBI block devices instead.
      [   12.277338] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.284243] omap2-nand 51000000.nand: uncorrectable bit-flips found
      [   12.290614] Buffer I/O error on dev mtdblock1, logical block 496, async page read


      reference:
      The NAND Flash used is MT29F2G08ABAEAWP.
      The result of the read ID command(0x90) is correct.
      I think the timing is fine because I got it correctly.
      [ 1.337095] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
      [ 1.343515] nand: Micron NAND 256MiB 3,3V 8-bit
      [ 1.351610] nand: 256 MiB, MLC, erase size: 128 KiB, page size: 2048, OOB size: 64
      [ 1.359229] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme
      [ 1.364616] 7 fixed-partitions partitions found on MTD device omap2-nand.0
      [ 1.371495] Creating 7 MTD partitions on "omap2-nand.0":
      [ 1.376805] 0x000000000000-0x000000200000 : "NAND.tiboot3"
      [ 1.384291] 0x000000200000-0x000000400000 : "NAND.tispl"
      [ 1.391453] 0x000000400000-0x000000600000 : "NAND.tiboot3.backup"
      [ 1.405140] 0x000000600000-0x000000a00000 : "NAND.u-boot"
      [ 1.413025] 0x000000a00000-0x000000a40000 : "NAND.u-boot-env"
      [ 1.420268] 0x000000a40000-0x000000a80000 : "NAND.u-boot-env.backup"
      [ 1.428161] 0x000000a80000-0x000010000000 : "NAND.file-system"

    Best Regards,

    TO

  • Hi TO,

    Please use the following patch to your "&gpmc" node in device tree to change GPMC FCLK to 100MHz.

            #address-cells = <2>;
            #size-cells = <1>;
    +       assigned-clocks = <&k3_clks 80 0>;
    +       assigned-clock-parents = <&k3_clks 80 1>;
    +       assigned-clock-rates = <100000000>;
     
            nand@0,0 {
                    compatible = "ti,am64-nand";

    "mtdblock: MTD device 'NAND.tiboot3' is NAND, please consider using UBI block devices instead."

    Those messages are waring, they can be ignored.

  • Hi, Bin.

    thank you for your reply.

    I try changing the frequency and check.

    Could you answer the question about error 2?

    I am concerned about issues "uncorrectable bit-flips" and "I/O error".

    Best Regards,

    TO

  • Hi TO,

    I am not familiar with the "uncorrectable bit-flips" message, but from kernel source code, it seems indicating BCH checking is unable to correct CRC errors.

    But I have more concern about the "Buffer I/O" error. It might mean the GPMC timing config is not correct.

    How did you flash NAND device?

  • Hi, Bin.

    thank you for your reply.

    But I have more concern about the "Buffer I/O" error. It might mean the GPMC timing config is not correct.

    I am using Micron's MT29F2G08ABAEAWP.
    I'm not sure how to set the NAND timings. Could you tell me how to set it up?

    Currently, the timing parameters are based on am335x-evm.dts.
    The am335x-evm(TMDXEVM3358 ) has an MT29F2G08ABAEAWP connected to the GPMC.  ->  Link

    The device tree used by TMDS64EVM is as follows:

    &gpmc0 {	
            status = "okay";	
            pinctrl-names = "default";	
            pinctrl-0 = <&gpmc0_pins_default>;	
            ranges = <0 0 0x00 0x51000000 0x01000000>; /* CS0 space. Min partition = 16MB */	
            #address-cells = <2>;	
            #size-cells = <1>;	
    	
            assigned-clocks = <&k3_clks 80 0>;	
            assigned-clock-parents = <&k3_clks 80 1>;	
            assigned-clock-rates = <100000000>;	
    	
            nand0_0: nand@0,0 {	
                    compatible = "ti,am64-nand";	
                    reg = <0 0 4>; /* CS0, offset 0, IO size 4 */	
                    interrupt-parent = <&gpmc0>;	
                    interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */	
                                 <1 IRQ_TYPE_NONE>; /* termcount */	
                    rb-gpios = <&gpmc0 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */	
                    ti,nand-xfer-type = "prefetch-polled";	
                    ti,nand-ecc-opt = "bch8";	
                    ti,elm-id = <&elm0>;	
                    nand-bus-width = <8>;	
                    gpmc,device-width = <1>;	
                    gpmc,sync-clk-ps = <0>;	
                    gpmc,cs-on-ns = <0>;	
                    gpmc,cs-rd-off-ns = <44>;	
                    gpmc,cs-wr-off-ns = <44>;	
                    gpmc,adv-on-ns = <6>;	
                    gpmc,adv-rd-off-ns = <34>;	
                    gpmc,adv-wr-off-ns = <44>;	
                    gpmc,we-on-ns = <0>;	
                    gpmc,we-off-ns = <40>;	
                    gpmc,oe-on-ns = <0>;	
                    gpmc,oe-off-ns = <54>;	
                    gpmc,access-ns = <64>;	
                    gpmc,rd-cycle-ns = <82>;	
                    gpmc,wr-cycle-ns = <82>;	
                    gpmc,bus-turnaround-ns = <0>;	
                    gpmc,cycle2cycle-delay-ns = <0>;	
                    gpmc,clk-activation-ns = <0>;	
                    gpmc,wr-access-ns = <40>;	
                    gpmc,wr-data-mux-bus-ns = <0>;	
    
                    partitions {
                            compatible = "fixed-partitions";
                            #address-cells = <1>;
                            #size-cells = <1>;
    
                            partition@0 {
                                    label = "NAND.tiboot3";
                                    reg = <0x00000000 0x00200000>;  /* 2M */
                            };
                            partition@200000 {
                                    label = "NAND.tispl";
                                    reg = <0x00200000 0x00200000>;  /* 2M */
                            };
                            partition@400000 {
                                    label = "NAND.tiboot3.backup";  /* 2M */
                                    reg = <0x00400000 0x00200000>;  /* BootROM looks at 4M */
                            };
                            partition@600000 {
                                    label = "NAND.u-boot";
                                    reg = <0x00600000 0x00400000>;  /* 4M */
                            };
                            partition@a00000 {
                                    label = "NAND.u-boot-env";
                                    reg = <0x00a00000 0x00040000>;  /* 256K */
                            };
                            partition@a40000 {
                                    label = "NAND.u-boot-env.backup";
                                    reg = <0x00a40000 0x00040000>;  /* 256K */
                            };
                            partition@a80000 {
                                    label = "NAND.file-system";
                                    reg = <0x00a80000 0x0f580000>;
                            };
                    };
            };
    };
    
    

    How did you flash NAND device?

    Unable to flash due to an error.
    I executed the "flash_erase" command but the erasure failed.
    The entire NAND block is a bad block. Is this a timing issue?

    root@am64xx-evm:~# flash_erase /dev/mtd0 0 0
    Erasing 2048 Kibyte @ 0 --  0 % complete [ 1948.665054] nand: nand_erase_nand: attempt to erase a bad block at 0x00000000
    libmtd: error!: MEMERASE64 ioctl failed for eraseblock 0 (mtd0)
            error 5 (Input/output error)
    flash_erase: error!: /dev/mtd0: MTD Erase entire chip failureTrying one by one each sector.
                 error 5 (Input/output error)
    flash_erase: Skipping bad block at 00000000
    flash_erase: Skipping bad block at 00010000
    flash_erase: Skipping bad block at 00020000
    flash_erase: Skipping bad block at 00030000
    flash_erase: Skipping bad block at 00040000
    flash_erase: Skipping bad block at 00050000
    flash_erase: Skipping bad block at 00060000
    flash_erase: Skipping bad block at 00070000
    flash_erase: Skipping bad block at 00080000
    flash_erase: Skipping bad block at 00090000
    flash_erase: Skipping bad block at 000a0000
    flash_erase: Skipping bad block at 000b0000
    flash_erase: Skipping bad block at 000c0000
    flash_erase: Skipping bad block at 000d0000
    flash_erase: Skipping bad block at 000e0000
    flash_erase: Skipping bad block at 000f0000
    flash_erase: Skipping bad block at 00100000
    flash_erase: Skipping bad block at 00110000
    flash_erase: Skipping bad block at 00120000
    flash_erase: Skipping bad block at 00130000
    flash_erase: Skipping bad block at 00140000
    flash_erase: Skipping bad block at 00150000
    flash_erase: Skipping bad block at 00160000
    flash_erase: Skipping bad block at 00170000
    flash_erase: Skipping bad block at 00180000
    flash_erase: Skipping bad block at 00190000
    flash_erase: Skipping bad block at 001a0000
    flash_erase: Skipping bad block at 001b0000
    flash_erase: Skipping bad block at 001c0000
    flash_erase: Skipping bad block at 001d0000
    flash_erase: Skipping bad block at 001e0000
    flash_erase: Skipping bad block at 001f0000
    Erasing 64 Kibyte @ 1f0000 -- 100 % complete

    Best Regards,

    TO

  • TO,

    I am routing your query to our GPMC hardware expert to comment on the timing configuration.

  • Hi, Bin and hardware expert.

    thank you for your support.

    Please help me with adjusting NAND timings

    The current situation is as follows:

    NAND Model Number

    MT29F2G08ABAEAWP

    NAND Timing

    &gpmc0 {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&gpmc0_pins_default>;
            ranges = <0 0 0x00 0x51000000 0x01000000>; /* CS0 space. Min partition = 16MB */
            #address-cells = <2>;
            #size-cells = <1>;
    
            nand0_0: nand@0,0 {
                    compatible = "ti,am64-nand";
                    reg = <0 0 64>; /* CS0, offset 0, IO size 4 */
                    interrupt-parent = <&gpmc0>;
                    interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                                 <1 IRQ_TYPE_NONE>; /* termcount */
                    rb-gpios = <&gpmc0 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
                    ti,nand-xfer-type = "prefetch-polled";
                    ti,nand-ecc-opt = "bch8";
                    ti,elm-id = <&elm0>;
                    nand-bus-width = <8>;
                    gpmc,device-width = <1>;
                    gpmc,sync-clk-ps = <0>;
                    gpmc,cs-on-ns = <0>;
                    gpmc,cs-rd-off-ns = <38>;
                    gpmc,cs-wr-off-ns = <38>;
                    gpmc,adv-on-ns = <8>;
                    gpmc,adv-rd-off-ns = <30>;
                    gpmc,adv-wr-off-ns = <38>;
                    gpmc,we-on-ns = <0>;
                    gpmc,we-off-ns = <30>;
                    gpmc,oe-on-ns = <0>;
                    gpmc,oe-off-ns = <45>;
                    gpmc,access-ns = <53>;
                    gpmc,rd-cycle-ns = <68>;
                    gpmc,wr-cycle-ns = <68>;
                    gpmc,bus-turnaround-ns = <0>;
                    gpmc,cycle2cycle-delay-ns = <0>;
                    gpmc,clk-activation-ns = <0>;
                    gpmc,wr-access-ns = <30>;
                    gpmc,wr-data-mux-bus-ns = <0>;

    Operation result

    NAND Device : OK

    [    1.345030] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
    [    1.351523] nand: Micron NAND 256MiB 3,3V 8-bit
    [    1.356084] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    [    1.363706] nand: using OMAP_ECC_BCH8_CODE_HW ECC scheme


    MTD Detect : OK
    root@am64xx-evm:~# cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00200000 00020000 "NAND.tiboot3"
    mtd1: 00200000 00020000 "NAND.tispl"
    mtd2: 00200000 00020000 "NAND.tiboot3.backup"
    mtd3: 00400000 00020000 "NAND.u-boot"
    mtd4: 00040000 00020000 "NAND.u-boot-env"
    mtd5: 00040000 00020000 "NAND.u-boot-env.backup"
    mtd6: 0f580000 00020000 "NAND.file-system"

    Erase and Read : OK

    root@am64xx-evm:~# flash_erase /dev/mtd0 0 0
    Erasing 2048 Kibyte @ 0 -- 100 % complete
    root@am64xx-evm:~# hexdump /dev/mtd0
    0000000 ffff ffff ffff ffff ffff ffff ffff ffff
    *
    0200000

    Program : NG
    The program appears to be working.
    However, the data does not match when compared to the source data(tiboot3.bin).
    The same problem occurs with mtd0~6.
    I think this is because an error ”uncorrectable bit-flips found” is occurring. Is this a timing issue?

    root@am64xx-evm:~# nandwrite -p /dev/mtd0 /run/media/boot-mmcblk1p1/tiboot3.bin
    Writing data to block 0 at offset 0x0
    Writing data to block 1 at offset 0x20000
    Writing data to block 2 at offset 0x40000
    Writing data to block 3 at offset 0x60000
    Writing data to block 4 at offset 0x80000
    root@am64xx-evm:~# hexdump /dev/mtd0 | head
    [  655.599277] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.605622] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.611907] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.618221] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.625036] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.631423] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.637711] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [  655.644014] omap2-nand 51000000.nand: uncorrectable bit-flips found
    0000000 8230 ba07 8230 a205 03a0 0102 0202 1e14
    0000010 cf9e d294 2773 3c6d 456a 625d 575c 2eec
    0000020 8798 0d30 0906 862a 8648 010d 0d01 0005
    0000030 8130 0b31 0930 0306 0455 1306 5302 0b31
    0000040 0930 0306 0455 0c08 5402 3158 300f 060d
    0000050 5503 0704 060c 6144 6c6c 7361 2731 2530
    0000060 0306 0455 0c0a 541e 7865 7361 4920 736e
    0000070 7274 6d75 6e65 7374 4920 636e 726f 7270
    0000080 7461 6465 1331 1130 0306 0455 0c0b 500a
    0000090 6f72 6563 7373 726f 3173 3013 0611 5503
    root@am64xx-evm:~# hexdump /run/media/boot-mmcblk1p1/tiboot3.bin | head
    0000000 8230 ba07 8230 a205 03a0 0102 0202 1e14
    0000010 cf9e d294 2773 3c6d fe6a 5d45 5c62 ec57
    0000020 982e 3087 060d 2a09 4886 f786 010d 0d01
    0000030 0005 8130 319d 300b 0609 5503 0604 0213
    0000040 5355 0b31 0930 0306 0455 0c08 5402 3158
    0000050 300f 060d 5503 0704 060c 6144 6c6c 7361
    0000060 2731 2530 0306 0455 0c0a 541e 7865 7361
    0000070 4920 736e 7274 6d75 6e65 7374 4920 636e
    0000080 726f 6f70 6172 6574 3164 3013 0611 5503
    0000090 0b04 0a0c 7250 636f 7365 6f73 7372 1331

    NAND TEST command : NG
    The same problem occurs with mtd0~6.

    root@am64xx-evm:~# nandtest /dev/mtd0
    ECC corrections: 0
    ECC failures   : 2
    Bad blocks     : 0
    BBT blocks     : 0
    00000000: reading (1 of 4)...[   48.009870] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [   48.018171] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [   48.024513] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [   48.030888] omap2-nand 51000000.nand: uncorrectable bit-flips found
    ~ skip ~
    [   49.639881] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [   49.646191] omap2-nand 51000000.nand: uncorrectable bit-flips found
    [   49.652469] omap2-nand 51000000.nand: uncorrectable bit-flips found
    
    ECC failed at 00000000
    00000000: checking...
    compare failed. seed 388096503
    Byte 0x2 is 11 should be d9
    Byte 0x3 is 02 should be 11
    Byte 0x4 is a5 should be 02
    Byte 0x5 is 1b should be 5d
    Byte 0x6 is cf should be a5
    Byte 0x7 is 7f should be 1b
    Byte 0x8 is 02 should be cf
    Byte 0x9 is 91 should be 7f
    Byte 0xa is 23 should be 02
    ~ skip ~


    Best Regards,

    TO

  • Hello TO,

    Thank you for the inputs.

    I am reviewing the inputs.

    I may have to reach out to the experts internally.

    Regards,

    Sreenivasa

  • Hi, Sreenivasa.

    Thank you for your cooperation.

    I'm checking the data sheet and adjusting the timing, but I can't program because of an ECC error.
    The NAND(MT29F2G08ABAEAWP) datasheet is attached. Please use this as a reference.

    m69a-2gb-ecc-nand.pdf

    I am hoping to be able to use the NAND timing at the following URL.
    This device tree shows the parameters of the NAND mounted on the TI expansion board PROC143E1.
    https://patchwork.kernel.org/project/linux-arm-kernel/patch/20240622-am62lp-sk-nand-v1-2-caee496eaf42@kernel.org/

    It appears that MT29F8G08ADAFAH is mounted on PROC143E1.
    /cfs-file/__key/communityserver-discussions-components-files/791/2804.proc143e2_5F00_sch.pdf

    Best Regards,

    TO

  • Hello TO,

    Thank you.

    Checking if there is a query or this is FYI on what you are trying ?

    Regards,

    Sreenivasa

  • Hello TO,

    I checked with the team here and looks like the approach you are following is in the right direction.

    Please let us know your observations.

    Regards,

    Sreenivasa

  • Hello Sreenivasa.

    Thank you for your support.

    I am adjusting the timing by looking at the NAND datasheet.

    However, the timing adjustment was not done properly and it did not work.

    I have attached a timing chart in Excel.

    Could you please check the contents? If there are any problems, please let me know.

    NAND timing.xlsx

    Best Regards,

    TO

  • Hello TO,

    I hank you.

    I will have to reach out to the expert to get his thoughts.

    This is expected to take some time.

    Regards,

    Sreenivasa

  • Hello Sreenivasa,

    Thank you for your support.

    I will start custom board designing next week, so I would like an answer by the end of this week if possible.

    While you are checking the software parameters, I check at the GPMC waveform.

    Best Regards,

    TO

  • Hello TO,

    Thank you.

    Let me follow-up and update.

    Regards,

    Sreenivasa

  • Hello TO,

    I am assigning the thread to our software expert to support.

    Regards,

    Sreenivasa

  • Hello TO,

    Can you please confirm operating voltage of your NAND device ?

    Mostly, the configured timing parameters which are available in the MCU+SDK or PROCESSOR SDK should work for all NAND devices.

    Internally (TI) we are using the below tool for configuration  NAND timing parameters .

    You can try using the same tool.

    In the tool, go to the NAND timings tab. After that provides the min and maximum values of each timing parameters in  e column.

    And play with the GPMC clock configuration in the b column.

    Please let me know if you face any issue .

    GPMC+tool.xlsm

    Regards,

    Anil.

  • Hello Anil,

    Can you please confirm operating voltage of your NAND device ?

    The voltage of NAND is 3.3V.

    and, Thanks for sending me the NAND timings configuration tool.

    Could you please tell me how to use this tool?

    1. do I only change column B of the Reg dump sheet? 

    2. GPMC is connecting NAND Flash to CS0. In that case, do I still need the register information from GPMC_REVISION (Line 14) to GPMC_ECCj_RESULT (Line 101)?

    I've been watching the GPMC waveform since yesterday, but it's noisy.

    Maybe it's a hardware problem. I will continue to check the GPMC waveform.

    Best Regards,

    TO

  • Hello Anil,

    Thank you for your support.

    There's no problem with the GPMC timing.

    The connection between the AM64EVM and the NAND Flash is too long, so waveform is noisy.

    Therefore, I determined it was a hardware problem.

    Could you please tell me one more thing?

    I have a question regarding NAND write timing waveforms.

    1. What is happening during the period indicated by the red arrow below? CS is deassertion.

    2. I want to eliminate this period, but how can I do it?

    * In the image below,  the yellow arrow is "CS", the pink arrow is "WE", and the blue arrow is "D0".

    Reference

    1. The register values when checking the waveform are as follows:

    GPMC_CONFIG1_0(0x3B000060) : 0x00000800
    GPMC_CONFIG2_0(0x3B000064) : 0x00060700
    GPMC_CONFIG3_0(0x3B000068) : 0x00040400
    GPMC_CONFIG4_0(0x3B00006C) : 0x03000501
    GPMC_CONFIG5_0(0x3B000070) : 0x00050607
    GPMC_CONFIG6_0(0x3B000074) : 0x86000000
    GPMC_CONFIG7_0(0x3B000078) : 0x00000F51

    2. NAND read timing is fine

    CS is never deasserted while reading data.
    * In the image below,  the yellow arrow is "CS", the pink arrow is "RE", and the blue arrow is "D0".

    Best Regards,

    TO

  • Hi,

    I will add some more information.

    The GPMC clock is 133MHz and the device tree values are as follows:

    nand-bus-width = <8>;
    gpmc,device-width = <1>;
    gpmc,sync-clk-ps = <0>;
    gpmc,cs-on-ns = <0>;
    gpmc,cs-rd-off-ns = <50>;
    gpmc,cs-wr-off-ns = <40>;
    gpmc,adv-on-ns = <0>;
    gpmc,adv-rd-off-ns = <25>;
    gpmc,adv-wr-off-ns = <25>;
    gpmc,we-on-ns = <0>;
    gpmc,we-off-ns = <20>;
    gpmc,oe-on-ns = <3>;
    gpmc,oe-off-ns = <35>;
    gpmc,access-ns = <35>;
    gpmc,rd-cycle-ns = <50>;
    gpmc,wr-cycle-ns = <40>;
    gpmc,bus-turnaround-ns = <0>;
    gpmc,cycle2cycle-delay-ns = <0>;
    gpmc,clk-activation-ns = <0>;
    gpmc,wr-access-ns = <40>;
    gpmc,wr-data-mux-bus-ns = <0>;

    Best Regards,

    TO

  • Hi, support.

    Do you have any update?

    Please let me know the status by today.

    Best Regards,

    TO

  • Hello TO,

    We have tuned all Timing parameters properly and added them to AM64x and AM62x devices for both Read and write operations.

    Whatever timing parameters are available in the mcu_sdk are optimized, and we can't reduce on it further.

    Regards,

    Anil.

  • Hello Anil,

    Thank you for your response.

    Could you please answer the following questions 1 and 2?

    I have a question regarding NAND write timing waveforms.

    1. What is happening during the period indicated by the red arrow below? CS is deassertion.

    2. I want to eliminate this period, but how can I do it?

    * In the image below,  the yellow arrow is "CS", the pink arrow is "WE", and the blue arrow is "D0".

    Best Regards,

    TO

  • Hello TO,

    I need some tome to get back on this .

    I will come in one or tow days .

    Regards,

    Anil.

  • Hello Anil,

    Thank you for your support.

    I look forward to hearing from you.

    Best Regards,

    TO

  • Hello TO,

    I have not verified your test results with the timing parameters, and it may take longer than usual.

    I can try to provide a reply by the end of the day or by tomorrow's end of the day.

    Regards,

    Anil.

  • Hello Anil,

    Thanks for your cooperation.

    Do you have any updates?

    Best Regards,

    TO

  • Hello support,

    Please reply today regarding the progress.

    Best Regards,

    TO

  • Hello TO,

    In the above GPMC tool.

    You can go through the NAND Timings tab.

    Then, go for the NAND command latch cycle in which you can check for tCH parameter.

    I have given a 5nsec value based on the NAND datasheet which we connected to EVM.

    In your case, go through the datasheet and feed the minimum value on the Excel sheet and later try to modify only the CSWROFFTIME parameter.

    In MCU+SDK we default configured to 6, then after updating according to the NAND datasheet, we can make it 4 as well. 

    The 4 value is followed by both tCH minimum and maximum criteria.

    After updating the change , please confirm both read and write cycles .

    Regards,

    Anil.

  • Hello Anil,

    Thank you for your support.

    I changed CSWROFFTIME from 6clk to 4clk.

    and, I also updated the NAND request timings and GPMC_CONFIGX in the GPMC tool.

    The modified GPMC tool is attached. I'll check it and share the results.

    Best Regards,

    TO

    6087.GPMC+tool.xlsm

  • Hello Anil,

    I changed CSWROFFTIME to 4clock and confirmed the NAND write waveform. It is as follow image:

    However, the red arrow period did not eliminate. There seems to be a blank period of about 100ns after writing two bytes.

    I have a question about this period marked with a red arrow.

    1.Is it possible to eliminate this period?

    2.What is GPMC driver doing this period?

    Best Regards,

    TO

  • Hello TO,

    Sorry for the delayed reply yesterday, India TI was  holiday.

    Thanks for sharing the above details.

    I am routing your query to Hw expert.

    The GPMC CS line is not controlled by the GPMC driver and GPMC IP controls this pin for every read and write transactions .

    1.Is it possible to eliminate this period?

    2.What is GPMC driver doing this period?

    Regards,

    Anil.

  • Hello Anil,

    Thank you.

    TO, i assigned to the GPMC expert to support.

    Please expect some delay in response.

    Regards,

    Sreenivasa

  • Hello Anil and Sreenivas,

    Thank you for all your support.

    I look forward to hearing form GPMC expert.

    Regards,

    TO

  • Hello Sreenivas,

    How is the progress on topic going?

    I look forward to hearing from you.

    Regards,

    TO

  • Hello Sreenivasa,

    Could you give me an update?

    Regards,

    TO

  • It looks like the expert assigned to this is out of office. I will follow up with them early next week. Sorry to keep you waiting for so long. 

  • I am not the expert, I can tell based on my experience.

    Is it possible to eliminate this period?

    Can't with CPU access, can be reduced with DMA access instead.

    .What is GPMC driver doing this period?

    Nothing. it is delay between bridges on internal bus from CPU to GPMC.

    So although the GPMC bus clock is 100MHz or 133MHz, the throughput is lower than expected. 

    Actually there are many e2e threads question the GPMC throughput. your waveform tells the root cause.

  • Hello Tony,

    Do you have any idea why this delay did not have in the Read cycle and why only this delay in write cycle ?

    Regards,

    Anil.

  • Hello Mukul,

    It looks like the expert assigned to this is out of office. I will follow up with them early next week.

    Could you give me an update?

    Regards,

    TO

  • I believe Tony's explanation is correct. I pinged the assigned expert and I hope they will respond back early next week to confirm 

  • Mukul:

     There so much info in this e2e post - is there anything here that needs to be populated into an [FAQ]????

  • Sorry for the late response. I suspect Tony is correct also - that the write CS inactive time overhead could be reduced by using DMA and GPMC Prefetch and write-posting engine...

    As a hardware person it is difficult for me to trace the drivers from nandwrite and nanddump in mtd_utils to drivers/mtd/nand/raw...

    It would be telling if we could see that nanddump uses the DMA + Prefetch and write-posting engine and nandwrite uses CPU only.

    Prefetch and write-posting engine includes a 64-byte FIFO buffer that the DMA can keep filled during a continuous read or continuous write. The engine cannot provide new commands or address to the NAND device - only data.

    Regards,
    Mark

  • Hello everyone,

    Thank you for all your support.

    I changed GPMC access to DMA instead of CPU.(See #1)

    However, the DMA engine request failed.(See #2)

    Please tell me how to solve this problem.

    #1. Device Tree Changes

    - ti,nand-xfer-type = "prefetch-polling";
    + ti,nand-xfer-type = "prefetch-dma";
    

    #2. Linux Debug Logs

    [    1.337459] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
    [    1.347400] nand: Micron MT29F2G08ABAEAWP
    [    1.351423] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
    [    1.359003] omap2-nand 51000000.nand: DMA engine request failed

    Regards,
    TO

  • Hi TO,

    Software team says am335x nand driver supports DMA, but K3 devices don't, so "prefetch-dma" cannot be used on K3. Apologies.

    • AM64x

    ti,nand-xfer-type = "prefetch-polled";

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am642-evm-nand.dtso?h=10.01.06#n80

    • AM335x

    ti,nand-xfer-type = "prefetch-dma";

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm/boot/dts/ti/omap/am335x-evm.dts?h=10.01.06#n515

    Regards,
    Mark

  • Hello, Mark,

    Thank you for your confirmation.

    K3 devices cannot use DMA for GPMC access, so does this mean that AM64xx cannot eliminate the period indicated by the red arrow below?

    I have a question about this period marked with a red arrow.

    1.Is it possible to eliminate this period?

    2.What is GPMC driver doing this period?

    Regards,
    TO

  • Hello TO/Mark,

    In MCU+SDK on R5F cores, we do support DMA on the Read cycle.

    Please look at the image below, there is NAND FIFO, and it is filled after 64 bytes and it generates one event. That event can trigger DMA.

    I assume that DMA is also possible in write  cycles.

    So, AM64X devices GPMC support DMA for NAND GPMC devices.

    I do not understand why the above delay is in the Write cycle rather than the read cycle.

    Regards,

    Anil.

  • Hello TO,

    Please confirm this delay is occurring for every byte transferred in the write cycle or in between byte de-asserting ?

    Regards,

    Anil.

  • Hello Anil,

    Thank you for your investigation.

    I am using PSDK and not MCU+SDK. Therefore, I cannot confirm that GPMC works on the R5F. 

    Regarding DMA support for GPMC, I understand that it is supported by MCU+SDK.

    Is there plan to include DMA support for GPMC in the PSDK?

    Regards,

    TO