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.

AM5749: AM5749: GPMC setting for connect FPGA is not correct on AM5749 custom board.

Part Number: AM5749

(Because of no reply, So I made a new post not related post. Sorry.)

Hi Dears.

I have a problem to setting the GPMC using dts file descriptions.

I'm using SDK-linux-am57xx-evm-08_02_01_00 and SD-card booting.

I modify dra7.dtsi and am574x-idk.dts files as like below.

===== dra7.dtsi =====

/* OCP2SCP1 */
/* IRQ for DWC3_3 and DWC3_4 need IRQ crossbar */
gpmc: gpmc@50000000 {
compatible = "ti,am3352-gpmc";
ti,hwmods = "gpmc";
reg = <0x50000000 0x37c>; /* device IO registers */
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&edma_xbar 4 0>;
dma-names = "rxtx";
gpmc,num-cs = <8>;
gpmc,num-waitpins = <2>;
#address-cells = <2>;
#size-cells = <1>;
interrupt-controller;
#interrupt-cells = <2>;
gpio-controller;
#gpio-cells = <2>;
status = "okay";            // <== here changed
};

====== am574x-idk.dts ======

&gpmc {
status = "okay";
//reg = <0 0x50000000 0 0x37c>; // 64-bits device IO registers
//compatible = "ti,am5532-gpmc";
//ti,hwmod = "gpmc";
ti,no-idle-on-init;
pinctrl-names = "default";
pinctrl-0 = <&adrs_gpmc_default>;
//interrupt-controller;
//gpio-controller;

#address-cell = <2>;
#size-cell = <1>;
ranges = <0 0 0x01000000 0x01000000>; // minimum GPMC partition = 64MB
//3 0 0x20000000 0x10000000>; // minimum GPMC partition = 64MB

fpgacs0@0,0 {
//status = "okay";
reg = <0 0x01000000 0x04000000>;

bank-width = <2>;
//interrupt-parent = <gpmc>;
//interrupts = <0 0>;

gpmc,sync-read;
gpmc,sync-write;
gpmc,device-width = <2>; // 16bits
gpmc,mux-add-data = <1>; // 1:AAD, 2:AD
gpmc,burst-length = <16>; // 16words

.....

};

};

&dra7_pmx_core {
idk_led_rgb0b_default:idk_led_rgb0b_default {
pinctrl-single,pins = <
DRA7XX_CORE_IOPAD(0x3714, PIN_OUTPUT | MUX_MODE14) // gpio1_4
>;
};

adrs_gpmc_default:adrs_gpmc_default {
pinctrl-single,pins = <
DRA7XX_CORE_IOPAD(0x3400, PIN_INPUT | MUX_MODE0) // gpmc_ad0
DRA7XX_CORE_IOPAD(0x3404, PIN_INPUT | MUX_MODE0) // gpmc_ad1
DRA7XX_CORE_IOPAD(0x3408, PIN_INPUT | MUX_MODE0) // gpmc_ad2
DRA7XX_CORE_IOPAD(0x340c, PIN_INPUT | MUX_MODE0) // gpmc_ad3
DRA7XX_CORE_IOPAD(0x3410, PIN_INPUT | MUX_MODE0) // gpmc_ad4

...

};

};

After modify, I compile using "make linux-dtbs" commands and compiled successfully.

I copy the file am574x-idk.dtb to SD-card (/media/someone/rootfs/boot) using sudo permission, and file time changed newly.

But Booting message for gpmc is looks not working

====== booting message ======

