Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp15155099ybl; Tue, 31 Dec 2019 02:31:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwnkC1IVUmkivQz1qvtlqYwLrwf7d0qEEMNmtYIcDZ4S0/uo2OPJvGTNIwzQ1CE9P3iCGRe X-Received: by 2002:a9d:650f:: with SMTP id i15mr62004752otl.97.1577788289230; Tue, 31 Dec 2019 02:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577788289; cv=none; d=google.com; s=arc-20160816; b=baExfGY1tYASbUGA+mkc5ltQEnqAyIuRpgbUh1TYKBy7NT+5Tz6OfPCWrXFMcXUZ3E ZPA8Hx1nC3YKtSTuymDFNo4BLng3ooMWVcu0sSLjDtYF3iqNxKBeD72PCXE3GhT/zOTT JeE3HNvmhaSYv2JHemLaBTVOo2S4MVZnqdUZUDJS/Q8v4cbdY+oEQzF0TjMvTchdQCBR 5hZutIYGmOlpTaYhLUDej7S3gvMx3bVTtvgFTyVD9Fl/2FFCHFg183YSMonAO9pDbDy7 L8eBxn3MPclCtxcZxhieI2NVL4D5gZMicQ+PEgjW2inHfPFvnbtsfubEARlTGXcQJ034 4aSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=egZUF2Q2oUn96W11vTO30v63+Fstyn/dxIMfqKPmgcE=; b=Z8QjnMS9lHlDU6pSL5otwkGf/rf2Z5isv0r1yWblefPWz9+X3uR+xdj6FfRjlLL1dP jkg5Zjr2lJ1kn/qUUkUWo4WD1cbV23R9WK+aI9a/wuNqZ4feUBsT1tRJbUVmR4QSF3ok YHER2aiHyv2gTJadtn03f6kJAU2qJ6Qvs6CUJM3hnoiY3wsqZPvP5dpFGuEFCwkheoXw 80skk4/1YwdtXqiPp7b9KoVINbSS4+TsktfOnB+m6hhFQsD+QG7+Ss/EIPcIUWVpxKXo ZJEucWGyxowrI/Jblbkaq3fM6M38maiN7cyXCBVJGpSe0FE04qZWz4N553aTL+/CVIdM 541A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t15si20512297oij.189.2019.12.31.02.31.17; Tue, 31 Dec 2019 02:31:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727165AbfLaK3f (ORCPT + 99 others); Tue, 31 Dec 2019 05:29:35 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:60239 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727133AbfLaK3b (ORCPT ); Tue, 31 Dec 2019 05:29:31 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from vadimp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 31 Dec 2019 12:29:27 +0200 Received: from r-build-lowlevel.mtr.labs.mlnx. (r-build-lowlevel.mtr.labs.mlnx [10.209.0.190]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xBVATJ7e008518; Tue, 31 Dec 2019 12:29:27 +0200 From: Vadim Pasternak To: andy@infradead.org, dvhart@infradead.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Vadim Pasternak Subject: [PATCH platform-next v1 7/9] platform/x86: mlx-platform: Add support for new capability register Date: Tue, 31 Dec 2019 10:29:15 +0000 Message-Id: <20191231102917.24181-8-vadimp@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191231102917.24181-1-vadimp@mellanox.com> References: <20191231102917.24181-1-vadimp@mellanox.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for capability register, which contains information about the number of PS units equipped on the system and about minimum I2C frequency supported by the all system's I2C devices. Utilization of this register allows to avoid necessity of providing new system description, in case it differs in number of PS units or in minimal I2C frequency. Signed-off-by: Vadim Pasternak --- drivers/platform/x86/mlx-platform.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 31c04ee53989..ac789f98c8b8 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -90,6 +90,7 @@ #define MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET 0xf6 #define MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET 0xf7 #define MLXPLAT_CPLD_LPC_REG_TACHO_SPEED_OFFSET 0xf8 +#define MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET 0xf9 #define MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET 0xfb #define MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET 0xfc #define MLXPLAT_CPLD_LPC_IO_RANGE 0x100 @@ -123,12 +124,16 @@ #define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6) #define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0) #define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0) +#define MLXPLAT_CPLD_PSU_EXT_MASK GENMASK(3, 0) +#define MLXPLAT_CPLD_PWR_EXT_MASK GENMASK(3, 0) #define MLXPLAT_CPLD_FAN_MASK GENMASK(3, 0) #define MLXPLAT_CPLD_ASIC_MASK GENMASK(1, 0) #define MLXPLAT_CPLD_FAN_NG_MASK GENMASK(5, 0) #define MLXPLAT_CPLD_LED_LO_NIBBLE_MASK GENMASK(7, 4) #define MLXPLAT_CPLD_LED_HI_NIBBLE_MASK GENMASK(3, 0) #define MLXPLAT_CPLD_VOLTREG_UPD_MASK GENMASK(5, 4) +#define MLXPLAT_CPLD_I2C_CAP_BIT 0x04 +#define MLXPLAT_CPLD_I2C_CAP_MASK GENMASK(5, MLXPLAT_CPLD_I2C_CAP_BIT) /* Masks for aggregation for comex carriers */ #define MLXPLAT_CPLD_AGGR_MASK_CARRIER BIT(1) @@ -1937,6 +1942,7 @@ static bool mlxplat_mlxcpld_readable_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: case MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_TACHO_SPEED_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET: @@ -2007,6 +2013,7 @@ static bool mlxplat_mlxcpld_volatile_reg(struct device *dev, unsigned int reg) case MLXPLAT_CPLD_LPC_REG_FAN_CAP2_OFFSET: case MLXPLAT_CPLD_LPC_REG_FAN_DRW_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_TACHO_SPEED_OFFSET: + case MLXPLAT_CPLD_LPC_REG_PSU_I2C_CAP_OFFSET: case MLXPLAT_CPLD_LPC_REG_CONFIG1_OFFSET: case MLXPLAT_CPLD_LPC_REG_CONFIG2_OFFSET: case MLXPLAT_CPLD_LPC_REG_UFM_VERSION_OFFSET: -- 2.11.0