Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1613379rdb; Thu, 7 Dec 2023 04:25:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDjWj3wdUKrUqH9xaJ8qjmY7UEMtBSuYy+oQOgzrGvTKA14EWnxRSYo65vZxA6FCKSuIOV X-Received: by 2002:a05:6a00:1345:b0:6ce:7987:75fa with SMTP id k5-20020a056a00134500b006ce798775famr2186853pfu.14.1701951900729; Thu, 07 Dec 2023 04:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701951900; cv=none; d=google.com; s=arc-20160816; b=yRnWGGmpE+ZwPD8Bhh0UEcH4/MWOEhVTB5ymvJEl0wd6fk8l5vldFgTzZaSx14Uq8M Vu04bjvarVu48I0U2oi3ayFYFHiYnxlqOvMYW8LwVX9MqHcPwocUoz33CQlqHKNJDUW1 stGWWus3fcyyXTS7UWCrwOP+7qrKPya/C5IzoELRzatlm/sjzbHpHklXHxOTPTPytu+I SqNv6KWYVSLveyUxhy0k6h8DPjKjYeFMD3rvCUINkylgA9UDaC63nolSf/zAxWY9wqYG YjATp9uJzC2ONdtolAx0L2yPiTLchl/fija9vzuIaZtULcikFrwaKip+qo/GrU+uJr5t XdKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RMph0glGrVDD8VnWvcCDQoV6oWT36Cm7jbJJyIeMq4g=; fh=pV69nXZQ5S4LKVsTymEGwUxnyXrWvF/jryOMxSoe8tE=; b=x+weBPmY8Ga0on+Jp/hoWWaFMIqL2Yy4cgmwU3jpoyXFyQej4X8uG5Va4EAf/dLOyM 4SVqx/y9i73As9FYjUu3+mKFUc70kXPe1MD8pp/JlJ5sisqmalPMqpNWwrB7puUuTfTL 1ndVju3gsVa/OknMn191u38qQH3gNFx1BZSH7DxleYtOPtXqwmzGOxtlvzclDMHWzkbq ce2fE1QH3bvtO4AHb03fFMyyo9CDcDzWRYhKYPdQxvw3zmeru1xcgUrHgreL8vN9VyOP BufCCoTH0ifIhfSFoulZ36QPcOuCMZqFWMxY0tUdutN14b8lH/kg2CFHJlgg7JUf5cU2 jQQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mhrl3Zmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id x6-20020a056a00188600b006ce5357405fsi1172157pfh.9.2023.12.07.04.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 04:25:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mhrl3Zmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 17A76808A8D2; Thu, 7 Dec 2023 04:24:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379254AbjLGMYp (ORCPT + 99 others); Thu, 7 Dec 2023 07:24:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbjLGMYo (ORCPT ); Thu, 7 Dec 2023 07:24:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC40AD7F for ; Thu, 7 Dec 2023 04:24:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E23DC433C8; Thu, 7 Dec 2023 12:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701951889; bh=b3k0yhQCgpeSi1OnQRtgWWkuB5o+fZqueJOQrN6jfe8=; h=From:To:Cc:Subject:Date:From; b=mhrl3Zmr2Ew3ZZuhVVg12Z+dT/1mE7EANZGjTFyJh+xPhnzBEjegNLcld66ck5exh 043MkAUSqVwETMpAq+Bw+6eHaFjfrcrLY0dlX002ETNxTMLMtTlNTSACVI/LRxtMM/ Vn7QERquBX0p++zvfvpkmO7UQSYOGHij0ysPDLm1eQAYtmRf7ppnNODwXeUwch7ORN zH+bET+s9i8xX4bvZ2FGUgH2zxptfW02Lwar8e3xIg4jnLJmh29XE45GKNap/0vZEl XDtSc0UT/zzlxXahfNbSowiD3yz+edhtNjRILGWSl3U2K0apk6vuPnSiyzfO+Id3wA 20iYAf0MkpCgw== From: Oded Gabbay To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Ariel Suller Subject: [PATCH 1/5] accel/habanalabs: report 3 instances of Infineon second stage Date: Thu, 7 Dec 2023 14:24:40 +0200 Message-Id: <20231207122444.50512-1-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 04:24:58 -0800 (PST) From: Ariel Suller Infineon controller second stage has 3 instances that their version need to be reported by driver. Signed-off-by: Ariel Suller Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/sysfs.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/accel/habanalabs/common/sysfs.c b/drivers/accel/habanalabs/common/sysfs.c index 8d2164691d81..c940c5f1d109 100644 --- a/drivers/accel/habanalabs/common/sysfs.c +++ b/drivers/accel/habanalabs/common/sysfs.c @@ -8,6 +8,7 @@ #include "habanalabs.h" #include +#include static ssize_t clk_max_freq_mhz_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -80,12 +81,27 @@ static ssize_t vrm_ver_show(struct device *dev, struct device_attribute *attr, c { struct hl_device *hdev = dev_get_drvdata(dev); struct cpucp_info *cpucp_info; + u32 infineon_second_stage_version; + u32 infineon_second_stage_first_instance; + u32 infineon_second_stage_second_instance; + u32 infineon_second_stage_third_instance; + u32 mask = 0xff; cpucp_info = &hdev->asic_prop.cpucp_info; + infineon_second_stage_version = le32_to_cpu(cpucp_info->infineon_second_stage_version); + infineon_second_stage_first_instance = infineon_second_stage_version & mask; + infineon_second_stage_second_instance = + (infineon_second_stage_version >> 8) & mask; + infineon_second_stage_third_instance = + (infineon_second_stage_version >> 16) & mask; + if (cpucp_info->infineon_second_stage_version) - return sprintf(buf, "%#04x %#04x\n", le32_to_cpu(cpucp_info->infineon_version), - le32_to_cpu(cpucp_info->infineon_second_stage_version)); + return sprintf(buf, "%#04x %#04x:%#04x:%#04x\n", + le32_to_cpu(cpucp_info->infineon_version), + infineon_second_stage_first_instance, + infineon_second_stage_second_instance, + infineon_second_stage_third_instance); else return sprintf(buf, "%#04x\n", le32_to_cpu(cpucp_info->infineon_version)); } -- 2.34.1