cnrv / fpga-rocket-chip

Wrapper for Rocket-Chip on FPGAs
Other
120 stars 26 forks source link

Failed to MMAP with DDR address(0x80000000) but could work with system port #15

Closed yzt000000 closed 3 years ago

yzt000000 commented 3 years ago

when I enable devmem in linux kernel, only system-port 's address could be mmap to virtual address.

the ddr address (>0x80000000) always failed to mmap.

wsong83 commented 3 years ago

My feeling is: this probably is something related to BBL or kernel configuration. I know it might be hard but can you dig further (I mean debug it further and see exactly what failed)?

yzt000000 commented 3 years ago

My feeling is: this probably is something related to BBL or kernel configuration. I know it might be hard but can you dig further (I mean debug it further and see exactly what failed)?

It seem that the kernel protects the memory used by itself. Did you think it has relationship with BBL? I found in RISCV linux, there are no "mmap.c" in arch/riscv/mm , not like arm or x86. and only "DEVMEM" could be configed.

wsong83 commented 3 years ago

BBL might some initial page protection in PMP or may be kernel would take over the full control, which I have no idea. This repo is just a hardware port of rocket-chip. Very little of the software has been touched, expect for a revised BBL.

yzt000000 commented 3 years ago

BBL might some initial page protection in PMP or may be kernel would take over the full control, which I have no idea. This repo is just a hardware port of rocket-chip. Very little of the software has been touched, expect for a revised BBL.

Thanks for your idea.

yzt000000 commented 3 years ago

BBL might some initial page protection in PMP or may be kernel would take over the full control, which I have no idea. This repo is just a hardware port of rocket-chip. Very little of the software has been touched, expect for a revised BBL.

start address and length must align to pagesize.