[ 5.586914] Registering SWP/SWPB emulation handler
[ 5.592041] omap_voltage_late_init: Voltage driver support not added
[ 5.598419] Power Management for TI OMAP4+ devices.
[ 5.603637] Loading compiled-in X.509 certificates
[ 5.628051] dmm 4e000000.dmm: workaround for errata i878 in use
[ 5.635375] dmm 4e000000.dmm: initialized all PAT entries
[ 5.642059] [drm] Initialized omapdrm 1.0.0 20110917 for omapdrm.0 on minor 0
[ 5.649505] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[ 5.654663] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000
[ 5.661071] omap-gpmc 50000000.gpmc: cannot remap GPMC CS 0 to 0x0000000002000000
[ 5.668579] omap-gpmc 50000000.gpmc: failed to probe DT child 'fpgacs0': -22
[ 5.675964] V3_3D: supplied by smps9
[ 5.680053] vtt_fixed: supplied by V3_3D
[ 5.685089] omap-iommu 40d01000.mmu: 40d01000.mmu registered
[ 5.692474] omap-iommu 40d02000.mmu: 40d02000.mmu registered
[ 5.698669] platform 40800000.dsp: Adding to iommu group 0
[ 5.705169] omap-iommu 58882000.mmu: 58882000.mmu registered

After booting, the command "cat /proc/iomem" printout like below.

====================

root@am57xx-evm:~# cat /proc/iomem
40300000-4037ffff : 40300000.ocmcram ocmcram@40300000
40d01000-40d010ff : 40d01000.mmu mmu@0
40d02000-40d020ff : 40d02000.mmu mmu@0
41501000-415010ff : 41501000.mmu mmu@0
41502000-415020ff : 41502000.mmu mmu@0
43300000-433fffff : 43300000.dma edma3_cc

....

4ae0c154-4ae0c157 : 4ae07de4.regulator-abb-gpu ldo-address
4ae0c158-4ae0c15b : 4ae07ddc.regulator-abb-mpu ldo-address
4ae10000-4ae101ff : 4ae10000.gpio gpio@0
4ae20000-4ae2007f : 4ae20000.timer timer@0
4b300000-4b3000ff : 4b300000.spi qspi_base
50000000-5000037b : 50000000.gpmc gpmc@50000000
55082000-550820ff : 55082000.mmu mmu@0
58000000-5800007f : 58000000.dss dss
58001000-58001fff : 58001000.dispc dispc@0
58004054-58004057 : 58000000.dss pll1_clkctrl
58004300-5800431f : 58000000.dss pll1
58009054-58009057 : 58000000.dss pll2_clkctrl
58009300-5800931f : 58000000.dss pll2
58882000-588820ff : 58882000.mmu mmu@0
80000000-afcfffff : System RAM
80008000-80ffffff : Kernel code
81200000-812fc00f : Kernel data
b0000000-ffffffff : System RAM


root@am57xx-evm:~# devmem2 0x01000000 h

/dev/mem opened.[ 75.796722] ------------[ cut here ]------------
[ 75.802673] WARNING: CPU: 0 PID: 218 at drivers/bus/omap_l3_noc.c:141 l3_interrupt_handler+0x294/0x38c
[ 75.812042] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET GPMC (Read): Data Access in User mode during Functional access
[ 75.823120] Modules linked in: sch_fq_codel cryptodev(O)
[ 75.828491] CPU: 0 PID: 218 Comm: devmem2 Tainted: G O 5.10.100-g7a7a3af903 #1
[ 75.837066] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 75.843200] [<c020eb18>] (unwind_backtrace) from [<c0209f10>] (show_stack+0x10/0x14)

....

Bus error (core dumped)
root@am57xx-evm:~# devmem2 0x50000000 h
/dev/mem opened.
Memory mapped at address 0xb6f4d000.
Read at address 0x50000000 (0xb6f4d000): 0x0060
root@am57xx-evm:~# devmem2 0x50000000 w
/dev/mem opened.
Memory mapped at address 0xb6f2c000.
Read at address 0x50000000 (0xb6f2c000): 0x00000060
root@am57xx-evm:~# devmem2 0x50000300 w
/dev/mem opened.
Memory mapped at address 0xb6f40000.
Read at address 0x50000300 (0xb6f40300): 0x00000000
root@am57xx-evm:~#

=============================================

I want to access gpmc address range (0x00000000 ~ 0x3fff_ffff) using devmem2 command.

I want to solve this problem using dts settings. Is it possible?

