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.

Changing memory map IPNC 3.0 DM8148 EVM

Expert 2220 points
Other Parts Discussed in Thread: DM385

Hello,

I am using IPNC 3.0 on the DM8148 EVM with 1GB of RAM. I am trying to change the memory map from the default 512MB to the 1GB map listed below.

Section                                  Size Offset Start        End           Size
var LINUX_SIZE 139 139 80000000 88B00000 08B00000
var DSS_M3_CODE_SIZE 2 141 88B00000 88D00000 00200000
var VIDEO_M3_CODE_SIZE 2 143 88D00000 88F00000 00200000
var VIDEO_M3_DATA_SIZE 20 163 88F00000 8A300000 01400000
var DSS_M3_DATA_SIZE 20 183 8A300000 8B700000 01400000
var SR1_SIZE 45 228 8B700000 8E400000 02D00000
var DSP_CODE_SIZE 12 240 8E400000 8F000000 00C00000
var DSP_DATA_SIZE 512 752 8F000000 AF000000 20000000
var LINUX2_SIZE 128 880 AF000000 B7000000 08000000
var SR2_FRAME_BUFFER_SIZE 112 992 B7000000 BE000000 07000000
var SR0_SIZE 25 1017 BE000000 BF900000 01900000
var HDVPSS_DESC_SIZE 2 1019 BF900000 BFB00000 00200000
var HDVPSS_SHARED_SIZE 2 1021 BFB00000 BFD00000 00200000
var NOTIFY_SHARED_SIZE 2 1023 BFD00000 BFF00000 00200000
var REMOTE_DEBUG_SIZE 1 1024 BFF00000 C0000000 00100000

 I have gone through and adjusted dependencies so that we no longer use CMEM and the tiler. I also adjusted the kernel so I could split the memory into two sections. The notify region, debug region, and M3 shared regions are unmoved. Everything seems to be working fine except for one thing. If I start using the 512MB DSP_DATA  region I start getting segfaults, or the DSP will not load. If I only put a small buffer in that region the application runs normally. It seems that when I allocate buffers somewhere around the 0x94800000 region that it starts to mess up. Here is an example of there errors that I am seeing:

[host] Starting Firmware

[host] Attached to slave procId 1.

[host] Loading Firmware
[c6xdsp ] Remote Debug Shared Memory @ 0xbff00000
[m3video] Remote Debug Shared Memory @ 0xbff05020
[m3vpss ] Remote Debug Shared Memory @ 0xbff0a040

[host] Attached to slave procId 0.

[host] Loading Firmware

[host] Loaded file ./firmware/ipnc_rdk_fw_m3video.xem3 on slave procId 1.

[host] Getting Firmware Start Parameters

