Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33142 )
Change subject: Kconfig: Create coreboot separate stage kconfigs ......................................................................
Patch Set 4:
And if we have stage definitions then only we could pick stages from mainboard or soc.
I'm still very skeptical about this mainboard and SoC argument... can you give a real example where you would want the mainboard to disable a stage without a new top-level Kconfig that changes code flow? All the stage transition code is common code -- a mainboard can't just decide to skip a stage without making sure the rest of coreboot can accommodate that.
Hi Julius, building on your careful comments here, are you ok with the goal that we can, on a per stage basis, pick what to build and include in the ROM?
I think we should cover all the explicit use cases that people have. But I don't think it makes sense that you can go into menuconfig and individually enable/disable every stage. Because having a bootblock and a ramstage without a romstage, for example, doesn't really make sense (maybe it will make sense one day in the context of a special feature, but then wouldn't that feature have an explicit Kconfig we'd use to decide that?).
I just had a requirement drop in my lap that's kind of interesting: the need to build a coreboot.rom with ONLY a ramstage and a payload, to be passed to kexec. This is the converse of RAMPAYLOAD.
This sounds to me like you'd want to add a new CONFIG_RAMSTAGE_ONLY or CONFIG_KEXECUTABLE or something like that, but it would be a new toplevel Kconfig that will control more things than just whether the other stage files are built, right? (For example, depending on the platform and exact use case it may need to do things like stack or page table setup that are normally expected to already be done by previous stages.)
(I'm also not sure if this is a good idea in general. I assume what you're trying to do is boot rampayload into LinuxBoot but then have the option to still run through coreboot's ramstage if the user selects to do it? So then your plan is to build coreboot twice -- once with RAMPAYLOAD and once with the option that makes it ramstage-only? Wouldn't it make more sense to just have another option -- dependent on RAMPAYLOAD -- that makes a single coreboot build output two CBFS files: the main coreboot.rom with all stages up to the rampayload and a second coreboot.kexec.rom that just has the ramstage and second payload?)