Attention is currently required from: Felix Singer, Nico Huber, Tim Wawrzynczak, Paul Menzel, Stefan Reinauer, Angel Pons, Kyösti Mälkki, Patrick Rudolph, Alexandru Gagniuc, ron minnich. Hello Felix Singer, build bot (Jenkins), Nico Huber, Tim Wawrzynczak, Paul Menzel, Stefan Reinauer, Angel Pons, Kyösti Mälkki, Patrick Rudolph, Alexandru Gagniuc, ron minnich,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/54135
to look at the new patch set (#3).
Change subject: [RFC] [POC] serialICE: integrate serialICE into the coreboot tree ......................................................................
[RFC] [POC] serialICE: integrate serialICE into the coreboot tree
serialICE is dead, long live serialICE!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TL;DR This change adds adds a new make target `serialice` which builds a separate image for the currently selected board that is compatible with the original serialICE firmware. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
serialICE once was based on the minimal base of coreboot. Since then, not much happened, besides porting the patches to newer versions of qemu, while coreboot evolved. It is still using ROMCC and changes like dynamic size of the bootblock never were ported. While this is not a problem for older platforms, serialICE would require rework to be able to use it on newer platforms, since the required code simply won't fit at the moment. * Also ROMCC has bugs.
Of course, it would be possible to backport things but why reinvent the wheel, when coreboot already has all we need? I would like to know, what you think of that idea, integrating serialICE into the coreboot tree, so there is no need to maintain a second project, which basically copies the miminal parts needed for booting from coreboot.
Roughly, the idea is to use already existing code of coreboot's bootblock (just the minimum to get a serial console working) and put the serialice stub on top. One can start porting a mainboard by just adding a `bootblock.c` (besides `Kconfig`, `Makefile.c`) which does mainboard-specific hardware setup like UART GPIOs. That also means, many boards should work out-of-box. We might want to add a Kconfig `MAINBOARD_SUPPORTS_SERIALICE` to guard `make serialice` but I don't think it's needed.
When bootblock code is needed, that wasn't added yet - like lpc - one has to add that to the according `Makefile.inc`. See CB:54144.
To build a regular coreboot image, just do as usual (`make ...`). For building a serialice stub image, type `make serialice`, which results in a `build/serialice.rom`, that can be flashed to the target board.
This patch series was tested on an out-of-tree Acer ES1-572.
The following changes are part of the series: - CB:54135 (this change) Copy an adapted version of `serialice.c`. The code should be rewritten, but it works fine as a PoC for now.
- CB:54136 drivers/uart,include/console: introduce helper `__uart_rx_byte` needed to access uart_rx_byte in a generic way just like tx
- CB:54137 include/console: introduce blocking uart read helper This helper will be used by serialICE in a loop. The standard implementation uses a timeout, but serialICE needs to block the loop.
- CB:54138 Makefile.inc: Generify build of `*.pre` and `*.rom` We also could create separate make targets but that would be copy-pasta once again, which should be avoided IMO.
- CB:54139 soc/intel/skl: implement minimal bootblock for serialICE Copy skl/bootblock.c to skl/serialice.c and minimize it, while staying bootable.
ALTERNATIVE: CB:54141 + CB:54142 : add !ENV_SERIALICE/ENV_SERIALCE to the existing bootblock code. Advantage: not duplicating code Disadvantage: code gets unreadable \o/
- CB:54140 introduce serialice stage
- introduce serialice stage - only add the bare minimum to get skl with lpss uart working - skip any unneeded code (!ENV_SERIALICE) - adapt Makefile.inc
- CB:54144 Add more stuff to serialice. I wasn't sure if I should add stuff like lpc, ec etc. while not being used by a board, yet. My idea would be that this gets added when needed, so we can keep the stage as minimal as possible. Can be discussed ofc.
Note: Please, do not review style for now. The patch series is quiet messy here and there but will be cleaned up as soon as this idea gets enough backing.
* See CB:54108, where I ported Acer ES1-572. All except MEM32 UART works, because the mem-based serial implementation blows up the bootblock, resulting in linker errors. I tried to move the main code out of the bootblock in CB:yyy but I didn't succeed, yet. Oh, and since I restructured stuff I trigger nice romcc bugs... :/
Signed-off-by: Michael Niewöhner foss@mniewoehner.de Change-Id: I6c5ad483d54cb2af7b549020dd23afb02bbc6a68 --- A src/include/serialice.h A src/lib/serialice.c 2 files changed, 456 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/54135/3