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.

AM625: gpmc dts example for 2 devices

Part Number: AM625

Tool/software:

The ti-aemif.txt is very clear on how to configure aemif. but ti,gpmc-child.yaml and ti,gpmc.yaml only has example to configure one NAND device.

Need a dts example to configure one NAND on CS0, 1 SRAM on CS1. I refer the file of this post,

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1354384/am625-am6254-gpmc-for-nand-sram-and-fpga#pifragment-323307=1

get error as below:

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/6866.k3_2D00_am62x_2D00_sk_2D00_common.dtsi

root@am62xx-evm:~# dmesg |grep gpmc
[ 1.051932] omap-gpmc 3b000000.memory-controller: GPMC revision 6.0
[ 1.058392] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[ 1.065129] omap-gpmc 3b000000.memory-controller: /bus@f0000/memory-controller@3b000000/nand@0,0 has malformed 'reg' property
[ 1.076722] omap-gpmc 3b000000.memory-controller: failed to probe DT child 'nand': -19
[ 1.084843] omap-gpmc 3b000000.memory-controller: /bus@f0000/memory-controller@3b000000/sram1@1,0 has malformed 'reg' property
[ 1.096502] omap-gpmc 3b000000.memory-controller: failed to probe DT child 'sram1': -19
root@am62xx-evm:~#

and the gpmc register is not configured. 

root@am62xx-evm:~# devmem2 0x3b000090
/dev/mem opened.
Memory mapped at address 0xffff7fd98000.
Read at address  0x3B000090 (0xffff7fd98090): 0x00001000

root@am62xx-evm:~# devmem2 0x3b000094
/dev/mem opened.
Memory mapped at address 0xffffad64e000.
Read at address  0x3B000094 (0xffffad64e094): 0x00101001

root@am62xx-evm:~# devmem2 0x3b000098
/dev/mem opened.
Memory mapped at address 0xffffae747000.
Read at address  0x3B000098 (0xffffae747098): 0x22060514

root@am62xx-evm:~# devmem2 0x3b00009c
/dev/mem opened.
Memory mapped at address 0xffff8e5ba000.
Read at address  0x3B00009C (0xffff8e5ba09c): 0x10057016

root@am62xx-evm:~# devmem2 0x3b0000a0
/dev/mem opened.
Memory mapped at address 0xffffa4d72000.
Read at address  0x3B0000A0 (0xffffa4d720a0): 0x010F1111

root@am62xx-evm:~# devmem2 0x3b0000a4
/dev/mem opened.
Memory mapped at address 0xffff97348000.
Read at address  0x3B0000A4 (0xffff973480a4): 0x8F070000

root@am62xx-evm:~# devmem2 0x3b0000a8
/dev/mem opened.
Memory mapped at address 0xffffa79b6000.
Read at address  0x3B0000A8 (0xffffa79b60a8): 0x00000F00

  • Hi Tony,

    Let me check on this and get back to you.

  • I am not sure if probe NAND will read information from NAND which will fail. I chance device to SRAM, it should not read the device information.

    still fail.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/7484.k3_2D00_am62x_2D00_sk_2D00_common.dtsi

    root@am62xx-evm:~# dmesg |grep gpmc
    [ 1.050529] omap-gpmc 3b000000.memory-controller: GPMC revision 6.0
    [ 1.057007] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [ 1.063782] omap-gpmc 3b000000.memory-controller: /bus@f0000/memory-controller@3b000000/sram0@0,0 has malformed 'reg' property
    [ 1.075450] omap-gpmc 3b000000.memory-controller: failed to probe DT child 'sram0': -19
    [ 1.083658] omap-gpmc 3b000000.memory-controller: /bus@f0000/memory-controller@3b000000/sram1@1,0 has malformed 'reg' property
    [ 1.095315] omap-gpmc 3b000000.memory-controller: failed to probe DT child 'sram1': -19
    root@am62xx-evm:~# 

  • Tony,

    your device tree has a syntax error in "ranges" property. please see the patch below.

    @@ -636,9 +636,9 @@ &gpmc0 {
            status = "okay";
            pinctrl-names = "default";
            pinctrl-0 = <&mygpmc1_pins_default>;
    -       ranges = <0 0 0x0 0x50000000  0x01000000>;   /* CS0 space. Min partition = 16MB */
    -       ranges = <1 0 0x0 0x51000000  0x01000000>;   /* CS1 space. Min partition = 16MB */
    -       ranges = <2 0 0x0 0x52000000  0x01000000>;   /* CS1 space. Min partition = 16MB */
    +       ranges = <0 0 0x0 0x50000000  0x01000000>,   /* CS0 space. Min partition = 16MB */
    +                <1 0 0x0 0x51000000  0x01000000>,   /* CS1 space. Min partition = 16MB */
    +                <2 0 0x0 0x52000000  0x01000000>;   /* CS1 space. Min partition = 16MB */
     
            #address-cells = <2>;
            #size-cells = <1>;

  • Bin,

    Thanks.

    all registers are configured successfully now. 

    there still one log of below. what is that?

    root@am62xx-evm:~# dmesg | grep gpmc
    [ 1.051031] omap-gpmc 3b000000.memory-controller: GPMC revision 6.0
    [ 1.057516] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000

  • Hi Tony,

    I see it in my setup. I will look into it.

  • Hi Tony,

    Sorry for the delay. I have been out for two weeks. But I will start looking into it from next week.

  • Hi Tony,

    Sorry for my late response.

    [ 1.057516] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000

    It turns out this message can be ignored. It was printed incorrectly before the GPMC child DT nodes are parsed and CS0 memory region has not been set. You can see the region address 0x0-0x1000000 is outside of the GPMC memory of 0x50000000.

    cs0 memory map has been programmed correctly later when the child DT nodes are parsed.