Can you give some advices or to know related threads?

  • I changed the gpmc section in DTS as like below.

    === DTS ===

    &gpmc {
    status = "okay";
    ti,no-idle-on-init;
    pinctrl-names = "default";
    pinctrl-0 = <&adrs_gpmc_default>;

    ranges = <0 0 0x08000000 0x10000000>; // minimum GPMC partition = 64MB

    fpgacs0@0 {
    reg = <0 0 0x04000000>;
    bank-width = <2>;

    gpmc,sync-read;

    =====

    And the command"cat /proc/iomem" shows the gpmc register space.

    But gpmc data address not shown.

    === cat /proc/iomem (edited) ===

    root@am57xx-evm:~# cat /proc/iomem
    40300000-4037ffff : 40300000.ocmcram ocmcram@40300000
    40d01000-40d010ff : 40d01000.mmu mmu@0
    40d02000-40d020ff : 40d02000.mmu mmu@0
    41501000-415010ff : 41501000.mmu mmu@0
    41502000-415020ff : 41502000.mmu mmu@0
    43300000-433fffff : 43300000.dma edma3_cc
    44000000-44ffffff : 44000000.ocp ocp
    45000000-45000fff : 44000000.ocp ocp
    48020000-4802001f : serial
    48034000-4803407f : 48034000.timer timer@0
    48036000-4803607f : 48036000.timer timer@0
    4803e000-4803e07f : 4803e000.timer timer@0
    48051000-480511ff : 48051000.gpio gpio@0
    48053000-480531ff : 48053000.gpio gpio@0
    48055000-480551ff : 48055000.gpio gpio@0
    48057000-480571ff : 48057000.gpio gpio@0
    48059000-480591ff : 48059000.gpio gpio@0
    4805b000-4805b1ff : 4805b000.gpio gpio@0
    4805d000-4805d1ff : 4805d000.gpio gpio@0
    48070000-480700ff : 48070000.i2c i2c@0
    48086000-4808607f : 48086000.timer timer@0

    ...

    4ae07e34-4ae07e37 : 4ae07e34.regulator-abb-ivahd setup-address
    4ae0c154-4ae0c157 : 4ae07de4.regulator-abb-gpu ldo-address
    4ae0c158-4ae0c15b : 4ae07ddc.regulator-abb-mpu ldo-address
    4ae10000-4ae101ff : 4ae10000.gpio gpio@0
    4ae20000-4ae2007f : 4ae20000.timer timer@0
    50000000-5000037b : 50000000.gpmc gpmc@50000000
    55082000-550820ff : 55082000.mmu mmu@0
    58000000-5800007f : 58000000.dss dss
    58001000-58001fff : 58001000.dispc dispc@0
    58004054-58004057 : 58000000.dss pll1_clkctrl
    58004300-5800431f : 58000000.dss pll1
    58009054-58009057 : 58000000.dss pll2_clkctrl
    58009300-5800931f : 58000000.dss pll2
    58882000-588820ff : 58882000.mmu mmu@0
    80000000-afcfffff : System RAM
    80008000-80ffffff : Kernel code
    81200000-812fc00f : Kernel data
    b0000000-ffffffff : System RAM
    root@am57xx-evm:~#

    ==========

    But this command "devmem2 0x08000000 h" hangs the linux.

    ==== command result ====

    root@am57xx-evm:~# devmem2 0x50000000 h
    /dev/mem opened.
    Memory mapped at address 0xb6f33000.
    Read at address 0x50000000 (0xb6f33000): 0x0060
    root@am57xx-evm:~# devmem2 0x08000000 h
    /dev/mem opened.                                                  <=== (hang, so reset system)

    U-Boot SPL 2021.01-00003-g16d964ac27-dirty (Oct 01 2022 - 11:58:40 +0900)
    DRA762-GP ES1.0 ABZ package
    Trying to boot from MMC1
    Loading Environment from FAT... OK

    =====================

    Have any ides?

    Thanks.

  • Hello Khoosen,

    Is your issue still open?