I'm working with the IPC 3.23 ex02_messageq example (OMAP54XX_linux_elf), and I could use some help on modifying this project to access L3 main memory (e.g. GPMC registers).
From "ex02_messageq/dsp/DspAmmu.cfg," the AMMU configuration seems to already support Q2-Q3 L3 access, which includes the GPMC address range (0x50000000-0x51FFFFFF) as shown below:
/* Peripheral regions: Large Page (512M); non-cacheable, posted */ /* config large page[1] to map 512MB VA 0x40000000 to L3 0x5FFFFFFF */ AMMU.largePages[1].pageEnabled = AMMU.Enable_YES; AMMU.largePages[1].logicalAddress = 0x40000000; AMMU.largePages[1].size = AMMU.Large_512M; AMMU.largePages[1].L1_cacheable = AMMU.CachePolicy_NON_CACHEABLE; AMMU.largePages[1].L1_posted = AMMU.PostedPolicy_POSTED; AMMU.largePages[1].L1_allocate = AMMU.AllocatePolicy_ALLOCATE; AMMU.largePages[1].L1_writePolicy = AMMU.WritePolicy_WRITE_THROUGH; AMMU.largePages[1].L2_cacheable = AMMU.CachePolicy_NON_CACHEABLE; AMMU.largePages[1].L2_posted = AMMU.PostedPolicy_POSTED; AMMU.largePages[1].L2_allocate = AMMU.AllocatePolicy_ALLOCATE; AMMU.largePages[1].L2_writePolicy = AMMU.WritePolicy_WRITE_THROUGH;
I noticed that address translation is disabled for each page, which I'm assuming is ok for now. This should also imply that the DSP can access L3 directly using a physical address.
Based on what I see, the AMMU config doesn't need to be modified, and it's probably safe to assume the DSP's MMU is configured during BIOS initialization.
I'm not sure if the next step is required, but I added the GPMC register address range to the DSP's memory map. This was done by modifying "config.bld" as shown below:
Build.platformTable["ti.platforms.sdp5430:dsp"] = { externalMemoryMap: [ [ "EXT_CODE", sdp5430_ExtMemMapDsp.EXT_CODE ], [ "EXT_DATA", sdp5430_ExtMemMapDsp.EXT_DATA ], [ "EXT_HEAP", sdp5430_ExtMemMapDsp.EXT_HEAP ], [ "TRACE_BUF", sdp5430_ExtMemMapDsp.TRACE_BUF ], [ "EXC_DATA", sdp5430_ExtMemMapDsp.EXC_DATA ], [ "PM_DATA", sdp5430_ExtMemMapDsp.PM_DATA ], [ "GPMC_REG", { name: "GPMC_REG", base: 0x50000000, len: 0x02000000, space: "data", access: "RW" } ], ], codeMemory: "EXT_CODE", dataMemory: "EXT_DATA", stackMemory: "EXT_DATA", };
At this point, I think I'm done, so I update the DSP with the following code snippet to access the GPMC revision address:
#define GPMC_REVISION_PTR ((volatile uint32*) (0x50000000)) unsigned int val = *BASE_PTR;
which results in the following error while booting the kernel (Linux):
[ 6.180908] remoteproc0: Booting fw image tesla-dsp.xe64T, size 5860016 [ 6.201049] omap-iommu omap-iommu.0: mmu_dsp: version 2.0 [ 6.223510] remoteproc0: remote processor dsp is now up [ 6.268402] omap-iommu omap-iommu.0: iommu fault: da 0x50000000 flags 0x0 [ 6.268432] remoteproc0: crash detected in dsp: type mmufault [ 6.268432] omap-iommu omap-iommu.0: mmu_dsp: errs:0x00000002 da:0x50000000 pgd:0xecfb9400 *pgd:px00000000 [ 6.269683] omap-rproc omap-rproc.0: received echo reply from dsp [ 6.269744] remoteproc0: handling crash #1 in dsp [ 6.269744] remoteproc0: recovering dsp [ 6.272186] ------------[ cut here ]------------ [ 6.272186] WARNING: at drivers/bus/omap_l3_noc.c:113 l3_interrupt_handler+0x13c/0x17c() [ 6.272186] L3 custom error: MASTER:MPU TARGET:L4CFG
I'm obviously missing something here, and would appreciate any assistance.
Thanks!