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?