mb/supermicro/x11-lga1151-series: switch from dev.init to mb_ops.init

GPIO needs to be initialized before the IPMI device gets initialized,
so the GPIOs can be read/set by the code in CB:48096 and CB:48094. Thus,
use mainboard_ops.init for GPIO configuration instead of using the
indirection via a mainboard_enable function.

To make it more visible, that we use chip.init, rename `mainboard_init`
to `mainboard_chip_init`.

Tested successfully on X11SSM-F including the IPMI changes.

Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Change-Id: I192e69a34fa262b38bc40a95fb11c22a4041d0ae
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48083
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Michael Niewöhner 2020-11-23 13:36:52 +01:00
parent dc811c9ea3
commit e88dacfa43
3 changed files with 6 additions and 11 deletions

View File

@ -5,6 +5,6 @@
#include <device/device.h>
void variant_mainboard_init(struct device *dev);
void variant_mainboard_init(void *chip_info);
#endif /* _BASEBOARD_X11_LGA1151_SERIES_H */

View File

@ -5,24 +5,19 @@
#include <soc/ramstage.h>
#include <variant/gpio.h>
__weak void variant_mainboard_init(struct device *dev)
__weak void variant_mainboard_init(void *chip_info)
{
}
static void mainboard_init(struct device *dev)
static void mainboard_chip_init(void *chip_info)
{
/* do common init */
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
/* do variant init */
variant_mainboard_init(dev);
}
static void mainboard_enable(struct device *dev)
{
dev->ops->init = mainboard_init;
variant_mainboard_init(chip_info);
}
struct chip_operations mainboard_ops = {
.enable_dev = mainboard_enable,
.init = mainboard_chip_init,
};

View File

@ -5,7 +5,7 @@
#include <intelblocks/pcr.h>
#include <soc/pcr_ids.h>
void variant_mainboard_init(struct device *dev)
void variant_mainboard_init(void *chip_info)
{
// TODO: NMI; is this needed? vendor sets it
pcr_write32(0xae, 0x01e4, 0x00000004);