- x86: various improvements made in getting Chromium OS verified boot
  running on top of coreboot, booting into U-Boot.
This commit is contained in:
Tom Rini
2021-07-15 11:06:24 -04:00
22 changed files with 221 additions and 40 deletions

View File

@@ -21,6 +21,7 @@
#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
#include <asm/fsp/fsp_support.h>
#endif
#include <dt-bindings/pci/pci.h>
#include <linux/delay.h>
#include "pci_internal.h"
@@ -164,7 +165,7 @@ int dm_pci_bus_find_bdf(pci_dev_t bdf, struct udevice **devp)
}
static int pci_device_matches_ids(struct udevice *dev,
struct pci_device_id *ids)
const struct pci_device_id *ids)
{
struct pci_child_plat *pplat;
int i;
@@ -181,7 +182,7 @@ static int pci_device_matches_ids(struct udevice *dev,
return -EINVAL;
}
int pci_bus_find_devices(struct udevice *bus, struct pci_device_id *ids,
int pci_bus_find_devices(struct udevice *bus, const struct pci_device_id *ids,
int *indexp, struct udevice **devp)
{
struct udevice *dev;
@@ -201,7 +202,7 @@ int pci_bus_find_devices(struct udevice *bus, struct pci_device_id *ids,
return -ENODEV;
}
int pci_find_device_id(struct pci_device_id *ids, int index,
int pci_find_device_id(const struct pci_device_id *ids, int index,
struct udevice **devp)
{
struct udevice *bus;
@@ -681,6 +682,34 @@ static bool pci_match_one_id(const struct pci_device_id *id,
return false;
}
/**
* pci_need_device_pre_reloc() - Check if a device should be bound
*
* This checks a list of vendor/device-ID values indicating devices that should
* be bound before relocation.
*
* @bus: Bus to check
* @vendor: Vendor ID to check
* @device: Device ID to check
* @return true if the vendor/device is in the list, false if not
*/
static bool pci_need_device_pre_reloc(struct udevice *bus, uint vendor,
uint device)
{
u32 vendev;
int index;
for (index = 0;
!dev_read_u32_index(bus, "u-boot,pci-pre-reloc", index,
&vendev);
index++) {
if (vendev == PCI_VENDEV(vendor, device))
return true;
}
return false;
}
/**
* pci_find_and_bind_driver() - Find and bind the right PCI driver
*
@@ -769,7 +798,9 @@ static int pci_find_and_bind_driver(struct udevice *parent,
* precious memory space as on some platforms as that space is pretty
* limited (ie: using Cache As RAM).
*/
if (!(gd->flags & GD_FLG_RELOC) && !bridge)
if (!(gd->flags & GD_FLG_RELOC) && !bridge &&
!pci_need_device_pre_reloc(parent, find_id->vendor,
find_id->device))
return log_msg_ret("notbr", -EPERM);
/* Bind a generic driver so that the device can be used */

View File

@@ -114,7 +114,7 @@ static bool ich9_can_do_33mhz(struct udevice *dev)
struct ich_spi_priv *priv = dev_get_priv(dev);
u32 fdod, speed;
if (!CONFIG_IS_ENABLED(PCI))
if (!CONFIG_IS_ENABLED(PCI) || !priv->pch)
return false;
/* Observe SPI Descriptor Component Section 0 */
dm_pci_write_config32(priv->pch, 0xb0, 0x1000);
@@ -632,7 +632,7 @@ static int ich_spi_get_basics(struct udevice *bus, bool can_probe,
if (device_get_uclass_id(pch) != UCLASS_PCH) {
uclass_first_device(UCLASS_PCH, &pch);
if (!pch)
return log_msg_ret("uclass", -EPROTOTYPE);
; /* ignore this error since we don't need it */
}
}

View File

@@ -18,8 +18,6 @@
#include <acpi/acpi_device.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch/iomap.h>
#include <asm/arch/pm.h>
#include <linux/delay.h>
#include <dm/acpi.h>