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:
parent
cf29b45866
commit
afeec465f1
18 changed files with 200 additions and 163 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
ifeq ($(CONFIG_OPENSIL_DRIVER),y)
|
||||
|
||||
subdirs-y += mpio
|
||||
|
||||
ramstage-y += ramstage.c
|
||||
|
||||
endif
|
||||
|
|
|
|||
3
src/drivers/amd/opensil/mpio/Makefile.mk
Normal file
3
src/drivers/amd/opensil/mpio/Makefile.mk
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
ramstage-$(CONFIG_OPENSIL_DRIVER) += chip.c
|
||||
22
src/drivers/amd/opensil/mpio/chip.c
Normal file
22
src/drivers/amd/opensil/mpio/chip.c
Normal 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);
|
||||
}
|
||||
8
src/drivers/amd/opensil/mpio/chip.h
Normal file
8
src/drivers/amd/opensil/mpio/chip.h
Normal 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 */
|
||||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue