On Mon, Sep 15, 2014 at 10:39 AM, Till Klocke <
till....@gmail.com> wrote:
> So if I understand this correctly: Depthcharge is for deciding which kernel
> and rootfs to boot and booting it. Coreboot initializes the hardware and
> loads depthcharge, but depthcharge chould also be loaded by something
> different (like U-Boot, barebox, an x86 BIOS etc.)? But if Coreboot just
> initializes the hardware, why not move this functionality to depthcharge?
> This way you have to modify to projects with low level hardware stuff and no
> possibility of sharing code.
I think that's a fair assessment w.r.t. making changes in 2 different
places. However, the code in depthcharge is more of driver
infrastructure for peripherals. I can't recall any hardware
initialization in depthcharge off the top of my head, but this may be
a disagreement in terms. I consider "hardware initialization" to be
setting up memory, configuring gpios per board use, etc.
You are right that it is possible to place the code/logic on either
side of the current coreboot/depthcharge split. And for certain
drivers, that definitely requires duplication. I'm not a fan of code
duplication either, but this how things are currently structured --
for better or worse. I will say, though, that having the vast majority
of the hardware bits in coreboot (or a single place) allows for reuse
of the SoC support. Since coreboot is designed to be agnostic to the
"payload" (depthcharge in ChromeOS) then it means people can reuse
that support for an SoC while using a different kernel loader w/o
being married to ChromeOS's kernel loader.
Hope that helps.
-Aaron