[host] Starting Firmware
Assertion at Line no: 499 in /home/benmcgee/RDK_IPNC_3_0/PrivateTI_IPNC_RDK_DM812x_DM385_v3.0.0/Source/ti_tools/syslink_2_10_06_28/packages/t
i/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/procMgr/common/loaders/Elf/ElfLoader.c: (elfLoaderObject != NULL) : failed
Assertion at Line no: 499 in /home/benmcgee/RDK_IPNC_3_0/PrivateTI_IPNC_RDK_DM812x_DM385_v3.0.0/Source/ti_tools/syslink_2_10_06_28/packages/t
i/syslink/utils/hlos/knl/Linux/../../../../../../ti/syslink/procMgr/common/loaders/Elf/ElfLoader.c: (elfLoaderObject != NULL) : failed
Unable to handle kernel NULL pointer dereference at virtual address 0000000c
pgd = c1230000
[0000000c] *pgd=81234031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT
last sysfs file: /sys/devices/virtual/gpio/gpio104/direction
Modules linked in: syslink
CPU: 0 Not tainted (2.6.37_DM8127_IPNC_3.00.00 #1)
PC is at ElfLoaderTrgWrite_copy+0x70/0x368 [syslink]
LR is at schedule+0x388/0x3c0
pc : [<bf0128f8>] lr : [<c0380f7c>] psr: 60000013
sp : c12dbcb8 ip : c12db998 fp : c12dbd1c
r10: 00000000 r9 : c456b000 r8 : c41fc000
r7 : 00000011 r6 : 00000005 r5 : c456e000 r4 : c12dbd48
r3 : 00000000 r2 : c12da000 r1 : 00000000 r0 : 0000011a
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c5387d Table: 81230019 DAC: 00000015
Process fw_load.out (pid: 852, stack limit = 0xc12da2e8)
Stack: (0xc12dbcb8 to 0xc12dc000)
bca0: c12dbd48 00000000
bcc0: 00082bc0 00000001 cd000000 c456e000 8f000000 8f000000 bf011624 06c8fca8
bce0: c45c0000 00000001 c41fc01c 8f000000 c12dbd0c c458f0c0 c456e000 00000005
bd00: 00000011 c41fc000 c456b000 00000001 c12dbd2c c12dbd20 bf015f74 bf012894
bd20: c12dbd9c c12dbd30 bf014d04 bf015f70 c12dbd6c c12dbd40 c456b000 bff0f060
bd40: 00000011 c41fc01c c456b000 00000000 cd000000 00000001 00000000 00000000
bd60: 00000002 00000000 c456e000 c456e000 00000000 c3fc3000 03046000 c3fbd000
bd80: 00000000 00000000 c12dbec0 00000000 c12dbde4 c12dbda0 bf011a80 bf0145dc
bda0: c4568000 00000000 00000000 00000000 bf033f48 c456b000 c12dbdf4 c3fbd000
bdc0: 00000000 00000000 c4568000 c12dbec0 c4568000 00000000 c12dbe1c c12dbde8
bde0: bf0022d0 bf011824 00000000 c12dbec0 00000000 00000000 c2aa7000 00000000
be00: c3fcf000 00000000 00000000 c12dbec0 c12dbe5c c12dbe20 bf006a08 bf0021f0
be20: 00000000 c12dbec0 00000000 00000000 00000024 00000000 c13f9300 c4568000
be40: be93fbd8 bf0fbc68 c12da000 00000000 c12dbef4 c12dbe60 bf0089c4 bf0067f4
be60: 00000000 c12dbec0 c12dbed4 c12dbea8 c03853f0 c0067954 00000000 c03853f0
be80: c12dbea4 c12dbe90 c03853f0 c0045440 c04bec28 00000003 c12dbed4 c12dbea8
bea0: c0067954 0000000a c3fcf000 be93fed4 00000024 00000000 00000000 00000000
bec0: 00000000 c12da000 c12dbef4 c12dbed8 c0209410 c1644ca0 c13f9300 00000007
bee0: 00000007 be93fbd8 c12dbf04 c12dbef8 c00d9fe0 bf007e38 c12dbf74 c12dbf08
bf00: c00da774 c00d9fc4 c12dbf3c c12dbf18 c0045470 c00469b0 c12dbf74 c12dbf58
bf20: c03853f0 c00cccf0 00000000 c03853f0 c12dbf54 c12dbf40 c03853f0 c0045440
bf40: c13f9300 00000007 c12dbf74 00000000 be93fbd8 c020e0a2 00000007 c13f9300
bf60: c12da000 00000000 c12dbfa4 c12dbf78 c00da814 c00da228 00000001 00000001
bf80: 00000003 be93fbd8 00000000 00000000 00000036 c0043088 00000000 c12dbfa8
bfa0: c0042ee0 c00da7c8 be93fbd8 00000000 00000007 c020e0a2 be93fbd8 00000001
bfc0: be93fbd8 00000000 00000000 00000036 0007ee6c 00051a1c 0007eb54 0007eb54
bfe0: c020e0a2 be93fba0 00029ee0 4019caec 60000010 00000007 81ffe021 81ffe421
Backtrace:
[<bf012888>] (ElfLoaderTrgWrite_copy+0x0/0x368 [syslink]) from [<bf015f74>] (DLIF_copy+0x10/0x1c [syslink])
[<bf015f64>] (DLIF_copy+0x0/0x1c [syslink]) from [<bf014d04>] (DLOAD_load+0x734/0xa58 [syslink])
[<bf0145d0>] (DLOAD_load+0x0/0xa58 [syslink]) from [<bf011a80>] (ElfLoader_load+0x268/0x36c [syslink])
[<bf011818>] (ElfLoader_load+0x0/0x36c [syslink]) from [<bf0022d0>] (Loader_load+0xec/0x164 [syslink])
[<bf0021e4>] (Loader_load+0x0/0x164 [syslink]) from [<bf006a08>] (ProcMgr_load+0x220/0x2fc [syslink])
[<bf0067e8>] (ProcMgr_load+0x0/0x2fc [syslink]) from [<bf0089c4>] (ProcMgrDrv_ioctl+0xb98/0x1c38 [syslink])
[<bf007e2c>] (ProcMgrDrv_ioctl+0x0/0x1c38 [syslink]) from [<c00d9fe0>] (vfs_ioctl+0x28/0x44)
r8:be93fbd8 r7:00000007 r6:00000007 r5:c13f9300 r4:c1644ca0
[<c00d9fb8>] (vfs_ioctl+0x0/0x44) from [<c00da774>] (do_vfs_ioctl+0x558/0x5a0)
[<c00da21c>] (do_vfs_ioctl+0x0/0x5a0) from [<c00da814>] (sys_ioctl+0x58/0x7c)
[<c00da7bc>] (sys_ioctl+0x0/0x7c) from [<c0042ee0>] (ret_fast_syscall+0x0/0x30)
r8:c0043088 r7:00000036 r6:00000000 r5:00000000 r4:be93fbd8
Code: e59f22b0 e59f32b4 eb008632 e5943004 (e593900c)
---[ end trace 6349180229eee8fa ]---
Segmentation fault


It seems that the firmware loader is failing. I am assuming that there is a hardcoded reference that I missed somewhere that is putting data in the dsp region which is then getting overwritten. Does anyone have an idea where this remaining bad reference might be?

Thanks,

Ben

  • I haven't run into that particular problem, but we did need to modify our memory map and sort out some related problems. We use the RDK 2.8 for the 8148, and we found out that when you modify the memory map you need to make sure the FC_RMAN_IRES_c6xdsp.cfg is in sync with it. That file contains caching settings that should match the segments that you have the DSP code and data stored in.

    The Cache.MAR... registers are bitmaps, each bit representing 16MB of memory. If a bit is 0, it is marked as not cached for the DSP, if it is 1, it is cached.

    For example, we set "Cache.MAR160_191 = 0x0FFF0000"

    That controls caching for the second 512MB of RAM, setting the first 256MB of it as not cached, the next 192MB as cached, the final 64MB as not cached.

    There are other registers for other memory chunks.

    There are other memory settings that are in AMMU_m3.cfg, but we have not needed to change those.

  • Thanks for the response Brett. 

    After spending the day going through the errors I have a little more information. When a static buffer is declared at build, that space is set to zero by the elf loader in syslink. Some of the local variables are getting overwritten when this large buffer is cleared out by the loader. Since I am stuck in kernel land, I don't seem to be able to get a physical address of any of the structures so it is hard to say this with 100% certainty. However, i was previously getting error saying that kernel could not dereference the virtual pointer 00000000. I changed the memset so that the loader would set empty regions to all 0xFF and not I get errors that say it cannot dereference FFFFFFFF. So I am 99% sure this is happening. I cannot figure out WHY it is happening though. Why would syslink use memory outside of the linux region? Is there any place that tells syslink where to run out of? Also, is there any way to get an accurate physical address for a linux address in the syslink module? I tried Memory_translate and virt_to_phys, but when I connect with my JTAG those don't seem to be mapping correctly. 

    Ben

  • Please check your DMM interleaving in u-boot. It is possible that only 512MB is mapped. Easy way to check this is to first write different memory pattern from uboot at addresses 0x8000_0000,0x8800_0000,0x9000_0000,0x9800_0000 ... until 0xC000_0000. Then read back the values. If DMM interleaving is not correct, memory address will be reflected to same physical memory. If issue is with DMM interleaving pls check the TRM for correct DMM interlaving settings

  • Thank you! When I check memory addresses in uboot, 0xa0000000 - 0xc0000000 mirrors 0x80000000 - 0xa0000000. For future reference, a note should really be made in the guide that explains the memory dependencies. 

    Again, thanks!