Hi everyone,
I just boot my code, linux embbeded inside the OMAP3530 (Beagle Board EVM) and test the code using insmod bridgedriver.ko.
As we're now designing a device which uses a vocoder algorithm that needs DSP engine, its code can't be allocated either in L1D, L1P or L2 at all.
That's the reason why I'm doing some improvements such as code allocation need other review. I'm not using CCS, I've just made a driver which starts DSP, and a main program at DSP side containing the algorithm code.
In doing so I've thought next tasks:
Use of MMU allocation, this is, I'll define MEMORY range within the 0x11000000 to 0xFFFFFFFF at DSP side in boot.cmd of 64 KB.
At DSP driver (L3 interconnect) I define a buffer u_int8_t LBUFFER [64*1024].
And I'm trying to configure IVA 2.2 MMU for transalating the range upside at DSP side to external memory at SDRAM.
I'm using one TLB entry and no TWL stuff, LARGE PAGE.
void init_MMU(void)
{
u32 phys_addr, addr;
unsigned int tbl_entry =0;
/* reset MMU and initiliaze*/
/*AUTO_IDLE MODE*/
addr = (u32) LBUFFER; /*virtual address of LBUFFER*/
phys_addr = virt_to_phys((void*)LBUFFER);
MMU_LOCK = tbl_entry <<10 | tbl_entry <<4;
/*Virtual tag of DSP, protection, valid TLB and type of section or page*/
MMU_CAM = (0x11000000 | 0xfffff000) | TLB_PROTECTED | TLB_VALID_ENTRY | LARGE_PAGE;
MMU_RAM = (phys_addr & 0xfffff000) | TLB_CPU_SIZE;
/*Physical address tag of SDRAM*/
MMU_LD_TLB = LDTLBITEM;
/*Loading that entry in TLB */
MMU_LOCK = ((tbl_entry +1) <<4);
/*Locking that entry by increasing the TLB VICTIM pointer*/
}
Once done this I'm trying to write at DSP side a variable which exactly points at
0x11000000 address and seeing the result at the driver (when I execute insmod).
int * p;
p =(int*)0x11000000;
*p = 0x12345678;
And at driver side I'm checking the result:
printk ("LBUFFER[%d] = %lx \n", 0,LBUFFER[0]);
But the result is 0 :(
Maybe it's an alignment problem . Perhaps I should align the LBUFFER[64*1024] into an address which alignment is 0xXXXX0000 (64KB), by example defining a bigger LBUFFER [1024*1024] and taking only an area aligned to 64 KB:
Remember the init_MMU function:
if the virtual addr is 0xbf09ce87 and I take the starting address at 0xbf0a0000 (with a certain offset) maybe it works but at the moment I haven't succeded.
Can anyone help me,please?