aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge/intel/lynxpoint/me_9.x.c
diff options
context:
space:
mode:
authorElyes HAOUAS <ehaouas@noos.fr>2018-12-05 10:59:42 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-12-07 11:22:20 +0000
commit1dcd8dbf760cd7b324d3a20f9e5f1c36fa95b5eb (patch)
tree85194b06b38468c7614820346f2aba4442477ebc /src/southbridge/intel/lynxpoint/me_9.x.c
parent012ef7735d6878ef63aa0315863636bfb88e6c1f (diff)
src/southbridge: Get rid of device_t
Use of device_t is deprecated. Change-Id: Ib4db9c263ff156966926f9576eed7e3cfb02e78a Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/30045 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/southbridge/intel/lynxpoint/me_9.x.c')
-rw-r--r--src/southbridge/intel/lynxpoint/me_9.x.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/src/southbridge/intel/lynxpoint/me_9.x.c b/src/southbridge/intel/lynxpoint/me_9.x.c
index 574a8308d6..1a0a68c9db 100644
--- a/src/southbridge/intel/lynxpoint/me_9.x.c
+++ b/src/southbridge/intel/lynxpoint/me_9.x.c
@@ -52,12 +52,16 @@ static const char *me_bios_path_values[] = {
[ME_DISABLE_BIOS_PATH] = "Disable",
[ME_FIRMWARE_UPDATE_BIOS_PATH] = "Firmware Update",
};
-static int intel_me_read_mbp(me_bios_payload *mbp_data, device_t dev);
+static int intel_me_read_mbp(me_bios_payload *mbp_data, struct device *dev);
#endif
/* MMIO base address for MEI interface */
static u32 *mei_base_address;
-void intel_me_mbp_clear(device_t dev);
+#ifdef __SIMPLE_DEVICE__
+void intel_me_mbp_clear(pci_devfn_t dev);
+#else
+void intel_me_mbp_clear(struct device *dev);
+#endif
#if IS_ENABLED(CONFIG_DEBUG_INTEL_ME)
static void mei_dump(void *ptr, int dword, int offset, const char *type)
@@ -112,7 +116,11 @@ static inline void mei_write_dword_ptr(void *ptr, int offset)
mei_dump(ptr, dword, offset, "WRITE");
}
-static inline void pci_read_dword_ptr(device_t dev, void *ptr, int offset)
+#ifdef __SIMPLE_DEVICE__
+static inline void pci_read_dword_ptr(pci_devfn_t dev, void *ptr, int offset)
+#else
+static inline void pci_read_dword_ptr(struct device *dev, void *ptr, int offset)
+#endif
{
u32 dword = pci_read_config32(dev, offset);
memcpy(ptr, &dword, sizeof(dword));
@@ -413,7 +421,11 @@ static inline int mei_sendrecv_mkhi(struct mkhi_header *mkhi,
* mbp give up routine. This path is taken if hfs.mpb_rdy is 0 or the read
* state machine on the BIOS end doesn't match the ME's state machine.
*/
-static void intel_me_mbp_give_up(device_t dev)
+#ifdef __SIMPLE_DEVICE__
+static void intel_me_mbp_give_up(pci_devfn_t dev)
+#else
+static void intel_me_mbp_give_up(struct device *dev)
+#endif
{
struct mei_csr csr;
@@ -429,7 +441,11 @@ static void intel_me_mbp_give_up(device_t dev)
* mbp clear routine. This will wait for the ME to indicate that
* the MBP has been read and cleared.
*/
-void intel_me_mbp_clear(device_t dev)
+#ifdef __SIMPLE_DEVICE__
+void intel_me_mbp_clear(pci_devfn_t dev)
+#else
+void intel_me_mbp_clear(struct device *dev)
+#endif
{
int count;
struct me_hfs2 hfs2;
@@ -657,7 +673,7 @@ static int me_icc_set_clock_enables(u32 mask)
}
/* Determine the path that we should take based on ME status */
-static me_bios_path intel_me_path(device_t dev)
+static me_bios_path intel_me_path(struct device *dev)
{
me_bios_path path = ME_DISABLE_BIOS_PATH;
struct me_hfs hfs;
@@ -727,7 +743,7 @@ static me_bios_path intel_me_path(device_t dev)
}
/* Prepare ME for MEI messages */
-static int intel_mei_setup(device_t dev)
+static int intel_mei_setup(struct device *dev)
{
struct resource *res;
struct mei_csr host;
@@ -757,7 +773,7 @@ static int intel_mei_setup(device_t dev)
}
/* Read the Extend register hash of ME firmware */
-static int intel_me_extend_valid(device_t dev)
+static int intel_me_extend_valid(struct device *dev)
{
struct me_heres status;
u32 extend[8] = {0};
@@ -804,7 +820,7 @@ static int intel_me_extend_valid(device_t dev)
}
/* Check whether ME is present and do basic init */
-static void intel_me_init(device_t dev)
+static void intel_me_init(struct device *dev)
{
struct southbridge_intel_lynxpoint_config *config = dev->chip_info;
me_bios_path path = intel_me_path(dev);
@@ -857,7 +873,8 @@ static void intel_me_init(device_t dev)
*/
}
-static void set_subsystem(device_t dev, unsigned vendor, unsigned device)
+static void set_subsystem(struct device *dev, unsigned int vendor,
+ unsigned int device)
{
if (!vendor || !device) {
pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
@@ -872,7 +889,7 @@ static struct pci_operations pci_ops = {
.set_subsystem = set_subsystem,
};
-static void intel_me_enable(device_t dev)
+static void intel_me_enable(struct device *dev)
{
/* Avoid talking to the device in S3 path */
if (acpi_is_wakeup_s3()) {
@@ -939,7 +956,7 @@ struct mbp_payload {
* mbp seems to be following its own flow, let's retrieve it in a dedicated
* function.
*/
-static int intel_me_read_mbp(me_bios_payload *mbp_data, device_t dev)
+static int intel_me_read_mbp(me_bios_payload *mbp_data, struct device *dev)
{
mbp_header mbp_hdr;
u32 me2host_pending;