drivers/amd/opensil/mpio: Factor out common MPIO symbols from vendorcode

Refactor vendorcode MPIO configuration functions to be invoked from
the openSIL driver.

Change-Id: I8b1f92f08565216dd93203a06015e3eec1e7bb69
Signed-off-by: Nicolas Kochlowski <nickkochlowski@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/85632
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Nicolas Kochlowski 2024-12-23 12:22:22 -03:00 committed by Felix Held
commit afeec465f1
18 changed files with 200 additions and 163 deletions

View file

@ -2,6 +2,8 @@
ifeq ($(CONFIG_OPENSIL_DRIVER),y)
subdirs-y += mpio
ramstage-y += ramstage.c
endif

View file

@ -0,0 +1,3 @@
## SPDX-License-Identifier: GPL-2.0-only
ramstage-$(CONFIG_OPENSIL_DRIVER) += chip.c

View file

@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include <vendorcode/amd/opensil/opensil.h>
#include "chip.h"
#include "../opensil.h"
struct chip_operations drivers_amd_opensil_mpio_ops = {
.name = "AMD MPIO",
};
void configure_mpio(void)
{
opensil_mpio_global_config();
/* Find all devices with this chip that are directly below the chip */
for (struct device *dev = &dev_root; dev; dev = dev->next)
if (dev->chip_ops == &drivers_amd_opensil_mpio_ops &&
dev->chip_info != dev->upstream->dev->chip_info)
opensil_mpio_per_device_config(dev);
}

View file

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef OPENSIL_MPIO_CHIP_H
#define OPENSIL_MPIO_CHIP_H
#include CONFIG_AMD_OPENSIL_MPIO_CHIP_H_FILE
#endif /* OPENSIL_MPIO_CHIP_H */

View file

@ -5,5 +5,7 @@
/* Set up openSIL env and call TP1 */
void amd_opensil_silicon_init(void);
/* Set global and per-device MPIO configurations */
void configure_mpio(void);
#endif /* OPENSIL_DRIVER_H */

View file

@ -3,11 +3,13 @@
#include <bootstate.h>
#include <vendorcode/amd/opensil/opensil.h>
#include "mpio/chip.h"
#include "opensil.h"
void amd_opensil_silicon_init(void)
{
setup_opensil();
configure_mpio();
opensil_xSIM_timepoint_1();
}