by Taniwha · 3y ago · 0 comments
- Initialising the DRAM controller and sizing memory
- optionally doing some crypto auth of the OpenSBI/etc to make sure they're not bogus
- Copying OpenSBI (and possibly a subsequent U-boot or kernel) into it from ROMIs 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...
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.
For example, on IBM PC devices like keyboard or mouse or beeper had fixed addresses and it caused no issues.
Hum I don't really understand that one. Based on the article I understood that the code before SBI was directly bootrom, and usually bootrom doesn't init DRAM (at least that's not how rockchip/allwinner/amlogic SoCs behave). So what's the expectation on how SoC vendors implement DDR init code? It's expected that SoC vendor push this code to bootrom (thus costing more in maskrom)?
These days though SDRAM controllers are complex, and need careful tuning when the power comes on (and the chip heats up), the code that runs cycles to initialise DRAM is often very complex and proprietary.
If you're building a high performance chip you typically have very big wide L1 caches, and relatively wide paths to DRAM - you don't want to hamper them by having to attach them to a much slower 8-bit wide ROM (typically eMMC these days) - better to have boot code do the copy (eMMC looks like a fast SD card) - there are tricks you can do with L1 cache tag management that turns it into an SRAM until DRAM is initialised