Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp617975pxf; Wed, 24 Mar 2021 11:40:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj1doqrtyCfLJ6E0fzPKEWQy51wqpwMgVNCBTC7RX1JX31W3a1Dp4Md5M7991zx1Z1PRkv X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr4960636eda.70.1616611215663; Wed, 24 Mar 2021 11:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616611215; cv=none; d=google.com; s=arc-20160816; b=ceg34VWxNb/pYbggnToAAO8+wkAcQNgxh6Gp5JJWnnl3vHoo292fuei25VPVYduQLh eQi8XbOz7igH2M9MlF+1g5dByBkxNA00cJ0sJ3UyOeyQ7zDGuhrCKD2MvNEo736nxTkW X1vmayGpJrWLs0QNFomCdnoclGg/foseFZJ5UrnDa5iCAu2HxO9TyVVzpNfY6q9gbtYk Myftnd1aCKVIA0ag+TwqC77nvxjBt/DS+SXBW29PkR7tqYr9+bCnAjyebKfv8MmL+1B1 7d0uwuumW3/6vXz1m9gpFO/2q3eysZ7Rwy5L1rFkDkz2HFovFzIV3wMxk9Ibhh9tmp0s /S5A== 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=zqhcJn9tcv6K+qLSQts+tLuQpHM48zmiRJd0F6HlCUQ=; b=Fgl56mHRugoqrTNCN12RhO4uTLQIrHBfhIsSMzMBCoEcuML/pnYaibd5jF6xhMEhFn EowafqggqzaV17GLGmU1ZEPgkmM4Bt2uCmuowWuygfo2wenWDnNihPM+x1q3YCpSwGj2 N84LFWgyRwaO7fx2IBYx3IjwzFDl8kNIbJlZxIeK5CC5dn478Eom8/xy5dDofJUQhw3A amR6IkRTfh2S6Mhv3sw4aDa4XD7SfYOZurn+CMe1c8uFI7QMeHNvTo2dUQ6Y3uy7gfOz 88C1x+UjnRlIl+keG1UNi6AlMGYxzjsxNaw8yKJg1lLZNl7tTuZmPkqMTtGaTXJ5YfYw Q9Sg== 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 a26si2296262edx.539.2021.03.24.11.39.52; Wed, 24 Mar 2021 11:40:15 -0700 (PDT) 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 S237697AbhCXSiz (ORCPT + 99 others); Wed, 24 Mar 2021 14:38:55 -0400 Received: from mga09.intel.com ([134.134.136.24]:17716 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237621AbhCXSiX (ORCPT ); Wed, 24 Mar 2021 14:38:23 -0400 IronPort-SDR: L5Hej4U88qeN2o+k3/PwoFkt6hRvB1W/ErgknWO28eV+eU5DCPz1c4m4GvovPGHWyX4WA0+3na 8tGn++UYFHFA== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="190859498" X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="190859498" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 11:38:23 -0700 IronPort-SDR: O9ibH8UfLSiHH4aEcHqHG84z89xw9HcF23fAouehVmhqNVfv/NwpE5EyXHJYptfVU5cz5o7aJs xtkqqFa0N8CA== X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="608203762" Received: from gna-dev.igk.intel.com ([10.102.80.34]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 11:38:20 -0700 From: Maciej Kwapulinski To: Greg Kroah-Hartman , Arnd Bergmann , Jonathan Corbet , Derek Kiernan , Dragan Cvetic , Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maciej Kwapulinski , Tomasz Jankowski , Savo Novakovic , Jianxun Zhang Subject: [PATCH v2 03/13] intel_gna: read hardware info in the driver Date: Wed, 24 Mar 2021 19:36:00 +0100 Message-Id: <20210324183610.4574-4-maciej.kwapulinski@linux.intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210324183610.4574-1-maciej.kwapulinski@linux.intel.com> References: <20210324183610.4574-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 Co-developed-by: Maciej Kwapulinski Signed-off-by: Maciej Kwapulinski --- drivers/misc/intel/gna/gna_device.c | 5 +++++ drivers/misc/intel/gna/gna_device.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/misc/intel/gna/gna_device.c b/drivers/misc/intel/gna/gna_device.c index 431113297879..6bac481b2247 100644 --- a/drivers/misc/intel/gna/gna_device.c +++ b/drivers/misc/intel/gna/gna_device.c @@ -12,12 +12,17 @@ static void 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; gna_priv->pdev = 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_base, GNA_MMIO_IBUFFS); + gna_priv->hw_info.in_buf_s = bld_reg & GENMASK(7, 0); } int gna_probe(struct pci_dev *pcidev, const struct pci_device_id *pci_id) diff --git a/drivers/misc/intel/gna/gna_device.h b/drivers/misc/intel/gna/gna_device.h index 39dc03d53feb..7704eeda90f6 100644 --- a/drivers/misc/intel/gna/gna_device.h +++ b/drivers/misc/intel/gna/gna_device.h @@ -23,6 +23,10 @@ struct gna_drv_info { struct gna_desc_info desc_info; }; +struct gna_hw_info { + u8 in_buf_s; +}; + struct gna_private { struct gna_driver_private *drv_priv; @@ -33,6 +37,7 @@ struct gna_private { /* device related resources */ void __iomem *bar0_base; struct gna_drv_info info; + struct gna_hw_info hw_info; }; int gna_probe(struct pci_dev *dev, const struct pci_device_id *id); -- 2.28.0