I have a system design that FPGA will generate data, and update to DDR3 of HPS. then notify (interrupts ) HPS. and HPS start to transmit data into PC via Ethernet.
I have few questions of software design in this architecture, please help me to find the solution.
Questions:
How to reserve DDR3 memory region in Linux OS ? (Linux OS will not use this segment of memory).
How to access reserved DDR3 memory region in Linux Application or Linux kernel ?
"
memmap=nn[KMG]$ss[KMG]
[KNL,ACPI] Mark specific memory as reserved.
Region of memory to be reserved is from ss to ss+nn.
Example: Exclude memory from 0x18690000-0x1869ffff
memmap=64K$0x18690000
or
memmap=0x10000$0x18690000
"
or you can also try reserved-memory in your device tree
in kernel /Documentation/devicetree/bindings/reserved-memory.txt
Hi,
I planned a similarly architecture in my application and will start to implement them now.
To write the data from FPGA, I can use the upper 512M from my 1GB RAM, when I set the parameter mem=512M in the u-boot scriptā¦? Is this true?
Have someone any good idea or solution to read the data (from Linux) which are located in the ddr memory? It should be also possible to process the data and write them back from the HPS. (In a further step, the data should be transmitted over Ethernet)
Where is the u-boot-scr file located? Can you elaborate on the steps required? Does only the uboot and perhaps preloader get modified to achieve this, and linux will inherit the reservation? Or do we have to rebuild linux?
hi!
you just create a u-boot.txt file with the kernel parameters
like this:
ā¦
setenv mmcboot "setenv bootargs console=ttyS0,115200 root=${mmcroot} mem=1020M memmap=4M$1020M rw rootwait;bootz ${loadaddr} - ${fdtaddr}"
run mmcload;
run mmcboot;
ā¦
Iāve started a design where FPGA uses own DMA to read/write to DDRAM attached to HPS. The tricky part seems to be reserve and found out physical memory adress for a buffer allocated in the app. Iām not reserving memory but instead allocate buffer then figuring out itās physical adress and provide this to DMA (Iām using Scatter Gather DMA). With small amounts of memory it works but I havenāt tested yet what happens with large buffers (beyond page size). Translation to physical adress is described in following link but itās more a hack than a portable solution.
Just discovered that this translation of virtual adress to physical doesnāt work in user space for me reliably. Sometimes it works but sometimes not!. So I switched to reserving memory and map this from /dev/mem by mmap.
Can please tell me how can I use the reserved-memory on a driver?
I have set a node as shown in the link you provided, but after that how can I request or use that memory in my device driver? I need to map that area in my driver.
Hiā¦i am a new user here. As per my knowledge the tricky part seems to be reserve and found out physical memory adress for a buffer allocated in the app. Iām not reserving memory but instead allocate buffer then figuring out itās physical adress and provide this to DMA. With small amounts of memory it works but I havenāt tested yet what happens with large buffers .
I have been able to reserve memory for FPGA and read it using mmap. The issue is the reads are slow. It takes roughly 16 ms to read 1 MByte of data (using memcpy) compared to 4ms for the same amount of data if the data were a local buffer. Any idea on how can we increase the access speed of this memory which is reserved fo FPGA direct access?
I am also having same requirement with my Intel Stratix-10, I am able to build the linux kernel, and by editing the kernel arguments, able to change the kernel start base address, I would like to access the DDR High memory 0x00000000 from Linux user space application. By using mmap operation I tried to access OCRAM=0xFFE00000 and able write to the OCRAM memory, But not able to access DDR.
I think we need to split DDR memory to user space/kernel space memory to access the DDR from Linux application. if any one able to access the DDR memory from ARM using Linux application. please help me. Thanks in advance