fwupd/plugins/intel-spi/fu-ifd-common.h
Richard Hughes f3c64adb6c intel-spi: Allow downloading the firmware image from the eSPI controller
Add the IFD regions as child devices and set the region access on the child
devices. Also add read-only SPI descriptor as an HSI attribute and require
FLOCKDN on Intel hardware.

Use the hidden PCI 00:1f.5 device to set the SPIBAR automatically and generate
the quirk file automatically to support more hardware.
2021-04-01 21:56:35 +01:00

41 lines
1.0 KiB
C

/*
* Copyright (C) 2021 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include <gio/gio.h>
typedef enum {
FU_IFD_REGION_DESC = 0x00,
FU_IFD_REGION_BIOS = 0x01,
FU_IFD_REGION_ME = 0x02,
FU_IFD_REGION_GBE = 0x03,
FU_IFD_REGION_PLATFORM = 0x04,
FU_IFD_REGION_DEVEXP = 0x05,
FU_IFD_REGION_BIOS2 = 0x06,
FU_IFD_REGION_EC = 0x08,
FU_IFD_REGION_IE = 0x0A,
FU_IFD_REGION_10GBE = 0x0B,
FU_IFD_REGION_MAX = 0x0F,
} FuIfdRegion;
typedef enum {
FU_IFD_ACCESS_NONE = 0,
FU_IFD_ACCESS_READ = 1 << 0,
FU_IFD_ACCESS_WRITE = 1 << 1,
} FuIfdAccess;
#define FU_IFD_FREG_BASE(freg) (((freg) << 12) & 0x07FFF000)
#define FU_IFD_FREG_LIMIT(freg) ((((freg) >> 4) & 0x07FFF000) | 0x00000FFF)
const gchar *fu_ifd_region_to_string (FuIfdRegion region);
const gchar *fu_ifd_region_to_name (FuIfdRegion region);
const gchar *fu_ifd_access_to_string (FuIfdAccess access);
FuIfdAccess fu_ifd_region_to_access (FuIfdRegion region,
guint32 flash_master,
gboolean is_skylake);