Yes, that is all you need to do. The
.img file is just a raw binary file containing the exact contents of the ROM. You can generate it however you want, such as attempting to reassemble the disassembly with your modifications, or even using a hex editor to replace the raw bytes in the existing
u500vc707devkit.img with the bytes that correspond to your desired instructions.
Alternatively, you can compile your own bootloader from scratch. The source code for the E300’s boot ROM is located at https://github.com/sifive/freedom/blob/f4375c22662f82b1b4f94e88b1aba6998b1f34ba/bootrom/xip/xip.S, which simply jumps to the address provided by the
XIP_TARGET_ADDR preprocessor variable. For example, to generate a version that jumps to 0x80000000:
$ riscv64-unknown-elf-gcc -nostartfiles -DXIP_TARGET_ADDR=0x80000000 -o xip.o xip.S -Wl,--section-start=.text=0x1000
$ riscv64-unknown-elf-objcopy -O binary xip.o bootrom.img