Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when recompiling the bootrom with a new maskrom_mem address range and a new dtb address #233

Open
Caiyujie007 opened this issue Jun 12, 2024 · 1 comment

Comments

@Caiyujie007
Copy link

In the original design of Rocketchip, the dtb is fixed in the ROM code. I want to change the dtb after the bitstream is generated, so I add a SRAM on the MEM AXI4 BUS with address range (0xA0000000, 0xA0000000+0x00010000). I plan to upload the newly compiled bootrom.elf (with modified dtb) into the SRAM and then jump the PC to 0xA0000040 using JTAG. But I encountered a problem when recompiling bootrom.elf.
I firstly change the maskrom_mem address definition in "bootrom.lds", as :
MEMORY {
error_mem (rw) : ORIGIN = 0x00003000, LENGTH = 0x00001000
maskrom_mem (rx) : ORIGIN = 0xA0000000, LENGTH = 0x00010000
memory_mem (rwx) : ORIGIN = 0x80000000, LENGTH = 0x00002000
}
Then recompile the bootrom.elf, download and execute bootrom.elf using JTAG. The debian OS can boot up, but I find that the device tree leaves unchanged.
Then, I found there is a macro definition of "BOOTROM_DTB_ADDR" in "common.h", so I changed the value of "BOOTROM_DTB_ADDR" into :
#define BOOTROM_DTB_ADDR 0xA0000080
Then, I recompile the bootrom.elf, download and execute bootrom.elf using JTAG again, but found that the OpenSBI cannot be launched.
How can I launch the debian OS with the newly compiled dtb at address 0xA0000080? Thanks.

@Caiyujie007
Copy link
Author

I am currently modifying the generated Verilog code (system-XXX.v) to turn TLROM into a RAM that can be written externally. Then I used the AXI2SRAM IP to re-download the contents of TLROM via JTAG. Currently, I can modify the dtb after generating the bitstream, but there should be a more elegant way if the address of dtb (i.e., the value of register a1) can be modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant