Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp543604pxj; Thu, 13 May 2021 10:48:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2qUcmwnDJhYcguAp4MmUQzbs/3js+lpVqBx/ZrwLPsDYOZ1K5JdrqjXylGysTe5lWmtNg X-Received: by 2002:aca:1101:: with SMTP id 1mr3725340oir.171.1620928136752; Thu, 13 May 2021 10:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620928136; cv=none; d=google.com; s=arc-20160816; b=p9HOCjhjMlqJu9MU3srSlawkEQUuE/miYBgJeb6TrkrGWA176cSZTvs0XHStcy4jXW zwSm5yntzfjzxzKveW9WyClk2pr6Gg5Zj/+r2ju7JMXlFiqZgPhsdJU8IJK+EeJpEYmO 0Ig2iRjNQfVc8aVpCC5MWpyGG1PxTLlyZXQCrDQ39yHoG/VKzHr8UOllcsI2zAchyTiz 8Mu8T8V3PNB9Lb/d0TMYHEsHmlNM9P392dN4hTxjjSPEZS/SUojpLzgsjWpaJPsX3au/ 1Wqr3Tb2SKZKlyQke1A5VEbuGJDHrlxDtgCqLQsTA6z/6oRWJYj9TvT4B8XlrSyEF6Ki lSYQ== 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=MP64+vnfULeIkutHlb1xnw89IEnlJX2eH5M1IgFKB3I=; b=lbu1eIsEma2CbHFVP8LZVMjVVAc4rYJCcT2tE/mIDO9qND6sMNIoxS968yiwn6xiTf hlilr8dRNaPAqhwMCd7IaplBQoydF2uXdD01mD9I2irXUpCHqCuY6pdRTY/CBE7aFuNq jqu2tGO9jKNAPXFU8v9VfU/OYaUOD58pCvVwtBOMA8S9LAhs8LjexHhrmJBe5shbnM3F GkpkIbVxz5pKcxWoA/j1VSYpuPKIwqIdxsGc2aUvEz/dxRaarm6XpuZs4BtR2ss5MId/ cYzBKetN/o3LHNda43K2YDO0JLgyXsBIgfWBqgN9QhXE96Q2bzv1fV2pL01K0oGA92MD cAJw== 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 c8si3942566oto.111.2021.05.13.10.48.43; Thu, 13 May 2021 10:48:56 -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 S233056AbhEMLDR (ORCPT + 99 others); Thu, 13 May 2021 07:03:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:45133 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232320AbhEMLCQ (ORCPT ); Thu, 13 May 2021 07:02:16 -0400 IronPort-SDR: U/BXwl/hh83/5ILD+pjaeGMUsEV7+ipqZME6MVNivp3jEiNnLT37juvF5lUa1LY29Vt1Y0zdIP kGjpuapnRDzw== X-IronPort-AV: E=McAfee;i="6200,9189,9982"; a="187048276" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="187048276" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 04:01:02 -0700 IronPort-SDR: /jUSWvsBR/ZzeILd2CcLHSaBvVx/xVbYBpr+1Uzg4fYexL71YsjmEgCbWH5zRgUTpOmMuDcgzc twcaaXriCYpQ== X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="625983828" 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; 13 May 2021 04:00:59 -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 v3 03/14] intel_gna: read hardware info in the driver Date: Thu, 13 May 2021 13:00:29 +0200 Message-Id: <20210513110040.2268-4-maciej.kwapulinski@linux.intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210513110040.2268-1-maciej.kwapulinski@linux.intel.com> References: <20210513110040.2268-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/device.c | 4 ++++ drivers/misc/intel/gna/device.h | 1 + drivers/misc/intel/gna/hw.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/drivers/misc/intel/gna/device.c b/drivers/misc/intel/gna/device.c index 8722935d26bf..45b4b6df64ef 100644 --- a/drivers/misc/intel/gna/device.c +++ b/drivers/misc/intel/gna/device.c @@ -21,6 +21,7 @@ int gna_probe(struct device *parent, struct gna_dev_info *dev_info, void __iomem static atomic_t dev_last_idx = ATOMIC_INIT(-1); struct gna_private *gna_priv; const char *dev_misc_name; + u32 bld_reg; int ret; gna_priv = devm_kzalloc(parent, sizeof(*gna_priv), GFP_KERNEL); @@ -48,6 +49,9 @@ int gna_probe(struct device *parent, struct gna_dev_info *dev_info, void __iomem } } + bld_reg = gna_reg_read(gna_priv, GNA_MMIO_IBUFFS); + gna_priv->hw_info.in_buf_s = bld_reg & GENMASK(7, 0); + return 0; } diff --git a/drivers/misc/intel/gna/device.h b/drivers/misc/intel/gna/device.h index a188f482a273..057dec0e1983 100644 --- a/drivers/misc/intel/gna/device.h +++ b/drivers/misc/intel/gna/device.h @@ -24,6 +24,7 @@ struct gna_private { /* device related resources */ void __iomem *iobase; struct gna_dev_info info; + struct gna_hw_info hw_info; }; int gna_probe(struct device *parent, struct gna_dev_info *dev_info, void __iomem *iobase); diff --git a/drivers/misc/intel/gna/hw.h b/drivers/misc/intel/gna/hw.h index f9c0566cbe60..f61792f9dd52 100644 --- a/drivers/misc/intel/gna/hw.h +++ b/drivers/misc/intel/gna/hw.h @@ -47,6 +47,10 @@ struct gna_desc_info { struct gna_mmu_info mmu_info; }; +struct gna_hw_info { + u8 in_buf_s; +}; + struct gna_dev_info { u32 hwid; u32 num_pagetables; -- 2.28.0