Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42786 )
Change subject: mb/amd: Add Pollock CRB Cereme as Mandolin variant ......................................................................
Patch Set 21:
(1 comment)
https://review.coreboot.org/c/coreboot/+/42786/21/src/mainboard/amd/mandolin... File src/mainboard/amd/mandolin/variants/cereme/early_gpio.c:
https://review.coreboot.org/c/coreboot/+/42786/21/src/mainboard/amd/mandolin... PS21, Line 4: ../../gpio.h
I look at the baseboard as providing:
- Common infrastructure that is used by all variants
- Header files that provide declarations for functions used by variants and common macro definitions used by all variants.
- Weak function implementations which can be easily overriden by variant if required.
In my opinion, this provides a flexible way for variants to utilize common code at the reference board level while still retaining the ability to override if required and it also removes a lot of duplication that we used to do early on without baseboard/variants.
So, mainboard top level provides support for basic boot flows and callbacks from other common code e.g. SoC, library, drivers, etc. Mainboard top level code then makes a variant_* call to perform some task. Now, this variant_* can either be the default implementation provided by baseboard or something that is variant specific. So, all this implementation whether provided by baseboard/variant all lives under variants/.
But, I would be curious to understand your proposal for "baseboard out of variants".
Oh, it's a very silly change. I agree that the baseboard concept is useful to keep things organized, but as it is currently implemented, things get really messy when there's multiple baseboards.
I'll use Zork as an example. There's two baseboards for Zork: Trembyle and Dalboz. AFAIUI, these baseboards are real boards, and also are a reference/example for ODMs that want to build their own Zork.
So, there would be a `mb/google/zork/baseboard` folder with the common baseboard files, and two `mb/google/zork/baseboard/trembyle` and `mb/google/zork/baseboard/dalboz` folders, each with the baseboard-specific devicetree and other stuff (everything with either `_trembyle` or `_dalboz` in the filename).
In addition, because Trembyle and Dalboz are real boards and thus need their own build targets, there would also be `mb/google/zork/variants/trembyle` and `mb/google/zork/variants/dalboz` folders (which already exist in the tree).