Prior to this commit, ownerboot had quite a lot of "magic addresses"
and flash chip layouts. This commit eliminates all of them.
All flash chip geometry is now computed from first principles and
two parameters:
1. The flash chip size
2. The number of images per chip (two means NORMAL/FALLBACK)
If (flash-chip-size / num-images) is too small, coreboot's build
process will notice this and fail.
It should be possible to build a single-image (i.e. no FALLBACK)
ownerboot for use on 8mbyte flash chips, which lets people try this
out without having to buy a new flash chip or (in the case of the
rk3399-gru-kevin laptop) doing any soldering.
This commit moves the `fmap` and `payload` arguments to `coreboot`
into the top-level scope, so they can be provided without needing to
override the `coreboot` expression.
This commit causes the coreboot payload (i.e. the Linux kernel,
initramfs, and any necessary DTBs) to be inserted into the coreboot
image as part of a separate derivation from the one which compiles
coreboot.
As a result, changing the contents of the initramfs is extremely
fast -- it can now be done without any recompilation.
As a result of this, the attribute name for the final image to be
flashed has changed from `coreboot` to `image`. The `coreboot`
attribute now builds a payloadless `coreboot.rom`.
This commit drops the verbatim `.config` files for coreboot that
were previously in the repository and converts them to NixOS-style
module configurations.
The big benefit of doing this is that the perl script in nixpkgs
that handles this will check to make sure that coreboot's Kconfig
machinery isn't silently ignoring any of our settings. It also
makes this configuration easier for end-users to customize.
This commit cleans up the selection of the serial console device and
gives it sensible default values (usually, the DB9 header on the
back I/O panel) on each platform.
This commit generalizes the selection and activation of the serial
console by promoting it to a top-level package-set member.
The top-level package set is starting to attract clutter, so I will
soon be moving all the non-package constitutents into a `config`
attrset.
This commit makes `hostPlatform` part of the packageset for more
consistent handling. A top-level `hostPlatform` argument is exposed
to the caller, in case they want to customize the `hostPlatform`
(compiler flags, etc).
The `hostPlatform` argument is inherited into the ownerboot package
set, where it will be overridden by `src/platform/*.nix` if it has
not been set explicitly.
Making `hostPlatform` part of the package set allows for more
sophisticated overriding schemes, for example adding additional
compiler flags or sanity-checking the flags that the user has
provided.