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.

Linux/AM5728: GPMC CS0 memory range

Part Number: AM5728

Tool/software: Linux

Hi,

I want to connect a fpga to GPMC on CS0 in 16-bit multiplexed mode.

[1]  What is the max range I could get with cs0 ?

[2] Is the range mapable in user space ?

Cheers,

Mike

  • Hi,

    1. See section 15.4.4.8.1 of the AM572x TRM Rev. I. Max. range is 256MB.
    2. GPMC is memory mapped. You can read and write directly to the GPMC address.
  • Hi Biser,

    Thanks fro the reply.

    Max range for all the CS is 256MB and is the range for just cs0 0x8000000 - 0x9000000 ? (ranges = <0 0 0x8000000 0x1000000>; /* CS0 @addr 0x8000000, size 0x1000000 */)
    Also what is the memory address we need to map to user space is it again 0x8000000 - 0x9000000 ?

    Cheers,
    Mike
  • No, max. range for a single CS is 256MB. Total GPMC memory range is 512MB, which can be divided in chunks from 16MB to 256MB per CS. And yes, GPMC is directly addressable.
  • Hi Biser,

    Following is my dmesg output:
    which is for (ranges = <0 0 0x8000000 0x1000000>; /* CS0 @addr 0x8000000, size 0x1000000 */)

    [ 0.412138] omap-gpmc 50000000.gpmc: could not find pctldev for node /ocp/l4@4a000000/scm@2000/pinmux@1400/gpmc_pins_default, deferringe
    [ 2.293694] omap-gpmc 50000000.gpmc: GPMC revision 6.0
    [ 2.298895] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
    [ 2.305125] gpiochip_add: registered GPIOs 510 to 511 on device: omap-gpmc

    Accessing it from userspace works as expected:

    $devmem2 0x8000000
    /dev/mem opened.
    Memory mapped at address 0xb6f62000.
    Value at address 0x8000000 (0xb6f62000): 0x0

    Now if I change the mapping to , ranges = <0 0 0x2000000 0x1000000>; /* CS0 @addr 0x8000000, size 0x1000000 */)

    The kernel frequently generates following warning:

    Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
    [ 55.682066] ------------[ cut here ]------------
    [ 55.682087] WARNING: CPU: 0 PID: 0 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x368()
    [ 55.682094] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET GPMC (Read): Data Access in User mode during Functional access
    [ 55.682099] Modules linked in:
    [ 55.682106] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.4.32-00004-gd9240c6-dirty #76
    [ 55.682109] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 55.682114] Backtrace:
    [ 55.682128] [<c0013150>] (dump_backtrace) from [<c001334c>] (show_stack+0x18/0x1c)
    [ 55.682139] r7:c03125c8 r6:20080193 r5:00000000 r4:c0b185f4
    [ 55.682148] [<c0013334>] (show_stack) from [<c02e440c>] (dump_stack+0x8c/0xa0)
    [ 55.682159] [<c02e4380>] (dump_stack) from [<c00336e4>] (warn_slowpath_common+0x88/0xb8)
    [ 55.682170] r7:c03125c8 r6:00000093 r5:00000009 r4:c0aebd30
    [ 55.682179] [<c003365c>] (warn_slowpath_common) from [<c003374c>] (warn_slowpath_fmt+0x38/0x40)
    [ 55.682190] r8:00000017 r7:c09eaab0 r6:00000002 r5:c09eab70 r4:c09eac14
    [ 55.682199] [<c0033718>] (warn_slowpath_fmt) from [<c03125c8>] (l3_interrupt_handler+0x25c/0x368)
    [ 55.682205] r3:eea11e40 r2:c09eac14
    [ 55.682209] r4:80080003
    [ 55.682219] [<c031236c>] (l3_interrupt_handler) from [<c007ed28>] (handle_irq_event_percpu+0xb4/0x160)
    [ 55.682232] r10:c0b4524a r9:eea0f840 r8:00000017 r7:00000000 r6:00000000 r5:eea0f8a0
    [ 55.682236] r4:eea213c0
    [ 55.682244] [<c007ec74>] (handle_irq_event_percpu) from [<c007ee14>] (handle_irq_event+0x40/0x64)
    [ 55.682257] r10:c0aec4e4 r9:c07f01e4 r8:ee808000 r7:00000000 r6:c0af24c4 r5:eea0f8a0
    [ 55.682260] r4:eea0f840
    [ 55.682269] [<c007edd4>] (handle_irq_event) from [<c0082140>] (handle_fasteoi_irq+0xc0/0x194)
    [ 55.682277] r7:00000000 r6:c0af24c4 r5:eea0f8a0 r4:eea0f840
    [ 55.682285] [<c0082080>] (handle_fasteoi_irq) from [<c007e354>] (generic_handle_irq+0x2c/0x3c)
    [ 55.682294] r7:00000000 r6:00000000 r5:00000017 r4:c0ae6424
    [ 55.682302] [<c007e328>] (generic_handle_irq) from [<c007e62c>] (__handle_domain_irq+0x64/0xbc)
    [ 55.682309] [<c007e5c8>] (__handle_domain_irq) from [<c000948c>] (gic_handle_irq+0x40/0x7c)
    [ 55.682321] r9:c07f01e4 r8:fa213000 r7:fa212000 r6:c0aebef0 r5:fa21200c r4:c0aec8b8
    [ 55.682327] [<c000944c>] (gic_handle_irq) from [<c0013e40>] (__irq_svc+0x40/0x74)
    [ 55.682331] Exception stack(0xc0aebef0 to 0xc0aebf38)
    [ 55.682336] bee0: 00000001 00000000 fe600000 00000000
    [ 55.682341] bf00: c0aea000 c0aec484 00000000 00000000 c0aebf60 c07f01e4 c0aec4e4 c0aebf4c
    [ 55.682345] bf20: c0aebf2c c0aebf40 c0026808 c00105c0 60080013 ffffffff
    [ 55.682357] r9:c07f01e4 r8:c0aebf60 r7:c0aebf24 r6:ffffffff r5:60080013 r4:c00105c0
    [ 55.682368] [<c0010598>] (arch_cpu_idle) from [<c006f5d8>] (default_idle_call+0x28/0x34)
    [ 55.682376] [<c006f5b0>] (default_idle_call) from [<c006f838>] (cpu_startup_entry+0x200/0x260)
    [ 55.682386] [<c006f638>] (cpu_startup_entry) from [<c07e6f78>] (rest_init+0x90/0x94)
    [ 55.682391] r7:00000000
    [ 55.682399] [<c07e6ee8>] (rest_init) from [<c0a94d88>] (start_kernel+0x400/0x40c)
    [ 55.682405] r5:c0b48000 r4:c0b4804c
    [ 55.682410] [<c0a94988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 55.682413] ---[ end trace 37124420284daa8f ]---
    [ 55.985117] pgd = edb76680
    [ 55.987832] [00000000] *pgd=acc05003, *pmd=fd0c3003


    As per memory map- 0x0000_0000 - 0x1FFF_FFFF is the max size of gpmc. as per the kernel log, its disabling the range 0x0-0x1000000 may be for bootloader/kernel, why isnt its allowing to map ranges = <0 0 0x2000000 0x1000000>; /* CS0 @addr 0x8000000, size 0x1000000 */) for CS0 ?

    Cheers,
    Mike
  • Mike,

    When changing the base address from 0x800_0000 to 0x200_0000, make sure the corresponding GPMC_CONFIG7_i[5:0] register is updated accordingly.

    Refer to the below e2e threads for more info regarding 0x200_0000 base address usage:

    e2e.ti.com/.../279485
    e2e.ti.com/.../609586
    e2e.ti.com/.../537769
    e2e.ti.com/.../509629

    Regards,
    Pavel