From b0f89c7de8f3cac4952acc5f09539c0b879e58d9 Mon Sep 17 00:00:00 2001 From: Iwona Winiarska Date: Mon, 9 May 2022 20:05:59 +0200 Subject: peci: Extend peci client with Domain ID information Since PECI Target addressing has been changed to use Domain ID information, each peci_client instance should correspond with both CPU ID and Domain ID. Let's extend peci_client structure, sysfs API and intel-peci-client to use Domain ID. Make MFD device ID as a combination of peci adapter number, CPU ID and Domain ID. Signed-off-by: Iwona Winiarska --- include/linux/mfd/intel-peci-client.h | 4 ++-- include/linux/peci.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/mfd/intel-peci-client.h b/include/linux/mfd/intel-peci-client.h index 84b5882bcf31..0a069b87f733 100644 --- a/include/linux/mfd/intel-peci-client.h +++ b/include/linux/mfd/intel-peci-client.h @@ -114,7 +114,7 @@ peci_client_read_package_config(struct peci_client_manager *priv, msg.index = index; msg.param = param; msg.rx_len = 4; - msg.domain_id = 0; + msg.domain_id = priv->client->domain_id; ret = peci_command(priv->client->adapter, PECI_CMD_RD_PKG_CFG, sizeof(msg), &msg); if (msg.cc != PECI_DEV_CC_SUCCESS) @@ -149,7 +149,7 @@ peci_client_write_package_config(struct peci_client_manager *priv, msg.param = param; msg.tx_len = 4u; msg.value = data; - msg.domain_id = 0; + msg.domain_id = priv->client->domain_id; ret = peci_command(priv->client->adapter, PECI_CMD_WR_PKG_CFG, sizeof(msg), &msg); if (!ret) { diff --git a/include/linux/peci.h b/include/linux/peci.h index 5a707bbeb66d..d9e77c5773be 100644 --- a/include/linux/peci.h +++ b/include/linux/peci.h @@ -13,6 +13,7 @@ struct peci_board_info { char type[PECI_NAME_SIZE]; u8 addr; /* CPU client address */ + u8 domain_id; struct device_node *of_node; }; @@ -77,6 +78,7 @@ struct peci_client { struct device dev; struct peci_adapter *adapter; u8 addr; + u8 domain_id; char name[PECI_NAME_SIZE]; struct list_head detected; }; @@ -146,6 +148,6 @@ int peci_for_each_dev(void *data, int (*fn)(struct device *, void *)); struct peci_xfer_msg *peci_get_xfer_msg(u8 tx_len, u8 rx_len); void peci_put_xfer_msg(struct peci_xfer_msg *msg); int peci_command(struct peci_adapter *adpater, enum peci_cmd cmd, uint msg_len, void *vmsg); -int peci_get_cpu_id(struct peci_adapter *adapter, u8 addr, u32 *cpu_id); +int peci_get_cpu_id(struct peci_adapter *adapter, u8 addr, u8 domain_id, u32 *cpu_id); #endif /* __LINUX_PECI_H */ -- cgit v1.2.3