Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5814033pxb; Tue, 16 Feb 2021 08:13:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUwrQ8J/Cst4iNR8nPHmr5p6zlhf4ow4wcpTOyH/eEV2nFczpzvw4jvXpV5X9727uB3hUS X-Received: by 2002:a17:906:90d9:: with SMTP id v25mr19074418ejw.271.1613491999358; Tue, 16 Feb 2021 08:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613491999; cv=none; d=google.com; s=arc-20160816; b=VbP+iw9ZuLTgrqihk5WHhev0CJuvuZLWKpBWpodWYGMZGWPMOChGgBgUxAVhMbCUrm dQbeip4I3owTXpjFCl+Kk6viVHqBAV7Sho8Als1HqCTeoKEr/Im9kLhnbglG1+aFjhk6 ZXptk3N5EBblis50TOpln1FwMMfngHjwQprc/VbUPNs29IODcogWbuPNRnkSKv82CikF ekpiOkL6XZG86XJS0TJe8NvppPTlEFlK5WHfOXOah1fP/Cz1/1gHU0SMb9pWfiVL3QvU xc4hWWD/qXxhMv0Zgz0WBYckcuZQOjsdmVioQW3SNW86KId5k3fE9WhEbV71WDU4MF21 olPw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=j7SF9iWZ9/tMM9oaISY5C5wUIY+xq2h6U0K0jENu3I0=; b=hIGawye2doIM4Sa90be08WYW+U+FCkVSqa51i5Q/DMnS/rt8OyHUTgQ7Z85F8kEE+p VxPg2SeGQbyBmlYJdZb0QKwrFN6E7Pr25+qiV/VNBAue+tUsq0Vkd79VqrcvaGpOmKth vuWttGkgzCbwU08h1RFOSG35x2a4n37gAEUzLkf4t/PSHbsJsRFG5QVlIGk5QVlz8l8p hKRr1v7Sl7fVWhTDtEiwZOtmcir3V7z4fnCsInrPXUY8cpHZqI3sof0lEjvFAs0m5P7Y keEYV85XniSEiZJBKEAvGI6PauzmFElOxdoPUXHE4nTO+bKVt2EjoP32rdvWpJknFuAS q5iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt1si13507088ejc.377.2021.02.16.08.12.45; Tue, 16 Feb 2021 08:13:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbhBPQLV (ORCPT + 99 others); Tue, 16 Feb 2021 11:11:21 -0500 Received: from mga01.intel.com ([192.55.52.88]:31316 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbhBPQLK (ORCPT ); Tue, 16 Feb 2021 11:11:10 -0500 IronPort-SDR: OeJcOXnrtMjBQ3fYpvCrCp49g8SNUao9g+oaaQQDDpAdTBRn515sX1N+UKrUUfsoCp7p+LVR+e UnqxGDkZ8tOA== X-IronPort-AV: E=McAfee;i="6000,8403,9897"; a="202118498" X-IronPort-AV: E=Sophos;i="5.81,184,1610438400"; d="scan'208";a="202118498" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2021 08:08:01 -0800 IronPort-SDR: s0RaILNxhblE5wzIo9O/GIfFgjyDDk2ug2vYR/0LQuE+QAF7ejtbBcLTh7Wu6VcQ2QOOXQ73X9 Wu9YUx84Veow== X-IronPort-AV: E=Sophos;i="5.81,184,1610438400"; d="scan'208";a="493336645" Received: from gna-dev.igk.intel.com ([10.102.80.34]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2021 08:07:58 -0800 From: Maciej Kwapulinski To: Greg Kroah-Hartman , Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maciej Kwapulinski , Tomasz Jankowski , Savo Novakovic , Jianxun Zhang Subject: [PATCH v1 03/12] gna: read hardware info in the driver Date: Tue, 16 Feb 2021 17:05:16 +0100 Message-Id: <20210216160525.5028-4-maciej.kwapulinski@linux.intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210216160525.5028-1-maciej.kwapulinski@linux.intel.com> References: <20210216160525.5028-1-maciej.kwapulinski@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomasz Jankowski Get the hardware information from register MMIO_IBUFFS Signed-off-by: Tomasz Jankowski Tested-by: Savo Novakovic Co-developed-by: Jianxun Zhang Signed-off-by: Jianxun Zhang Signed-off-by: Maciej Kwapulinski --- drivers/misc/gna/gna_device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/misc/gna/gna_device.c b/drivers/misc/gna/gna_device.c index a6ef7e790e9e..869507594f9e 100644 --- a/drivers/misc/gna/gna_device.c +++ b/drivers/misc/gna/gna_device.c @@ -6,10 +6,13 @@ #include "gna_device.h" #include "gna_driver.h" +#include "gna_hw.h" static int gna_dev_init(struct gna_private *gna_priv, struct pci_dev *pcidev, const struct pci_device_id *pci_id) { + u32 bld_reg; + pci_set_drvdata(pcidev, gna_priv); gna_priv->parent = &pcidev->dev; @@ -17,6 +20,9 @@ static int gna_dev_init(struct gna_private *gna_priv, struct pci_dev *pcidev, gna_priv->info = *(struct gna_drv_info *)pci_id->driver_data; gna_priv->drv_priv = &gna_drv_priv; + bld_reg = gna_reg_read(gna_priv->bar0.mem_addr, GNA_MMIO_IBUFFS); + gna_priv->hw_info.in_buf_s = bld_reg & GENMASK(7, 0); + return 0; } -- 2.28.0