On Tue, Jan 10, 2017 at 12:31 PM, Don A. Bailey <
do...@securitymouse.com> wrote:
> Hi All,
>
> Over lunch, I was taking a quick review of a previous email thread on Config
> Strings in RISC-V. I'm now thinking about it in the context of DTS. Are
> those implementing RISC-V cores using DTS as the model for configuration
> strings?
AFAIK only the Berkeley cores run general-purpose operating systems
and they use the DTS-inspired config strings.
> I made the joke in the last thread that I was concerned we were going in the
> direction of 1275. Ironically, the DTS specification seems to cite 1275 in
> its lineage. Though, I'm actually starting to understand why DTS is becoming
> more adopted.
>
> If you are using (or just pro-) DTS, can you describe why?
1. Because device tree works well for its intended use case ( multi-MB
kernels with drivers for every piece of hardware ), and it's a
Schelling point with ready support in multiple open-source kernels as
well as supporting utilities (QEMU can generate device trees
corresponding to its internal hardware model, etc).
2. If you're making a board-specific kernel for a board with <1 MB
memory, you are not in the device tree target audience, and that's OK.
3. If your kernel has out-of-band knowledge of the board, then your
kernel doesn't need to look at the device tree. You could still do a
strcmp() check to panic if the kernel and the board got out of sync,
or not if you prefer. _Just because it's there doesn't mean the
kernel is required to look at it_
4. For intermediate sizes (let's say 64KB to 1MB), you might have a
fixed set of drivers but still use the device tree to get the memory
map. This is also a valid design point.
5. Including it will make tethered debuggers happier, but it's
perfectly OK to have it and not use it in the kernel itself.
> My concerns are the same as the last thread, that DTS will be a challenge to
> parse correctly on constrained environments. My renewed interest is that if
2 & 3 above.
> my kernel uses DTS, I no longer have to have a board-specific port of my
> kernel for constrained environments (our kernel, Harvest, is also our
> bootloader). With DTS, we can still act as a bootloader, but in a more
> abstract way that makes us massively more portable than we were.
2 & 3.
> I may not like the complexity of DTS, but I can at least now see the
> argument for it.
DTS is a pretty ugly format to parse at runtime. Config string is
better, but needs a few small changes to align it with the device tree
data model, as well as a general spec clarification. FDT is also
better for parsing, but has a moderate disadvantage of being a
typeless binary format.
I'm on the fence about whether I prefer FDT or an evolved config
string, but I'm quite sure we want the device tree data model (a tree,
each node of which has key/value properties).
I can't seem to find any links for Harvest right now, but if you can
spare 8kb of _text_ and 100k instructions of startup time, FDT and
config-string can both be parsed with no heap and very little
data/stack; so if you're doing runtime configuration of the memory map
at all it might still be worth using config-string.
It's possible to design nonhierarchical systems that are marginally
simpler, but IMO would be a bad use of time to standardize anything
simpler than FDT/config string.
> Thanks for any thoughts.
-s