Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Is there any merit in having UART at different addresses on different machines?

Is there any advantage to encumbering the ISA by having a fixed memory address?

If what you need is a debug console, use SBI Debug Console Extension[0].

Otherwise, get the address from the device tree, or from the pointer you've been passed by the SPL, if you are the SBI or you run without SBI.

Note that, in the first place, you will be accessing the UART registers using a register as base + an offset.

0. https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/s...



> Is there any advantage to encumbering the ISA by having a fixed memory address?

The software becomes much simpler. No need to parse any device trees. When something changes (for example, 128-bit quantum memory becomes available), simply make revision 2 for standard and move device addresses to other place.


You can certainly make some RISC-V platform standard that fixes addresses if you like -- as the PC did by totally copying IBM's machines -- but people want to avoid that.

There was a large ecosystem of MS-DOS computers before the IBM PC took over that had very diverse hardware and depended on the BIOS for compatibility.

We lost a lot when we all had to copy IBM's 640k RAM limit and A20 bug. Other, earlier, MS DOS machines allowed more RAM than that e.g. DEC Rainbow supported 896k of RAM. With a suitable expansion card the Sanyo MBC-550 could make 960k of RAM available to MSDOS.


>No need to parse any device trees.

If you just use the UART address that has been passed directly in a register, there's no need to look at the device tree.

If the UART base address was fixed, you'd normally need to load this base address in a register yourself and offset the hardware registers of the UART from it.

Yet, the way it actually is, this non-fixed base address is already in a register; You need to do even less work.


The problem with this approach is that usually there are more devices that registers. And registers are needed for other purposes rather than constantly storing UART's base address.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: