riscvarchive / riscv-qemu

QEMU with RISC-V (RV64G, RV32G) Emulation Support
385 stars 154 forks source link

does U500 UART is incompatible with E310 UART? #54

Closed frantony closed 7 years ago

frantony commented 7 years ago

@sorear It looks like the SiFive U500 Coreplex UART model (introduced by 896ef7a9938fd578710f6d162a3ccd6be7a4f5fc) is incompatible with SiFive E310 UART because it uses different register layout (please see E310 register layout in
https://github.com/sifive/freedom-e-sdk/blob/master/bsp/include/sifive/devices/uart.h and in https://github.com/sifive/sifive-blocks/blob/master/src/main/scala/devices/uart/UARTCtrlRegs.scala).

If this incompatibility is intentional and U500 uses it's own UART IP-block then we have to rename U500 UART model in qemu code. If U500 uses the same UART IP-block as E310 does then we have too fix SiFive UART model in qemu code.

sorear commented 7 years ago

@frantony Actually what happened is that SiFive changed the register layout of the UART. QEMU implements the old version, which matches the git hash for freedom-u-sdk in the README. The most recent freedom-u-sdk does not work with qemu because of the UART incompatibility, either.

Updating the UART model would be a good change for a PR, but as part of testing any such PR I'd like to make sure if can boot at least one version of freedom-u-sdk (and update the README to point to a new-UART freedom-u-sdk instead of an old-UART version).

aswaterman commented 7 years ago

The config string for the UART should contain a version number.